org.apache.oodt.cas.filemgr.ingest
Class RmiCache

java.lang.Object
  extended by org.apache.oodt.cas.filemgr.ingest.RmiCache
All Implemented Interfaces:
Cache

public class RmiCache
extends Object
implements Cache

Version:
$Revision: 11462 $

An RMI client to the RmiCacheServer, implementing an RMI front end to a LocalCache.

.
Author:
mattmann, bfoster

Field Summary
 
Fields inherited from interface org.apache.oodt.cas.filemgr.ingest.Cache
DEFAULT_UNIQUE_MET_KEY
 
Constructor Summary
RmiCache(String rmiCacheServerUrn)
           
 
Method Summary
 void clear()
          Clears the current cache.
 boolean contains(String productName)
          Checks the cache to determine if a Product with the given productName exists.
 URL getFileManagerUrl()
          Gets the URL of the File Manager that this Cache communicates with.
 void setFileManager(URL fmUrl)
          Specifies the URL to the File Manager to connect this Cache to.
 void setUniqueElementName(String uniqueElementName)
          Sets the name of the met element to use as the identifier of a Product for use in determining whether the Product is in the Cache.
 void setUniqueElementProductTypeNames(List<String> uniqueElementProductTypeNames)
          Sets the names of the ProductTypes to cache.
 int size()
           
 void sync()
          Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method.
 void sync(List<String> uniqueElementProductTypeNames)
          Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method.
 void sync(String uniqueElementName, List<String> uniqueElementProductTypeNames)
          Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RmiCache

public RmiCache(String rmiCacheServerUrn)
         throws InstantiationException
Throws:
InstantiationException
Method Detail

clear

public void clear()
Description copied from interface: Cache
Clears the current cache. This should be used before a re-#sync(String, String)) occurs.

Specified by:
clear in interface Cache

contains

public boolean contains(String productName)
Description copied from interface: Cache
Checks the cache to determine if a Product with the given productName exists.

Specified by:
contains in interface Cache
Parameters:
productName - The name of the Product to check for in the Cache.
Returns:
True if the Product is foudn in the Cache, False, otherwise.

setFileManager

public void setFileManager(URL fmUrl)
Description copied from interface: Cache
Specifies the URL to the File Manager to connect this Cache to.

Specified by:
setFileManager in interface Cache
Parameters:
fmUrl - The URL of the File Manager to cache Products from.

size

public int size()
Specified by:
size in interface Cache
Returns:
The size of the current Product cache.

sync

public void sync(List<String> uniqueElementProductTypeNames)
          throws CacheException
Description copied from interface: Cache
Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method.

Specified by:
sync in interface Cache
Parameters:
uniqueElementProductTypeNames - The List ProductTypes to cache Products from.
Throws:
CacheException - If there is any error.

sync

public void sync(String uniqueElementName,
                 List<String> uniqueElementProductTypeNames)
          throws CacheException
Description copied from interface: Cache
Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method.

Specified by:
sync in interface Cache
Parameters:
uniqueElementName - The met key identifier to use for determining Product existance (if different than "CAS.ProductName").
uniqueElementProductTypeNames - The List of ProductTypes to cache Products from.
Throws:
CacheException - If there is any error.

setUniqueElementProductTypeNames

public void setUniqueElementProductTypeNames(List<String> uniqueElementProductTypeNames)
Description copied from interface: Cache
Sets the names of the ProductTypes to cache.

Specified by:
setUniqueElementProductTypeNames in interface Cache
Parameters:
uniqueElementProductTypeNames - A List of java.util.String names of ProductTypes.

sync

public void sync()
          throws CacheException
Description copied from interface: Cache
Synchronizes this Cache with the File Manager specified by the Cache.setFileManager(URL) method. This method also assumes that the unique element (identified by Cache.setUniqueElementName(String) and the List of ProductTypes have also been set appropriate (e.g., by using Cache.setUniqueElementProductTypeNames(List).

Specified by:
sync in interface Cache
Throws:
CacheException - If any error occurs.

setUniqueElementName

public void setUniqueElementName(String uniqueElementName)
Description copied from interface: Cache
Sets the name of the met element to use as the identifier of a Product for use in determining whether the Product is in the Cache.

Specified by:
setUniqueElementName in interface Cache
Parameters:
uniqueElementName - The name of the met element used to uniquely identify Products.

getFileManagerUrl

public URL getFileManagerUrl()
Description copied from interface: Cache
Gets the URL of the File Manager that this Cache communicates with.

Specified by:
getFileManagerUrl in interface Cache
Returns:
The URL of the File Manager that this Cache communicates with.


Copyright © 1999-2011 Apache OODT. All Rights Reserved.