org.apache.jackrabbit.core.session
Class SessionItemOperation<T>

java.lang.Object
  extended by org.apache.jackrabbit.core.session.SessionItemOperation<T>
All Implemented Interfaces:
SessionOperation<T>

public abstract class SessionItemOperation<T>
extends Object
implements SessionOperation<T>

Session operation for accessing an item at a given path. See the static methods for factories of different kinds of item operations.


Method Summary
static SessionItemOperation<ItemImpl> getItem(String path)
          Creates a session operation for getting the item at the given path.
static SessionItemOperation<NodeImpl> getNode(String path)
          Creates a session operation for getting the node at the given path.
static SessionItemOperation<PropertyImpl> getProperty(String path)
          Creates a session operation for getting the property at the given path.
static SessionItemOperation<Boolean> itemExists(String path)
          Creates a session operation for checking the existence of an item at the given path.
static SessionItemOperation<Boolean> nodeExists(String path)
          Creates a session operation for checking the existence of a node at the given path.
protected abstract  T perform(ItemManager manager, Path path)
          Performs this operation using the given item manager.
 T perform(SessionContext context)
          Performs this operation on the specified item.
static SessionItemOperation<Boolean> propertyExists(String path)
          Creates a session operation for checking the existence of a property at the given path.
static SessionItemOperation<Object> remove(String path)
          Creates a session operation for removing the item at the given path.
 String toString()
          Returns a string representation of this operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

itemExists

public static SessionItemOperation<Boolean> itemExists(String path)
Creates a session operation for checking the existence of an item at the given path.

Parameters:
path - absolute path of the item
Returns:
session operation

propertyExists

public static SessionItemOperation<Boolean> propertyExists(String path)
Creates a session operation for checking the existence of a property at the given path.

Parameters:
path - absolute path of the property
Returns:
session operation

nodeExists

public static SessionItemOperation<Boolean> nodeExists(String path)
Creates a session operation for checking the existence of a node at the given path.

Parameters:
path - absolute path of the node
Returns:
session operation

getItem

public static SessionItemOperation<ItemImpl> getItem(String path)
Creates a session operation for getting the item at the given path.

Parameters:
path - absolute path of the item
Returns:
session operation

getProperty

public static SessionItemOperation<PropertyImpl> getProperty(String path)
Creates a session operation for getting the property at the given path.

Parameters:
path - absolute path of the property
Returns:
session operation

getNode

public static SessionItemOperation<NodeImpl> getNode(String path)
Creates a session operation for getting the node at the given path.

Parameters:
path - absolute path of the node
Returns:
session operation

remove

public static SessionItemOperation<Object> remove(String path)
Creates a session operation for removing the item at the given path.

Parameters:
path - absolute path of the item
Returns:
session operation

perform

public T perform(SessionContext context)
          throws RepositoryException
Performs this operation on the specified item. This method resolves the given absolute path and calls the abstract perform(ItemManager, Path) method to actually perform the selected operation.

Specified by:
perform in interface SessionOperation<T>
Parameters:
context - component context of this session
Throws:
RepositoryException - if the operation fails

perform

protected abstract T perform(ItemManager manager,
                             Path path)
                      throws RepositoryException
Performs this operation using the given item manager.

Parameters:
manager - item manager of this session
path - resolved path of the item
Throws:
RepositoryException - if the operation fails

toString

public String toString()
Returns a string representation of this operation.

Overrides:
toString in class Object
Returns:
"getItem(/path/to/item)", etc.


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