com.ibm.di.connector.dominoUsers
Class DominoUsersConnector

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

public class DominoUsersConnector
extends Connector
implements 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 Summary
protected static String ADMIN_DATABASE_NAME
          Constant for default 'Administration' Database
static String ATTR_NAME_ALT_FULL_NAME
          This field corresponds to the AltFullName Item of the Domino document.
static String ATTR_NAME_ALT_FULL_NAME_LANGUAGE
          This field corresponds to the AltFullNameLanguage Item of the Domino document.
static String ATTR_NAME_COMMENT
          This field corresponds to the Comment Item of the Domino document.
static 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”.
static String ATTR_NAME_FIRST_NAME
          This field corresponds to the FirstName Item of the Domino document.
static String ATTR_NAME_FORM
          Corresponds to the Form Item of the Domino document.
static String ATTR_NAME_FULL_NAME
          This field corresponds to the FullName Item of the Domino document.
static String ATTR_NAME_HTTP_PASSWORD
          This field corresponds to the HTTPPassword Item of the Domino document.
static String ATTR_NAME_LAST_NAME
          This field corresponds to the LastName Item of the Domino document.
static String ATTR_NAME_LOCATION
          This field corresponds to the Location Item of the Domino document.
static 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.
static String ATTR_NAME_MAIL_FILE
          This field corresponds to the MailFile Item of the Domino document.
static String ATTR_NAME_MAIL_TEMPLATE_FILE
          The filename of a Notes template database, which the Connector will use to create the user mail file.
static 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.
static String ATTR_NAME_MIDDLE_INITIAL
          This field corresponds to the MiddleInitial Item of the Domino document.
static 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.
static 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.
static String ATTR_NAME_REG_SERVER
          The name of the server containing the user's mail file.
static String ATTR_NAME_TYPE
          Corresponds to the Type Item of the Domino document.
protected static String FORMULA_FORM_PERSON
          Constant for default formula
protected static String NAB_DEFAULT_VALUE
          Constant for default 'Name and Address Book' Database
static String PROP_AUTHORS
          This field corresponds to the Authors Item of the Domino document.
static String PROP_IS_SIGNED
          This field corresponds to the IsSigned Item of the Domino document.
static String PROP_IS_VALID
          This field corresponds to the IsValid Item of the Domino document.
static String PROP_NOTE_ID
          This field corresponds to the NoteID Item of the Domino document.
static String PROP_UNIVERSAL_ID
          This field corresponds to the UniversalID Item of the Domino document.
static String PROP_VERIFIER
          This field corresponds to the Verifier Item of the Domino document.
protected static String VIEW_PEOPLE
          Constant for default view
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
DominoUsersConnector()
          Constructor Creates the connector and sets the AddOnly, Delete, Iterator, Lookup and Update modes
 
Method Summary
protected  void checkExtractAndExecuteDominoAction(IDominoAction aDominoAction, Entry aEntry)
          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
protected  Entry clearFixedDominoActionAttributes(IDominoAction aDominoAction, Entry aEntry)
          Extracts and stores data for the Domino Action
 void deleteEntry(Entry aEntry, SearchCriteria aSearch)
          Deletes an existing entry.
 Entry findEntry(SearchCriteria aSearch)
          Finds an existing entry.
 lotus.domino.Database getAdminDatabase()
          Getter method for the mAdminDatabase inner variable
 lotus.domino.Database getDatabase()
          Getter method for the mDatabase inner variable
 String getDeleteGroupName()
          API provided to get the group that the user name is placed on deletion.
 int getDeleteMailFile()
          API provided to get the default delete mail file type
 Entry getNextEntry()
          Returns the next Entry from the connector.
static ResourceHash getResHash()
          Getter for the ResourceHash of the TMS messages
 lotus.domino.Session getSession()
          Getter method for the mSession inner variable
 String getVersion()
          Version information
 void initialize(Object aObject)
          Initialize the connector.
 void initLocalThread()
          This call is needed when the connector makes local calls through a client or server.
 void modEntry(Entry aEntry, SearchCriteria aSearch)
          Modifies an existing entry.
