org.apache.jackrabbit.session
Class SessionHelper

java.lang.Object
  extended byorg.apache.jackrabbit.session.SessionHelper

public final class SessionHelper
extends Object

Helper class for accessing the namespaces and node types associated with a JCR Session.


Constructor Summary
SessionHelper(Session session)
          Creates a helper for accessing the given session.
 
Method Summary
 boolean equals(Object that)
          Compares session helpers for equality.
 String getName(Name name)
          Returns the prefixed JCR name that represents the given qualified name.
 NodeType getNodeType(Name name)
          Returns the named node type.
 NodeType getNodeType(String name)
          Returns the named node type.
 int hashCode()
          Calculates the session helper hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionHelper

public SessionHelper(Session session)
Creates a helper for accessing the given session.

Parameters:
session - current session
Method Detail

getName

public String getName(Name name)
               throws IllegalStateException,
                      RuntimeException
Returns the prefixed JCR name that represents the given qualified name.

Parameters:
name - qualified name
Returns:
prefixed JCR name
Throws:
IllegalStateException - if the namespace does not exist
RuntimeException - if a repository error occurs

getNodeType

public NodeType getNodeType(Name name)
                     throws IllegalStateException,
                            RuntimeException
Returns the named node type. This method is used to convert qualified node type names to actual NodeType objects of the current node type manager. The returned node type is acquired using the standard JCR API starting with getWorkspace().getNodeTypeManager() from the current session.

Parameters:
name - qualified node type name
Returns:
named node type
Throws:
IllegalStateException - if the named node type does not exist
RuntimeException - if a repository error occurs

getNodeType

public NodeType getNodeType(String name)
                     throws IllegalStateException,
                            RuntimeException
Returns the named node type. This method is used to convert node type names to actual NodeType objects of the current node type manager. The returned node type is acquired using the standard JCR API starting with getWorkspace().getNodeTypeManager() from the current session.

Parameters:
name - node type name
Returns:
named node type
Throws:
IllegalStateException - if the named node type does not exist
RuntimeException - if a repository error occurs

equals

public boolean equals(Object that)
Compares session helpers for equality. Two session helpers are equal if they refer to the same session.

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

hashCode

public int hashCode()
Calculates the session helper hash code. This method simply returns the hash code of the underlying session.

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


Copyright © 2004-2005 . All Rights Reserved.