Class EIFConnector

    • Constructor Detail

      • EIFConnector

        public EIFConnector()
        Constructs an instance of this connector.
    • Method Detail

      • initialize

        public void initialize​(java.lang.Object o)
                        throws java.lang.Exception
        Initialize the connector. The connector may be passed a parameter of any kind by the user. It is up to the connector to determine whether this object can be used or not. The parameter is typically provided by a user script. When an AssemblyLine initializes it's Connectors, they are passed a ConnectorMode object.
        Specified by:
        initialize in interface ConnectorInterface
        Overrides:
        initialize in class Connector
        Parameters:
        o - User provided parameter
        Throws:
        java.lang.Exception - if the initialization of this connector fails.
      • selectEntries

        public void selectEntries()
                           throws java.lang.Exception
        Prepare the Connector for sequential read. If necessary, create a result set to be used for getNextEntry(). When the Connector is used as an Iterator in an AssemblyLine, this method will be called. Default is an empty method.
        Specified by:
        selectEntries in interface ConnectorInterface
        Overrides:
        selectEntries in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
      • getNextEntry

        public Entry getNextEntry()
                           throws java.lang.Exception
        The returned entry has the following structure:
         Entry
            +-->className:String
            +-->{slotName}:String
            +-->{slotName}:String
            ...{moreSlots}...
         
        Specified by:
        getNextEntry in interface ConnectorInterface
        Overrides:
        getNextEntry in class Connector
        Returns:
        an entry with the specified above structure or null.
        Throws:
        java.lang.Exception - if an error occurs.
        See Also:
        ConnectorInterface.selectEntries()
      • putEntry

        public void putEntry​(Entry entry)
                      throws java.lang.Exception
        Sends an Entry to the remote server.
        Specified by:
        putEntry in interface ConnectorInterface
        Overrides:
        putEntry in class Connector
        Parameters:
        entry - the event to send. The entry should comply with the following structure. If the attribute event is present (not null) then it will be sent to the remote server, otherwise the className and slots attributes will be used to compile an event.
         Entry
            +-->className:String
            +-->{slotName}:String
            +-->{slotName}:String
            ...{moreSlots}...
         
        Throws:
        java.lang.Exception - if an error occurs.
      • terminate

        public void terminate()
                       throws java.lang.Exception
        Terminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active.
        Specified by:
        terminate in interface ConnectorInterface
        Overrides:
        terminate in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
      • querySchema

        public java.lang.Object querySchema​(java.lang.Object source)
        Query the Schema.
        Specified by:
        querySchema in interface ConnectorInterface
        Overrides:
        querySchema in class Connector
        Parameters:
        source - The object on which to discover schema. This may be an Entry or a string value
        Returns:
        If the eifSchemaFile file is null, returns the schema for the current Entry; else returns schema containing destination field names from the mapping file used by the Gateway for Tivoli EIF.
        See Also:
        Entry, Vector
      • updateSchemaFromMap

        public void updateSchemaFromMap​(java.lang.String path,
                                        java.util.Vector<java.lang.Object> schema)
                                 throws java.lang.Exception
        This method updates the schema vector based on a mapping file.
         CREATE MAPPING StatusMap
                (
                        'identifier'       =    '@Identifier',
                        'server_identifier'=    '@ServerName' + " " + TO_STRING('@ServerSerial'),
                        'sub_source'       =    '@AlertKey'             ON INSERT ONLY,
                        'sub_origin'       =    '@AlertGroup'           ON INSERT ONLY,
                        'msg'              =    '@Summary'              ON INSERT ONLY,
                        'origin'           =    '@Node'                 ON INSERT ONLY,
                        'node_alias'       =    '@NodeAlias'            ON INSERT ONLY
                                                                                NOTNULL '@Node',
                        'manager'          =    '@Manager'              ON INSERT ONLY,
                        'source'           =    '@Agent'                ON INSERT ONLY,
                        'severity'         =    '@Severity',
                        'date'             =    '@LastOccurrence'       ON INSERT ONLY,
                        'omnibus_last_modified_time' = '@InternalLast'  ON INSERT ONLY );
         
        Parameters:
        path - path to the file
        Throws:
        java.lang.Exception - if file could not be found, read or closed.
      • getVersion

        public java.lang.String getVersion()
        Description copied from interface: VersionInfoInterface
        Version information.
        Returns:
        the version of this connector as String.