Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesListIFS

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.ISeriesListIFS
All Implemented Interfaces:
IISeriesAPIProcessor, IISeriesListProcessor

public class ISeriesListIFS
extends ISeriesAbstractListProcessor

A class for listing IFS objects on an iSeries. This is done by calling the appropriate system API.

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. The createObject or createIFSFolderObject methods of this will be called for each item in the returned list, depending on whether we are processing an ifs file or ifs folder. The empty object returned by the supplied factory method 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 only
  • IISeriesHostObjectBrief-> returns minimal info
  • IISeriesHostObjectBasic -> returns typical info
  • IISeriesHostObjectExhaustive -> returns all available info (**)


    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
    ISeriesListIFS()
              Constructor used when you do not have an AS400 object already.
    ISeriesListIFS(AS400 system)
              Constructor when an AS400 object already exists.
     
    Method Summary
     boolean accept(IFSFile file)
              Method required by the IFSFileFilter interface from the Toolbox.
    static String getExtension(String fileName)
              Helper method to get file name extension from file name
     List getList(ISeriesAbstractFilterString fsObj)
              When basic info is wanted and the default basic factory is ok.
     List getListBrief(ISeriesAbstractFilterString fsObj)
              When only brief info is wanted and the default brief factory is ok.
    protected  List getListFromAS400(String filterString)
              Prepare and call host.
     List getListNameOnly(ISeriesAbstractFilterString fsObj)
              When only the name is wanted and the default name factory is ok.
     List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory)
              Do the actual list retrieval.
     List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory, IISeriesHostListStatusCallback callback)
              Retrieve list of IFS files and/or folders from the AS/400.
    static void setFileInfo(IISeriesHostObjectNameOnly obj, IFSFile fileObj)
              Helper method to set file information from IFSFile object.
     
    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, determineInfoLevel, 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, setSystem, 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

    ISeriesListIFS

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


    ISeriesListIFS

    public ISeriesListIFS(AS400 system)
    Constructor when an AS400 object already exists.

    Parameters:
    system - AS400 system to use for the connection. AS400 is a toolbox class.
    Method Detail

    getListNameOnly

    public List getListNameOnly(ISeriesAbstractFilterString fsObj)
                         throws Exception
    When only the name is wanted and the default name factory is ok.

    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 ISeriesHostObjectNameOnly objects.
    Throws:
    Exception

    getListBrief

    public List getListBrief(ISeriesAbstractFilterString fsObj)
                      throws Exception
    When only brief info is wanted and the default brief factory is ok.

    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

    getList

    public List getList(ISeriesAbstractFilterString fsObj)
                 throws Exception
    When basic info is wanted and the default basic factory is ok.

    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

    getObjectList

    public List getObjectList(ISeriesAbstractFilterString fsObj,
                              IISeriesHostListObjectFactory listObjectFactory)
                       throws Exception
    Do the actual list retrieval.

    Specified by:
    getObjectList in class ISeriesAbstractListProcessor
    Parameters:
    fsObj - Filter string object identifying what list to get.
    listObjectFactory - An object implementing the IISeriesHostListObjectFactory interface. This interface prescribes four methods, of which we use two here:
    1. createObject() for each IFS file object found on the host.
    2. createIFSFolderObject() for each IFS folder object found on the host.
    The object returned by the factory method is populated with data from the host about that host item. The amount of data put into is determined by examining which of the four interfaces the object returned by createObject() implements:
    1. IISeriesHostObjectNameOnly -> name only
    2. IISeriesHostObjectBrief -> brief information
    3. IISeriesHostObjectBasic -> typical information
    4. IISeriesHostObjectExhaustive -> ALL information the host gives us
    Throws:
    Exception

    getObjectList

    public List getObjectList(ISeriesAbstractFilterString fsObj,
                              IISeriesHostListObjectFactory listObjectFactory,
                              IISeriesHostListStatusCallback callback)
                       throws Exception
    Retrieve list of IFS files and/or folders from the AS/400. 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. Since IFS list requests can't be multi-generic, this method is redundant and here for completeness. 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

    getListFromAS400

    protected List getListFromAS400(String filterString)
                             throws Exception
    Prepare and call host.

    Throws:
    Exception

    accept

    public boolean accept(IFSFile file)
    Method required by the IFSFileFilter interface from the Toolbox. This simply filters out files vs directories.


    getExtension

    public static String getExtension(String fileName)
    Helper method to get file name extension from file name


    setFileInfo

    public static void setFileInfo(IISeriesHostObjectNameOnly obj,
                                   IFSFile fileObj)
    Helper method to set file information from IFSFile object.

    Parameters:
    Object - whose information is to be populated from info in the IFSFile object.
    IFSFile - object to extract the information from.

    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.