org.apache.jackrabbit.rmi.client
Class ClientObject

java.lang.Object
  extended byorg.apache.jackrabbit.rmi.client.ClientObject
Direct Known Subclasses:
ClientItem, ClientItemDefinition, ClientNamespaceRegistry, ClientNodeType, ClientNodeTypeManager, ClientObservationManager, ClientQuery, ClientQueryManager, ClientQueryResult, ClientRepository, ClientSession, ClientWorkspace

public class ClientObject
extends Object

Base class for client adapter objects. The only purpose of this class is to centralize the handling of the local adapter factory used by the client adapters to instantiate new adapters.

Author:
Jukka Zitting

Constructor Summary
protected ClientObject(LocalAdapterFactory factory)
          Creates a basic client adapter that uses the given factory to create new adapters.
 
Method Summary
protected  LocalAdapterFactory getFactory()
          Returns the local adapter factory used to create new adapters.
protected  Item getItem(Session session, RemoteItem remote)
          Utility method to create a local adapter for a remote item.
protected  Node getNode(Session session, RemoteNode remote)
          Utility method to create a local adapter for a remote node.
protected  NodeDefinition[] getNodeDefArray(RemoteNodeDefinition[] remotes)
          Utility method for creating an array of local node definition adapters for an array of remote node definitions.
protected  NodeIterator getNodeIterator(Session session, RemoteNode[] remotes)
          Utility method for creating a node iterator for an array of remote nodes.
protected  NodeType[] getNodeTypeArray(RemoteNodeType[] remotes)
          Utility method for creating an array of local node type adapters for an array of remote node types.
protected  NodeTypeIterator getNodeTypeIterator(RemoteNodeType[] remotes)
          Utility method for creating an iterator of local node type adapters for an array of remote node types.
protected  PropertyDefinition[] getPropertyDefArray(RemotePropertyDefinition[] remotes)
          Utility method for creating an array of local property definition adapters for an array of remote property definitions.
protected  PropertyIterator getPropertyIterator(Session session, RemoteProperty[] remotes)
          Utility method for creating a property iterator for an array of remote properties.
protected  Version[] getVersionArray(Session session, RemoteVersion[] remotes)
          Utility method for creating a version array for an array of remote versions.
protected  VersionIterator getVersionIterator(Session session, RemoteVersion[] remotes)
          Utility method for creating a version iterator for an array of remote versions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientObject

protected ClientObject(LocalAdapterFactory factory)
Creates a basic client adapter that uses the given factory to create new adapters.

Parameters:
factory - local adapter factory
Method Detail

getFactory

protected LocalAdapterFactory getFactory()
Returns the local adapter factory used to create new adapters.

Returns:
local adapter factory

getItem

protected Item getItem(Session session,
                       RemoteItem remote)
Utility method to create a local adapter for a remote item. This method introspects the remote reference to determine whether to instantiate a Property, a Node, or an Item adapter using the local adapter factory.

If the remote item is a RemoteNode, this method delegates to getNode(Session, RemoteNode).

Parameters:
session - current session
remote - remote item
Returns:
local property, node, or item adapter

getNode

protected Node getNode(Session session,
                       RemoteNode remote)
Utility method to create a local adapter for a remote node. This method introspects the remote reference to determine whether to instantiate a Node, a VersionHistory, or a Version adapter using the local adapter factory.

Parameters:
session - current session
remote - remote node
Returns:
local node, version, or version history adapter

getPropertyIterator

protected PropertyIterator getPropertyIterator(Session session,
                                               RemoteProperty[] remotes)
Utility method for creating a property iterator for an array of remote properties. The properties in the returned iterator are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
session - current session
remotes - remote properties
Returns:
local property iterator

getNodeIterator

protected NodeIterator getNodeIterator(Session session,
                                       RemoteNode[] remotes)
Utility method for creating a node iterator for an array of remote nodes. The nodes in the returned iterator are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
session - current session
remotes - remote nodes
Returns:
local node iterator

getVersionArray

protected Version[] getVersionArray(Session session,
                                    RemoteVersion[] remotes)
Utility method for creating a version array for an array of remote versions. The versions in the returned array are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
session - current session
remotes - remote versions
Returns:
local version array

getVersionIterator

protected VersionIterator getVersionIterator(Session session,
                                             RemoteVersion[] remotes)
Utility method for creating a version iterator for an array of remote versions. The versions in the returned iterator are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
session - current session
remotes - remote versions
Returns:
local version iterator

getNodeTypeArray

protected NodeType[] getNodeTypeArray(RemoteNodeType[] remotes)
Utility method for creating an array of local node type adapters for an array of remote node types. The node type adapters are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
remotes - remote node types
Returns:
local node type array

getNodeTypeIterator

protected NodeTypeIterator getNodeTypeIterator(RemoteNodeType[] remotes)
Utility method for creating an iterator of local node type adapters for an array of remote node types. The node type adapters are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
remotes - remote node types
Returns:
local node type iterator

getNodeDefArray

protected NodeDefinition[] getNodeDefArray(RemoteNodeDefinition[] remotes)
Utility method for creating an array of local node definition adapters for an array of remote node definitions. The node definition adapters are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
remotes - remote node definitions
Returns:
local node definition array

getPropertyDefArray

protected PropertyDefinition[] getPropertyDefArray(RemotePropertyDefinition[] remotes)
Utility method for creating an array of local property definition adapters for an array of remote property definitions. The property definition adapters are created using the local adapter factory.

A null input is treated as an empty array.

Parameters:
remotes - remote property definitions
Returns:
local property definition array


Copyright © 2004-2005 . All Rights Reserved.