Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.cache
Class QSYSObjectCacheHandler

java.lang.Object
  extended by com.ibm.etools.iseries.subsystems.qsys.cache.AbstractCacheHandler
      extended by com.ibm.etools.iseries.subsystems.qsys.cache.QSYSObjectCacheHandler

public class QSYSObjectCacheHandler
extends AbstractCacheHandler

Cache driver for QSYS objects. Cached files are stored as a UTF8 files. Format: Root --> Hostname -----> Objects (The Subsystem) --> Each Handlers root --------> listings.cache | relative.cache | LIB1.cache | Lib1(Folder) | Special Filters | Overrides | filters.cache --------------------------------------------------------------> Folders for each object which then contain listingDetails.cache, relativeFilters.cache -------------------------------------------------> Advanced Properties for that object


Nested Class Summary
 class QSYSObjectCacheHandler.QSYSFileFilter
           
 
Field Summary
static String copyright
           
 
Method Summary
 void cacheDatabaseFileDetails(IQSYSDatabaseFile file)
          Cache the Database File details
 void cacheFilterStringResults(String filterString, Object[] results, boolean additionalDetails)
          Cache the specified filter string.
 String cacheLocationForResource(IQSYSResource resource)
          Returns the cache location for the given resource
 void cacheMemberDetails(IQSYSMember member, boolean advanced)
          Cache the member details
 void deleteFile(File file)
          Deletes the passed file by recursively deleting all children first
 void deleteMessageDescription(IQSYSMessageDescription desc)
          Removes the passed Message Description from the cache
 IQSYSLibrary getCurlibOverride()
           
 boolean getDatabaseFileDetails(IQSYSDatabaseFile file)
          Retrieves the cached database file details and sets them for the passed database file
 String getDatabaseFileDetailsLocation(IQSYSDatabaseFile file)
          Returns the location where the cached Database File Details are located for the passed datbase file
static QSYSObjectCacheHandler getInstance(QSYSObjectSubSystem subsystem)
          Singleton access method.
 IQSYSLibrary[] getLibraryListOverride()
           
 boolean getMemberDetails(IQSYSMember member, boolean advanced)
          Retrieves the cached member details and sets them for the passed member
 String getMemberDetailsLocation(IQSYSMember member)
          Returns the location where the cached Member Details are located for the passed member
 Boolean loadAuthorityCheck(String library, String object, String objectType, String authorityList, String userId)
          Check the authority from the cache.
 IQSYSDatabaseField[] loadDatabaseFields(IQSYSFileRecordFormat record, String fieldFilter)
           
 IQSYSDatabaseFileRecordFormat loadDatabaseFileRecord(IQSYSDatabaseFile file, String record)
           
 IISeriesHostRecordDevice[] loadDeviceRecords(IQSYSFile file)
           
 ISeriesFileOverrideInformation loadFileOverride(String file)
          Load file override from the cache
 IISeriesHostKeyField[] loadKeyFields(IQSYSDatabaseFile dtaFile, String recordName)
          Load the IISeriesHostKeyField's from the given database file with the given recordName
 IQSYSMessageDescription[] loadMessageDescriptions(IQSYSMessageFile msgFile, String msgID)
          Return the cached array of message descriptions for a given message file and msgID(* for all)
 List<ISeriesHostProcedureBasic> loadProcedures(String pgmLibraryName, String pgmName, String moduleName, boolean exportedProcsOnly)
          Load the procedures with the given library name, program name (null if not applicable), and module name
 com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation loadProgramInformation(IQSYSObject program, boolean exportedProcsOnly)
          Return the cached QSYSProgramInformation for a specified program
 void removeFromCache(IQSYSResource resource)
          Removes the passed resource from the cache and all children of that resource
 Object[] resolveFilterString(String filterString, boolean additionalDetails)
          Resolve the filter from the cache.
 void resourceRenamed(IQSYSResource resource, String newName)
          Updated the cache with the new name for the passed resource
 void saveAuthorityCheck(String library, String object, String objectType, String authorityList, String userProfile, boolean result)
          Save the results of an authority check.
 void saveDatabaseFields(IQSYSFileRecordFormat record, String fieldFilter, IQSYSDatabaseField[] fields)
           
 void saveDatabaseFileRecord(IQSYSDatabaseFile file, String record, IQSYSDatabaseFileRecordFormat fileRecord)
           
 void saveDeviceRecords(IQSYSFile file, IISeriesHostRecordDevice[] records)
           
 void saveFileOverride(String file, ISeriesFileOverrideInformation override)
          Save file override information.
 void saveKeyFields(IQSYSDatabaseFile dtaFile, String recordName, IISeriesHostKeyField[] fields)
          Cache the given IISeriesHostKeyField's from the given database file and record name
 void saveMessageDescriptions(IQSYSMessageFile msgFile, String msgID, IQSYSMessageDescription[] msgs)
          Write to cache the given Message Descriptions
 void saveProcedures(String pgmLibraryName, String pgmName, String moduleName, List<Object> procedures, boolean exportedProcsOnly)
          Cache the given procedures for the provided location
 void saveProgramInformation(IQSYSObject program, com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation info, boolean exportedProcsOnly)
          Cache QSYSProgramInformation for the given program
 void setLibraryListOverride(IQSYSLibrary[] tempLIBL, IQSYSLibrary assocLib)
           
