|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.ccmdb.CCMDBConnector
public class CCMDBConnector
This Connector will read Actual Config Items and relations from MAXIMO
database.
This Connector supports two modes:
Field Summary |
---|
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
CCMDBConnector()
Constructor which populates the modes supported by the Connector. |
Method Summary | |
---|---|
String |
checkDbConnection()
Checks if with the currently configured properties, a connection to the MAXIMO database can be established. |
void |
deleteEntry(Entry entry,
SearchCriteria search)
Deletes an existing entry. |
Entry |
findEntry(SearchCriteria criteria)
Finds an existing entry. |
String |
getCDMType(String classification)
|
String |
getClassification(String cdmType)
|
List<String> |
getClassTypes(String artifactType)
|
Connection |
getConnection()
Returns the JDBC Connection to the Maximo database. |
String |
getDbUsername()
Returns the username for connection to the Maximo database. |
String |
getJdbcDriver()
Returns the JDBC driver for connection to the Maximo database. |
String |
getJdbcUrl()
Returns the JDBC URL for connection to the Maximo database. |
Entry |
getNextEntry()
This method returns a single entry object for a CI\Relationship searched as per criteria. |
protected static ResourceHash |
getResHash()
|
String |
getVersion()
Version information. |
void |
initialize(Object entry)
This standard method initializes the Connector with values present in its Configuration panel. |
void |
modEntry(Entry entry,
SearchCriteria search)
Modifies an existing entry. |
void |
modEntry(Entry entry,
SearchCriteria search,
Entry oldEntry)
Modifies an existing entry. |
void |
putEntry(Entry entry)
Adds a new entry to the data source |
Object |
querySchema(Object arg0)
This method populates Output Map for CallReply mode and Input Map for Iterator\Lookup mode. |
void |
selectEntries()
This is preparation method for Iterator mode. |
void |
terminate()
This method will close Connection to the MAXIMO database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.connector.ConnectorInterface |
---|
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, pushback, queryOperations, queryReply, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer |
Constructor Detail |
---|
public CCMDBConnector()
Method Detail |
---|
public String getVersion()
getVersion
in interface VersionInfoInterface
public String getDbUsername()
public String getJdbcDriver()
public String getJdbcUrl()
public Connection getConnection() throws SQLException
SQLException
public String getCDMType(String classification) throws Exception
classification
-
Exception
public String getClassification(String cdmType)
cdmType
-
public List<String> getClassTypes(String artifactType) throws CCMDBException
artifactType
-
CCMDBException
public void initialize(Object entry) throws Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
entry
- an initial entry provided to the Connector.
Exception
- if a problem occurs.public Object querySchema(Object arg0) throws Exception
querySchema
in interface ConnectorInterface
querySchema
in class Connector
arg0
- an object parameter not used by this method.
null
, since the Connector handles the schema
population on its own.
Exception
- if a problem occurs.Entry
,
Vector
public void terminate() throws Exception
terminate
in interface ConnectorInterface
terminate
in class Connector
Exception
- if a problem occur.public String checkDbConnection()
IOException
- if a problem occurs.public void selectEntries() throws Exception
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
Exception
- if a problem occurs.public Entry getNextEntry() throws Exception
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
Exception
- if an error occurs.ConnectorInterface.selectEntries()
public Entry findEntry(SearchCriteria criteria) throws Exception
Here 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!"); } }
findEntry
in interface ConnectorInterface
findEntry
in class Connector
criteria
- The search criteria used to locate the entry to be modified
Exception
- if an error occurs.public void putEntry(Entry entry) throws Exception
Example:
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); }
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- The entry data to add
Exception
- if an error occurs.public void modEntry(Entry entry, SearchCriteria search, Entry oldEntry) throws Exception
Connector
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- The entry datasearch
- The search criteria used to locate the entry to be modifiedoldEntry
- The old entry found by the search criteria
Exception
- if an error occurs.public void modEntry(Entry entry, SearchCriteria search) throws Exception
Connector
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- The entry datasearch
- The search criteria used to locate the entry to be modified
Exception
- if an error occurs.public void deleteEntry(Entry entry, SearchCriteria search) throws Exception
Connector
deleteEntry
in interface ConnectorInterface
deleteEntry
in class Connector
entry
- The entry datasearch
- The search criteria used to locate the entry to be deleted
Exception
- if an error occurs.protected static ResourceHash getResHash()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |