Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.util.clprompter
Class ClCacheUtilities

java.lang.Object
  extended by com.ibm.etools.iseries.rse.util.clprompter.ClCacheUtilities
All Implemented Interfaces:
ICacheConstants

public class ClCacheUtilities
extends Object
implements ICacheConstants


Field Summary
static String Copyright
           
 
Fields inherited from interface com.ibm.etools.iseries.subsystems.qsys.cache.ICacheConstants
CACHE_FILE_CL_COMMAND_EXTENSION, CACHE_FILE_CL_COMMAND_PROPERTIES, CACHE_FILE_CL_HELP_EXTENSION, CACHE_FILE_CL_HELP_TABLE_EXTENSION, CACHE_FILE_CORRUPTED_EXTENSION, CACHE_KEY_DELIMINATOR, copyright, MAX_SIZE_DEFAULT, PREF_ALWAYS, PREF_CACHE_LISTS, PREF_CL, PREF_CL_HOST, PREF_CL_IGNORE, PREF_CL_RELEASE, PREF_DISABLE_CACHE, PREF_LEVELCHECK, PREF_LOCATION, PREF_MAX_INMEMORY_CACHE_FILES, PREF_MAXSIZE, PREF_MAXSIZE_OPTION, PREF_NEVER, PREF_OFFLINE_UNIVERSAL, PREF_ONLINE_OPTIONS
 
Constructor Summary
ClCacheUtilities()
           
 
Method Summary
static String getCacheDir(IBMiConnection connection)
          Method getCacheDir.
static String getCacheFileContents(String fullFileName)
          Method getCacheFileContents.
static byte[] getCacheFileContentsBytes(String fullFileName)
           
static String getCommandLibraryUsingCache(String command, String library, IBMiConnection connection, com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel)
           
static boolean isCacheFull(int numBytes)
          indicates whether or not the cache is full
static boolean isCachingDisabled(IBMiConnection connection)
          Indicates whether or not caching is disabled.
static boolean isObjectModified(IBMiConnection connection, String library, String object, String objectType)
          indicates whether or not an object has been modified since the last cache operation
static boolean setCacheFileContents(String fullFileName, byte[] contents)
           
static boolean setCacheFileContents(String fullFileName, String contents)
          Method setCacheFileContents.
static void setCommandTimeStamp(IBMiConnection connection, String library, String object, String objectType)
          saves the last modified property for the specified command
 
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

ClCacheUtilities

public ClCacheUtilities()
Method Detail

getCacheDir

public static String getCacheDir(IBMiConnection connection)
Method getCacheDir. retrieves the cache directory using the values in the preferences

Parameters:
connection - the iSeries connection to cache info for
Returns:
String the directory to put cache files in

getCacheFileContents

public static String getCacheFileContents(String fullFileName)
Method getCacheFileContents. Helper method to retrieve cache contents

Parameters:
fullFileName - the fully specified filename of the cache file
Returns:
String the contents of the cache file, null if an error occurs.

getCacheFileContentsBytes

public static byte[] getCacheFileContentsBytes(String fullFileName)

setCacheFileContents

public static boolean setCacheFileContents(String fullFileName,
                                           String contents)
Method setCacheFileContents. helper method to store info in a cache file

Parameters:
fullFileName - the cache file name
contents - the info to store in the cache file
Returns:
boolean whether or not storing the info was successful

setCacheFileContents

public static boolean setCacheFileContents(String fullFileName,
                                           byte[] contents)

getCommandLibraryUsingCache

public static String getCommandLibraryUsingCache(String command,
                                                 String library,
                                                 IBMiConnection connection,
                                                 com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel)
                                          throws SystemMessageException,
                                                 ClCommandException
Throws:
SystemMessageException
ClCommandException

isCachingDisabled

public static boolean isCachingDisabled(IBMiConnection connection)
Indicates whether or not caching is disabled.

Parameters:
connection - the connection to check
Returns:
true if caching is disabled, false otherwise.
Since:
6.0

setCommandTimeStamp

public static void setCommandTimeStamp(IBMiConnection connection,
                                       String library,
                                       String object,
                                       String objectType)
saves the last modified property for the specified command

Parameters:
connection - the connection used to retrieve the command information
library - the library the command resides in
object - the object to save the last modified date for
objectType - the object type to save the last modified date for
Since:
6.0

isObjectModified

public static boolean isObjectModified(IBMiConnection connection,
                                       String library,
                                       String object,
                                       String objectType)
                                throws SystemMessageException
indicates whether or not an object has been modified since the last cache operation

Parameters:
connection - the connection for the command
library - the library that the command is in
object - the object to check
objectType - the objectType of the object to check.
Returns:
false if the command has not been modified, true otherwise
Throws:
SystemMessageException
Since:
6.0

isCacheFull

public static boolean isCacheFull(int numBytes)
indicates whether or not the cache is full

Parameters:
numBytes - the number of bytes to add to the cache size to determine if the cache would be full after adding those bytes
Returns:
true if the cache is too full to add the specified number of bytes, false otherwise
Since:
6.0

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.