Class 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:
    • CallReply
    • Iterator
    • Lookup

    Note: The IT registry API uses multiple maps without generic types which cause multiple warnings.

    • Constructor Detail

      • ITRegistryConnector

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

      • getDbUsername

        public java.lang.String getDbUsername()
        Returns the username for connection to the IT registry database.
        Returns:
        the dbUsername.
      • getJdbcDriver

        public java.lang.String getJdbcDriver()
        Returns the JDBC driver for connection to the IT registry database.
        Returns:
        the jdbcDriver.
      • getJdbcUrl

        public java.lang.String getJdbcUrl()
        Returns the JDBC URL for connection to the IT registry database.
        Returns:
        the jdbcUrl.
      • getUseITRegistry

        public java.lang.String getUseITRegistry()
        Returns whether the Connector relies on a IT registry for its meta-data.
        Returns:
        the useITRegistry parameter.
      • initialize

        public void initialize​(java.lang.Object entry)
                        throws java.lang.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 IdMLConstants.IT_REGISTRY_PROPERTIES_FILE file.
        Specified by:
        initialize in interface ConnectorInterface
        Overrides:
        initialize in class Connector
        Parameters:
        entry - initial entry provided to the Connector.
        Throws:
        java.lang.Exception - if a problem occurs.
      • querySchema

        public java.lang.Object querySchema​(java.lang.Object arg0)
                                     throws java.lang.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:
        java.lang.Exception - if a problem occurs.
        See Also:
        Entry, Vector
      • queryReply

        public Entry queryReply​(Entry entry)
                         throws java.lang.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:
        • create: add a CI or Relationship. If Init IT registry FC has set a Refresh flag, then the Connector will first remove all entries in the IT registry database which are older that a given timestamp. The timestamp is detemined by the Init IT registry FC and made available through the shared book. To add a CI the Connector should satisfy at least one of its Naming Rules. A naming rule is a specific list of identifying attributes that should be passed to the IT registry for a CI to be successfully registered in its database (please refer to the Tivoli Common Data Model documentation for more details).
          The supported attributes for a CI (identifying and non-identifying) can be discovered in Output Map of the Connector. After registering a CI the Connector will return a $id attribute - a wrapper of the actual GUID returned by the IT registry. It could be latter passed to another IT registry Connector for registering Relationships. However, the value of the wrapped GUID cannot and should not be extracted by users. To add a Relationship the &id-s of two CIs should be passed for the 'source' and 'target' attributes in the Output Map of the Connector.
        • modify: currently this operation is not supported neither for CIs nor Relationships.
        • delete: delete a CI\Relationship. To delete a Relationship the $id-s of the 'source' and 'target' CIs should be supplied.

Specified by:
queryReply in interface ConnectorInterface
Overrides:
queryReply in class Connector
Parameters:
entry - 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:
java.lang.Exception - If Book Name is not supplied. If MSS Guid is not supplied. If operation is not supplied.