public class ServerAdapterFactory extends Object implements RemoteAdapterFactory
RemoteAdapterFactory
interface. This factory uses the server adapters
defined in this package as the default adapter implementations. Subclasses
can override or extend the default adapters by implementing the corresponding
factory methods.
The bufferSize
property can be used to configure the size of the
buffer used by iterators to speed up iterator traversal over the network.
Constructor and Description |
---|
ServerAdapterFactory() |
Modifier and Type | Method and Description |
---|---|
int |
getBufferSize()
Returns the iterator buffer size.
|
int |
getPortNumber()
Returns the port number for server objects.
|
RemoteAccessControlEntry |
getRemoteAccessControlEntry(javax.jcr.security.AccessControlEntry local)
Returns a remote adapter for the given local access control manager.
|
RemoteAccessControlEntry[] |
getRemoteAccessControlEntry(javax.jcr.security.AccessControlEntry[] local)
Returns a remote adapter for the given local access control manager.
|
RemoteAccessControlManager |
getRemoteAccessControlManager(javax.jcr.security.AccessControlManager acm)
Creates a
ServerAccessControlManager
instance. |
RemoteAccessControlPolicy |
getRemoteAccessControlPolicy(javax.jcr.security.AccessControlPolicy local)
Returns a remote adapter for the given local access control manager.
|
RemoteAccessControlPolicy[] |
getRemoteAccessControlPolicy(javax.jcr.security.AccessControlPolicy[] local)
Returns a remote adapter for the given local access control manager.
|
RemoteIterator |
getRemoteAccessControlPolicyIterator(javax.jcr.security.AccessControlPolicyIterator iterator)
Creates a
ServerNodeIterator instance. |
RemoteEventCollection |
getRemoteEvent(long listenerId,
javax.jcr.observation.EventIterator events)
Creates a
ServerEventCollection instances. |
RemoteItem |
getRemoteItem(javax.jcr.Item item)
Creates a
ServerItem instance. |
RemoteItemDefinition |
getRemoteItemDefinition(javax.jcr.nodetype.ItemDefinition def)
Creates a
ServerItemDefinition instance. |
RemoteLock |
getRemoteLock(javax.jcr.lock.Lock lock)
Creates a
ServerLock instance. |
RemoteLockManager |
getRemoteLockManager(javax.jcr.lock.LockManager lockManager) |
RemoteNamespaceRegistry |
getRemoteNamespaceRegistry(javax.jcr.NamespaceRegistry registry)
Creates a
ServerNamespaceRegistry
instance. |
RemoteNode |
getRemoteNode(javax.jcr.Node node)
Creates a
ServerNode instance. |
RemoteNodeDefinition |
getRemoteNodeDefinition(javax.jcr.nodetype.NodeDefinition def)
Creates a
ServerNodeDefinition instance. |
RemoteIterator |
getRemoteNodeIterator(javax.jcr.NodeIterator iterator)
Creates a
ServerNodeIterator instance. |
RemoteNodeType |
getRemoteNodeType(javax.jcr.nodetype.NodeType type)
Creates a
ServerNodeType instance. |
RemoteIterator |
getRemoteNodeTypeIterator(javax.jcr.nodetype.NodeTypeIterator iterator)
Creates a
ServerNodeTypeIterator instance. |
RemoteNodeTypeManager |
getRemoteNodeTypeManager(javax.jcr.nodetype.NodeTypeManager manager)
Creates a
ServerNodeTypeManager instance. |
RemoteObservationManager |
getRemoteObservationManager(javax.jcr.observation.ObservationManager observationManager)
Creates a
ServerObservationManager
instance. |
RemotePrincipal |
getRemotePrincipal(Principal principal)
Returns a remote adapter for the given local access control manager.
|
RemoteIterator |
getRemotePrincipalIterator(Iterator<Principal> principals)
Returns a remote adapter for the given local access control manager.
|
RemotePrivilege |
getRemotePrivilege(javax.jcr.security.Privilege local)
Returns a remote adapter for the given local access control manager.
|
RemotePrivilege[] |
getRemotePrivilege(javax.jcr.security.Privilege[] local)
Returns a remote adapter for the given local access control manager.
|
RemoteProperty |
getRemoteProperty(javax.jcr.Property property)
Creates a
ServerProperty instance. |
RemotePropertyDefinition |
getRemotePropertyDefinition(javax.jcr.nodetype.PropertyDefinition def)
Creates a
ServerPropertyDefinition
instance. |
RemoteIterator |
getRemotePropertyIterator(javax.jcr.PropertyIterator iterator)
Creates a
ServerPropertyIterator instance. |
RemoteQuery |
getRemoteQuery(javax.jcr.query.Query query)
Creates a
ServerQuery instance. |
RemoteQueryManager |
getRemoteQueryManager(javax.jcr.Session session,
javax.jcr.query.QueryManager manager)
Creates a
ServerQueryManager instance. |
RemoteQueryResult |
getRemoteQueryResult(javax.jcr.query.QueryResult result)
Creates a
ServerQueryResult instance. |
RemoteRepository |
getRemoteRepository(javax.jcr.Repository repository)
Creates a
ServerRepository instance. |
RemoteRow |
getRemoteRow(javax.jcr.query.Row row)
Creates a
ServerQueryResult instance. |
RemoteIterator |
getRemoteRowIterator(javax.jcr.query.RowIterator iterator)
Creates a
ServerRowIterator instance. |
RemoteSession |
getRemoteSession(javax.jcr.Session session)
Creates a
ServerSession instance. |
RemoteVersion |
getRemoteVersion(javax.jcr.version.Version version)
Creates a
ServerVersion instance. |
RemoteVersionHistory |
getRemoteVersionHistory(javax.jcr.version.VersionHistory versionHistory)
Creates a
ServerVersionHistory instance. |
RemoteIterator |
getRemoteVersionIterator(javax.jcr.version.VersionIterator iterator)
Creates a
ServerVersionIterator instance. |
RemoteVersionManager |
getRemoteVersionManager(javax.jcr.Session session,
javax.jcr.version.VersionManager versionManager) |
RemoteWorkspace |
getRemoteWorkspace(javax.jcr.Workspace workspace)
Creates a
ServerWorkspace instance. |
protected RemoteIterator |
optimizeIterator(RemoteIterator remote)
Optimizes the given remote iterator for transmission across the network.
|
void |
setBufferSize(int bufferSize)
Sets the iterator buffer size.
|
void |
setPortNumber(int portNumber)
Sets the port number for server objects.
|
public int getBufferSize()
public void setBufferSize(int bufferSize)
bufferSize
- iterator buffer sizepublic int getPortNumber()
getPortNumber
in interface RemoteAdapterFactory
public void setPortNumber(int portNumber)
portNumber
- port number, or 0 for the defaultpublic RemoteRepository getRemoteRepository(javax.jcr.Repository repository) throws RemoteException
ServerRepository
instance.
Returns a remote adapter for the given local repository.getRemoteRepository
in interface RemoteAdapterFactory
repository
- local repositoryRemoteException
- on RMI errorspublic RemoteSession getRemoteSession(javax.jcr.Session session) throws RemoteException
ServerSession
instance. In case the
underlying session is transaction enabled, the remote interface is will
be transaction enabled too through the ServerXASession
.
Returns a remote adapter for the given local session.getRemoteSession
in interface RemoteAdapterFactory
session
- local sessionRemoteException
- on RMI errorspublic RemoteWorkspace getRemoteWorkspace(javax.jcr.Workspace workspace) throws RemoteException
ServerWorkspace
instance. Returns a remote adapter for the given local workspace.getRemoteWorkspace
in interface RemoteAdapterFactory
workspace
- local workspaceRemoteException
- on RMI errorspublic RemoteObservationManager getRemoteObservationManager(javax.jcr.observation.ObservationManager observationManager) throws RemoteException
ServerObservationManager
instance. Returns a remote adapter for the given local observation manager.getRemoteObservationManager
in interface RemoteAdapterFactory
observationManager
- local observation managerRemoteException
- on RMI errorspublic RemoteNamespaceRegistry getRemoteNamespaceRegistry(javax.jcr.NamespaceRegistry registry) throws RemoteException
ServerNamespaceRegistry
instance. Returns a remote adapter for the given local namespace registry.getRemoteNamespaceRegistry
in interface RemoteAdapterFactory
registry
- local namespace registryRemoteException
- on RMI errorspublic RemoteNodeTypeManager getRemoteNodeTypeManager(javax.jcr.nodetype.NodeTypeManager manager) throws RemoteException
ServerNodeTypeManager
instance.
Returns a remote adapter for the given local node type manager.getRemoteNodeTypeManager
in interface RemoteAdapterFactory
manager
- local node type managerRemoteException
- on RMI errorspublic RemoteItem getRemoteItem(javax.jcr.Item item) throws RemoteException
ServerItem
instance. Returns a remote adapter for the given local item. This method
will return an adapter that implements only the
Item
interface. The caller may want to introspect
the local item to determine whether to use either the
getRemoteNode
or the
getRemoteProperty
method instead.getRemoteItem
in interface RemoteAdapterFactory
item
- local itemRemoteException
- on RMI errorspublic RemoteProperty getRemoteProperty(javax.jcr.Property property) throws RemoteException
ServerProperty
instance. Returns a remote adapter for the given local property.getRemoteProperty
in interface RemoteAdapterFactory
property
- local propertyRemoteException
- on RMI errorspublic RemoteNode getRemoteNode(javax.jcr.Node node) throws RemoteException
ServerNode
instance. Returns a remote adapter for the given local node.getRemoteNode
in interface RemoteAdapterFactory
node
- local nodeRemoteException
- on RMI errorspublic RemoteVersion getRemoteVersion(javax.jcr.version.Version version) throws RemoteException
ServerVersion
instance. Returns a remote adapter for the given local version.getRemoteVersion
in interface RemoteAdapterFactory
version
- local versionRemoteException
- on RMI errorspublic RemoteVersionHistory getRemoteVersionHistory(javax.jcr.version.VersionHistory versionHistory) throws RemoteException
ServerVersionHistory
instance.
Returns a remote adapter for the given local version history.getRemoteVersionHistory
in interface RemoteAdapterFactory
versionHistory
- local version historyRemoteException
- on RMI errorspublic RemoteNodeType getRemoteNodeType(javax.jcr.nodetype.NodeType type) throws RemoteException
ServerNodeType
instance. Returns a remote adapter for the given local node type.getRemoteNodeType
in interface RemoteAdapterFactory
type
- local node typeRemoteException
- on RMI errorspublic RemoteItemDefinition getRemoteItemDefinition(javax.jcr.nodetype.ItemDefinition def) throws RemoteException
ServerItemDefinition
instance.
Returns a remote adapter for the given local item definition.
This method will return an adapter that implements only the
ItemDefinition
interface. The caller may want to introspect
the local item definition to determine whether to use either the
getRemoteNodeDef
or the
getRemotePropertyDef
method instead.getRemoteItemDefinition
in interface RemoteAdapterFactory
def
- local item definitionRemoteException
- on RMI errorspublic RemoteNodeDefinition getRemoteNodeDefinition(javax.jcr.nodetype.NodeDefinition def) throws RemoteException
ServerNodeDefinition
instance.
Returns a remote adapter for the given local node definition.getRemoteNodeDefinition
in interface RemoteAdapterFactory
def
- local node definitionRemoteException
- on RMI errorspublic RemotePropertyDefinition getRemotePropertyDefinition(javax.jcr.nodetype.PropertyDefinition def) throws RemoteException
ServerPropertyDefinition
instance. Returns a remote adapter for the given local property definition.getRemotePropertyDefinition
in interface RemoteAdapterFactory
def
- local property definitionRemoteException
- on RMI errorspublic RemoteLock getRemoteLock(javax.jcr.lock.Lock lock) throws RemoteException
ServerLock
instance. Returns a remote adapter for the given local lock.getRemoteLock
in interface RemoteAdapterFactory
lock
- local lockRemoteException
- on RMI errorspublic RemoteQueryManager getRemoteQueryManager(javax.jcr.Session session, javax.jcr.query.QueryManager manager) throws RemoteException
ServerQueryManager
instance.
Returns a remote adapter for the given local query manager.getRemoteQueryManager
in interface RemoteAdapterFactory
session
- current sessionmanager
- local query managerRemoteException
- on RMI errorspublic RemoteQuery getRemoteQuery(javax.jcr.query.Query query) throws RemoteException
ServerQuery
instance. Returns a remote adapter for the given local query.getRemoteQuery
in interface RemoteAdapterFactory
query
- local queryRemoteException
- on RMI errorspublic RemoteQueryResult getRemoteQueryResult(javax.jcr.query.QueryResult result) throws RemoteException
ServerQueryResult
instance.
Returns a remote adapter for the given local query result.getRemoteQueryResult
in interface RemoteAdapterFactory
result
- local query resultRemoteException
- on RMI errorspublic RemoteRow getRemoteRow(javax.jcr.query.Row row) throws RemoteException
ServerQueryResult
instance.
Returns a remote adapter for the given local query row.getRemoteRow
in interface RemoteAdapterFactory
row
- local query rowRemoteException
- on RMI errorspublic RemoteEventCollection getRemoteEvent(long listenerId, javax.jcr.observation.EventIterator events) throws RemoteException
ServerEventCollection
instances.
Returns a remote adapter for the given local events.getRemoteEvent
in interface RemoteAdapterFactory
listenerId
- The listener identifier to which the events are to be
dispatched.events
- the local eventsRemoteException
- on RMI errorsprotected RemoteIterator optimizeIterator(RemoteIterator remote) throws RemoteException
RemoteIterator.nextObjects()
and then asks for the total
size of the iterator. If the size is unkown or greater than the length of
the retrieved array, then the elements, the size, and the remote iterator
reference are wrapped into a BufferIterator
instance that gets
passed over the network. If the retrieved array of elements contains all
the elements in the iterator, then the iterator instance is discarded and
just the elements are wrapped into a ArrayIterator
instance to be
passed to the client.
Subclasses can override this method to provide alternative optimizations.
remote
- remote iteratorRemoteException
- on RMI errorspublic RemoteIterator getRemoteNodeIterator(javax.jcr.NodeIterator iterator) throws RemoteException
ServerNodeIterator
instance. Returns a remote adapter for the given local node iterator.getRemoteNodeIterator
in interface RemoteAdapterFactory
iterator
- local node iteratorRemoteException
- on RMI errorspublic RemoteIterator getRemotePropertyIterator(javax.jcr.PropertyIterator iterator) throws RemoteException
ServerPropertyIterator
instance. Returns a remote adapter for the given local property iterator.getRemotePropertyIterator
in interface RemoteAdapterFactory
iterator
- local property iteratorRemoteException
- on RMI errorspublic RemoteIterator getRemoteVersionIterator(javax.jcr.version.VersionIterator iterator) throws RemoteException
ServerVersionIterator
instance. Returns a remote adapter for the given local version iterator.getRemoteVersionIterator
in interface RemoteAdapterFactory
iterator
- local version iteratorRemoteException
- on RMI errorspublic RemoteIterator getRemoteNodeTypeIterator(javax.jcr.nodetype.NodeTypeIterator iterator) throws RemoteException
ServerNodeTypeIterator
instance. Returns a remote adapter for the given local node type iterator.getRemoteNodeTypeIterator
in interface RemoteAdapterFactory
iterator
- local node type iteratorRemoteException
- on RMI errorspublic RemoteIterator getRemoteRowIterator(javax.jcr.query.RowIterator iterator) throws RemoteException
ServerRowIterator
instance. Returns a remote adapter for the given local row iterator.getRemoteRowIterator
in interface RemoteAdapterFactory
iterator
- local row iteratorRemoteException
- on RMI errorspublic RemoteLockManager getRemoteLockManager(javax.jcr.lock.LockManager lockManager) throws RemoteException
getRemoteLockManager
in interface RemoteAdapterFactory
RemoteException
public RemoteVersionManager getRemoteVersionManager(javax.jcr.Session session, javax.jcr.version.VersionManager versionManager) throws RemoteException
getRemoteVersionManager
in interface RemoteAdapterFactory
RemoteException
public RemoteAccessControlManager getRemoteAccessControlManager(javax.jcr.security.AccessControlManager acm) throws RemoteException
ServerAccessControlManager
instance. Returns a remote adapter for the given local access control manager.getRemoteAccessControlManager
in interface RemoteAdapterFactory
acm
- local access control managerRemoteException
- on RMI errorspublic RemotePrivilege getRemotePrivilege(javax.jcr.security.Privilege local) throws RemoteException
RemoteAdapterFactory
getRemotePrivilege
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemotePrivilege[] getRemotePrivilege(javax.jcr.security.Privilege[] local) throws RemoteException
RemoteAdapterFactory
getRemotePrivilege
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteAccessControlPolicy getRemoteAccessControlPolicy(javax.jcr.security.AccessControlPolicy local) throws RemoteException
RemoteAdapterFactory
getRemoteAccessControlPolicy
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteAccessControlPolicy[] getRemoteAccessControlPolicy(javax.jcr.security.AccessControlPolicy[] local) throws RemoteException
RemoteAdapterFactory
getRemoteAccessControlPolicy
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteIterator getRemoteAccessControlPolicyIterator(javax.jcr.security.AccessControlPolicyIterator iterator) throws RemoteException
ServerNodeIterator
instance. Returns a remote adapter for the given local access control manager.getRemoteAccessControlPolicyIterator
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteAccessControlEntry getRemoteAccessControlEntry(javax.jcr.security.AccessControlEntry local) throws RemoteException
RemoteAdapterFactory
getRemoteAccessControlEntry
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteAccessControlEntry[] getRemoteAccessControlEntry(javax.jcr.security.AccessControlEntry[] local) throws RemoteException
RemoteAdapterFactory
getRemoteAccessControlEntry
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemotePrincipal getRemotePrincipal(Principal principal) throws RemoteException
RemoteAdapterFactory
getRemotePrincipal
in interface RemoteAdapterFactory
RemoteException
- on RMI errorspublic RemoteIterator getRemotePrincipalIterator(Iterator<Principal> principals) throws RemoteException
RemoteAdapterFactory
getRemotePrincipalIterator
in interface RemoteAdapterFactory
RemoteException
- on RMI errorsCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.