com.ibm.di.connector
Class ITRegistryConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.ITRegistryConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class ITRegistryConnector
extends Connector
implements ConnectorInterface

This Connector will add a CI (Configuration Item) or a Relationship to a centralized IT registry database. It depends upon IT registry for working properly.
This Connector supports three modes:


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
ITRegistryConnector()
          Constructor which populates the modes supported by the Connector.
 
Method Summary
 String checkDbConnection()
          Checks if with the currently configured properties, a connection to the IT registry database can be established.
 Entry findEntry(SearchCriteria searchCrit)
          This will return an Entry (CI\Relationship) based on the conditions specified in the Link Criteria of the Connector.
 String getAttributeFilter()
          Returns the attribute filter configured for an IT registry Ci and Relationship Connector in Iterator mode.
 String getCdmVersion()
          Returns the version of the CDM that this Connector is using.
 String getDateFilter()
          Returns the date filter configured for an IT registry Ci and Relationship Connector in Iterator mode.
 String getDbUsername()
          Returns the username for connection to the IT registry database.
 String getJdbcDriver()
          Returns the JDBC driver for connection to the IT registry database.
 String getJdbcUrl()
          Returns the JDBC URL for connection to the IT registry database.
 TreeMap<String,HashMap> getMSS()
          Returns the Management Software Systems (MSSs) present in IT registry database.
 Entry getNextEntry()
          This method returns a single entry object for a CI\Relationship searched as per criteria.
 Map<String,Object> getTypes()
          Returns the types of CIs/Relationships available for this Connector.
 String getUseITRegistry()
          Returns whether the Connector relies on a IT registry for its meta-data.
 String getVersion()
          Version information.
 void initialize(Object entry)
          This standard method initializes the Connector with values present in its Configuration panel.
 Entry queryReply(Entry entry)
          This method is invoke for CallReply mode.
 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 IT registry database and shutdown NRS service.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, 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, putEntry, queryOperations, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
 
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
deleteEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, putEntry, queryOperations, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Constructor Detail

ITRegistryConnector

public ITRegistryConnector()
Constructor which populates the modes supported by the Connector.

Method Detail

getDbUsername

public String getDbUsername()
Returns the username for connection to the IT registry database.

Returns:
the dbUsername.

getJdbcDriver

public String getJdbcDriver()
Returns the JDBC driver for connection to the IT registry database.

Returns:
the jdbcDriver.

getJdbcUrl

public String getJdbcUrl()
Returns the JDBC URL for connection to the IT registry database.

Returns:
the jdbcUrl.

getUseITRegistry

public String getUseITRegistry()
Returns whether the Connector relies on a IT registry for its meta-data.

Returns:
the useITRegistry parameter.

initialize

public void initialize(Object entry)
                throws Exception
This standard method initializes the Connector with values present in its Configuration panel. If database related parameters are not present in the Connector's configuration, they are taken from the #IT_REGISTRY_PROPERTIES_FILE file.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
an - initial entry provided to the Connector.
Throws:
Exception - if a problem occurs.

querySchema

public Object querySchema(Object arg0)
                   throws Exception
This method populates Output Map for CallReply mode and Input Map for Iterator\Lookup mode. Depending upon the value of "Use IT registry" parameter the attributes for a CI\Relationship are fetched from JAR or the IT registry database.

Specified by:
querySchema in interface ConnectorInterface
Overrides:
querySchema in class Connector
Parameters:
arg0 - an object parameter not used by this method.
Returns:
null, since the Connector handles the schema population on its own.
Throws:
Exception - if a problem occurs.
See Also:
Entry, Vector

queryReply

public Entry queryReply(Entry entry)
                 throws Exception
This method is invoke for CallReply mode. In this mode the Connector will be used together with an Init IT registry FC in the AssemblyLine. It depends upon Init IT registry FC for statically sharing a book - an object holding needed information, which it looks up using a 'Book Name' parameter. In this mode the Connector can perform the following operations:

