Package com.ibm.di.connector.maximo
Class TpaeIFConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.maximo.core.SimpleTpaeIFConnector
-
- com.ibm.di.connector.maximo.TpaeIFConnector
-
- All Implemented Interfaces:
ConnectorInterface,VersionInfoInterface
public class TpaeIFConnector extends SimpleTpaeIFConnector
Tpae IF Connector is able to work with hierarchical entries and is based on the SimpleTpaeIFConnector.
-
-
Field Summary
-
Fields inherited from class com.ibm.di.connector.maximo.core.SimpleTpaeIFConnector
cfg, connIterator, connLookup, proxyLog
-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description TpaeIFConnector()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteEntry(Entry entry, SearchCriteria sc)Deletes an existing entry.EntryfindEntry(SearchCriteria searchCriteria)Finds an existing entry.EntrygetNextEntry()Returns the next Entry from the connector.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object obj)Initialize the connector.voidmodEntry(Entry newEntry, SearchCriteria searchCriteria, Entry oldEntry)Modifies an existing entry.voidputEntry(Entry newEntry)Adds a new entry to the data sourcejava.lang.ObjectquerySchema(java.lang.Object obj)This method populates the input/output map of the connector with the hierarchical schema of the specified Object structure.voidselectEntries()Prepare the Connector for sequential read.voidsetConfiguration(java.lang.Object config)This method makes sure thatInternalSchema.CONNECTOR_COMPUTE_CHANGESis set tofalsesince compute changes logic is not supported for hierarchical entries yet.-
Methods inherited from class com.ibm.di.connector.maximo.core.SimpleTpaeIFConnector
clearSchemaCache, extractExceptionInformation, extractMaximoException, getFc, getMboList, getResHash, setParam, terminate
-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, 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, pushback, queryOperations, queryReply, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParser, setProperty, setRSInterface, terminateServer
-
-
-
-
Method Detail
-
setConfiguration
public void setConfiguration(java.lang.Object config)
This method makes sure thatInternalSchema.CONNECTOR_COMPUTE_CHANGESis set tofalsesince compute changes logic is not supported for hierarchical entries yet.- Specified by:
setConfigurationin interfaceConnectorInterface- Overrides:
setConfigurationin classConnector- Parameters:
config- The configuration object (an instance of ConnectorConfig)
-
initialize
public void initialize(java.lang.Object obj) throws java.lang.ExceptionInitialize 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:
initializein interfaceConnectorInterface- Overrides:
initializein classSimpleTpaeIFConnector- Parameters:
obj- User provided parameter- Throws:
java.lang.Exception- if the initialization of this connector fails.
-
selectEntries
public void selectEntries() throws MxConnectorExceptionPrepare 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:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classSimpleTpaeIFConnector- Throws:
MxConnectorException
-
getNextEntry
public Entry getNextEntry() throws MxConnectorException
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.Example:
var ctor = input.getConnector(); var entry = ctor.getNextEntry(); for (; entry != null; entry = ctor.getNextEntry()) { main.logmsg("Read entry..."); main.dumpEntry(entry); }- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin classSimpleTpaeIFConnector- Returns:
- - the next Entry, or null if no more data
- Throws:
MxConnectorException- See Also:
ConnectorInterface.selectEntries()
-
putEntry
public void putEntry(Entry newEntry) throws MxConnectorException
Adds a new entry to the data sourceExample:
var ctor = write.getConnector(); for (i = 0; i < 10; i++) { var entry = system.newEntry(); entry.setAttribute("linenumber", i); entry.setAttribute("line", i + " line of text..."); main.logmsg("Writes entry to output..."); main.dumpEntry(entry); ctor.putEntry(entry); }- Specified by:
putEntryin interfaceConnectorInterface- Overrides:
putEntryin classSimpleTpaeIFConnector- Parameters:
newEntry- The entry data to add- Throws:
MxConnectorException
-
findEntry
public Entry findEntry(SearchCriteria searchCriteria) throws java.lang.Exception
Finds an existing entry. The search criteria specifies which entry to locateHere is an example of how to find all people with names starting with 'J' which are from IBM organization in US.
Example:
var ctor = input.getConnector(); var crit = new com.ibm.di.SearchCriteria("$dn", com.ibm.di.SearchCriteria.SUBSTRING, "c=US,o=IBM"); crit.addCriteria("name", com.ibm.di.SearchCriteria.INITIAL_STRING, "J"); crit.addCriteria("objectclass", com.ibm.di.SearchCriteria.SUBSTRING, "person"); var res = ctor.findEntry(crit); if (res != null) { main.logmsg("Found entry:"); main.dumpEntry(res); } else { if( getFindEntryCount()> 1 ){ main.logmsg("Found these entries:"); while ( (entry = ctor.getNextFindEntry()) != null ) { main.dumpEntry(entry); } } else { main.logmsg("Entry not found!"); } }- Specified by:
findEntryin interfaceConnectorInterface- Overrides:
findEntryin classSimpleTpaeIFConnector- Parameters:
searchCriteria- The search criteria used to locate the entry to be modified- Returns:
- The entry found, or null if no or multiple entries found
- Throws:
java.lang.Exception- if an error occurs.
-
modEntry
public void modEntry(Entry newEntry, SearchCriteria searchCriteria, Entry oldEntry) throws MxConnectorException
Modifies an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.- Specified by:
modEntryin interfaceConnectorInterface- Overrides:
modEntryin classSimpleTpaeIFConnector- Parameters:
newEntry- The entry datasearchCriteria- The search criteria used to locate the entry to be modifiedoldEntry- The old entry found by the search criteria- Throws:
MxConnectorException
-
deleteEntry
public void deleteEntry(Entry entry, SearchCriteria sc) throws MxConnectorException
Deletes an existing entry. The search criteria specifies which entry to modify. Some connectors may silently ignore the search criteria. For example, the LDAP connector will use the distinguished name ($dn) from the entry parameter (if it exists) rather than expanding the search criteria and search for the entry. Each connector's inner semantics governs whether the search parameter is used or not.- Specified by:
deleteEntryin interfaceConnectorInterface- Overrides:
deleteEntryin classSimpleTpaeIFConnector- Parameters:
entry- The entry datasc- The search criteria used to locate the entry to be deleted- Throws:
MxConnectorException
-
querySchema
public java.lang.Object querySchema(java.lang.Object obj) throws java.lang.ExceptionThis method populates the input/output map of the connector with the hierarchical schema of the specified Object structure.Note: This method uses
SchemaUtils.convertEntryToSchemaHier(Entry, ConnectorConfig, boolean)method to display a hierarchical schema. However currently this method is no converting correctly the hierarchical entry to a hierarchical schema. This will be addressed later in the release.- Specified by:
querySchemain interfaceConnectorInterface- Overrides:
querySchemain classSimpleTpaeIFConnector- Parameters:
obj- The object on which to discover schema. This may be an Entry or a string value- Returns:
- A Vector of com.ibm.di.entry.Entry objects describing each entity
- Throws:
java.lang.Exception- if an error while retrieving the schema occurs.- See Also:
Entry,Vector
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersionin interfaceVersionInfoInterface- Overrides:
getVersionin classSimpleTpaeIFConnector- Returns:
- version information
-
-