Interface Connector
- All Known Implementing Classes:
AbstractConnector
public interface Connector
A Connector is used by the client for creating and controlling a connection.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()closes the connectorCreate and return a connection from this connector.booleanisEquivalent(Map<String, 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.booleanreturns true if the connector is started, oterwise false.voidstart()starts the connector
-
Method Details
-
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
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.
-