Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.objects
Class QSYSObjectSubSystem

java.lang.Object
  extended by SubSystem
      extended by com.ibm.etools.iseries.subsystems.qsys.QSYSAbstractSubSystem
          extended by com.ibm.etools.iseries.subsystems.qsys.objects.QSYSObjectSubSystem
All Implemented Interfaces:
IISeriesSubSystem, IQSYSObjectSubSystem

public class QSYSObjectSubSystem
extends QSYSAbstractSubSystem
implements IQSYSObjectSubSystem

Subsystem implementation for QSYS library file subsystem.


Field Summary
static String copyright
           
 
Constructor Summary
protected QSYSObjectSubSystem(IHost host, IConnectorService connectorService)
          Create a QSYSObjectSubSystem.
 
Method Summary
protected  void addResolvedFilterStringObjects(Vector allChildrenSoFar, Object[] childrenForThisFilterString, String[] allFilterStrings, int currFilterStringIndex)
           
 boolean checkAuthority(String library, String object, String objectType, String authorityList)
          Check object authorities
 boolean checkAuthority(String library, String object, String objectType, String authorityList, boolean cacheResults)
          Check object authorities
 boolean copyLibrary(Shell shell, IQSYSLibrary srcLibrary, String newName, boolean processCmdLineParm, IProgressMonitor monitor)
          Copy a given library to a new library of the given name in the given connection
 boolean copyMember(Shell shell, IQSYSMember srcMember, IQSYSObject tgtFile, String newName, boolean processCmdLineParm)
          Copy a given member to the given file
 boolean copyObject(Shell shell, IQSYSObject srcObject, IQSYSLibrary tgtLibrary, String newName, boolean processCmdLineParm)
          Copy a given object to the given library
 IQSYSFile createFileWithAbsoluteName(String path, int recordLength)
          Create a new src physical file with the specified path and record length
 IQSYSLibrary createLibraryWithAbsoluteName(String libraryName)
          Find or create a new library with the specified path
 IQSYSMember createMemberWithAbsoluteName(String path, String memberType, int recordLength)
          Create a new member with the specified path and member type
 boolean doesFilterStringListContentsOf(ISystemFilterString filterString, String remoteObjectAbsoluteName)
           
 boolean doesFilterStringMatch(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive)
           
 QSYSObjectCacheHandler getCacheHandler()
          Returns cache handler for this subsystem
 ICacheManager getCacheManager()
           
 IQSYSDatabaseFile getDatabaseFileDetails(IQSYSDatabaseFile file, IProgressMonitor monitor)
          Retrieve details for the specified physical file object
 IQSYSDatabaseFileRecordFormat getDatabaseFileRecord(IQSYSDatabaseFile file, IProgressMonitor monitor)
          Retrieves the first database record for the specified physical file
 IQSYSDatabaseFileRecordFormat getDatabaseFileRecord(IQSYSDatabaseFile file, String record, IProgressMonitor monitor)
          Retrieves the specified database record for the specified physical file
 IISeriesHostRecordDevice[] getDeviceRecords(IQSYSFile file)
          Retrieve the records for the deviceFile.
 int getEditingCCSID(IQSYSMember member)
          Query the CCSID used to translate files from EBCDIC to UTF-8 for editing in the Workbench.
 ISeriesFileOverrideInformation getFileOverride(String filename)
          Check if the specified file is an override file.
 IQSYSMember getMemberDetails(IQSYSMember member, IProgressMonitor monitor)
          Retrieve details for specified member object
 ISubSystem getObjectSubSystem()
          Return the objects subsystem ("iSeries Objects") for accessing remote QSYS libs, objs, mbrs, etc.
 Object getObjectWithAbsoluteName(String key)
           
 Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor)
           
 com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation getProgramInformation(IQSYSObject program)
           
 QSYSCommandSubSystem getQSYSCommandSubSystem()
          Get QSYSCommnadSubSystem instance.
