Package com.ibm.di.connector
Class EIFConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.EIFConnector
-
- All Implemented Interfaces:
ConnectorInterface
,VersionInfoInterface
public class EIFConnector extends Connector
A connector for sending and receiving messages from/to IBM Tivoli Enterprise Console.- Since:
- 7.0
-
-
Field Summary
-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description EIFConnector()
Constructs an instance of this connector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Entry
getNextEntry()
The returned entry has the following structure:java.lang.String
getVersion()
Version information.void
initialize(java.lang.Object o)
Initialize the connector.void
putEntry(Entry entry)
Sends an Entry to the remote server.java.lang.Object
querySchema(java.lang.Object source)
Query the Schema.void
selectEntries()
Prepare the Connector for sequential read.void
terminate()
Terminate the connector.void
updateSchemaFromMap(java.lang.String path, java.util.Vector<java.lang.Object> schema)
This method updates the schema vector based on a mapping file.-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, extractExceptionInformation, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, modEntry, pushback, queryOperations, queryReply, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
-
-
-
-
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 interfaceConnectorInterface
- Overrides:
initialize
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
selectEntries
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
getNextEntry
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
putEntry
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
terminate
in classConnector
- 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 interfaceConnectorInterface
- Overrides:
querySchema
in classConnector
- Parameters:
source
- The object on which to discover schema. This may be an Entry or a string value- Returns:
- If the
eifSchemaFile
file isnull
, 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.
-
-