com.ibm.as400.access
Class DirectoryEntryList

java.lang.Object
  extended by com.ibm.as400.access.DirectoryEntryList

public class DirectoryEntryList
extends Object

Retrieves a list of system distribution directory entries.

By default, all entries are returned as if by calling addSelection(DirectoryEntryList.USER_PROFILE, "*").

 AS400 system = new AS400();
 DirectoryEntryList list = new DirectoryEntryList(system);
 // Retrieves all of the entries that map to user profiles that begin with the letter 'B'.
 list.addSelection(DirectoryEntryList.USER_PROFILE, "B*");
 DirectoryEntry[] entries = list.getEntries();
 

Here is an example of using selection IDs:

 AS400 system = new AS400();
 DirectoryEntryList list = new DirectoryEntryList(system);
 list.addSelection(DirectoryEntryList.LAST_NAME, "SMITH");
 list.addSelection(DirectoryEntryList.FIRST_NAME, "C*");
 list.setKey(DirectoryEntryList.FIRST_NAME); // Set the primary sort to be the first name field.
 DirectoryEntry[] entries = list.getEntries();
 

See Also:
DirectoryEntry, User

Field Summary
static String ADDRESS1
          Constant used to filter the list of directory entries by mailing address.
static String ADDRESS2
          Constant used to filter the list of directory entries by mailing address.
static String ADDRESS3
          Constant used to filter the list of directory entries by mailing address.
static String ADDRESS4
          Constant used to filter the list of directory entries by mailing address.
static String BUILDING
          Constant used to filter the list of directory entries by building.
static String COMPANY
          Constant used to filter the list of directory entries by company.
static String DEPARTMENT
          Constant used to filter the list of directory entries by department.
static String FAX
          Constant used to filter the list of directory entries by fax number.
static String FIRST_NAME
          Constant used to filter the list of directory entries by first name.
static String FIRST_OR_PREFERRED_NAME
          Constant used to filter the list of directory entries by first or preferred name.
static String FULL_NAME
          Constant used to filter the list of directory entries by full name.
static String JOB_TITLE
          Constant used to filter the list of directory entries by job title.
static String LAST_NAME
          Constant used to filter the list of directory entries by last name.
static String LOCATION
          Constant used to filter the list of directory entries by location.
static String MIDDLE_NAME
          Constant used to filter the list of directory entries by middle name.
static String NETWORK_USER_ID
          Constant used to filter the list of directory entries by network user ID.
static String OFFICE
          Constant used to filter the list of directory entries by office.
static String PREFERRED_NAME
          Constant used to filter the list of directory entries by preferred name.
static String SYSTEM_GROUP
          Constant used to filter the list of directory entries by system group.
static String SYSTEM_NAME
          Constant used to filter the list of directory entries by system name.
static String TELEPHONE1
          Constant used to filter the list of directory entries by telephone number.
static String TELEPHONE2
          Constant used to filter the list of directory entries by telephone number.
static String TEXT
          Constant used to filter the list of directory entries by text description.
static String USER_ADDRESS
          Constant used to filter the list of directory entries by directory entry user address.
static String USER_DESCRIPTION
          Constant used to filter the list of directory entries by user description.
static String USER_ID
          Constant used to filter the list of directory entries by directory entry user ID.
static String USER_PROFILE
          Constant used to filter the list of directory entries by user profile name.
 
Constructor Summary
DirectoryEntryList(AS400 system)
          Constructs a DirectoryEntryList.
 
Method Summary
 void addSelection(String selectionID, String value)
          Adds a value used to filter the list of directory entries returned by getEntries().
 void clearSelection()
          Removes all selection IDs and values that were previously added by addSelection().
 DirectoryEntry[] getEntries()
          Retrieves the directory entry information from the system.
 String getKey()
          Returns the primary selection ID used when searching the system distribution directory.
 AS400 getSystem()
          Returns the system.
 void setKey(String selectionID)
          Sets the primary selection ID used when searching the system distribution directory.
 void setSystem(AS400 system)
          Sets the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADDRESS1

public static final String ADDRESS1
Constant used to filter the list of directory entries by mailing address.

See Also:
DirectoryEntry.getMailingAddress1(), Constant Field Values

ADDRESS2

public static final String ADDRESS2
Constant used to filter the list of directory entries by mailing address.

See Also:
DirectoryEntry.getMailingAddress2(), Constant Field Values

ADDRESS3

public static final String ADDRESS3
Constant used to filter the list of directory entries by mailing address.

See Also:
DirectoryEntry.getMailingAddress3(), Constant Field Values

ADDRESS4

public static final String ADDRESS4
Constant used to filter the list of directory entries by mailing address.

See Also:
DirectoryEntry.getMailingAddress4(), Constant Field Values

BUILDING

public static final String BUILDING
Constant used to filter the list of directory entries by building.

See Also:
DirectoryEntry.getBuilding(), Constant Field Values

COMPANY

public static final String COMPANY
Constant used to filter the list of directory entries by company.

See Also:
DirectoryEntry.getCompany(), Constant Field Values

DEPARTMENT

public static final String DEPARTMENT
Constant used to filter the list of directory entries by department.

See Also:
DirectoryEntry.getDepartment(), Constant Field Values

FAX

public static final String FAX
Constant used to filter the list of directory entries by fax number.

See Also:
DirectoryEntry.getFaxNumber(), Constant Field Values

FIRST_NAME

public static final String FIRST_NAME
Constant used to filter the list of directory entries by first name.

See Also:
DirectoryEntry.getFirstName(), Constant Field Values

FIRST_OR_PREFERRED_NAME

