Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesRetrieveDatabaseFileDescription

java.lang.Object
  extended by com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
      extended by com.ibm.etools.iseries.comm.ISeriesRetrieveDatabaseFileDescription
All Implemented Interfaces:
IISeriesAPIProcessor

public class ISeriesRetrieveDatabaseFileDescription
extends ISeriesAbstractHostAPIProcessor

A class for retrieving the file definition template for an OS/400 file. This class uses the OS/400 Retrieve Database File Description (QDBRTVFD) system api to retrieve the information.


Nested Class Summary
protected  class ISeriesRetrieveDatabaseFileDescription.API_Output
          A protected class to return the output from calling the AS400 API's.
 
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.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
ISeriesRetrieveDatabaseFileDescription()
          Constructor to use when you do not already have an AS400 object.
ISeriesRetrieveDatabaseFileDescription(AS400 system)
          Constructor for ISeriesListEditDescriptions.
 
Method Summary
static String convertDateTimeFormat(byte dattimfmt)
          Convert the single byte representation of the date time format to the equivalent String representation
static char convertDateTimeSeparator(byte dattimsep)
          Convert the single byte representation of the date time separator to the equivalent String representation
 boolean isAllowOverrides()
          Returns whether or not overrides are processed by the api.
protected static String lookupKeyword(byte id)
           
 List retrieveFieldList(String library, String file, String record, String fieldFilter)
          Retrieve a list of fields, returning objects created by a supplied object factory.
 int retrieveFileCCSID(String libraryName, String fileName)
          Specialized method for quickly retrieving the file's CCSID.
 IISeriesHostFileDefinition retrieveFileDefinition(String libraryName, String fileName, String recordName)
          Retrieve the file definition for the file.
 IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName, String fileName, String recordName)
          Retrieve the specified record format definition for file.
 IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName, String fileName, String recordName, IISeriesHostDatabaseFileDescriptionFactory factory)
          Retrieve the specified record format definition for file.
 IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName, String fileName, String recordName, String fieldFilter, IISeriesHostDatabaseFileDescriptionFactory factory, boolean includeFormatData)
          Retrieve the specified record format definition for file.
 IISeriesHostRecordFormatKeyInformation[] retrieveKeyInformation(String libraryName, String fileName)
          Method retrieveKeyInformation.
 IISeriesHostRecordFormatKeyInformation[] retrieveKeyInformation(String libraryName, String fileName, String record)
          Method retrieveKeyInformation.
 void setAllowOverrides(boolean allowOverrides)
          Sets whether or not overrides are to be processed by the api.
 void setDDMFile(boolean ddmFile)
          Sets whether or not the api is being called for a DDM file.
 
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
 

Field Detail

Copyright

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

ISeriesRetrieveDatabaseFileDescription

public ISeriesRetrieveDatabaseFileDescription()
Constructor to use when you do not already have an AS400 object. A new AS400 object will be created when one of the retrieve methods are called, unless you subsequently call setSystem(AS400) first.


ISeriesRetrieveDatabaseFileDescription

public ISeriesRetrieveDatabaseFileDescription(AS400 system)
Constructor for ISeriesListEditDescriptions.

Parameters:
system - AS400 Toolbox object used to connect to the iSeries
Method Detail

retrieveFileDefinition

public IISeriesHostFileDefinition retrieveFileDefinition(String libraryName,
                                                         String fileName,
                                                         String recordName)
                                                  throws Exception
Retrieve the file definition for the file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
recordName - record name or *FIRST to use the first record in the file
Returns:
IISeriesHostFileDefinition containing the file definition information
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

retrieveFormatDefinition

public IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName,
                                                             String fileName,
                                                             String recordName)
                                                      throws Exception
Retrieve the specified record format definition for file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
recordName - record name or *FIRST to use the first record in the file
Returns:
IISeriesFormatDefinition for the specified record format
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

retrieveFormatDefinition

public IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName,
                                                             String fileName,
                                                             String recordName,
                                                             IISeriesHostDatabaseFileDescriptionFactory factory)
                                                      throws Exception
Retrieve the specified record format definition for file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
recordName - record name or *FIRST to use the first record in the file
Returns:
IISeriesFormatDefinition for the specified record format
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

retrieveFormatDefinition

public IISeriesHostFormatDefinition retrieveFormatDefinition(String libraryName,
                                                             String fileName,
                                                             String recordName,
                                                             String fieldFilter,
                                                             IISeriesHostDatabaseFileDescriptionFactory factory,
                                                             boolean includeFormatData)
                                                      throws Exception
Retrieve the specified record format definition for file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
recordName - record name or *FIRST to use the first record in the file
fieldFilter - Name filter for extracting a subset of the fields (or a single field)
includeFormatData - Pass true if record format information should be included, false if you are only interested in field information
Returns:
IISeriesFormatDefinition for the specified record format
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

retrieveKeyInformation

public IISeriesHostRecordFormatKeyInformation[] retrieveKeyInformation(String libraryName,
                                                                       String fileName)
                                                                throws Exception
Method retrieveKeyInformation. Retrieve the key information for this file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
Returns:
Array of IISeriesRecordFormatKeyInformation, one instance for each key in the file.
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

retrieveKeyInformation

public IISeriesHostRecordFormatKeyInformation[] retrieveKeyInformation(String libraryName,
                                                                       String fileName,
                                                                       String record)
                                                                throws Exception
Method retrieveKeyInformation. Retrieve the key information for this file.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
Returns:
Array of IISeriesRecordFormatKeyInformation, one instance for each key in the file.
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

convertDateTimeFormat

public static String convertDateTimeFormat(byte dattimfmt)
Convert the single byte representation of the date time format to the equivalent String representation


convertDateTimeSeparator

public static char convertDateTimeSeparator(byte dattimsep)
Convert the single byte representation of the date time separator to the equivalent String representation


retrieveFileCCSID

public int retrieveFileCCSID(String libraryName,
                             String fileName)
                      throws Exception
Specialized method for quickly retrieving the file's CCSID.

Parameters:
libraryName - library where the file is located, can be either a library name, *CURLIB or *LIBL
fileName - name of the file
Returns:
int The file's CCSID
Throws:
ISeriesAPIErrorCodeException - if there was an error while running the OS/400 system api
IBM - Toolbox for Java exceptions if there was a problem calling the OS/400 system api
Exception

isAllowOverrides

public boolean isAllowOverrides()
Returns whether or not overrides are processed by the api.


setAllowOverrides

public void setAllowOverrides(boolean allowOverrides)
Sets whether or not overrides are to be processed by the api. The default is to allow overrides.

Parameters:
allowOverrides - true if overrides should be processed, false if they should not be processed

setDDMFile

public void setDDMFile(boolean ddmFile)
Sets whether or not the api is being called for a DDM file. Default is false.

Parameters:
ddmFile - true if the api is being called on a DDM file, false if it is being called on any other database file type.

lookupKeyword

protected static String lookupKeyword(byte id)

retrieveFieldList

public List retrieveFieldList(String library,
                              String file,
                              String record,
                              String fieldFilter)
                       throws Exception
Retrieve a list of fields, returning objects created by a supplied object factory. This is the API callers use when they want to create each object in the returned list, perhaps optimized for their environment. If you are ok with the default returned objects, then just use one of the other getFieldList method. All others internally call this method with a default factory object.

Note this API does not yet support multi-generic lists. Explicit names must be provided for the library, file and record parameters.

Parameters:
library - The library where the database file is located.
file - The file for which to retrieve field information.
record - The record for which to retrieve field information.
factory - An object implementing the IISeriesHostListDatabaseFieldFactory interface. This interface prescribes one method for creating instances of IISeriesHostDatabaseField
Returns:
A list of IISeriesHostDatabaseField instances, each representing a single field.
Throws:
Exception
See Also:
IISeriesHostDatabaseField

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.