static void updateCacheLocation(String newLocation)
          Updates the cache location of every handler
 
Methods inherited from class com.ibm.etools.iseries.subsystems.qsys.cache.AbstractCacheHandler
addToOutputXNumberOfLines, backupAndDeleteCacheFile, checkCacheSize, getCacheRootDirectory, getListingDetailsFileName, getReader, getWriter, isCachingDisabled, setCacheLocation, skipNumberOfLines, writeFile
 
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
Method Detail

getInstance

public static QSYSObjectCacheHandler getInstance(QSYSObjectSubSystem subsystem)
Singleton access method.


updateCacheLocation

public static void updateCacheLocation(String newLocation)
Updates the cache location of every handler

Parameters:
newLocation - The new location the cache should cache files to now

cacheFilterStringResults

public void cacheFilterStringResults(String filterString,
                                     Object[] results,
                                     boolean additionalDetails)
Cache the specified filter string.

Parameters:
filterString -
results -

resolveFilterString

public Object[] resolveFilterString(String filterString,
                                    boolean additionalDetails)
Resolve the filter from the cache.

Parameters:
filterString -
Returns:

getCurlibOverride

public IQSYSLibrary getCurlibOverride()

getLibraryListOverride

public IQSYSLibrary[] getLibraryListOverride()

setLibraryListOverride

public void setLibraryListOverride(IQSYSLibrary[] tempLIBL,
                                   IQSYSLibrary assocLib)

saveMessageDescriptions

public void saveMessageDescriptions(IQSYSMessageFile msgFile,
                                    String msgID,
                                    IQSYSMessageDescription[] msgs)
Write to cache the given Message Descriptions

Parameters:
file - The Message File the msgs are from
msgID - the filter string
msgs - The Message Descriptions to be cached

loadMessageDescriptions

public IQSYSMessageDescription[] loadMessageDescriptions(IQSYSMessageFile msgFile,
                                                         String msgID)
Return the cached array of message descriptions for a given message file and msgID(* for all)


loadProgramInformation

public com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation loadProgramInformation(IQSYSObject program,
                                                                                                   boolean exportedProcsOnly)
Return the cached QSYSProgramInformation for a specified program


saveProgramInformation

public void saveProgramInformation(IQSYSObject program,
                                   com.ibm.etools.iseries.services.qsys.internal.QSYSProgramInformation info,
                                   boolean exportedProcsOnly)
Cache QSYSProgramInformation for the given program


loadProcedures

public List<ISeriesHostProcedureBasic> loadProcedures(String pgmLibraryName,
                                                      String pgmName,
                                                      String moduleName,
                                                      boolean exportedProcsOnly)
Load the procedures with the given library name, program name (null if not applicable), and module name


saveProcedures

public void saveProcedures(String pgmLibraryName,
                           String pgmName,
                           String moduleName,
                           List<Object> procedures,
                           boolean exportedProcsOnly)
Cache the given procedures for the provided location