public static final String FIRST_OR_PREFERRED_NAME
Constant used to filter the list of directory entries by first or preferred name. This constant is only used as input to filter the list. Its value cannot be retrieved from a DirectoryEntry object.

See Also:
Constant Field Values

FULL_NAME

public static final String FULL_NAME
Constant used to filter the list of directory entries by full name.

See Also:
DirectoryEntry.getFullName(), Constant Field Values

JOB_TITLE

public static final String JOB_TITLE
Constant used to filter the list of directory entries by job title.

See Also:
DirectoryEntry.getJobTitle(), Constant Field Values

LAST_NAME

public static final String LAST_NAME
Constant used to filter the list of directory entries by last name.

See Also:
DirectoryEntry.getLastName(), Constant Field Values

LOCATION

public static final String LOCATION
Constant used to filter the list of directory entries by location.

See Also:
DirectoryEntry.getLocation(), Constant Field Values

MIDDLE_NAME

public static final String MIDDLE_NAME
Constant used to filter the list of directory entries by middle name.

See Also:
DirectoryEntry.getMiddleName(), Constant Field Values

NETWORK_USER_ID

public static final String NETWORK_USER_ID
Constant used to filter the list of directory entries by network user ID.

See Also:
DirectoryEntry.getNetworkUserID(), Constant Field Values

OFFICE

public static final String OFFICE
Constant used to filter the list of directory entries by office.

See Also:
DirectoryEntry.getOffice(), Constant Field Values

PREFERRED_NAME

public static final String PREFERRED_NAME
Constant used to filter the list of directory entries by preferred name.

See Also:
DirectoryEntry.getPreferredName(), Constant Field Values

SYSTEM_GROUP

public static final String SYSTEM_GROUP
Constant used to filter the list of directory entries by system group.

See Also:
DirectoryEntry.getSystemGroup(), Constant Field Values

SYSTEM_NAME

public static final String SYSTEM_NAME
Constant used to filter the list of directory entries by system name.

See Also:
DirectoryEntry.getSystemName(), Constant Field Values

TELEPHONE1

public static final String TELEPHONE1
Constant used to filter the list of directory entries by telephone number.

See Also:
DirectoryEntry.getTelephoneNumber1(), Constant Field Values

TELEPHONE2

public static final String TELEPHONE2
Constant used to filter the list of directory entries by telephone number.

See Also:
DirectoryEntry.getTelephoneNumber2(), Constant Field Values

TEXT

public static final String TEXT
Constant used to filter the list of directory entries by text description.

See Also:
DirectoryEntry.getText(), Constant Field Values

USER_ADDRESS

public static final String USER_ADDRESS
Constant used to filter the list of directory entries by directory entry user address.

See Also:
DirectoryEntry.getUserAddress(), Constant Field Values

USER_DESCRIPTION

public static final String USER_DESCRIPTION
Constant used to filter the list of directory entries by user description.

See Also:
DirectoryEntry.getUserDescription(), Constant Field Values

USER_ID

public static final String USER_ID
Constant used to filter the list of directory entries by directory entry user ID.

See Also:
DirectoryEntry.getUserID(), Constant Field Values

USER_PROFILE

public static final String USER_PROFILE
Constant used to filter the list of directory entries by user profile name.

See Also:
DirectoryEntry.getUserProfile(), Constant Field Values
Constructor Detail

DirectoryEntryList

public DirectoryEntryList(AS400 system)
Constructs a DirectoryEntryList. By default, no selection IDs have been added. You must add at least one selection ID in order to retrieve any directory entries. The most common way to retrieve a list of all entries on the system is to add a selection for USER_PROFILE with a value of "*".

Parameters:
system - The system.
Method Detail

addSelection

public void addSelection(String selectionID,
                         String value)
Adds a value used to filter the list of directory entries returned by getEntries(). See the list of constants in this class for some possible selection IDs. Other selection IDs can be used, if they are allowed by the QOKSCHD system API. If the specified selectionID has already been added, then the specified value will override the previously added value.

Parameters:
selectionID - The selectionID, e.g. LAST_NAME or USER_PROFILE.
value - The value used as the filter for the specified selectionID, e.g. "SMITH" or "A*". The asterisk '*' is allowed as a wildcard character.
See Also:
clearSelection(), setKey(java.lang.String)

clearSelection

public void clearSelection()
Removes all selection IDs and values that were previously added by addSelection(). This also clears the key.

See Also:
addSelection(java.lang.String, java.lang.String), setKey(java.lang.String)

getEntries

public DirectoryEntry[] getEntries()
                            throws AS400Exception,
                                   AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   InterruptedException,
                                   IOException,
                                   ObjectDoesNotExistException
Retrieves the directory entry information from the system. This method internally calls the following system API: QOKSCHD

Returns:
An array of directory entries.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
InterruptedException
IOException
ObjectDoesNotExistException

getKey

public String getKey()
Returns the primary selection ID used when searching the system distribution directory. If the key has not been added as a selection ID by addSelection() then it has no effect on how the list is sorted when returned by getEntries().

If no key has been set, then the first entry added via addSelection() is used.

See Also:
setKey(java.lang.String)

getSystem

public AS400 getSystem()
Returns the system.

Returns:
The system.
See Also:
setSystem(com.ibm.as400.access.AS400)

setKey

public void setKey(String selectionID)
Sets the primary selection ID used when searching the system distribution directory. If the key has not been added as a selection ID by addSelection() then it has no effect on how the list is sorted when returned by getEntries().

If no key has been set, then the first entry added via addSelection() is used.

See Also:
addSelection(java.lang.String, java.lang.String), getKey()

setSystem

public void setSystem(AS400 system)
Sets the system.

Parameters:
system - The new system.
See Also:
getSystem()