com.ibm.as400.access
Class DirectoryEntryList

java.lang.Object
  |
  +--com.ibm.as400.access.DirectoryEntryList

public class DirectoryEntryList
extends java.lang.Object

The DirectoryEntryList class is used to retrieve 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 java.lang.String ADDRESS1
          Constant used to filter the list of directory entries by mailing address.
static java.lang.String ADDRESS2
          Constant used to filter the list of directory entries by mailing address.
static java.lang.String ADDRESS3
          Constant used to filter the list of directory entries by mailing address.
static java.lang.String ADDRESS4
          Constant used to filter the list of directory entries by mailing address.
static java.lang.String BUILDING
          Constant used to filter the list of directory entries by building.
static java.lang.String COMPANY
          Constant used to filter the list of directory entries by company.
static java.lang.String DEPARTMENT
          Constant used to filter the list of directory entries by department.
static java.lang.String FAX
          Constant used to filter the list of directory entries by fax number.
static java.lang.String FIRST_NAME
          Constant used to filter the list of directory entries by first name.
static java.lang.String FIRST_OR_PREFERRED_NAME
          Constant used to filter the list of directory entries by first or preferred name.
static java.lang.String FULL_NAME
          Constant used to filter the list of directory entries by full name.
static java.lang.String JOB_TITLE
          Constant used to filter the list of directory entries by job title.
static java.lang.String LAST_NAME
          Constant used to filter the list of directory entries by last name.
static java.lang.String LOCATION
          Constant used to filter the list of directory entries by location.
static java.lang.String MIDDLE_NAME
          Constant used to filter the list of directory entries by middle name.
static java.lang.String NETWORK_USER_ID
          Constant used to filter the list of directory entries by network user ID.
static java.lang.String OFFICE
          Constant used to filter the list of directory entries by office.
static java.lang.String PREFERRED_NAME
          Constant used to filter the list of directory entries by preferred name.
static java.lang.String SYSTEM_GROUP
          Constant used to filter the list of directory entries by system group.
static java.lang.String SYSTEM_NAME
          Constant used to filter the list of directory entries by system name.
static java.lang.String TELEPHONE1
          Constant used to filter the list of directory entries by telephone number.
static java.lang.String TELEPHONE2
          Constant used to filter the list of directory entries by telephone number.
static java.lang.String TEXT
          Constant used to filter the list of directory entries by text description.
static java.lang.String USER_ADDRESS
          Constant used to filter the list of directory entries by directory entry user address.
static java.lang.String USER_DESCRIPTION
          Constant used to filter the list of directory entries by user description.
static java.lang.String USER_ID
          Constant used to filter the list of directory entries by directory entry user ID.
static java.lang.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(java.lang.String selectionID, java.lang.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 server.
 java.lang.String getKey()
          Returns the primary selection ID used when searching the system distribution directory.
 AS400 getSystem()
          Returns the system.
 void setKey(java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String BUILDING
Constant used to filter the list of directory entries by building.

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

COMPANY

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

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

DEPARTMENT

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

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

FAX

public static final java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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(java.lang.String selectionID,
                         java.lang.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,
                                   java.lang.InterruptedException,
                                   java.io.IOException,
                                   ObjectDoesNotExistException
Retrieves the directory entry information from the server. This method internally calls the OS/400 QOKSCHD system API.

Returns:
An array of directory entries.
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
java.lang.InterruptedException
java.io.IOException
ObjectDoesNotExistException

getKey

public java.lang.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(java.lang.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()