Class TpaeIFConnector

    • Constructor Detail

      • TpaeIFConnector

        public TpaeIFConnector()
        Default constructor.
    • Method Detail

      • initialize

        public void initialize​(java.lang.Object obj)
                        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 interface ConnectorInterface
        Overrides:
        initialize in class SimpleTpaeIFConnector
        Parameters:
        obj - User provided parameter
        Throws:
        java.lang.Exception - if the initialization of this connector fails.
      • putEntry

        public void putEntry​(Entry newEntry)
                      throws MxConnectorException
        Adds a new entry to the data source

        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);
         }
         
        Specified by:
        putEntry in interface ConnectorInterface
        Overrides:
        putEntry in class SimpleTpaeIFConnector
        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 locate

        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!");
          }
         }
         
        Specified by:
        findEntry in interface ConnectorInterface
        Overrides:
        findEntry in class SimpleTpaeIFConnector
        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.
      • 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:
        deleteEntry in interface ConnectorInterface
        Overrides:
        deleteEntry in class SimpleTpaeIFConnector
        Parameters:
        entry - The entry data
        sc - 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.Exception
        This 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:
        querySchema in interface ConnectorInterface
        Overrides:
        querySchema in class SimpleTpaeIFConnector
        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