org.modeshape.jboss.managed
Class ManagedRepository

java.lang.Object
  extended by org.modeshape.jboss.managed.ManagedRepository
All Implemented Interfaces:
ModeShapeManagedObject

public class ManagedRepository
extends Object
implements ModeShapeManagedObject

The ManagedRepository is a JBoss managed object for a repository.


Constructor Summary
ManagedRepository()
           
ManagedRepository(JcrRepository repository)
          Creates a JBoss managed object for the specified repository.
 
Method Summary
 String getName()
          Obtains the options configured for this repository.
 int getQueryActivity()
           
 int getSaveActivity()
           
 Object getSessionActivity()
           
 String getVersion()
          Obtains the JCR version supported by this repository.
 List<ManagedLock> listLocks()
          Obtains all the repository locks sorted by owner.
 List<ManagedLock> listLocks(Comparator<ManagedLock> lockSorter)
          Obtains all the repository locks sorted by the specified sorter.
 List<ManagedSession> listSessions()
          Obtains all the repository sessions sorted by user name.
 List<ManagedSession> listSessions(Comparator<ManagedSession> sessionSorter)
          Obtains all the repository sessions sorted by the specified sorter.
 boolean removeLock(String lockId)
          Removes the lock with the specified identifier.
 void setName(String name)
          The name for this repository.
 void setVersion(String version)
          The version support for this repository.
 boolean terminateSession(String sessionId)
          Terminates the session with the specified identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedRepository

public ManagedRepository()

ManagedRepository

public ManagedRepository(JcrRepository repository)
Creates a JBoss managed object for the specified repository.

Parameters:
repository - the repository being managed (never null)
Method Detail

getName

public String getName()
Obtains the options configured for this repository. This is a JBoss managed readonly property.

Returns:
String name (can be null)

setName

public void setName(String name)
The name for this repository.

Parameters:
name -

getVersion

public String getVersion()
Obtains the JCR version supported by this repository. This is a JBoss managed readonly property.

Returns:
String version (never null)

setVersion

public void setVersion(String version)
The version support for this repository.

Parameters:
version -

getQueryActivity

public int getQueryActivity()

getSaveActivity

public int getSaveActivity()

getSessionActivity

public Object getSessionActivity()

listLocks

public List<ManagedLock> listLocks()
Obtains all the repository locks sorted by owner. This is a JBoss managed operation.

Returns:
a list of sessions sorted by owner (never null)

listLocks

public List<ManagedLock> listLocks(Comparator<ManagedLock> lockSorter)
Obtains all the repository locks sorted by the specified sorter.

Parameters:
lockSorter - the lock sorter (never null)
Returns:
a list of locks sorted by the specified lock sorter (never null)

listSessions

public List<ManagedSession> listSessions()
Obtains all the repository sessions sorted by user name. This is a JBoss managed operation.

Returns:
a list of sessions sorted by user name (never null)

listSessions

public List<ManagedSession> listSessions(Comparator<ManagedSession> sessionSorter)
Obtains all the repository sessions sorted by the specified sorter.

Parameters:
sessionSorter - the session sorter (never null)
Returns:
a list of locks sorted by the specified session sorter (never null)

removeLock

public boolean removeLock(String lockId)
Removes the lock with the specified identifier. This is a JBoss managed operation.

Parameters:
lockId - the lock's identifier
Returns:
true if the lock was removed

terminateSession

public boolean terminateSession(String sessionId)
Terminates the session with the specified identifier. This is a JBoss managed operation.

Parameters:
sessionId - the session's identifier
Returns:
true if the session was terminated


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.