|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
public abstract class ISeriesAbstractHostAPIProcessor
A base class for all classes that call a system API to retrieve or update information on an ISeries.
It turns out that there are a number of common parameters and structures in many of the ISeries system APIs. This class tries to simplify the work to call a new system API by offering built in functionality for all those commonly used parameters and structures.
The approach taken is to use nested classes for the common structures, and a series of methods for other common processing needs such as working with a user space which most APIs require.
The following nested classes are offered for common structures:
HostAPIErrorCodeStructure
Nested Class Summary | |
---|---|
static class |
ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure
==================================================================== HostAPIErrorCodeStructure ------------------------- Nested helper class to facilitate creating and subsequent parsing of the common ISeries error code structure that many APIs take as input and populate. |
Constructor Summary | |
---|---|
ISeriesAbstractHostAPIProcessor()
Constructor when there is no AS400 system object. |
|
ISeriesAbstractHostAPIProcessor(AS400 system)
Constructor when there is an AS400 system object. |
Method Summary | |
---|---|
protected void |
addCancellableSubTask(ISeriesAbstractHostAPIProcessor subTask)
For child classes to register cancellable subtasks they spawn. |
protected void |
addWarning(String warning)
Log a warning that can be retrieved by callers |
void |
cancel()
Cancel the listing process. |
protected void |
clearWarnings()
Clear warnings. |
protected void |
closeUserSpace()
Close local userspace object. |
protected long |
computeSize(int size,
int sizeMultiplier)
Calculate object size given size and size multiplier |
protected void |
createUserSpaceOnHost()
Create a User Space on the AS/400. |
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 |
getClientCCSID()
Get the CCSID used for client side text |
protected IISeriesHostObjectFactory |
getDefaultObjectFactory()
Get default object factory used to create new objects. |
protected ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure |
getErrorCodeStructure()
Return instance of HostAPIErrorCodeStructure |
int |
getHostCCSID()
Get the CCSID used for host side text |
protected String |
getLibrary()
Return library that is the context for items in this list. |
PrintWriter |
getLogFileStream()
Helper when calling printStackTrace |
protected IISeriesHostObjectFactory |
getObjectFactory()
Get object factory used to create new objects. |
protected String |
getObjectName()
Get the object name to used in the list processing. |
protected String |
getObjectType()
Get the object type to use in the list processing. |
AS400 |
getSystem()
Return AS400 object used for this list processor |
protected UserSpace |
getUserSpace()
Create a local UserSpace object, if not already created, and return reference to it. |
protected byte[] |
getUserSpaceAPIName()
Return qualified user space name as a byte array ready to use in a host ProgramCall ProgramParameter. |
protected String |
getUserSpaceIFSName()
Return user space name in IFS format. |
protected String |
getUserSpaceLibrary()
Gets the userspace Library name. |
protected String |
getUserSpaceName()
Gets the userspace Name |
List |
getWarnings()
Get warnings issued by this api call. |
boolean |
isCancelled()
Queried internally to see if request has been cancelled, and available after the getList call to see if this list was cancelled versus ending normally. |
boolean |
isTraceOn()
Query tracing |
void |
logException(Exception exc)
Helper method for logging trace information for an exception |
protected String |
logHostMessages(ProgramCall pcObj,
String apiName)
Logs system messages in the message queue, after an API call. |
void |
logMessage()
Helper method for logging a blank line |
void |
logMessage(String msg)
Helper method for logging trace information |
static void |
logMessage(String tracePrefix,
String msg)
Helper STATIC method for logging trace information |
void |
logTodo(String todo,
String methodName)
Helper method for logging a TODO item so we don't forget |
protected void |
openUserSpace()
Open local userspace object. |
static String |
padString(String input,
int padlen)
Pad given string with blanks to given length. |
protected static Date |
parseBin8Date(long milliseconds)
Helper method to parse dates returned in epoch format |
protected static Date |
parseChar13Date(String javaTxt)
Helper method to parse date+times returned in CYYMMDDHHMMSS format |
protected static Date |
parseChar7Date(String javaTxt)
Helper method to parse dates returned in CYYMMDD format |
protected static Date |
parseChar8Date(String javaTxt)
Helper method to parse dates returned in system format (char 8) format |
protected int |
readUserSpace(byte[] byte400,
int start)
Given an existing and opened user space (in instance variable), this method reads the space until end, starting at the given offset. |
protected byte[] |
readUserSpace(int start,
int len)
Given an existing and opened user space (in instance variable), this method reads the next nn bytes from it. |
void |
registerCancelQuerier(IISeriesHostListStatusCallback caller)
Register a caller that can handle the "did user cancel?" request that the list processors will periodically call to check for a user cancel request. |
protected void |
removeCancellableSubTask(ISeriesAbstractListProcessor subTask)
For child classes to de-register cancellable subtasks they spawn. |
void |
setClientCCSID(int ccsid)
Set the CCSID used for client side text |
void |
setHostCCSID(int ccsid)
Set the CCSID used for host side text |
protected void |
setLibrary(String library)
Set the library which is the context for non *LIB requests |
static void |
setLogFileDirectory(String dir)
Call this to specify the directory where logging of comm trace info should happen. |
protected void |
setObjectFactory(IISeriesHostObjectFactory factory)
Set object factory used to create new objects. |
protected void |
setObjectName(String name)
Set the object name to use in the list processing. |
protected void |
setObjectType(String type)
Set the object type to use in the list processing. |
void |
setSystem(AS400 system)
Set the AS/400 object used for this list processor. |
void |
setTracing(boolean trace,
String prefix)
Enable/disable tracing |
protected void |
setUserSpaceLibrary(String userSpaceLibrary)
Sets the userspace library name. |
protected void |
setUserSpaceName(String userSpaceName)
Sets the userspace Name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String Copyright
protected static String LOG_FILENAME
protected static String LOG_DIR
protected static int logLineCounter
protected static PrintWriter logFileStream
protected static File logFile
protected static boolean logStandardOut
protected String tracePrefix
protected boolean cancel
protected IISeriesHostListStatusCallback cancelQuerier
protected List cancellableSubTasks
protected List warnings
protected String objName
protected String objType
protected List todos
public static final int INFOLEVEL_NAME
public static final int INFOLEVEL_BRIEF
public static final int INFOLEVEL_BASIC
public static final int INFOLEVEL_EXHAUSTIVE
public static final int INFOLEVEL_NAMEARRAY
protected static final IISeriesHostObjectFactory DEFAULT_OBJECT_FACTORY_NAMEONLY
protected static final IISeriesHostObjectFactory DEFAULT_OBJECT_FACTORY_BRIEF
protected static final IISeriesHostObjectFactory DEFAULT_OBJECT_FACTORY_BASIC
protected static final IISeriesHostObjectFactory DEFAULT_OBJECT_FACTORY_EXHAUSTIVE
protected IISeriesHostObjectFactory returnObjectFactory
protected ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure errorcodeObj
protected static final boolean CREATE_TRUE
protected static final boolean CREATE_FALSE
protected static final boolean NEED_USERSPACE_YES
protected static final boolean NEED_USERSPACE_NO
protected static final int INITIAL_SPACESIZE
protected static Hashtable hostAPILibraries
protected static Hashtable dbcsConvert
public static ISeriesHostObjectBasic QVDEOBJLinfo
Constructor Detail |
---|
public ISeriesAbstractHostAPIProcessor()
public ISeriesAbstractHostAPIProcessor(AS400 system)
AS400
- system to use for the connection.Method Detail |
---|
public void setSystem(AS400 system)
public AS400 getSystem()
public void cancel()
public void registerCancelQuerier(IISeriesHostListStatusCallback caller)
protected void addCancellableSubTask(ISeriesAbstractHostAPIProcessor subTask)
protected void removeCancellableSubTask(ISeriesAbstractListProcessor subTask)
public boolean isCancelled() throws Exception
Exception
protected void setLibrary(String library)
protected void setObjectName(String name)
protected void setObjectType(String type)
protected String getLibrary()
protected String getObjectName()
protected String getObjectType()
protected void setObjectFactory(IISeriesHostObjectFactory factory)
protected IISeriesHostObjectFactory getObjectFactory()
protected IISeriesHostObjectFactory getDefaultObjectFactory()
protected int determineInfoLevel(IISeriesHostObjectNameOnly obj)
public void setHostCCSID(int ccsid)
public int getHostCCSID()
public void setClientCCSID(int ccsid)
public int getClientCCSID()
protected String getUserSpaceLibrary()
protected void setUserSpaceLibrary(String userSpaceLibrary)
protected void setUserSpaceName(String userSpaceName)
protected String getUserSpaceName()
protected String getUserSpaceIFSName()
protected byte[] getUserSpaceAPIName()
protected void createUserSpaceOnHost() throws Exception
Exception
protected UserSpace getUserSpace()
protected void closeUserSpace()
protected void openUserSpace() throws Exception
Exception
protected byte[] readUserSpace(int start, int len) throws Exception
Exception
protected int readUserSpace(byte[] byte400, int start) throws Exception
byte
- array to read into.offest
- to start reading. Read continues until end of data.
Exception
public static String padString(String input, int padlen)
protected static Date parseChar13Date(String javaTxt)
protected static Date parseChar7Date(String javaTxt)
protected static Date parseChar8Date(String javaTxt)
protected static Date parseBin8Date(long milliseconds)
protected long computeSize(int size, int sizeMultiplier)
public void setTracing(boolean trace, String prefix)
public boolean isTraceOn()
public void logMessage(String msg)
public void logMessage()
public void logTodo(String todo, String methodName)
public void logException(Exception exc)
public static void logMessage(String tracePrefix, String msg)
public static void setLogFileDirectory(String dir)
public PrintWriter getLogFileStream()
protected String logHostMessages(ProgramCall pcObj, String apiName)
the
- ProgramCall object that was used to make the call.the
- name of the host API that was called.
protected void addWarning(String warning)
protected void clearWarnings()
public List getWarnings()
getWarnings
in interface IISeriesAPIProcessor
protected ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure getErrorCodeStructure()
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |