org.apache.jackrabbit.rmi.client
Class ClientAdapterFactory

java.lang.Object
  extended by org.apache.jackrabbit.rmi.client.ClientAdapterFactory
All Implemented Interfaces:
LocalAdapterFactory
Direct Known Subclasses:
JackrabbitClientAdapterFactory

public class ClientAdapterFactory
extends Object
implements LocalAdapterFactory

Default implementation of the LocalAdapterFactory interface. This factory uses the client adapters defined in this package as the default adapter implementations. Subclasses can easily override or extend the default adapters by implementing the corresponding factory methods.


Constructor Summary
ClientAdapterFactory()
           
 
Method Summary
 AccessControlEntry getAccessControlEntry(RemoteAccessControlEntry remote)
          Factory method for creating a local adapter for a remote access control entry
 AccessControlEntry[] getAccessControlEntry(RemoteAccessControlEntry[] remote)
          Factory method for creating an array of local adapter for an array of remote access control entry
 AccessControlManager getAccessControlManager(RemoteAccessControlManager remote)
          Factory method for creating a local adapter for a remote access control manager
 AccessControlPolicy getAccessControlPolicy(RemoteAccessControlPolicy remote)
          Factory method for creating a local adapter for a remote access control policy
 AccessControlPolicy[] getAccessControlPolicy(RemoteAccessControlPolicy[] remote)
          Factory method for creating an array of local adapter for an array of remote access control policies
 AccessControlPolicyIterator getAccessControlPolicyIterator(RemoteIterator remote)
          Factory method for creating a local adapter for a remote access control policy iterator
 Item getItem(Session session, RemoteItem remote)
          Creates and returns a ClientItem instance.
 ItemDefinition getItemDef(RemoteItemDefinition remote)
          Creates and returns a ClientItemDefinition instance.
 Lock getLock(Session session, RemoteLock remote)
          Creates and returns a ClientLock instance.
 LockManager getLockManager(Session session, RemoteLockManager remote)
           
 NamespaceRegistry getNamespaceRegistry(RemoteNamespaceRegistry remote)
          Creates and returns a ClientClientNamespaceRegistry instance.
 Node getNode(Session session, RemoteNode remote)
          Creates and returns a ClientNode instance.
 NodeDefinition getNodeDef(RemoteNodeDefinition remote)
          Creates and returns a ClientNodeDefinition instance.
 NodeIterator getNodeIterator(Session session, RemoteIterator remote)
          Creates and returns a ClientNodeIterator instance.
 NodeType getNodeType(RemoteNodeType remote)
          Creates and returns a ClientNodeType instance.
 NodeTypeIterator getNodeTypeIterator(RemoteIterator remote)
          Creates and returns a ClientNodeTypeIterator instance.
 NodeTypeManager getNodeTypeManager(RemoteNodeTypeManager remote)
          Creates and returns a ClienNodeTypeManager instance.
 ObservationManager getObservationManager(Workspace workspace, RemoteObservationManager remote)
          Creates and returns a ClientObservationManager instance.
 Principal getPrincipal(RemotePrincipal remote)
          Factory method for creating a local adapter for a remote principal.
 Iterator<Principal> getPrincipalIterator(RemoteIterator remote)
          Factory method for creating a local adapter for a remote principal iterator.
 Privilege getPrivilege(RemotePrivilege remote)
          Factory method for creating a local adapter for a remote privilege
 Privilege[] getPrivilege(RemotePrivilege[] remote)
          Factory method for creating an array of local adapter for an array of remote privilege
 Property getProperty(Session session, RemoteProperty remote)
          Creates and returns a ClientProperty instance.
 PropertyDefinition getPropertyDef(RemotePropertyDefinition remote)
          Creates and returns a ClientPropertyDefinition instance.
 PropertyIterator getPropertyIterator(Session session, RemoteIterator remote)
          Creates and returns a ClientPropertyIterator instance.
 Query getQuery(Session session, RemoteQuery remote)
          Creates and returns a ClientQuery instance.
 QueryManager getQueryManager(Session session, RemoteQueryManager remote)
          Creates and returns a ClientQueryManager instance.
 QueryResult getQueryResult(Session session, RemoteQueryResult remote)
          Creates and returns a ClientQueryResult instance.
 Repository getRepository(RemoteRepository remote)
          Creates and returns a ClientRepository instance.
 Row getRow(RemoteRow remote)
          Creates and returns a ClientRow instance.
 RowIterator getRowIterator(RemoteIterator remote)
          Creates and returns a ClientRowIterator instance.
 Session getSession(Repository repository, RemoteSession remote)
          Creates and returns a ClientSession instance.
 Version getVersion(Session session, RemoteVersion remote)
          Creates and returns a ClientVersion instance.
 VersionHistory getVersionHistory(Session session, RemoteVersionHistory remote)
          Creates and returns a ClientVersionHistory instance.
 VersionIterator getVersionIterator(Session session, RemoteIterator remote)
          Creates and returns a ClientVersionIterator instance.
 VersionManager getVersionManager(Session session, RemoteVersionManager remote)
           
 Workspace getWorkspace(Session session, RemoteWorkspace remote)
          Creates and returns a ClientWorkspace instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientAdapterFactory

public ClientAdapterFactory()
Method Detail

getRepository

public Repository getRepository(RemoteRepository remote)
Creates and returns a ClientRepository instance. Factory method for creating a local adapter for a remote repository.

Specified by:
getRepository in interface LocalAdapterFactory
Parameters:
remote - remote repository
Returns:
local repository adapter

getSession

public Session getSession(Repository repository,
                          RemoteSession remote)
Creates and returns a ClientSession instance. In case the remote session is transaction enabled, the returned session will be transaction enabled too through the ClientXASession. Factory method for creating a local adapter for a remote session.

Specified by:
getSession in interface LocalAdapterFactory
Parameters:
repository - current repository
remote - remote session
Returns:
local session adapter

getWorkspace

public Workspace getWorkspace(Session session,
                              RemoteWorkspace remote)
Creates and returns a ClientWorkspace instance. Factory method for creating a local adapter for a remote workspace.

Specified by:
getWorkspace in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote workspace
Returns:
local workspace adapter

getObservationManager

public ObservationManager getObservationManager(Workspace workspace,
                                                RemoteObservationManager remote)
Creates and returns a ClientObservationManager instance. Factory method for creating a local adapter for a remote observation manager.

Specified by:
getObservationManager in interface LocalAdapterFactory
Parameters:
workspace - current workspace
remote - remote observation manager
Returns:
local observation manager adapter

getNamespaceRegistry

public NamespaceRegistry getNamespaceRegistry(RemoteNamespaceRegistry remote)
Creates and returns a ClientClientNamespaceRegistry instance. Factory method for creating a local adapter for a remote namespace registry.

Specified by:
getNamespaceRegistry in interface LocalAdapterFactory
Parameters:
remote - remote namespace registry
Returns:
local namespace registry adapter

getNodeTypeManager

public NodeTypeManager getNodeTypeManager(RemoteNodeTypeManager remote)
Creates and returns a ClienNodeTypeManager instance. Factory method for creating a local adapter for a remote node type manager.

Specified by:
getNodeTypeManager in interface LocalAdapterFactory
Parameters:
remote - remote node type manager
Returns:
local node type manager adapter

getItem

public Item getItem(Session session,
                    RemoteItem remote)
Creates and returns a ClientItem instance. Factory method for creating a local adapter for a remote item. Note that before calling this method, the client may want to introspect the remote item reference to determine whether to use the getNode or getProperty method instead, as the adapter returned by this method will only cover the basic Item interface.

Specified by:
getItem in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote item
Returns:
local item adapter

getProperty

public Property getProperty(Session session,
                            RemoteProperty remote)
Creates and returns a ClientProperty instance. Factory method for creating a local adapter for a remote property.

Specified by:
getProperty in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote property
Returns:
local property adapter

getNode

public Node getNode(Session session,
                    RemoteNode remote)
Creates and returns a ClientNode instance. Factory method for creating a local adapter for a remote node.

Specified by:
getNode in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote node
Returns:
local node adapter

getVersion

public Version getVersion(Session session,
                          RemoteVersion remote)
Creates and returns a ClientVersion instance. Factory method for creating a local adapter for a remote version.

Specified by:
getVersion in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote version
Returns:
local version adapter

getVersionHistory

public VersionHistory getVersionHistory(Session session,
                                        RemoteVersionHistory remote)
Creates and returns a ClientVersionHistory instance. Factory method for creating a local adapter for a remote version history.

Specified by:
getVersionHistory in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote version history
Returns:
local version history adapter

getNodeType

public NodeType getNodeType(RemoteNodeType remote)
Creates and returns a ClientNodeType instance. Factory method for creating a local adapter for a remote node type.

Specified by:
getNodeType in interface LocalAdapterFactory
Parameters:
remote - remote node type
Returns:
local node type adapter

getItemDef

public ItemDefinition getItemDef(RemoteItemDefinition remote)
Creates and returns a ClientItemDefinition instance. Factory method for creating a local adapter for a remote item definition. Note that before calling this method, the client may want to introspect the remote item definition to determine whether to use the getNodeDef or getPropertyDef method instead, as the adapter returned by this method will only cover the ItemDef base interface.

Specified by:
getItemDef in interface LocalAdapterFactory
Parameters:
remote - remote item definition
Returns:
local item definition adapter

getNodeDef

public NodeDefinition getNodeDef(RemoteNodeDefinition remote)
Creates and returns a ClientNodeDefinition instance. Factory method for creating a local adapter for a remote node definition.

Specified by:
getNodeDef in interface LocalAdapterFactory
Parameters:
remote - remote node definition
Returns:
local node definition adapter

getPropertyDef

public PropertyDefinition getPropertyDef(RemotePropertyDefinition remote)
Creates and returns a ClientPropertyDefinition instance. Factory method for creating a local adapter for a remote property definition.

Specified by:
getPropertyDef in interface LocalAdapterFactory
Parameters:
remote - remote property definition
Returns:
local property definition adapter

getLock

public Lock getLock(Session session,
                    RemoteLock remote)
Creates and returns a ClientLock instance. Factory method for creating a local adapter for a remote lock.

Specified by:
getLock in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote lock
Returns:
local lock adapter

getQueryManager

public QueryManager getQueryManager(Session session,
                                    RemoteQueryManager remote)
Creates and returns a ClientQueryManager instance. Factory method for creating a local adapter for a remote query manager.

Specified by:
getQueryManager in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote query manager
Returns:
local query manager adapter

getQuery

public Query getQuery(Session session,
                      RemoteQuery remote)
Creates and returns a ClientQuery instance. Factory method for creating a local adapter for a remote query.

Specified by:
getQuery in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote query
Returns:
local query adapter

getQueryResult

public QueryResult getQueryResult(Session session,
                                  RemoteQueryResult remote)
Creates and returns a ClientQueryResult instance. Factory method for creating a local adapter for a remote query result.

Specified by:
getQueryResult in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote query result
Returns:
local query result adapter

getRow

public Row getRow(RemoteRow remote)
Creates and returns a ClientRow instance. Factory method for creating a local adapter for a remote query row.

Specified by:
getRow in interface LocalAdapterFactory
Parameters:
remote - remote query row
Returns:
local query row adapter

getNodeIterator

public NodeIterator getNodeIterator(Session session,
                                    RemoteIterator remote)
Creates and returns a ClientNodeIterator instance. Factory method for creating a local adapter for a remote node iterator.

Specified by:
getNodeIterator in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote node iterator
Returns:
local node iterator adapter

getPropertyIterator

public PropertyIterator getPropertyIterator(Session session,
                                            RemoteIterator remote)
Creates and returns a ClientPropertyIterator instance. Factory method for creating a local adapter for a remote property iterator.

Specified by:
getPropertyIterator in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote property iterator
Returns:
local property iterator adapter

getVersionIterator

public VersionIterator getVersionIterator(Session session,
                                          RemoteIterator remote)
Creates and returns a ClientVersionIterator instance. Factory method for creating a local adapter for a remote version iterator.

Specified by:
getVersionIterator in interface LocalAdapterFactory
Parameters:
session - current session
remote - remote version iterator
Returns:
local version iterator adapter

getNodeTypeIterator

public NodeTypeIterator getNodeTypeIterator(RemoteIterator remote)
Creates and returns a ClientNodeTypeIterator instance. Factory method for creating a local adapter for a remote node type iterator.

Specified by:
getNodeTypeIterator in interface LocalAdapterFactory
Parameters:
remote - remote node type iterator
Returns:
local node type iterator adapter

getRowIterator

public RowIterator getRowIterator(RemoteIterator remote)
Creates and returns a ClientRowIterator instance. Factory method for creating a local adapter for a remote row iterator.

Specified by:
getRowIterator in interface LocalAdapterFactory
Parameters:
remote - remote row iterator
Returns:
local row iterator adapter

getLockManager

public LockManager getLockManager(Session session,
                                  RemoteLockManager remote)
Specified by:
getLockManager in interface LocalAdapterFactory

getVersionManager

public VersionManager getVersionManager(Session session,
                                        RemoteVersionManager remote)
Specified by:
getVersionManager in interface LocalAdapterFactory

getAccessControlManager

public AccessControlManager getAccessControlManager(RemoteAccessControlManager remote)
Factory method for creating a local adapter for a remote access control manager

Specified by:
getAccessControlManager in interface LocalAdapterFactory
Parameters:
remote - remote access control manager
Returns:
local access control manager

getAccessControlPolicy

public AccessControlPolicy getAccessControlPolicy(RemoteAccessControlPolicy remote)
Factory method for creating a local adapter for a remote access control policy

Specified by:
getAccessControlPolicy in interface LocalAdapterFactory
Parameters:
remote - remote access control policy
Returns:
local access control policy

getAccessControlPolicy

public AccessControlPolicy[] getAccessControlPolicy(RemoteAccessControlPolicy[] remote)
Factory method for creating an array of local adapter for an array of remote access control policies

Specified by:
getAccessControlPolicy in interface LocalAdapterFactory
Parameters:
remote - array of remote access control policies
Returns:
array of local access control policies

getAccessControlPolicyIterator

public AccessControlPolicyIterator getAccessControlPolicyIterator(RemoteIterator remote)
Factory method for creating a local adapter for a remote access control policy iterator

Specified by:
getAccessControlPolicyIterator in interface LocalAdapterFactory
Parameters:
remote - access control policy iterator
Returns:
local access control policy iterator

getAccessControlEntry

public AccessControlEntry getAccessControlEntry(RemoteAccessControlEntry remote)
Factory method for creating a local adapter for a remote access control entry

Specified by:
getAccessControlEntry in interface LocalAdapterFactory
Parameters:
remote - remote access control entry
Returns:
local access control entry

getAccessControlEntry

public AccessControlEntry[] getAccessControlEntry(RemoteAccessControlEntry[] remote)
Factory method for creating an array of local adapter for an array of remote access control entry

Specified by:
getAccessControlEntry in interface LocalAdapterFactory
Parameters:
remote - array of remote access control entry
Returns:
local array of access control entry

getPrincipal

public Principal getPrincipal(RemotePrincipal remote)
Factory method for creating a local adapter for a remote principal.

If remote is a org.apache.jackrabbit.rmi.remote.security.RemoteGroup the prinicipal returned implements the java.security.acl.Group interface.

Specified by:
getPrincipal in interface LocalAdapterFactory
Parameters:
remote - principal
Returns:
local principal

getPrincipalIterator

public Iterator<Principal> getPrincipalIterator(RemoteIterator remote)
Factory method for creating a local adapter for a remote principal iterator.

Each entry in the remote iterator which is a org.apache.jackrabbit.rmi.remote.security.RemoteGroup will be provided as a principal implementing the java.security.acl.Group interface.

Specified by:
getPrincipalIterator in interface LocalAdapterFactory
Parameters:
remote - remote principal iterator
Returns:
local principal iterator

getPrivilege

public Privilege getPrivilege(RemotePrivilege remote)
Factory method for creating a local adapter for a remote privilege

Specified by:
getPrivilege in interface LocalAdapterFactory
Parameters:
remote - remote privilege
Returns:
local privilege

getPrivilege

public Privilege[] getPrivilege(RemotePrivilege[] remote)
Factory method for creating an array of local adapter for an array of remote privilege

Specified by:
getPrivilege in interface LocalAdapterFactory
Parameters:
remote - array of remote privilege
Returns:
array of local privilege


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.