Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesListMembers

java.lang.Object
  extended by com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
      extended by com.ibm.etools.iseries.comm.ISeriesAbstractListProcessor
          extended by com.ibm.etools.iseries.comm.ISeriesListMembers
All Implemented Interfaces:
IISeriesAPIProcessor, IISeriesListProcessor

public class ISeriesListMembers
extends ISeriesAbstractListProcessor

A class for listing members on an ISeries. This is done by calling the system API QUSLMBR.

The output of the list request is a List of objects that implement the interface IISeriesHostObjectXXX. In order to enable this class to create instances of classes that implement this interface, the caller is asked to supply an object that implements the interface IISeriesHostListObjectFactory.

This prescribes a number of methods, but for member list requests, only one of these methods is used. The createObject method of the supplied factory object will be called for each item in the returned list. The resulting object from the createObject call will be examined to see which of the following three interfaces it implements and the amount of information returned will be determined by that:

  • IISeriesHostObjectNameOnly-> returns name and context info only
  • IISeriesHostObjectBrief-> returns minimal info
  • IISeriesHostObjectBasic -> returns typical info

    PLEASE NOTE THAT MEMBER LISTS ONLY SUPPORT BRIEF AND BASIC LEVELS, NOT THE EXHAUSTIVE LEVEL SUPPORTED BY OBJECTS. FURTHER, THE SIZE IS NOT AVAILABLE IN THE BASIC LEVEL.


    Nested Class Summary
     
    Nested classes/interfaces inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractListProcessor
    ISeriesAbstractListProcessor.HostAPIGenericListHeader
     
    Nested classes/interfaces inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
    ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure
     
    Field Summary
    static String Copyright
               
     
    Fields inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractListProcessor
    DEFAULT_LISTMEMBER_FACTORY_NAMEONLY, DEFAULT_LISTOBJECT_FACTORY_BASIC, DEFAULT_LISTOBJECT_FACTORY_BRIEF, DEFAULT_LISTOBJECT_FACTORY_EXHAUSTIVE, DEFAULT_LISTOBJECT_FACTORY_NAMEARRAY, DEFAULT_LISTOBJECT_FACTORY_NAMEONLY, GENERIC_HEADER_SIZE, returnListObjectFactory
     
    Fields inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
    cancel, cancellableSubTasks, cancelQuerier, CREATE_FALSE, CREATE_TRUE, dbcsConvert, DEFAULT_OBJECT_FACTORY_BASIC, DEFAULT_OBJECT_FACTORY_BRIEF, DEFAULT_OBJECT_FACTORY_EXHAUSTIVE, DEFAULT_OBJECT_FACTORY_NAMEONLY, errorcodeObj, hostAPILibraries, INFOLEVEL_BASIC, INFOLEVEL_BRIEF, INFOLEVEL_EXHAUSTIVE, INFOLEVEL_NAME, INFOLEVEL_NAMEARRAY, INITIAL_SPACESIZE, LOG_DIR, LOG_FILENAME, logFile, logFileStream, logLineCounter, logStandardOut, NEED_USERSPACE_NO, NEED_USERSPACE_YES, objName, objType, QVDEOBJLinfo, returnObjectFactory, todos, tracePrefix, warnings
     
    Constructor Summary
    ISeriesListMembers()
              Constructor used when you do not have an AS400 object already.
    ISeriesListMembers(AS400 system)
              Constructor when there is an existing AS400 object.
     
    Method Summary
    protected  void buildList(int nbrRows, int listStartingPosition, int sizePerRow)
              Originally BuildListMBR in AS400eList Build the list.
    protected  int determineInfoLevel(IISeriesHostObjectNameOnly obj)
              Examine an object returned by the supplied object factory to determine what information level is requested by the caller.
     int getInfoLevel()
              Get the level of information to retrieve for each object.
     List getList(ISeriesAbstractFilterString fsObj)
              Retrieve a list of members, returning a typical (basic) amount of information per member.
     List getListBrief(ISeriesAbstractFilterString fsObj)
              Retrieve a list of members, returning a brief (minimal) amount of information per member.
    protected  void getListFromAS400(String filterString)
              Call QUSLMBR on AS/400 to get the list.
     ISeriesListMembersHeader getListHeader()
              This method returns the member list header information.
     String[] getListNameArray(ISeriesAbstractFilterString fsObj)
              Retrieve list of names-only as an array of strings.
     List getListNameOnly(ISeriesAbstractFilterString fsObj)
              Retrieve a list of members, returning the name of each member.
     boolean getMemberOverride()
              Query whether this list processor honors member override information
     List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory)
              Retrieve a list of objects, returning objects created by a supplied object factory.
     List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory, IISeriesHostListStatusCallback callback)
              Retrieve a list of members, informing the caller when processing starts for each part of a multi-generic list.
    protected  void populateObj()
              Build a return object with information for one file system object.
     void setInfoLevel(int infoLevel)
              Set the level of information to retrieve for each object.
     void setMemberOverride(boolean override)
              Specify whether member overrides are honored or not during list processing.
     void setSystem(AS400 system)
              Set the AS/400 object used for this list processor.
     
    Methods inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractListProcessor
    createListObject, getDefaultListObjectFactory, getFilterString, getFilterStringObject, getList, getList, getListObjectFactory, setFilterStringObj, setListObjectFactory
     
    Methods inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
    addCancellableSubTask, addWarning, cancel, clearWarnings, closeUserSpace, computeSize, createUserSpaceOnHost, getClientCCSID, getDefaultObjectFactory, getErrorCodeStructure, getHostCCSID, getLibrary, getLogFileStream, getObjectFactory, getObjectName, getObjectType, getSystem, getUserSpace, getUserSpaceAPIName, getUserSpaceIFSName, getUserSpaceLibrary, getUserSpaceName, getWarnings, isCancelled, isTraceOn, logException, logHostMessages, logMessage, logMessage, logMessage, logTodo, openUserSpace, padString, parseBin8Date, parseChar13Date, parseChar7Date, parseChar8Date, readUserSpace, readUserSpace, registerCancelQuerier, removeCancellableSubTask, setClientCCSID, setHostCCSID, setLibrary, setLogFileDirectory, setObjectFactory, setObjectName, setObjectType, setTracing, setUserSpaceLibrary, setUserSpaceName
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface com.ibm.etools.iseries.comm.interfaces.IISeriesAPIProcessor
    getWarnings
     

    Field Detail

    Copyright

    public static final String Copyright
    See Also:
    Constant Field Values
    Constructor Detail

    ISeriesListMembers

    public ISeriesListMembers()
    Constructor used when you do not have an AS400 object already. A new AS400 object will be created when getList is called, unless you subsequently call setSystem(AS400) first.


    ISeriesListMembers

    public ISeriesListMembers(AS400 system)
    Constructor when there is an existing AS400 object.

    Parameters:
    AS400 - system to use for the connection.
    Method Detail

    setMemberOverride

    public void setMemberOverride(boolean override)
    Specify whether member overrides are honored or not during list processing.

    Parameters:
    true=>honor - overrides, false=>do not honor overrides

    getMemberOverride

    public boolean getMemberOverride()
    Query whether this list processor honors member override information


    getList

    public List getList(ISeriesAbstractFilterString fsObj)
                 throws Exception
    Retrieve a list of members, returning a typical (basic) amount of information per member. Uses a default factory that creates ISeriesHostObjectBasic objects for each item in the returned list.

    Specified by:
    getList in interface IISeriesListProcessor
    Specified by:
    getList in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - Filter string object identifying what list to get.
    Returns:
    List of ISeriesHostObjectBasic objects.
    Throws:
    Exception

    getListNameOnly

    public List getListNameOnly(ISeriesAbstractFilterString fsObj)
                         throws Exception
    Retrieve a list of members, returning the name of each member. Uses a default factory that creates ISeriesHostMemberNameOnly objects for each item in the returned list.

    Specified by:
    getListNameOnly in interface IISeriesListProcessor
    Specified by:
    getListNameOnly in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - Filter string object identifying what list to get.
    Returns:
    List of ISeriesHostMemberNameOnly objects.
    Throws:
    Exception

    getListNameArray

    public String[] getListNameArray(ISeriesAbstractFilterString fsObj)
                              throws Exception
    Retrieve list of names-only as an array of strings. Super efficient!!

    Returns:
    Array of names matching filtering criteria. May return null if the list is empty!
    Throws:
    Exception

    getListBrief

    public List getListBrief(ISeriesAbstractFilterString fsObj)
                      throws Exception
    Retrieve a list of members, returning a brief (minimal) amount of information per member. Uses a default factory that creates ISeriesHostObjectBrief objects for each item in the returned list.

    Specified by:
    getListBrief in interface IISeriesListProcessor
    Specified by:
    getListBrief in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - Filter string object identifying what list to get.
    Returns:
    List of ISeriesHostObjectBrief objects.
    Throws:
    Exception

    getObjectList

    public List getObjectList(ISeriesAbstractFilterString fsObj,
                              IISeriesHostListObjectFactory listObjectFactory)
                       throws Exception
    Retrieve a list of objects, returning objects created by a supplied object factory. This is the API callers use to get their list after instantiating an object. This can be called multiple times per instantiated object, as long as the same host connection is used each time. Only the constructor takes a host connection object.

    Note this supports multi-generic lists, where the library and/or file are generic. In this case, the list of libraries will be retrieved first, then for each library the list of files. Finally, for every resulting file, the member list as requested is retrieved. The entire list of all members is concatenated together and returned as a single list.

    Specified by:
    getObjectList in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - ISeriesMemberFilterString filter string object identify what list to get. To construct one of these, pass a string of the form library/file(member) MBRTYPE(type type ...) to its constructor.
    listObjectFactory - An object implementing the IISeriesHostListObjectFactory interface. This interface prescribes four methods:
    1. createObject().
    2. createLibraryObject(),
    3. createDBFileObject() and
    4. createIFSFolderObject().
    We only use <@link com.ibm.etools.iseries.comm.interfaces.IISeriesHostListObjectFactory#createObject() createObject()} here. For each as/400 member found, the createObject() factory method is called to create the object for each item in the return list. Once created, the object is populated with data from the host about that host item. The amount of data put into is determined by examining which of the three interfaces the object returned by createObject() implements:
    1. IISeriesHostObjectNameOnly -> name and context only information
    2. IISeriesHostObjectBrief -> brief information
    3. IISeriesHostObjectBasic -> typical information

    PLEASE NOTE THAT WHILE MEMBER LISTS FULLY SUPPORT NAME, BRIEF AND BASIC LEVELS, IT ONLY RETURNS THE DATE-CREATED PROPERTY OF THE EXHAUSTIVE LEVEL SUPPORTED BY OBJECTS. FURTHER, THE SIZE IS NOT AVAILABLE IN THE BASIC LEVEL.

    Throws:
    Exception

    getObjectList

    public List getObjectList(ISeriesAbstractFilterString fsObj,
                              IISeriesHostListObjectFactory listObjectFactory,
                              IISeriesHostListStatusCallback callback)
                       throws Exception
    Retrieve a list of members, informing the caller when processing starts for each part of a multi-generic list. This is the same as the getObjectList(ISeriesAbstractFilterString, IISeriesHostListObjectFactory) method, but includes a callback object that is called when processing starts for each part of a multi-generic list request. A multi-generic member list is a request where either the library or the file name are themselves generic, requiring multiple calls to host member list API. This version of getList is usually used by GUI code that wishes to update a status dialog.

    Specified by:
    getObjectList in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - Filter string object identifying what list to get.
    listObjectFactory - Factory for creating each of the returned objects.
    callback - Object to callback as each list phase is started.
    Throws:
    Exception

    getListHeader

    public ISeriesListMembersHeader getListHeader()
    This method returns the member list header information. This is information pertaining to the file containing the members, and is the header part of the information returned by the system API QUSLMBR which is used to get the list. ** THIS METHOD CAN ONLY BE CALLED AFTER CALLING GETLIST. ** IT RETURNS THE HEADER INFORMATION FROM THE PREVIOUS GETLIST REQUEST.

    Returns:
    ISeriesListMembersHeader object

    getListFromAS400

    protected void getListFromAS400(String filterString)
                             throws Exception
    Call QUSLMBR on AS/400 to get the list. Originally CallQUSLMBR in AS400eList. Updates theMemberList global list

    Throws:
    Exception

    buildList

    protected void buildList(int nbrRows,
                             int listStartingPosition,
                             int sizePerRow)
                      throws Exception
    Originally BuildListMBR in AS400eList Build the list. Parse whole chunk of data by sizePerItem. For each parsed piece, call populateObj to create and populate a returned object, that is added to the list. Overridden from parent. Updates theMemberList global list.

    Throws:
    Exception

    populateObj

    protected void populateObj()
    Build a return object with information for one file system object. SEE AddVectorLineMBR METHOD IN RICK SOWA'S AS400eList CLASS FOR ORIGINAL CODE.

    Parameters:
    lib - obj to populate
    int - index into the String where item starts.
    param - int

    setSystem

    public void setSystem(AS400 system)
    Description copied from class: ISeriesAbstractHostAPIProcessor
    Set the AS/400 object used for this list processor.

    Overrides:
    setSystem in class ISeriesAbstractHostAPIProcessor

    getInfoLevel

    public int getInfoLevel()
    Get the level of information to retrieve for each object. Returns -1 if the information level has not been set or determined yet.

    See Also:
    ISeriesAbstractHostAPIProcessor.INFOLEVEL_BASIC, ISeriesAbstractHostAPIProcessor.INFOLEVEL_BRIEF, ISeriesAbstractHostAPIProcessor.INFOLEVEL_EXHAUSTIVE, ISeriesAbstractHostAPIProcessor.INFOLEVEL_NAME, ISeriesAbstractHostAPIProcessor.INFOLEVEL_NAMEARRAY

    setInfoLevel

    public void setInfoLevel(int infoLevel)
    Set the level of information to retrieve for each object. A value of -1 means the information level will be determined by the factory method.

    See Also:
    ISeriesAbstractHostAPIProcessor.INFOLEVEL_BASIC, ISeriesAbstractHostAPIProcessor.INFOLEVEL_BRIEF, ISeriesAbstractHostAPIProcessor.INFOLEVEL_EXHAUSTIVE, ISeriesAbstractHostAPIProcessor.INFOLEVEL_NAME, ISeriesAbstractHostAPIProcessor.INFOLEVEL_NAMEARRAY

    determineInfoLevel

    protected int determineInfoLevel(IISeriesHostObjectNameOnly obj)
    Description copied from class: ISeriesAbstractHostAPIProcessor
    Examine an object returned by the supplied object factory to determine what information level is requested by the caller. For performance reasons, only call this once per list request and store the result.

    Overrides:
    determineInfoLevel in class ISeriesAbstractHostAPIProcessor

    Rational Developer for Power Systems Software
    V7.6

    Copyright © 2011 IBM Corp. All Rights Reserved.

    Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.