protected  IQSYSFactory getQSYSFactory()
          Get factory which supports additional information.
 void initializeSubSystem(IProgressMonitor monitor)
           
 Object[] internalResolveFilterString(Object parent, String filterString, IProgressMonitor monitor)
           
 Object[] internalResolveFilterString(String filterString, boolean additionalDetails, IProgressMonitor monitor)
           
 Object[] internalResolveFilterString(String filterString, IProgressMonitor monitor)
           
protected  boolean isBriefFilterString(String filterString)
          Check if the filter string is for brief information or not.
 IQSYSDatabaseField[] listDatabaseFields(IQSYSFileRecordFormat record, IProgressMonitor monitor)
          List all fields matching for the specified record
 IQSYSDatabaseField[] listDatabaseFields(IQSYSFileRecordFormat record, String fieldFilter, IProgressMonitor monitor)
          List the database fields matching the specified field name filter for the specified record
 IISeriesHostKeyField[] listKeyFields(IQSYSDatabaseFile file, String recordName)
          Retrieve the key fields for the iSeries Database file.
 String[] listLibraryNames(String nameFilter, IProgressMonitor monitor)
          This is a high performance way to query library names only, optionally subset by library name.
 List<ISeriesHostObjectLock> listMemberLocks(IQSYSMember member)
          Retrieve the list of locks for the specified IBM i member
 String[] listMemberNames(String library, String file, String nameFilter, String[] typeFilters, IProgressMonitor monitor)
          This is a high performance way to query the members names only in this file, optionally subset by member name and type.
 IQSYSMessageDescription[] listMessageDescriptions(IQSYSMessageFile file, IProgressMonitor monitor)
          List all message descriptions for the specified message file.
 IQSYSMessageDescription[] listMessageDescriptions(IQSYSMessageFile file, String msgID, IProgressMonitor monitor)
          List message descriptions for the specified message file.
 String[] listObjectNames(String library, String nameFilter, String[] typeFilters, IProgressMonitor monitor)
          This is a high performance way to query the object names only in a given library, optionally subset by object name and type.
 List<ISeriesHostProcedure> listProceduresInModule(String libraryName, String moduleName)
           
 boolean moveMember(Shell shell, IQSYSMember srcMember, IQSYSObject tgtFile, String newName, boolean processCmdLineParm)
          Move a given member to the given file
 boolean moveObject(Shell shell, IQSYSObject srcObject, IQSYSLibrary tgtLibrary, String newName, boolean processCmdLineParm)
          Move a given object to the given library
protected  String stripFilterStringAdditionalFlag(String filterString)
          Strip out the IQSYSFilterTypes.FILTERTYPE_ADDITIONAL at the end of filter string.
 boolean supportsCaching()
           
 IISeriesSQLStatementHeader syntaxCheckSQL(String sqlStmt, int stmtLen, int numRec, String language, int numKeys, String options)
          Syntax Check SQL statements
 
Methods inherited from class com.ibm.etools.iseries.subsystems.qsys.QSYSAbstractSubSystem
checkIsConnected, checkIsConnected, checkIsConnected, getCmdSubSystem, processListRetrieveError, verifyConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright
Constructor Detail

QSYSObjectSubSystem

protected QSYSObjectSubSystem(IHost host,
                              IConnectorService connectorService)
Create a QSYSObjectSubSystem.

Parameters:
host -
connectorService -
Method Detail

initializeSubSystem

public void initializeSubSystem(IProgressMonitor monitor)

internalResolveFilterString

public Object[] internalResolveFilterString(String filterString,
                                            IProgressMonitor monitor)
                                     throws InvocationTargetException,
                                            InterruptedException
Throws:
InvocationTargetException
InterruptedException

internalResolveFilterString

public Object[] internalResolveFilterString(String filterString,
                                            boolean additionalDetails,
                                            IProgressMonitor monitor)
                                     throws InvocationTargetException,
                                            InterruptedException
Throws:
InvocationTargetException
InterruptedException

internalResolveFilterString

