Interface Connector
-
- All Known Implementing Classes:
AbstractConnector
public interface ConnectorA Connector is used by the client for creating and controlling a connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()closes the connectorConnectioncreateConnection()Create and return a connection from this connector.booleanisEquivalent(java.util.Map<java.lang.String,java.lang.Object> configuration)If the configuration is equivalent to this connector, which means if the parameter configuration is used to create a connection to a target node, it will be the same node as of the connections made with this connector.booleanisStarted()returns true if the connector is started, oterwise false.voidstart()starts the connector
-
-
-
Method Detail
-
start
void start()
starts the connector
-
close
void close()
closes the connector
-
isStarted
boolean isStarted()
returns true if the connector is started, oterwise false.- Returns:
- true if the connector is started
-
createConnection
Connection createConnection()
Create and return a connection from this connector.This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null
- Returns:
- The connection, or null if unable to create a connection (e.g. network is unavailable)
-
isEquivalent
boolean isEquivalent(java.util.Map<java.lang.String,java.lang.Object> configuration)
If the configuration is equivalent to this connector, which means if the parameter configuration is used to create a connection to a target node, it will be the same node as of the connections made with this connector.- Parameters:
configuration-- Returns:
- true means the configuration is equivalent to the connector. false otherwise.
-
-