Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesListObjects

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

public class ISeriesListObjects
extends ISeriesAbstractListProcessor

A class for listing objects on an ISeries. This is done by calling the system API QVDEOBJL, which in turn calls QUSLOBJ.

The output of the list request is a List of objects that implement the interface ISeriesHostObjectXXX. 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 appropriate createXXXObject method of this will be called for each item in the returned list. The resulting object 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 -> name and context information only
  2. IISeriesHostObjectBrief -> brief information
  3. IISeriesHostObjectBasic -> typical information
  4. IISeriesHostObjectExhaustive-> ALL information the host gives us


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 DBATTR
          Special object attribute value for listing all PF, LF and DDM files.
 
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
ISeriesListObjects()
          Constructor used when you do not have an AS400 object already.
ISeriesListObjects(AS400 system)
          Constructor used when you have an AS400 object already.
 
Method Summary
protected  void buildListHunk(int nbrRows, int startingPosition, int sizePerRow)
          Given one big hunk of returned data, xlate it to text and parse it row by row into a populated object.
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 list of typical object information for objects in an AS/400 library.
 List getListBrief(ISeriesAbstractFilterString fsObj)
          Retrieve list of simple object information for objects in an AS/400 library.
 List getListExhaustive(ISeriesAbstractFilterString fsObj)
          Retrieve list of complete object information for objects in an AS/400 library.
protected  void getListFromAS400()
          Call QVDEOBJL on AS/400 to get the list (which in turn calls system api QUSLOBJ.
 String[] getListNameArray(ISeriesAbstractFilterString fsObj)
          Retrieve list of names-only as an array of strings.
 List getListNameOnly(ISeriesAbstractFilterString fsObj)
          Retrieve list of names-only object information for objects in an AS/400 library.
 List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory)
          Retrieve list of object information for objects in an AS/400 library.
 List getObjectList(ISeriesAbstractFilterString fsObj, IISeriesHostListObjectFactory listObjectFactory, IISeriesHostListStatusCallback callback)
          Retrieve a list of objects, informing the caller when processing starts for each part of a multi-generic list.
protected  void populateObj()
          Method that parses the next of data and populates the current list object.
 void setAuthorityChecks(String[] libAuth, String[] objAuth)
          Set the library and object authorities to check on the QUSLOBJ call.
 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

DBATTR

public static final String DBATTR
Special object attribute value for listing all PF, LF and DDM files. "*DATABASE"

See Also:
Constant Field Values
Constructor Detail

ISeriesListObjects

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


ISeriesListObjects

public ISeriesListObjects(AS400 system)
Constructor used when you have an AS400 object already.

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

getList

public List getList(ISeriesAbstractFilterString fsObj)
             throws Exception
Retrieve list of typical object information for objects in an AS/400 library. Same as getList that takes a list object factory, but in this case we use a default factory that returns basic information IISeriesHostObjectBasic

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 list of names-only object information for objects in an AS/400 library. Same as getList that takes a list object factory, but in this case we use a default factory that returns name-only information IISeriesHostObjectNameOnly for every item in the 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

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 list of simple object information for objects in an AS/400 library. Same as getList that takes a list object factory, but in this case we use a default factory that returns brief information IISeriesHostObjectBrief for every item in the 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
Retrieve list of complete object information for objects in an AS/400 library. Same as getList that takes a list object factory, but in this case we use a default factory that returns all information IISeriesHostObjectExhaustive for every item in the list.

Returns:
List of ISeriesHostObjectExhaustive objects.
Throws:
Exception

getObjectList

public List getObjectList(ISeriesAbstractFilterString fsObj,
                          IISeriesHostListObjectFactory listObjectFactory)
                   throws Exception
Retrieve list of object information for objects in an AS/400 library. This is the API callers use to get their list after instantiating an object of this class. The other getList methods all call this one, but supply default object factories. This method 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.

Specified by:
getObjectList in class ISeriesAbstractListProcessor
Parameters:
fsObj - an ISeriesObjectFilterString object identifying what objects to list. This tells the list processor the library to list objects in, and the object name pattern. It can also identify an object type and attribute to refine the subsetting. To create one of these ISeriesObjectFilterString objects, pass a filter string of the form library/object OBJTYPE(type:attribute type:attribute ...) to its constructor. The library and object names, and the object attribute, can optionally be generic containing one or two asterisks anywhere in them. Note that if the library is generic (not scalar or *CURLIB) then this is a multi-generic list request and will result in multiple requests to the host API: one per library matching the generic library name. All results will be concatenated together into the single returned List.
listObjectFactory - An object implementing the IISeriesHostListObjectFactory interface. This interface prescribes three methods: createObject() for creating object objects, createLibraryObject for creating library objects, and createDBFile object for creating database file objects. The appropriate method is called by this list processing code 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 information only
  2. IISeriesHostObjectBrief -> brief information
  3. IISeriesHostObjectBasic -> typical information
  4. IISeriesHostObjectExhaustive-> ALL information the host gives us
Returns:
List of objects that implement one of the above three interfaces. Which one depends on the object returned by the supplied factory. Note that createLibraryObject will be called for library objects, createDBFile for PF file objects, and createObject for all other objects. It is the caller's decision whether to create different objects for each of these or not. If a default factory is used then the same object type is used for all three.
Throws:
Exception

getObjectList

public List getObjectList(ISeriesAbstractFilterString fsObj,
                          IISeriesHostListObjectFactory listObjectFactory,
                          IISeriesHostListStatusCallback callback)
                   throws Exception
Retrieve a list of objects, 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 object list is a request where the library itself is generic, thus requiring multiple calls to the host object 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

getListFromAS400

protected void getListFromAS400()
                         throws Exception
Call QVDEOBJL on AS/400 to get the list (which in turn calls system api QUSLOBJ. Originally CallQVDEOBJL in AS400eList. Populates global theObjectList List.

Throws:
Exception

buildListHunk

protected void buildListHunk(int nbrRows,
                             int startingPosition,
                             int sizePerRow)
                      throws Exception
Given one big hunk of returned data, xlate it to text and parse it row by row into a populated object. Each object is added to the returned list.

Throws:
Exception

populateObj

protected void populateObj()
                    throws Exception
Method that parses the next of data and populates the current list object.

Throws:
Exception

setAuthorityChecks

public void setAuthorityChecks(String[] libAuth,
                               String[] objAuth)
Set the library and object authorities to check on the QUSLOBJ call. If the user profile does not have specified authorities ot the object then the infomration status field is returned as IISeriesHostObjectBrief.STATUS_NOTAUTHORIZED This method must be invoked prior to calling any of the getList... or getObjectList... methods.

Parameters:
libAuth - The library authorities to check.
objAuth - The object authorities to check.

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.