public Object[] internalResolveFilterString(Object parent,
                                            String filterString,
                                            IProgressMonitor monitor)
                                     throws InvocationTargetException,
                                            InterruptedException
Throws:
InvocationTargetException
InterruptedException

getQSYSFactory

protected IQSYSFactory getQSYSFactory()
Get factory which supports additional information.


isBriefFilterString

protected boolean isBriefFilterString(String filterString)
Check if the filter string is for brief information or not. The filter string for full information has DETAILS(*ALL) at end.


stripFilterStringAdditionalFlag

protected String stripFilterStringAdditionalFlag(String filterString)
Strip out the IQSYSFilterTypes.FILTERTYPE_ADDITIONAL at the end of filter string.

Parameters:
filterString: - filter string with IQSYSFilterTypes.FILTERTYPE_ADDITIONAL at the end.
Returns:
filter string stripped out the IQSYSFilterTypes.FILTERTYPE_ADDITIONAL

listObjectNames

public String[] listObjectNames(String library,
                                String nameFilter,
                                String[] typeFilters,
                                IProgressMonitor monitor)
                         throws SystemMessageException,
                                InterruptedException
This is a high performance way to query the object names only in a given library, optionally subset by object name and type. This does not query all the properties usually returned for each object so is very efficient. It can be used to populate a ValidatorISeriesObject object, for example, to validate object names are unique. Please note that two objects can have the same name in a given library, as long as their types are different, so include a type filter is very important for this type of error checking.

Throws:
SystemMessageException
InterruptedException

listLibraryNames

public String[] listLibraryNames(String nameFilter,
                                 IProgressMonitor monitor)
                          throws SystemMessageException,
                                 InterruptedException
This is a high performance way to query library names only, optionally subset by library name. This does not query all the properties usually returned for each object so is very efficient. It can be used to populate a ValidatorISeriesLibrary object, for example, to validate library names are unique.

Throws:
SystemMessageException
InterruptedException

listMemberNames

public String[] listMemberNames(String library,
                                String file,
                                String nameFilter,
                                String[] typeFilters,
                                IProgressMonitor monitor)
                         throws SystemMessageException,
                                InterruptedException
This is a high performance way to query the members names only in this file, optionally subset by member name and type. This does not query all the properties usually returned for each member so is very efficient. It can be used to populate a ValidatorISeriesMember object, for example, to validate member names are unique.

Throws:
SystemMessageException
InterruptedException

getDatabaseFileRecord

public IQSYSDatabaseFileRecordFormat getDatabaseFileRecord(IQSYSDatabaseFile file,
                                                           IProgressMonitor monitor)
                                                    throws SystemMessageException,
                                                           InterruptedException
Retrieves the first database record for the specified physical file

Throws:
SystemMessageException
InterruptedException

getDatabaseFileRecord

public IQSYSDatabaseFileRecordFormat getDatabaseFileRecord(IQSYSDatabaseFile file,
                                                           String record,
                                                           IProgressMonitor monitor)
                                                    throws SystemMessageException,
                                                           InterruptedException
Retrieves the specified database record for the specified physical file

Throws:
SystemMessageException
InterruptedException

listDatabaseFields

public IQSYSDatabaseField[] listDatabaseFields(IQSYSFileRecordFormat record,
                                               IProgressMonitor monitor)
                                        throws SystemMessageException,
                                               InterruptedException
List all fields matching for the specified record

Throws:
SystemMessageException
InterruptedException

listDatabaseFields

public IQSYSDatabaseField[] listDatabaseFields(IQSYSFileRecordFormat record,
                                               String fieldFilter,
                                               IProgressMonitor monitor)
                                        throws SystemMessageException,
                                               InterruptedException
List the database fields matching the specified field name filter for the specified record

Throws:
SystemMessageException
InterruptedException

listMessageDescriptions

public IQSYSMessageDescription[] listMessageDescriptions(IQSYSMessageFile file,
                                                         IProgressMonitor monitor)
                                                  throws SystemMessageException,
                                                         InterruptedException
