Class GLAConnector

  • All Implemented Interfaces:
    ConnectorInterface, VersionInfoInterface

    public class GLAConnector
    extends Connector
    implements ConnectorInterface
    This is the GLAConnector class. GLAConnector is used to process a log file and transform its contents to CommonBaseEvent objects. The Connector needs an adapter configuration file to be provided as a Connector parameter. The Connector than uses the GLA run-time to validate and start the given configuration file. The Connector uses a specially made outputter, called TDIOutputter, to receive the generated from the log file CBE objects. The TDIOutputter must be configured to the adapter configuration file. For more information about configuring the Connector and the TDIOutputter refer to the GLAConnector documentation.
    • Field Detail

      • DEFAULT_CORR_ID

        public static final java.lang.String DEFAULT_CORR_ID
        The default correlation ID is used from both the GLAConnector and the TDIOutputter. It is used if one (or both) of the Connector correlationID or the Outputter tdi_correlation_id parameter is not set.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GLAConnector

        public GLAConnector()
        The GLAConnector constructor. It sets the mode of the connector. The only supported mode is Iterator.
    • Method Detail

      • initialize

        public void initialize​(java.lang.Object obj)
                        throws java.lang.Exception
        This method initializes the connector parameters. It gets the "configFile" parameter and checks if it has any assigned value. If no value is assigned then an Exception is thrown. Then the "correlationID" of the Connector is taken. If no value is specified to this parameter than automatically a default value is used.
        Specified by:
        initialize in interface ConnectorInterface
        Overrides:
        initialize in class Connector
        Parameters:
        obj - not used.
        Throws:
        java.lang.Exception - An Exception is thrown if some of the requred parameters is missing.
      • selectEntries

        public void selectEntries()
                           throws java.lang.Exception
        This method starts the Adapter and fills the queue with CBE objects. Before starting the Adapter a validation is made to ensure that the configuration adapter file is valid.
        Specified by:
        selectEntries in interface ConnectorInterface
        Overrides:
        selectEntries in class Connector
        Throws:
        java.lang.Exception - If the configuration adapter file is not valid or an error occurs during execution.
      • getNextEntry

        public Entry getNextEntry()
                           throws java.lang.Exception
        This method gets the next CBE object from the queue and creates an Entry. To the Entry is set an attribute with name "rawCBEObject" and value the CBE object. Also to the same Entry object are added the CommonBaseEvent properties as (name,value) pair. This Entry is passed to the AssemblyLine.
        Specified by:
        getNextEntry in interface ConnectorInterface
        Overrides:
        getNextEntry in class Connector
        Returns:
        Entry object containing the next CBE object.
        Throws:
        java.lang.Exception - if an error occurs.
        See Also:
        ConnectorInterface.selectEntries()
      • getVersion

        public java.lang.String getVersion()
        Returns the connector version.
        Specified by:
        getVersion in interface VersionInfoInterface
        Returns:
        String representing the connector version.
      • terminate

        public void terminate()
                       throws java.lang.Exception
        Terminates the Connector and unregisters it from the TDIOutputter's Hashtable.
        Specified by:
        terminate in interface ConnectorInterface
        Overrides:
        terminate in class Connector
        Throws:
        java.lang.Exception - : never
      • getCurrentCBEObject

        public org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCurrentCBEObject()
        Returns the last taken CBE object. Users may use this method to get the current CBE object.
        Returns:
        CBE object which is last taken from the Queue.