com.sap.mdm.blobs
Interface BlobCacheManager


public interface BlobCacheManager

An interface representing cache for BlobCache instances. Key of cache is combination: ServerName + RepositoryName + RegionName + RoleSet(currently not used) This key is internal and it is constructed on the basis of information obtained from the instance of UserSessionContext that is passed as input parameter.

Since:
7.1.04

Field Summary
static int ON_STARTUP_ALWAYS_REMOVE_FILES
          On startup, always remove the blob files from cache directory.
static int ON_STARTUP_IF_NO_CACHE_REMOVE_FILES
          On startup, remove the blob files from cache directory if cache info doesn't exist or is invalid.
static int ON_STARTUP_NEVER_REMOVE_FILES
          On startup, never remove any blob files from cache directory.
 
Method Summary
 void freeUnusedBlobCaches()
          Free (shutdown) all unused (released) BlobCache instances
 String getCacheRootDirectory()
          Returns path of the root directory where blob objects are cached
 int getMaximunCacheSize()
          Returns the maximum cache size used in all cached BlobCache instances
 int getStartupType()
          Returns the startup type used in all cached BlobCache instances
 void releaseBlobCache(UserSessionContext ctx)
          Releases instance of BlobCache.
 BlobCache reserveBlobCache(UserSessionContext ctx)
          Reserves instance of BlobCache class for retrieving and caching blob objects.
 BlobCache reserveBlobCache(UserSessionContext ctx, String password)
          Reserves instance of BlobCache class for retrieving and caching blob objects.
 void setCacheRootDirectory(String directoryPath)
          Specify path of the root directory where blob objects are cached.
 void setMaximunCacheSize(int maxCacheSize)
          Specify the maximum cache size used in all cached BlobCache instances Default value is 1024 * 1024
 void setStartupType(int startupType)
          Specify the startup type used in all cached BlobCache instances The default is ON_STARTUP_IF_NO_CACHE_REMOVE_FILES
 

Field Detail

ON_STARTUP_ALWAYS_REMOVE_FILES

public static final int ON_STARTUP_ALWAYS_REMOVE_FILES
On startup, always remove the blob files from cache directory.

See Also:
Constant Field Values

ON_STARTUP_IF_NO_CACHE_REMOVE_FILES

public static final int ON_STARTUP_IF_NO_CACHE_REMOVE_FILES
On startup, remove the blob files from cache directory if cache info doesn't exist or is invalid.

See Also:
Constant Field Values

ON_STARTUP_NEVER_REMOVE_FILES

public static final int ON_STARTUP_NEVER_REMOVE_FILES
On startup, never remove any blob files from cache directory.

See Also:
Constant Field Values
Method Detail

reserveBlobCache

public BlobCache reserveBlobCache(UserSessionContext ctx,
                                  String password)
                           throws BlobCacheException
Reserves instance of BlobCache class for retrieving and caching blob objects. The BlobCache instance can reserved by several users simultaneously. If instance does not exist in the cache then new one is created and stored in the cache

Parameters:
ctx - instance of UserSessionContext representing MDM repository
password - repository user password
Returns:
instance of BlobCache
Throws:
BlobCacheException - if there is any problem

reserveBlobCache

public BlobCache reserveBlobCache(UserSessionContext ctx)
                           throws BlobCacheException
Reserves instance of BlobCache class for retrieving and caching blob objects. The BlobCache instance can reserved by several users simultaneously. If instance does not exist in the cache then new one is created only of trusted connection is used, otherwise the exception will be thrown

Parameters:
ctx - instance of UserSessionContext representing MDM repository
Returns:
instance of BlobCache
Throws:
BlobCacheException - if BlobCache instance can not be found in the cache and can not be created or if there is any problem

releaseBlobCache

public void releaseBlobCache(UserSessionContext ctx)
Releases instance of BlobCache. If instance was reserved by several users it is marked as released only after all users call this method.

Parameters:
ctx - instance of UserSessionContext representing MDM repository

getCacheRootDirectory

public String getCacheRootDirectory()
Returns path of the root directory where blob objects are cached

Returns:
the root directory of blob object cache

setCacheRootDirectory

public void setCacheRootDirectory(String directoryPath)
Specify path of the root directory where blob objects are cached. This path will be used as root directory for all BlobCache instances created by this manager. The default value of root directory is C:\Temp\MDM\BlobCache\

Parameters:
directoryPath - the root directory of blob object cache

getMaximunCacheSize

public int getMaximunCacheSize()
Returns the maximum cache size used in all cached BlobCache instances

Returns:
a maximum cache size in kilobytes
See Also:
BlobCache

setMaximunCacheSize

public void setMaximunCacheSize(int maxCacheSize)
Specify the maximum cache size used in all cached BlobCache instances Default value is 1024 * 1024

Parameters:
maxCacheSize - a maximum cache size in kilobytes
See Also:
BlobCache

getStartupType

public int getStartupType()
Returns the startup type used in all cached BlobCache instances

Returns:
a startup type
See Also:
BlobCache

setStartupType

public void setStartupType(int startupType)
Specify the startup type used in all cached BlobCache instances The default is ON_STARTUP_IF_NO_CACHE_REMOVE_FILES

Returns:
a startup type
See Also:
BlobCache

freeUnusedBlobCaches

public void freeUnusedBlobCaches()
Free (shutdown) all unused (released) BlobCache instances



Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.