Class DominoUsersConnector

  • All Implemented Interfaces:
    ConnectorInterface, VersionInfoInterface, java.lang.Runnable

    public class DominoUsersConnector
    extends Connector
    implements java.lang.Runnable, ConnectorInterface
    The Domino Users Connector enables access to and management of Lotus Domino users. With the Domino Users Connector you can do the following: - retrieve users documents and their items from the Name and Address Book - create and register Domino users - initiate Domino users deletion (through the Domino Administration Process) by posting administration requests to the Administration Requests Database - modify users by modifying their Person documents in the Name and Address Book - perform users disabling/enabling by adding/removing users names to/from a "Deny Access Group" - perform "lookup" of Domino users The following features are not currently supported by the Domino Users Connector: - Users recertifying
    • Field Detail

      • ATTR_NAME_FORM

        public static final java.lang.String ATTR_NAME_FORM
        Corresponds to the Form Item of the Domino document. This item is mandatory
        See Also:
        Constant Field Values
      • ATTR_NAME_TYPE

        public static final java.lang.String ATTR_NAME_TYPE
        Corresponds to the Type Item of the Domino document. This item is mandatory
        See Also:
        Constant Field Values
      • ATTR_NAME_FIRST_NAME

        public static final java.lang.String ATTR_NAME_FIRST_NAME
        This field corresponds to the FirstName Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_MIDDLE_INITIAL

        public static final java.lang.String ATTR_NAME_MIDDLE_INITIAL
        This field corresponds to the MiddleInitial Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_LAST_NAME

        public static final java.lang.String ATTR_NAME_LAST_NAME
        This field corresponds to the LastName Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_FULL_NAME

        public static final java.lang.String ATTR_NAME_FULL_NAME
        This field corresponds to the FullName Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_MAIL_FILE

        public static final java.lang.String ATTR_NAME_MAIL_FILE
        This field corresponds to the MailFile Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_LOCATION

        public static final java.lang.String ATTR_NAME_LOCATION
        This field corresponds to the Location Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_COMMENT

        public static final java.lang.String ATTR_NAME_COMMENT
        This field corresponds to the Comment Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_ALT_FULL_NAME

        public static final java.lang.String ATTR_NAME_ALT_FULL_NAME
        This field corresponds to the AltFullName Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_ALT_FULL_NAME_LANGUAGE

        public static final java.lang.String ATTR_NAME_ALT_FULL_NAME_LANGUAGE
        This field corresponds to the AltFullNameLanguage Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_HTTP_PASSWORD

        public static final java.lang.String ATTR_NAME_HTTP_PASSWORD
        This field corresponds to the HTTPPassword Item of the Domino document.
        See Also:
        Constant Field Values
      • ATTR_NAME_REG_SERVER

        public static final java.lang.String ATTR_NAME_REG_SERVER
        The name of the server containing the user's mail file. If the Attribute is missing, the value will be obtained from the current Connector's Domino Session. When the Connector is running on a Notes client machine and is registering a user, this Attribute must be specified in order to create a mail file on the server for the newly registered user.
        See Also:
        Constant Field Values
      • ATTR_NAME_REG_CREATE_MAIL_DB

        public static final java.lang.String ATTR_NAME_REG_CREATE_MAIL_DB
        If set to true - creates a mail database. If set to false - does not create a mail database; it will be created during setup. If this Attribute is missing, a default value of false will be assumed.
        See Also:
        Constant Field Values
      • ATTR_NAME_REG_PERFORM

        public static final java.lang.String ATTR_NAME_REG_PERFORM
        If set to true the Connector will perform user registration. If this Attribute is missing, or its value is false, the Connector will not perform user registration, regardless of the presence and the values of the other REG_ Attributes.
        See Also:
        Constant Field Values
      • ATTR_NAME_MAIL_TEMPLATE_FILE

        public static final java.lang.String ATTR_NAME_MAIL_TEMPLATE_FILE
        The filename of a Notes template database, which the Connector will use to create the user mail file. If this Attribute does not exist the default mail template is used.
        See Also:
        Constant Field Values
      • ATTR_NAME_MAIL_DB_INHERIT

        public static final java.lang.String ATTR_NAME_MAIL_DB_INHERIT
        If set to true - the user mail database to be created will inherit any changes to the mail template database design. If set to false - the user mail database to be created will not inherit any changes to the mail template database design. If this Attribute is missing, a default value of false will be assumed.
        See Also:
        Constant Field Values
      • ATTR_NAME_MAIL_TEMPLATE_SERVER

        public static final java.lang.String ATTR_NAME_MAIL_TEMPLATE_SERVER
        The IP address of the Domino server machine on which the mail template database (specified by REG_MailTemplateFile) resides. If this Attribute does not exist the local Domino server machine is used.
        See Also:
        Constant Field Values
      • ATTR_NAME_DER_IS_ENABLED

        public static final java.lang.String ATTR_NAME_DER_IS_ENABLED
        true if the user does not belong to a "Deny List only" group; false if the user belongs to at least one group of type "Deny List only".
        See Also:
        Constant Field Values
      • PROP_NOTE_ID

        public static final java.lang.String PROP_NOTE_ID
        This field corresponds to the NoteID Item of the Domino document.
        See Also:
        Constant Field Values
      • PROP_UNIVERSAL_ID

        public static final java.lang.String PROP_UNIVERSAL_ID
        This field corresponds to the UniversalID Item of the Domino document.
        See Also:
        Constant Field Values
      • PROP_AUTHORS

        public static final java.lang.String PROP_AUTHORS
        This field corresponds to the Authors Item of the Domino document.
        See Also:
        Constant Field Values
      • PROP_IS_VALID

        public static final java.lang.String PROP_IS_VALID
        This field corresponds to the IsValid Item of the Domino document.
        See Also:
        Constant Field Values
      • PROP_IS_SIGNED

        public static final java.lang.String PROP_IS_SIGNED
        This field corresponds to the IsSigned Item of the Domino document.
        See Also:
        Constant Field Values
      • PROP_VERIFIER

        public static final java.lang.String PROP_VERIFIER
        This field corresponds to the Verifier Item of the Domino document.
        See Also:
        Constant Field Values
      • NAB_DEFAULT_VALUE

        protected static final java.lang.String NAB_DEFAULT_VALUE
        Constant for default 'Name and Address Book' Database
        See Also:
        Constant Field Values
      • ADMIN_DATABASE_NAME

        protected static final java.lang.String ADMIN_DATABASE_NAME
        Constant for default 'Administration' Database
        See Also:
        Constant Field Values
      • VIEW_PEOPLE

        protected static final java.lang.String VIEW_PEOPLE
        Constant for default view
        See Also:
        Constant Field Values
      • FORMULA_FORM_PERSON

        protected static final java.lang.String FORMULA_FORM_PERSON
        Constant for default formula
        See Also:
        Constant Field Values
    • Constructor Detail

      • DominoUsersConnector

        public DominoUsersConnector()
        Constructor Creates the connector and sets the AddOnly, Delete, Iterator, Lookup and Update modes
    • Method Detail

      • getResHash

        public static ResourceHash getResHash()
        Getter for the ResourceHash of the TMS messages
        Returns:
        the ResourceHash
      • initLocalThread

        public void initLocalThread()
                             throws java.lang.Exception
        This call is needed when the connector makes local calls through a client or server. The local calls (lotus.domino.local.*) are available only in the Notes.jar which may not be in the installation. Thus, use reflection to load and call sinitThread/stermThread. This method is called from the initialize method when local session is made.
        Throws:
        java.lang.Exception - An exception is thrown if this method fails.
      • termLocalThread

        public void termLocalThread()
        This method terminates the Notes API thread to make sure resources are cleaned up properly. This method is usually called from the terminate method. It is not recommended to use it directly.
      • run

        public void run()
        Accepts commands from the command line until termination is requested.
        Specified by:
        run in interface java.lang.Runnable
      • initialize

        public void initialize​(java.lang.Object aObject)
                        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 Connector
        Parameters:
        aObject - User provided parameter
        Throws:
        java.lang.Exception - if the initialization of this connector fails.
      • selectEntries

        public void selectEntries()
                           throws java.lang.Exception
        Prepare 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:
        selectEntries in interface ConnectorInterface
        Overrides:
        selectEntries in class Connector
        Throws:
        java.lang.Exception - if an error occurs.
      • getNextEntry

        public Entry getNextEntry()
                           throws java.lang.Exception
        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:
        getNextEntry in interface ConnectorInterface
        Overrides:
        getNextEntry in class Connector
        Returns:
        - the next Entry, or null if no more data
        Throws:
        java.lang.Exception - if an error occurs.
        See Also:
        ConnectorInterface.selectEntries()
      • findEntry

        public Entry findEntry​(SearchCriteria aSearch)
                        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 Connector
        Parameters:
        aSearch - 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 aEntry,
                             SearchCriteria aSearch)
                      throws java.lang.Exception
        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:
        modEntry in interface ConnectorInterface
        Overrides:
        modEntry in class Connector
        Parameters:
        aEntry - The entry data
        aSearch - The search criteria used to locate the entry to be modified
        Throws:
        java.lang.Exception - if an error occurs.
      • putEntry

        public void putEntry​(Entry aEntry)
                      throws java.lang.Exception
        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 Connector
        Parameters:
        aEntry - The entry data to add
        Throws:
        java.lang.Exception - if an error occurs.
      • deleteEntry

        public void deleteEntry​(Entry aEntry,
                                SearchCriteria aSearch)
                         throws java.lang.Exception
        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 Connector
        Parameters:
        aEntry - The entry data
        aSearch - The search criteria used to locate the entry to be deleted
        Throws:
        java.lang.Exception - if an error occurs.
      • terminate

        public void terminate()
        Terminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active.
        Specified by:
        terminate in interface ConnectorInterface
        Overrides:
        terminate in class Connector
      • getVersion

        public java.lang.String getVersion()
        Version information
        Specified by:
        getVersion in interface VersionInfoInterface
        Returns:
        version information.
      • getDeleteMailFile

        public int getDeleteMailFile()
        API provided to get the default delete mail file type
        Returns:
        the deletion type
      • setDeleteMailFile

        public void setDeleteMailFile​(int aDeleteType)
                               throws java.lang.Exception
        API provided to specify how and if the mail file should be deleted Can be one of: 0 - Don't delete mail file 1 - Delete just the mail file specified in Person document 2 - Delete mail file specified in Person document and all replicas
        Parameters:
        aDeleteType - the type to be set
        Throws:
        java.lang.Exception - if an error occur
      • getDeleteGroupName

        public java.lang.String getDeleteGroupName()
        API provided to get the group that the user name is placed on deletion. Typically this is the "Deny List only" group
        Returns:
        the group name
      • setDeleteGroupName

        public void setDeleteGroupName​(java.lang.String aGroupName)
                                throws java.lang.Exception
        API provided to specify the group that the user name should be placed on deletion. Typically this is the "Deny List only" group
        Parameters:
        aGroupName - the name of the group
        Throws:
        java.lang.Exception - if an error occur
      • mustPerformDominoAction

        protected boolean mustPerformDominoAction​(IDominoAction aDominoAction,
                                                  Entry aEntry)
                                           throws java.lang.Exception
        Inspects the Attributes of the given Entry and determines if the Domino Action has to be performed.
        Parameters:
        aDominoAction - the action to be checked
        aEntry - the Entry date
        Returns:
        true if must be performed
        Throws:
        java.lang.Exception - if an error occur
      • resetAndExtractData

        protected void resetAndExtractData​(IDominoAction aDominoAction,
                                           Entry aEntry)
                                    throws java.lang.Exception
        Resets the local data holders to empty/default values according the business logic of the Domino Action.
        Parameters:
        aDominoAction - the action
        aEntry - the Entry data
        Throws:
        java.lang.Exception - if an error occur
      • performDominoAction

        protected void performDominoAction​(IDominoAction aDominoAction)
                                    throws java.lang.Exception
        Check if a Domino Action could be performed and if so it is performed
        Parameters:
        aDominoAction - the action
        Throws:
        java.lang.Exception - if an error occur
      • clearFixedDominoActionAttributes

        protected Entry clearFixedDominoActionAttributes​(IDominoAction aDominoAction,
                                                         Entry aEntry)
                                                  throws java.lang.Exception
        Extracts and stores data for the Domino Action
        Parameters:
        aDominoAction - the action
        aEntry - the Entry data
        Returns:
        the fixed Entry
        Throws:
        java.lang.Exception - if an error occur
      • checkExtractAndExecuteDominoAction

        protected void checkExtractAndExecuteDominoAction​(IDominoAction aDominoAction,
                                                          Entry aEntry)
                                                   throws java.lang.Exception
        If the Domino Action should be performed this method resets the local data holders to empty/default values according the action and then extracts and stores the data
        Parameters:
        aDominoAction - the action
        aEntry - the Entry data
        Throws:
        java.lang.Exception - if an error occur
      • getSession

        public lotus.domino.Session getSession()
        Getter method for the mSession inner variable
        Returns:
        the session
      • getDatabase

        public lotus.domino.Database getDatabase()
        Getter method for the mDatabase inner variable
        Returns:
        the database
      • getAdminDatabase

        public lotus.domino.Database getAdminDatabase()
        Getter method for the mAdminDatabase inner variable
        Returns:
        the Administration database