org.apache.jackrabbit.session.nodetype
Class SessionNodeTypeManager

java.lang.Object
  extended byorg.apache.jackrabbit.base.nodetype.BaseNodeTypeManager
      extended byorg.apache.jackrabbit.session.nodetype.SessionNodeTypeManager
All Implemented Interfaces:
NodeTypeManager

public final class SessionNodeTypeManager
extends BaseNodeTypeManager
implements NodeTypeManager

Immutable and session-bound node type manager frontend. An instance of this class presents the underlying node type manager state using the JCR NodeTypeManager interface.

By not exposing the setter methods of the underlying state instance, this class intentionally makes it impossible for a JCR client to modify node type information.


Constructor Summary
SessionNodeTypeManager(SessionHelper helper, NodeTypeManagerState state)
          Creates a node type manager frontend that is bound to the given session and underlying node type manager state.
 
Method Summary
 boolean equals(Object that)
          Compares objects for equality.
 NodeTypeIterator getAllNodeTypes()
          Returns all available node types.
 int hashCode()
          Returns a hash code for this object.
 
Methods inherited from class org.apache.jackrabbit.base.nodetype.BaseNodeTypeManager
getMixinNodeTypes, getNodeType, getPrimaryNodeTypes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.nodetype.NodeTypeManager
getMixinNodeTypes, getNodeType, getPrimaryNodeTypes
 

Constructor Detail

SessionNodeTypeManager

public SessionNodeTypeManager(SessionHelper helper,
                              NodeTypeManagerState state)
Creates a node type manager frontend that is bound to the given session and underlying node type manager state.

Parameters:
helper - helper for accessing the current session
state - underlying node type manager state
Method Detail

getAllNodeTypes

public NodeTypeIterator getAllNodeTypes()
Returns all available node types. The returned node types are SessionNodeTypes instantiated using the node type states returned by the underlying node type manager state.

Specified by:
getAllNodeTypes in interface NodeTypeManager
Overrides:
getAllNodeTypes in class BaseNodeTypeManager
Returns:
all node types
See Also:
SessionNodeType, NodeTypeManager.getAllNodeTypes(), NodeTypeManagerState.getNodeTypeStates()

equals

public boolean equals(Object that)
Compares objects for equality. Returns true if the given object is a SessionNodeTypeManager with the same underlying node type manager state and session.

Note that the node type manager state class does not override the equals method and thus the mutable state instances are compared for reference equality.

Parameters:
that - the object to compare this object with
Returns:
true if the objects are equal, false otherwise
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Returns a hash code for this object. To satisfy the equality constraints the returned hash code is a combination of the hash codes of the underlying node type manager state and session.

Returns:
hash code
See Also:
Object.hashCode()


Copyright © 2004-2005 . All Rights Reserved.