Class ConnectorBroker


  • public class ConnectorBroker
    extends java.lang.Object
    The ConnectorBroker is a generic factory for Open Connector Framework (OCF) Connectors. The OCF provides a default implementation because all the implementation that is specific to a particular type of connector is delegated to the connector provider specified in the connection.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectorBroker()
      Typical constructor
      ConnectorBroker​(AuditLog auditLog)
      Constructor to supply the audit log to all connectors that implement the AuditLoggingConnector interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      Provide a common implementation of equals for all OCF Connector Broker objects.
      Connector getConnector​(Connection connection)
      Creates a new instance of a connector using the name of the connector provider in the supplied connection.
      Connector getConnector​(ConnectionProperties connection)
      Creates a new instance of a connector using the name of the connector provider in the supplied connection.
      int hashCode()
      Provide an implementation of hashCode for all OCF Connector Broker objects.
      java.lang.String toString()
      Standard toString method.
      void validateConnection​(Connection connection)
      Validate that the connection has sufficient properties to attempt to create a connector.
      void validateConnection​(ConnectionProperties connection)
      Validate that the connection has sufficient properties to attempt to create a connector.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ConnectorBroker

        public ConnectorBroker()
        Typical constructor
      • ConnectorBroker

        public ConnectorBroker​(AuditLog auditLog)
        Constructor to supply the audit log to all connectors that implement the AuditLoggingConnector interface.
        Parameters:
        auditLog - audit log to pass on to the connector providers
    • Method Detail

      • validateConnection

        public void validateConnection​(Connection connection)
                                throws ConnectionCheckedException
        Validate that the connection has sufficient properties to attempt to create a connector. Any problems found are expressed as a ConnectionCheckedException.
        Parameters:
        connection - connection properties
        Throws:
        ConnectionCheckedException - an error with the connection.
      • validateConnection

        public void validateConnection​(ConnectionProperties connection)
                                throws ConnectionCheckedException
        Validate that the connection has sufficient properties to attempt to create a connector. Any problems found are expressed as a ConnectionCheckedException.
        Parameters:
        connection - connection properties
        Throws:
        ConnectionCheckedException - an error with the connection.
      • hashCode

        public int hashCode()
        Provide an implementation of hashCode for all OCF Connector Broker objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to describe the hash code of the connector broker object.
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)
        Provide a common implementation of equals for all OCF Connector Broker objects. The UUID is unique and is randomly assigned and so its hashCode is as good as anything to evaluate the equality of the connector broker object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - object to test
        Returns:
        boolean flag
      • toString

        public java.lang.String toString()
        Standard toString method.
        Overrides:
        toString in class java.lang.Object
        Returns:
        print out of variables in a JSON-style