org.gcube.informationsystem.cache
Date: 2014-11-12

# Package org.gcube.informationsystem.cache

Introduction

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  ISCacheConsistencyManagerMBean | The MBean manages the available cache consistency components (cc).
  ISCacheMBean | Cache object.
  ISCacheRegistryMBean |

- Class Summary
  Class | Description
  --- | ---
  ISCache | Implementation of the `ISCacheMBean` interface.
  ISCacheConsistencyManager | Implementation of the `ISCacheConsistencyManagerMBean`
  ISCacheManager | ISCacheManager class is the initiator and accessor to the ISCache workflow.
  ISCacheMM | Class that initiates the JMX server and provides access to the MBean (un)registration operations.
  ISCacheRegistry |
  ISRetriever | Supporting class that provides some IS artifacts (mainly query objects).
  ScopesUtil |
  Srv | Srv class represents a service entity
  SrvRegistry |

- Enum Summary
  Enum | Description
  --- | ---
  SrvType | Valid service types

## Package org.gcube.informationsystem.cache Description

#### Introduction

The only artifacts users need to pay attention to are the `ISCache` and `ISCacheManager` classes. In the beginning use the `ISCacheManager.initialize()` method, which initializes the ISCache environment. Users can access the `ISCache` object, using `ISCacheManager.getCache()` method. Then they can invoke the methods defined in the `ISCache` class and manage the cache information. There are 2 noteworthy factors regarding the cache architecture.

It's inherently, completely, uniquely, utterly dynamic
  cache consistency components may be added/deleted at runtime without affecting the system. In matter of fact, one can change the consistency component at runtime keeping all of its previous cached information. From the user perspective all the mechanics are completely transparent.
It's JMX-enabled
  This means that ISCache has all the advantages of JMX, in terms of management and monitoring

#### Examples of Usage

##### Simple Usage

`ISCacheManager.addManager(GCUBEScope.getScope("/gcube/devsec"));
ISCacheManager.addManager(GCUBEScope.getScope("/gcube/devsec"));
ISCacheManager.delManager(GCUBEScope.getScope("/gcube/testing"));
ISCacheManager.addManager(GCUBEScope.getScope("/gcube/devsec"));
ISCacheManager.getManager(GCUBEScope.getScope("/gcube/devsec")).cache.getEPRsFor("MetadataManagement", "XMLIndexer", "FACTORY") :: String[]
ISCacheManager.getManager(GCUBEScope.getScope("/gcube/devsec")).cache.getEPRsFor("MetadataManagement", "XMLIndexer", "STATEFULL") :: String[]
ISCacheManager.getManager(GCUBEScope.getScope("/gcube/devsec")).cache.addFilterCriterion("MetadataManagement", "XMLIndexer", "STATEFULL", "/child::*[local-name()='AccessType']", "GCUBEDaix");
ISCacheManager.getManager(GCUBEScope.getScope("/gcube/devsec")).cache.getEPRsFor("MetadataManagement", "XMLIndexer", "STATEFULL") :: String[]
ISCacheManager.getManager(GCUBEScope.getScope("/gcube/devsec")).cache.getEPRsFor("Personalisation", "UserProfileAccess", "SIMPLE") :: String[]
`

##### Management & Monitoring

In order to see the current state of ISCache (registered services, corresponding RIs, execution statistics, etc), you can use JConsole (just type 'jconsole' in your command prompt. ISCache is fully JMX-enabled and thus can be configured and monitored at runtime.