org.exoplatform.jcr.benchmark.usecases.portal
Class AbstractAction

java.lang.Object
  extended by org.exoplatform.jcr.benchmark.usecases.portal.AbstractAction
Direct Known Subclasses:
AbstractWriteAction, ReadPageAction

public abstract class AbstractAction
extends java.lang.Object

Action performing read usecase.

Version:
$Id: Action.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
Author:
Nikolay Zamosenchuk

Constructor Summary
AbstractAction(org.exoplatform.services.jcr.impl.core.RepositoryImpl repository, java.lang.String workspace, java.lang.String rootName, int depth)
           
 
Method Summary
protected  javax.jcr.Node getNodeOnLevel(javax.jcr.Node testRoot, int level)
           
 java.lang.String getRootNodeName()
           
 javax.jcr.Session getSession(boolean anonymous)
          Returns session, using ThreadLocalSessionProvider
 javax.jcr.Node nextNode(javax.jcr.Node testRoot)
          Returns next node from hierarchy tree in stochastic (random) order
 javax.jcr.Node nextParent(javax.jcr.Node testRoot)
          Returns next node from hierarchy tree in stochastic (random) order
 java.lang.String nextPropertyName()
          Generates next random property name by selecting random property type and single/multi value option.
abstract  void perform()
          Performs action on the page (possibly read, write or what ever)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAction

public AbstractAction(org.exoplatform.services.jcr.impl.core.RepositoryImpl repository,
                      java.lang.String workspace,
                      java.lang.String rootName,
                      int depth)
Parameters:
repository - Repository instance
workspace - Workspace name
rootName - Test's root node name
Method Detail

getRootNodeName

public java.lang.String getRootNodeName()
Returns:
The name of test's root node

getSession

public javax.jcr.Session getSession(boolean anonymous)
                             throws javax.jcr.RepositoryException
Returns session, using ThreadLocalSessionProvider

Parameters:
anonymous - If true, then anonymous session is returned
Returns:
Throws:
javax.jcr.RepositoryException

nextNode

public javax.jcr.Node nextNode(javax.jcr.Node testRoot)
                        throws javax.jcr.RepositoryException
Returns next node from hierarchy tree in stochastic (random) order

Parameters:
testRoot - Node to start from
Returns:
Throws:
javax.jcr.RepositoryException

nextParent

public javax.jcr.Node nextParent(javax.jcr.Node testRoot)
                          throws javax.jcr.RepositoryException
Returns next node from hierarchy tree in stochastic (random) order

Parameters:
testRoot -
Returns:
Throws:
javax.jcr.RepositoryException

getNodeOnLevel

protected javax.jcr.Node getNodeOnLevel(javax.jcr.Node testRoot,
                                        int level)
                                 throws javax.jcr.RepositoryException
Parameters:
testRoot -
level -
Returns:
Throws:
javax.jcr.RepositoryException

nextPropertyName

public java.lang.String nextPropertyName()
Generates next random property name by selecting random property type and single/multi value option.

Returns:

perform

public abstract void perform()
                      throws javax.jcr.RepositoryException
Performs action on the page (possibly read, write or what ever)

Throws:
javax.jcr.RepositoryException


Copyright © 2010 eXo Platform SAS. All Rights Reserved.