saveAuthorityCheck

public void saveAuthorityCheck(String library,
                               String object,
                               String objectType,
                               String authorityList,
                               String userProfile,
                               boolean result)
Save the results of an authority check. A single authorities file is stored per library. The format of authorities file: line 1: library/object objectType line 2: userProfile:authority string line 3: true | false


loadAuthorityCheck

public Boolean loadAuthorityCheck(String library,
                                  String object,
                                  String objectType,
                                  String authorityList,
                                  String userId)
Check the authority from the cache. See saveAuthorityCheck(String, String, String, String, String, boolean) for details on cache file format.


saveFileOverride

public void saveFileOverride(String file,
                             ISeriesFileOverrideInformation override)
Save file override information. Passing a value of override with blank fields represents no override in place. All overrides are stored in the overrides.cache file with the repeating file format: file file used library used member used override type


loadFileOverride

public ISeriesFileOverrideInformation loadFileOverride(String file)
Load file override from the cache


loadKeyFields

public IISeriesHostKeyField[] loadKeyFields(IQSYSDatabaseFile dtaFile,
                                            String recordName)
Load the IISeriesHostKeyField's from the given database file with the given recordName


saveKeyFields

public void saveKeyFields(IQSYSDatabaseFile dtaFile,
                          String recordName,
                          IISeriesHostKeyField[] fields)
Cache the given IISeriesHostKeyField's from the given database file and record name


loadDatabaseFields

public IQSYSDatabaseField[] loadDatabaseFields(IQSYSFileRecordFormat record,
                                               String fieldFilter)

saveDatabaseFields

public void saveDatabaseFields(IQSYSFileRecordFormat record,
                               String fieldFilter,
                               IQSYSDatabaseField[] fields)

loadDeviceRecords

public IISeriesHostRecordDevice[] loadDeviceRecords(IQSYSFile file)

saveDeviceRecords

public void saveDeviceRecords(IQSYSFile file,
                              IISeriesHostRecordDevice[] records)

saveDatabaseFileRecord

public void saveDatabaseFileRecord(IQSYSDatabaseFile file,
                                   String record,
                                   IQSYSDatabaseFileRecordFormat fileRecord)

loadDatabaseFileRecord

public IQSYSDatabaseFileRecordFormat loadDatabaseFileRecord(IQSYSDatabaseFile file,
                                                            String record)

removeFromCache

public void removeFromCache(IQSYSResource resource)
Removes the passed resource from the cache and all children of that resource

Parameters:
resource - The Resource to be removed from cache

resourceRenamed

public void resourceRenamed(IQSYSResource resource,
                            String newName)
Updated the cache with the new name for the passed resource

Parameters:
resource - The resource that has been renamed

cacheLocationForResource

public String cacheLocationForResource(IQSYSResource resource)
Returns the cache location for the given resource

Parameters:
resource - The resource we are determining the cache location for

deleteFile

public void deleteFile(File file)
Deletes the passed file by recursively deleting all children first


deleteMessageDescription

public void deleteMessageDescription(IQSYSMessageDescription desc)
Removes the passed Message Description from the cache


getMemberDetails

public boolean getMemberDetails(IQSYSMember member,
                                boolean advanced)
                         throws SystemMessageException
Retrieves the cached member details and sets them for the passed member

Throws:
SystemMessageException

cacheMemberDetails

public void cacheMemberDetails(IQSYSMember member,
                               boolean advanced)
Cache the member details


getMemberDetailsLocation

public String getMemberDetailsLocation(IQSYSMember member)
Returns the location where the cached Member Details are located for the passed member


getDatabaseFileDetailsLocation

public String getDatabaseFileDetailsLocation(IQSYSDatabaseFile file)
Returns the location where the cached Database File Details are located for the passed datbase file


getDatabaseFileDetails

public boolean getDatabaseFileDetails(IQSYSDatabaseFile file)
                               throws SystemMessageException
Retrieves the cached database file details and sets them for the passed database file

Throws:
SystemMessageException

cacheDatabaseFileDetails

public void cacheDatabaseFileDetails(IQSYSDatabaseFile file)
Cache the Database File details


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.