List all message descriptions for the specified message file.

Parameters:
file - The message file to retrieve message descriptions from.
Throws:
SystemMessageException
InterruptedException

listMessageDescriptions

public IQSYSMessageDescription[] listMessageDescriptions(IQSYSMessageFile file,
                                                         String msgID,
                                                         IProgressMonitor monitor)
                                                  throws SystemMessageException,
                                                         InterruptedException
List message descriptions for the specified message file.

Parameters:
file - The message file to retrieve message descriptions from.
msgID - The ID of the message description to retrieve or * to retrieve all message descriptions.
Throws:
SystemMessageException
InterruptedException

getQSYSCommandSubSystem

public QSYSCommandSubSystem getQSYSCommandSubSystem()
Get QSYSCommnadSubSystem instance.

Specified by:
getQSYSCommandSubSystem in interface IQSYSObjectSubSystem

copyLibrary

public boolean copyLibrary(Shell shell,
                           IQSYSLibrary srcLibrary,
                           String newName,
                           boolean processCmdLineParm,
                           IProgressMonitor monitor)
                    throws Exception
Copy a given library to a new library of the given name in the given connection

Throws:
Exception

copyObject

public boolean copyObject(Shell shell,
                          IQSYSObject srcObject,
                          IQSYSLibrary tgtLibrary,
                          String newName,
                          boolean processCmdLineParm)
                   throws Exception
Copy a given object to the given library

Throws:
Exception

moveObject

public boolean moveObject(Shell shell,
                          IQSYSObject srcObject,
                          IQSYSLibrary tgtLibrary,
                          String newName,
                          boolean processCmdLineParm)
                   throws Exception
Move a given object to the given library

Throws:
Exception

copyMember

public boolean copyMember(Shell shell,
                          IQSYSMember srcMember,
                          IQSYSObject tgtFile,
                          String newName,
                          boolean processCmdLineParm)
                   throws Exception
Copy a given member to the given file

Throws:
Exception

moveMember

public boolean moveMember(Shell shell,
                          IQSYSMember srcMember,
                          IQSYSObject tgtFile,
                          String newName,
                          boolean processCmdLineParm)
                   throws Exception
Move a given member to the given file

Throws:
Exception

getObjectWithAbsoluteName

public Object getObjectWithAbsoluteName(String key)
                                 throws Exception
Throws:
Exception

getObjectWithAbsoluteName

public Object getObjectWithAbsoluteName(String key,
                                        IProgressMonitor monitor)
                                 throws Exception
Throws:
Exception

getMemberDetails

public IQSYSMember getMemberDetails(IQSYSMember member,
                                    IProgressMonitor monitor)
                             throws SystemMessageException,
                                    InterruptedException
Retrieve details for specified member object

Throws:
SystemMessageException
InterruptedException

getDatabaseFileDetails

public IQSYSDatabaseFile getDatabaseFileDetails(IQSYSDatabaseFile file,
                                                IProgressMonitor monitor)
                                         throws SystemMessageException,
                                                InterruptedException
Retrieve details for the specified physical file object

Throws:
SystemMessageException
InterruptedException

checkAuthority

public boolean checkAuthority(String library,
                              String object,
                              String objectType,
                              String authorityList)
                       throws SystemMessageException
Check object authorities

Throws:
SystemMessageException

checkAuthority

public boolean checkAuthority(String library,
                              String object,
                              String objectType,
                              String authorityList,
                              boolean cacheResults)
                       throws SystemMessageException
Check object authorities

Throws:
SystemMessageException

createFileWithAbsoluteName

public IQSYSFile createFileWithAbsoluteName(String path,
                                            int recordLength)
Create a new src physical file with the specified path and record length

Parameters:
path - the qualified path of the file
recordLength - the record length for the file
Returns:
the new File

createLibraryWithAbsoluteName

public IQSYSLibrary createLibraryWithAbsoluteName(String libraryName)
Find or create a new library with the specified path

