Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesListLibraries

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

public class ISeriesListLibraries
extends ISeriesAbstractListProcessor

A class for listing libraries on an iSeries. This is done by calling the system API QUSRJOBI. Note this class is only for lists of *LIBL, *CURLIB, *USRLIB or *PRODLIBL. All other library list requests are implicitly forwarded to ISeriesListObjects on your behalf. 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 IISeriesHostListObject. This list processor only ever calls the createLibraryObject method of that factory for each returned item.

This object returned by the supplied factory will be examined to see which of the following three interfaces it implements and the amount of information returned will be determined by that:

  1. IISeriesHostObjectNameOnly -> returns name and context information only
  2. IISeriesHostObjectBrief -> returns minimal info
  3. IISeriesHostObjectBasic -> returns typical info
  4. 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
           
static String CURLIB
           
static String LIBL
           
static String PRODLIBL
           
static String SYSLIBL
           
static String USRLIBL
           
 
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
ISeriesListLibraries()
          Constructor used when you do not have an AS400 object already.
ISeriesListLibraries(AS400 system)
          Constructor when an AS400 object already exists.
 
Method Summary
protected  List buildList(String javaTxt, int pNumberItemsTODO, int pListStartingPosition, int sizePerItem)
          Build the list
 void copyLibraryProperties(IISeriesHostObjectBrief toObj, IISeriesHostObjectBrief fromObj)
          Copy library properties from one object to another
protected  int determineInfoLevel(IISeriesHostObjectNameOnly obj)
          Examine an object returned by the supplied object factory to determine what information level is requested by the caller.
 boolean getExcludeCurLib()
          Retrieve exclude *CURLIB value.
 boolean getGetAllLibraryInformation()
          Retrieve all library information value.
 int getInfoLevel()
          Get the level of information to retrieve for each object.
 List getList(ISeriesAbstractFilterString fsObj)
          Return list of library objects with basic information per library.
 List getListBrief(ISeriesAbstractFilterString fsObj)
          Return list of library objects with brief information per library.
 List getListExhaustive(ISeriesAbstractFilterString fsObj)
          Return list of library objects with full information per library.
protected  List getListFromAS400(String filterString)
          Call QUSRJOBI on AS/400 to get the list.
 List getListNameOnly(ISeriesAbstractFilterString fsObj)
          Return list of library objects with only name information per library.
 List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory)
          Retrieve list of libraries from the AS/400 using the supplied factory to create each object.
 List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory, IISeriesHostListStatusCallback callback)
          Retrieve list of libraries from the AS/400 using the supplied factory to create each object.
protected  IISeriesHostObjectNameOnly populateObj(String javaTxt, int start)
          Build a return object with information for one file system object.
 void setExcludeCurLib(boolean exclude)
          Set to true if you want to exclude *CURLIB in a *USRLIBL request.
protected  void setFromAS400ListObjects(boolean from)
           
 void setGetAllLibraryInformation(boolean set)
          Set to true if you want to get all library object info on a *LIBL, *USRLIBL or *CURLIB request.
 void setInfoLevel(int infoLevel)
          Set the level of information to retrieve for each object.
 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

LIBL

public static final String LIBL
See Also:
Constant Field Values

CURLIB

public static final String CURLIB
See Also:
Constant Field Values

USRLIBL

public static final String USRLIBL
See Also:
Constant Field Values

SYSLIBL

public static final String SYSLIBL
See Also:
Constant Field Values

PRODLIBL

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

ISeriesListLibraries

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


ISeriesListLibraries

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

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

getList

public List getList(ISeriesAbstractFilterString fsObj)
             throws Exception
Return list of library objects with basic information per library. Fastpath to getList where we use a default list object factory that returns an ISeriesHostObjectBasic object for each item in the returned list. Note this will only return non-brief information for library list requests that are not special (*LIBL, *CURLIB, *USRLIB, *PRODLIBL).

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
Return list of library objects with only name information per library. Fastpath to getList where we use a default list object factory that returns an ISeriesHostObjectNameOnly object 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 ISeriesHostObjectNameOnly objects.
Throws:
Exception

