Class MemoryConnection
java.lang.Object
com.aquima.interactions.foundation.connectivity.impl.MemoryConnection
- All Implemented Interfaces:
IConnection
,IMemoryConnection
Default implementation of IMemoryConnection.
This implementation internally uses a HashMap to store objects. This map is unbound in size.
Stored objects are not persisted in any way, resulting in a loss of all stored objects when the connection instance
is garbage collected.
- Since:
- 9.3
- Author:
- m.mahabiersing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(GUID id) Check if this connection has an object for the given id.Retrieve an object from the connection.getName()
This method returns the name of the connection object.getType()
This method returns the type of the connection object.void
Store an object on the connection.void
Remove an object from the connection.
-
Constructor Details
-
Method Details
-
getName
Description copied from interface:IConnection
This method returns the name of the connection object. The name is used to uniquely identify the connection object.- Specified by:
getName
in interfaceIConnection
- Returns:
- the name of the connection object.
-
getType
Description copied from interface:IConnection
This method returns the type of the connection object.- Specified by:
getType
in interfaceIConnection
- Returns:
- the type of the connection object.
-
containsKey
Description copied from interface:IMemoryConnection
Check if this connection has an object for the given id.- Specified by:
containsKey
in interfaceIMemoryConnection
- Parameters:
id
- The id, never null- Returns:
- Returns true if an entry exists, false otherwise.
-
get
Description copied from interface:IMemoryConnection
Retrieve an object from the connection.- Specified by:
get
in interfaceIMemoryConnection
- Parameters:
id
- The id of the object to retrieve.- Returns:
- The object associated with the id, or null when the connection has no object for the given id.
-
put
Description copied from interface:IMemoryConnection
Store an object on the connection.- Specified by:
put
in interfaceIMemoryConnection
- Parameters:
id
- The id of the object to store.item
- The object to store, may not be null.
-
remove
Description copied from interface:IMemoryConnection
Remove an object from the connection.- Specified by:
remove
in interfaceIMemoryConnection
- Parameters:
id
- The id of the object to remove, may not be null.
-