Parameters:
libraryName - the name of the library
Returns:
the new library

createMemberWithAbsoluteName

public IQSYSMember createMemberWithAbsoluteName(String path,
                                                String memberType,
                                                int recordLength)
Create a new member with the specified path and member type

Parameters:
path - the qualified path of the member
memberType - the type of the member
Returns:
the new member

getObjectSubSystem

public ISubSystem getObjectSubSystem()
Description copied from interface: IISeriesSubSystem
Return the objects subsystem ("iSeries Objects") for accessing remote QSYS libs, objs, mbrs, etc. For historical reasons, this is also known as the "file subsystem".

Specified by:
getObjectSubSystem in interface IISeriesSubSystem
Overrides:
getObjectSubSystem in class QSYSAbstractSubSystem

doesFilterStringMatch

public boolean doesFilterStringMatch(String filterString,
                                     String remoteObjectAbsoluteName,
                                     boolean caseSensitive)

doesFilterStringListContentsOf

public boolean doesFilterStringListContentsOf(ISystemFilterString filterString,
                                              String remoteObjectAbsoluteName)

getEditingCCSID

public int getEditingCCSID(IQSYSMember member)
                    throws SystemMessageException
Query the CCSID used to translate files from EBCDIC to UTF-8 for editing in the Workbench.

Throws:
SystemMessageException

getFileOverride

public ISeriesFileOverrideInformation getFileOverride(String filename)
                                               throws SystemMessageException
Check if the specified file is an override file.

Returns:
The ISeriesFileOverrideInformation for the override or null if no override is currently set for the file.
Throws:
SystemMessageException

listMemberLocks

public List<ISeriesHostObjectLock> listMemberLocks(IQSYSMember member)
                                            throws SystemMessageException
Retrieve the list of locks for the specified IBM i member

Throws:
SystemMessageException

listKeyFields

public IISeriesHostKeyField[] listKeyFields(IQSYSDatabaseFile file,
                                            String recordName)
                                     throws SystemMessageException
Retrieve the key fields for the iSeries Database file.

Throws:
SystemMessageException

getDeviceRecords

public IISeriesHostRecordDevice[] getDeviceRecords(IQSYSFile file)
                                            throws SystemMessageException
Retrieve the records for the deviceFile. This does not currently use any API wrappers so it should be considered internal use only. The only information that is returned is the lowest response indicator and buffer size (which are required by the RPG program verifier.)

Returns:
IISeriesHostRecordDevice[]
Throws:
SystemMessageException

syntaxCheckSQL

public IISeriesSQLStatementHeader syntaxCheckSQL(String sqlStmt,
                                                 int stmtLen,
                                                 int numRec,
                                                 String language,
                                                 int numKeys,
                                                 String options)
                                          throws SystemMessageException
Syntax Check SQL statements

Parameters:
SQL - statements
Length - of each SQL statement
Number - of Records
Language - in which the SQL statements are coded
Number - of Keys
String - for Options
Returns:
The statement information of each of the statment processed
Throws:
SystemMessageException - with ID = ISystemMessages.MSG_GENERIC_W_HELP if the OS/400 api returns an error code.

getProgramInformation

public com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation getProgramInformation(IQSYSObject program)
                                                                                           throws SystemMessageException
Throws:
SystemMessageException

listProceduresInModule

public List<ISeriesHostProcedure> listProceduresInModule(String libraryName,
                                                         String moduleName)
                                                  throws SystemMessageException
Throws:
SystemMessageException

getCacheHandler

public QSYSObjectCacheHandler getCacheHandler()
Returns cache handler for this subsystem


supportsCaching

public boolean supportsCaching()

getCacheManager

public ICacheManager getCacheManager()

addResolvedFilterStringObjects

protected void addResolvedFilterStringObjects(Vector allChildrenSoFar,
                                              Object[] childrenForThisFilterString,
                                              String[] allFilterStrings,
                                              int currFilterStringIndex)

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.