getListBrief

public List getListBrief(ISeriesAbstractFilterString fsObj)
                  throws Exception
Return list of library objects with brief information per library. Fastpath to getList where we use a default list object factory that returns an ISeriesHostObjectBrief object 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

getListExhaustive

public List getListExhaustive(ISeriesAbstractFilterString fsObj)
                       throws Exception
Return list of library objects with full information per library. Fastpath to getList where we use a default list object factory that returns an ISeriesHostObjectExhaustive object for each item in the returned list.

Note this will only return non-brief information for library list requests that are not special (*LIBL, *CURLIB, *USRLIB, *PRODLIBL).

Throws:
Exception

getObjectList

public List getObjectList(ISeriesAbstractFilterString fsObj,
                          IISeriesHostListObjectFactory listObjectFactory)
                   throws Exception
Retrieve list of libraries from the AS/400 using the supplied factory to create each object. 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 object and this method are only for special library list requests: *LIBL, *CURLIB, *USRLIBL or *PRODLIBL. All other library list requests are forwarded to ISeriesListObjects on your behalf.

Specified by:
getObjectList in class ISeriesAbstractListProcessor
Parameters:
Filter - string object identify what list to get.
An - object implementing the IISeriesHostListObjectFactory interface. This interface prescribes four methods:
  1. createObject. This method is called to create an Object object
  2. createLibraryObject. This method is called to create a Library object
  3. createDBFileObject. This method is called to create a database File object.
  4. createIFSFolderObject. This method is called to create an IFS folder object.
This list processor API only uses methods 1 (for *LIBL/*CURLIB/*USRLIBL/*PRODLIBL} request or 2 (for all other library list requests).

Each returned object is populated with data from the host about that host item. The list of all objects is returned as a List

The amount of data put into is determined by examining which of the four interfaces the object returned by createXXXObject() implements:

  1. IISeriesHostObjectNameOnly -> returns only the name
  2. IISeriesHostObjectBrief -> returns minimal info
  3. IISeriesHostObjectBasic -> returns typical info
  4. IISeriesHostObjectExhaustive -> returns all available info
Throws:
Exception

getObjectList

public List getObjectList(ISeriesAbstractFilterString fsObj,
                          IISeriesHostListObjectFactory listObjectFactory,
                          IISeriesHostListStatusCallback callback)
                   throws Exception
Retrieve list of libraries from the AS/400 using the supplied factory to create each object. 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 library list requests can't be multi-generic, this method is redundant and here for completeness.

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
Call QUSRJOBI on AS/400 to get the list.

Throws:
Exception

buildList

protected List buildList(String javaTxt,
                         int pNumberItemsTODO,
                         int pListStartingPosition,
                         int sizePerItem)
Build the list


populateObj

protected IISeriesHostObjectNameOnly populateObj(String javaTxt,
                                                 int start)
Build a return object with information for one file system object.

Parameters:
lib - obj to populate
int - index into the String where item starts.
Returns:
one populated file system object

copyLibraryProperties

public void copyLibraryProperties(IISeriesHostObjectBrief toObj,
                                  IISeriesHostObjectBrief fromObj)
Copy library properties from one object to another


setFromAS400ListObjects

protected void setFromAS400ListObjects(boolean from)

getGetAllLibraryInformation

public boolean getGetAllLibraryInformation()
Retrieve all library information value.

Returns:
boolean

setGetAllLibraryInformation

public void setGetAllLibraryInformation(boolean set)
Set to true if you want to get all library object info on a *LIBL, *USRLIBL or *CURLIB request. Default is true.


getExcludeCurLib

public boolean getExcludeCurLib()
Retrieve exclude *CURLIB value.

Returns:
boolean

setExcludeCurLib

public void setExcludeCurLib(boolean exclude)
Set to true if you want to exclude *CURLIB in a *USRLIBL request. The default is false.


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.