org.xcmis.spi
Class CmisRegistry

java.lang.Object
  extended by org.xcmis.spi.CmisRegistry

public class CmisRegistry
extends Object

xCMIS SPI entry point. Contains list of all known CMIS StorageProviders with convenience addStorage method for theirs initializing as well as the method getConnection for accessing data from concrete Storage (visible on top level as CMIS Repository)

Version:
$Id:$

Field Summary
protected  List<String> renditionProviders
           
protected  Map<String,StorageProvider> storageProviders
           
 
Constructor Summary
CmisRegistry()
          Default constructor
 
Method Summary
 void addRenditionProvider(String provider)
          Adds an extra rendition provider .
 void addStorage(StorageProvider storageProvider)
          Registers StorageProvider
 Connection getConnection(String storageId)
          Create new connection.
static CmisRegistry getInstance()
          Singleton method for obtaining "current" CmisRegistry object stored in AtomicReference-ed CmisRegistryFactory.
 Set<RepositoryShortInfo> getStorageInfos()
          Get id of all available storages.
static void setFactory(CmisRegistryFactory factory)
          Sets the "current" instance of CmisRegistryFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renditionProviders

protected List<String> renditionProviders

storageProviders

protected Map<String,StorageProvider> storageProviders
Constructor Detail

CmisRegistry

public CmisRegistry()
Default constructor

Method Detail

getInstance

public static CmisRegistry getInstance()
Singleton method for obtaining "current" CmisRegistry object stored in AtomicReference-ed CmisRegistryFactory. Such a factory should be set by compilmentary (in some sence) setFactory(CmisRegistryFactory inst) method in advance. Otherwise, it will try to find it using CmisRegistryFactoryFinder.findCmisRegistry()

Returns:
"current" CmisRegistry

setFactory

public static void setFactory(CmisRegistryFactory factory)
Sets the "current" instance of CmisRegistryFactory

Parameters:
inst -

addStorage

public void addStorage(StorageProvider storageProvider)
Registers StorageProvider

Parameters:
storageProvider - to be registerd

getConnection

public Connection getConnection(String storageId)
Create new connection. Delegated to appropriate StorageProvider method

Parameters:
storageId - storage id
Returns:
connection
Throws:
InvalidArgumentException - if storage with specified id is not registered

getStorageInfos

public Set<RepositoryShortInfo> getStorageInfos()
Get id of all available storages.

Returns:
short information about storages, see RepositoryShortInfo. If no one storages configured than empty set should be returned (never null).

addRenditionProvider

public void addRenditionProvider(String provider)
Adds an extra rendition provider .

Parameters:
provider - String FQN of provider to add.


Copyright © 2011 eXo Platform SAS. All Rights Reserved.