Specified by:
queryReply in interface ConnectorInterface
Overrides:
queryReply in class Connector
Parameters:
the - entry mapped in the Output Map of the FC.
Returns:
the returned entry object. It contains an attribute $id which will hold a wrapper of the GUID returned by the IT registry upon registering a CI. For the rest of the cases (update and delete) it is null.
Throws:
Exception - If Book Name is not supplied. If MSS Guid is not supplied. If operation is not supplied.

selectEntries

public void selectEntries()
                   throws Exception
This is preparation method for Iterator mode. This will fetch values of CI\Relationship from the IT registry database. The values will be selected based on 'Attribute Filter' parameter or 'Date Filter' parameter. The 'MSS Name' parameter determines the artifacts for whose MSSs should be searched. All CIs\Relationships will be fetched if no value is supplied in either of the above parameters.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
Exception - if a problem occurs.

getNextEntry

public Entry getNextEntry()
                   throws Exception
This method returns a single entry object for a CI\Relationship searched as per criteria. Refer to selectEntries for more details.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
the next read entry.
Throws:
Exception - if an error occurs.
See Also:
ConnectorInterface.selectEntries()

findEntry

public Entry findEntry(SearchCriteria searchCrit)
                throws Exception
This will return an Entry (CI\Relationship) based on the conditions specified in the Link Criteria of the Connector. The returned attributes will comply with the Common Data Model. In case more than one entry is found 'On Multiple Entries' hook should be enabled.
The search criteria should use logical AND conditions between the separate criterion and the comparison should be "equals". Otherwise, an Exception will be thrown.

Specified by:
findEntry in interface ConnectorInterface
Overrides:
findEntry in class Connector
Parameters:
searchCrit - the search criteria.
Returns:
the found entry.
Throws:
Exception - if a problem occurs.

terminate

public void terminate()
               throws Exception
This method will close Connection to the IT registry database and shutdown NRS service. It will also clear the counter for Iterator mode.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector
Throws:
Exception - if a problem occur.

checkDbConnection

public String checkDbConnection()
Checks if with the currently configured properties, a connection to the IT registry database can be established.

Returns:
if the connection was established successfully null is returned, otherwise the method returns a String containing the exception's text.
Throws:
IOException - if a problem occurs.

getTypes

public Map<String,Object> getTypes()
                            throws Exception
Returns the types of CIs/Relationships available for this Connector. Depending on its Configuration we can get the names of all supported CIs, or of all Relationships.

Returns:
a List with all CI/Relationship types.
Throws:
Exception - if a problem occurs.

getCdmVersion

public String getCdmVersion()
                     throws Exception
Returns the version of the CDM that this Connector is using. depending on its configuration this can be either the version of CDM that the IT registry is using or the version of the CDM meta-data stored in the locally used jar file.

Returns:
the CDM version, with format '<version>.<release>.<modifier>'.
Throws:
Exception - if a problem occurs.

getVersion

public String getVersion()
Version information.

Specified by:
getVersion in interface VersionInfoInterface
Returns:
version information

getAttributeFilter

public String getAttributeFilter()
Returns the attribute filter configured for an IT registry Ci and Relationship Connector in Iterator mode.

Returns:
the value of "Attrbute Filter" parameter.

getDateFilter

public String getDateFilter()
Returns the date filter configured for an IT registry Ci and Relationship Connector in Iterator mode.

Returns:
the value of "Date Filter" parameter.

getMSS

public TreeMap<String,HashMap> getMSS()
                               throws Exception
Returns the Management Software Systems (MSSs) present in IT registry database. This will help populate 'MSS Guid' parameter and is applicable only for Lookup and Iterator mode.

Returns:
a HashMap of MSSs. For each entry the key is either the MSSName of the MSS or a combination of its identifying attributes (the format is [ManufacturerName, ProductName, Hostname], and the value is a HashMap containing the full information for the MSS.MSS.
Throws:
Exception - if a problem occurs.