com.ibm.as400.access
Class MemberList

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

public class MemberList
extends Object

Represents a list of database file members.

Implementation note: This class internally calls the "List Database File Members" API (QUSLMBR). Information from formats MBRL0100 and MBRL0200 is retrieved.

This class is mostly based on a prototype contributed by Mihael Schmidt.

See Also:
MemberDescription, AS400File

Constructor Summary
Constructor and Description
MemberList(AS400File file)
          Constructs a MemberList object.
MemberList(AS400 system, QSYSObjectPathName path)
          Constructs a MemberList object.
MemberList(AS400 system, String libraryName, String objectName)
          Constructs a MemberList object.
 
Method Summary
Modifier and Type Method and Description
 void addAttribute(int attributeKey)
          Adds an attribute to the attribute list which specifies which attributes of the member are to be retrieved.
 void clear()
          Removes all member descriptions from this object.
 void clearAttributeList()
          Clears the attribute list which specifies which attributes should be retrieved.
 MemberDescription[] getMemberDescriptions()
          Returns an array of retrieved member descriptions.
 void load()
          Loads all members from the specified file(s).
 void refresh()
          Reloads all member descriptions that have been specified via addAttribute().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberList

public MemberList(AS400File file)
Constructs a MemberList object.

Parameters:
file - A database file.

MemberList

public MemberList(AS400 system,
                  QSYSObjectPathName path)
Constructs a MemberList object. Note: Generic names are only supported for the 'member' part of the IFS path. To retrieve all members, the IFS path should point to the database file.

Parameters:
system - AS400 system object.
path - IFS path to the database file or member.

MemberList

public MemberList(AS400 system,
                  String libraryName,
                  String objectName)
Constructs a MemberList object.

Parameters:
system - AS400 system object
libraryName - Library where the physical file is located.
objectName - The name of the physical file.
Method Detail

clear

public void clear()
Removes all member descriptions from this object.


clearAttributeList

public void clearAttributeList()
Clears the attribute list which specifies which attributes should be retrieved.


addAttribute

public void addAttribute(int attributeKey)
Adds an attribute to the attribute list which specifies which attributes of the member are to be retrieved. Constants that specify attributes are available in class MemberDescription.

Parameters:
attributeKey - The attribute to be added.

refresh

public void refresh()
             throws AS400SecurityException,
                    ErrorCompletingRequestException,
                    InterruptedException,
                    IOException,
                    ObjectDoesNotExistException
Reloads all member descriptions that have been specified via addAttribute().

Throws:
ObjectDoesNotExistException - If a system object necessary for the call does not exist on the system.
InterruptedException - If this thread is interrupted.
IOException - If an error occurs while communicating with the system.
ErrorCompletingRequestException - If an error occurs before the request is completed.
AS400SecurityException - If a security or authority error occurs.

load

public void load()
          throws AS400Exception,
                 AS400SecurityException,
                 ErrorCompletingRequestException,
                 IOException,
                 InterruptedException,
                 ObjectDoesNotExistException
Loads all members from the specified file(s).

Throws:
ObjectDoesNotExistException - If an object necessary for the call does not exist on the system.
InterruptedException - If this thread is interrupted.
IOException - If an error occurs while communicating with the system.
ErrorCompletingRequestException - If an error occurs before the request is completed.
AS400SecurityException - If a security or authority error occurs.
AS400Exception - If the program on the server sends an escape message.

getMemberDescriptions

public MemberDescription[] getMemberDescriptions()
Returns an array of retrieved member descriptions. If no member descriptions could be retrieved because there are no members or because of an error, an empty array is returned. If no members has been retrieved yet due to no call to load(), then an empty array is returned.

Returns:
Array of retrieved member descriptions