protected  boolean mustPerformDominoAction(IDominoAction aDominoAction, Entry aEntry)
          Inspects the Attributes of the given Entry and determines if the Domino Action has to be performed.
protected  void performDominoAction(IDominoAction aDominoAction)
          Check if a Domino Action could be performed and if so it is performed
 void putEntry(Entry aEntry)
          Adds a new entry to the data source
protected  void resetAndExtractData(IDominoAction aDominoAction, Entry aEntry)
          Resets the local data holders to empty/default values according the business logic of the Domino Action.
 void run()
          Accepts commands from the command line until termination is requested.
 void selectEntries()
          Prepare the Connector for sequential read.
 void setDeleteGroupName(String aGroupName)
          API provided to specify the group that the user name should be placed on deletion.
 void setDeleteMailFile(int aDeleteType)
          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
 void terminate()
          Terminate the connector.
 void termLocalThread()
          This method terminates the Notes API thread to make sure resources are cleaned up properly.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, 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, pushback, queryOperations, queryReply, querySchema, 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
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Field Detail

ATTR_NAME_FORM

public static final 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 String NAB_DEFAULT_VALUE
Constant for default 'Name and Address Book' Database

See Also:
Constant Field Values

ADMIN_DATABASE_NAME

protected static final String ADMIN_DATABASE_NAME
Constant for default 'Administration' Database

See Also:
Constant Field Values

VIEW_PEOPLE

protected static final String VIEW_PEOPLE
Constant for default view

See Also:
Constant Field Values

FORMULA_FORM_PERSON

protected static final 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 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:
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 Runnable

initialize

public void initialize(Object aObject)
                throws 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:
Exception - if the initialization of this connector fails.

selectEntries

public void selectEntries()
                   throws 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:
Exception - if an error occurs.

getNextEntry

public Entry getNextEntry()
                   throws 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:
Exception - if an error occurs.
See Also:
ConnectorInterface.selectEntries()

findEntry

public Entry findEntry(SearchCriteria aSearch)
                throws 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:
Exception - if an error occurs.

modEntry

public void modEntry(Entry aEntry,
                     SearchCriteria aSearch)
              throws 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:
Exception - if an error occurs.

putEntry

public void putEntry(Entry aEntry)
              throws 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:
Exception - if an error occurs.

deleteEntry

public void deleteEntry(Entry aEntry,
                        SearchCriteria aSearch)
                 throws 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:
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 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 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:
Exception - if an error occur

getDeleteGroupName

public 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(String aGroupName)
                        throws 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:
Exception - if an error occur

mustPerformDominoAction

protected boolean mustPerformDominoAction(IDominoAction aDominoAction,
                                          Entry aEntry)
                                   throws 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:
Exception - if an error occur

resetAndExtractData

protected void resetAndExtractData(IDominoAction aDominoAction,
                                   Entry aEntry)
                            throws 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:
Exception - if an error occur

performDominoAction

protected void performDominoAction(IDominoAction aDominoAction)
                            throws Exception
Check if a Domino Action could be performed and if so it is performed

Parameters:
aDominoAction - the action
Throws:
Exception - if an error occur

clearFixedDominoActionAttributes

protected Entry clearFixedDominoActionAttributes(IDominoAction aDominoAction,
                                                 Entry aEntry)
                                          throws Exception
Extracts and stores data for the Domino Action

Parameters:
aDominoAction - the action
aEntry - the Entry data
Returns:
the fixed Entry
Throws:
Exception - if an error occur

checkExtractAndExecuteDominoAction

protected void checkExtractAndExecuteDominoAction(IDominoAction aDominoAction,
                                                  Entry aEntry)
                                           throws 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:
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