|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.shotoku.ContentManager
public abstract class ContentManager
A base class which provides access to nodes and directories.
Warning: all shotoku classes are not thread-safe.
| Field Summary | |
|---|---|
static java.util.Map<java.lang.String,Pair<java.lang.String,org.apache.commons.configuration.Configuration>> |
contentManagersImplementations
Map (content manager id -> pair (content manager class name, content manager configuration) |
| Constructor Summary | |
|---|---|
protected |
ContentManager(java.lang.String id,
java.lang.String prefix)
Standard constructor. |
| Method Summary | |
|---|---|
abstract void |
delete(java.util.Collection<Resource> resources)
Deletes the given resources at one time. |
void |
delete(Resource... resources)
Deletes the given resources at one time. |
void |
delete(Resource resource)
Deletes the given resource. |
static ContentManager |
getContentManager()
Gets a content manager with a default id and an empty prefix. |
static ContentManager |
getContentManager(java.lang.String prefix)
Gets a content manager with a default id and the given prefix. |
static ContentManager |
getContentManager(java.lang.String id,
java.lang.String prefix)
Gets a content manager with the given id and prefix. |
static int |
getDefaultServiceInterval()
Gets the default Shotoku service interval. |
abstract Directory |
getDirectory(java.lang.String path)
Gets a directory which can be found under the given path (to get nodes from subdirectories, use / to separate them). |
java.lang.String |
getId()
Gets the id of this repository. |
abstract Node |
getNode(java.lang.String path)
Gets the most recent version of a node which can be found under the given path (to get nodes from subdirectories, use / to separate
them). |
java.lang.String |
getPrefix()
Gets the prefix of this content manager. |
static int |
getProperty(java.lang.String name,
int defaultValue)
Gets a property of this content manager, as it is written in the configuration file (helper method for implementations). |
static long |
getProperty(java.lang.String name,
long defaultValue)
Gets a property of this content manager, as it is written in the configuration file (helper method for implementations). |
static java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Gets a property of this content manager, as it is written in the configuration file (helper method for implementations). |
abstract Directory |
getRootDirectory()
Gets a root directory that is represented by this content manager. |
static int |
getTransferBufferSize()
Gets the transfer buffer size. |
org.apache.velocity.app.VelocityEngine |
getVelocityEngine()
Gets a velocity engine, initialized with default properties, as defined in velocity.properties in the shotoku-base jar. |
org.apache.velocity.app.VelocityEngine |
getVelocityEngine(boolean addIdPrefix)
Gets a velocity engine, initialized with default properties, as defined in velocity.properties in the shotoku-base jar. |
org.apache.velocity.app.VelocityEngine |
getVelocityEngine(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> overProps,
boolean addIdPrefix)
Gets a velocity engine, initialized with default properties, overwritten by the given propeties. |
static void |
initializeContentManager(java.lang.String implementation)
|
static boolean |
isEmbedded()
Checks if Shotoku is configured to run in embedded mode or not. |
abstract void |
save(java.lang.String logMessage,
java.util.Collection<Resource> resources)
Saves the given resources at one time. |
void |
save(java.lang.String logMessage,
Resource... resources)
Saves the given resources at one time. |
void |
save(java.lang.String logMessage,
Resource res)
Saves the given resource. |
void |
save(java.lang.String logMessage,
Resource res1,
Resource res2)
Saves the given resources at one time. |
void |
save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3)
Saves the given resources at one time. |
void |
save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3,
Resource res4)
Saves the given resources at one time. |
void |
save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3,
Resource res4,
Resource res5)
Saves the given resources at one time. |
NodeList |
search(Search search)
Performs the given search in this content manager. |
static void |
setup()
Setups the content managers before first used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.Map<java.lang.String,Pair<java.lang.String,org.apache.commons.configuration.Configuration>> contentManagersImplementations
| Constructor Detail |
|---|
protected ContentManager(java.lang.String id,
java.lang.String prefix)
throws RepositoryException
id - Id of this content manager.prefix - Prefix of this content manager, as stated in properties.
RepositoryException| Method Detail |
|---|
public abstract Directory getRootDirectory()
throws RepositoryException
RepositoryException
public abstract Node getNode(java.lang.String path)
throws ResourceDoesNotExist,
RepositoryException
/ to separate
them).
path - Path for which to get the node.
ResourceDoesNotExist
RepositoryException
public abstract Directory getDirectory(java.lang.String path)
throws ResourceDoesNotExist,
RepositoryException
/ to separate them).
path - Path for which to get the directory.
ResourceDoesNotExist
RepositoryException
public NodeList search(Search search)
throws ResourceDoesNotExist
search - Search to perform.
ResourceDoesNotExistpublic java.lang.String getId()
public java.lang.String getPrefix()
public abstract void save(java.lang.String logMessage,
java.util.Collection<Resource> resources)
throws SaveException,
RepositoryException
logMessage - Log message to save with.resources - Resources to save.
SaveException
RepositoryException
public abstract void delete(java.util.Collection<Resource> resources)
throws DeleteException,
RepositoryException
resources - Resources to delete.
DeleteException
RepositoryException
public void delete(Resource resource)
throws DeleteException,
RepositoryException
resource - Resources to delete.
DeleteException
RepositoryException
public void save(java.lang.String logMessage,
Resource res)
throws SaveException,
RepositoryException
res.save(String).
res - First resource to save.logMessage - Log message to save with.
SaveException
RepositoryException
public void save(java.lang.String logMessage,
Resource... resources)
throws RepositoryException,
SaveException
logMessage - Log message to save with.resources - Any number of resources
RepositoryException
SaveException
public void delete(Resource... resources)
throws DeleteException,
RepositoryException
resources - Any number of resources to delete
DeleteException
RepositoryException
public void save(java.lang.String logMessage,
Resource res1,
Resource res2)
throws SaveException,
RepositoryException
save(Collection, String), where the collection is filled
with the two given resources.
logMessage - Log message to save with.res1 - First resource to save.res2 - Second resource to save.
SaveException
RepositoryException
public void save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3)
throws SaveException,
RepositoryException
save(Collection, String), where the collection is filled
with the three given resources.
logMessage - Log message to save with.res1 - First resource to save.res2 - Second resource to save.res3 - Third resource to save.
SaveException
RepositoryException
public void save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3,
Resource res4)
throws SaveException,
RepositoryException
save(Collection, String), where the collection is filled
with the four given resources.
logMessage - Log message to save with.res1 - First resource to save.res2 - Second resource to save.res3 - Third resource to save.res4 - Fourth resource to save.
SaveException
RepositoryException
public void save(java.lang.String logMessage,
Resource res1,
Resource res2,
Resource res3,
Resource res4,
Resource res5)
throws SaveException,
RepositoryException
save(Collection, String), where the collection is filled
with the five given resources.
logMessage - Log message to save with.res1 - First resource to save.res2 - Second resource to save.res3 - Third resource to save.res4 - Fourth resource to save.res5 - Fifth resource to save.
SaveException
RepositoryException
public org.apache.velocity.app.VelocityEngine getVelocityEngine()
throws java.lang.Exception
java.lang.Exception - In case of a velocity exception/ properties reading
exception.
public org.apache.velocity.app.VelocityEngine getVelocityEngine(boolean addIdPrefix)
throws java.lang.Exception
addIdPrefix - True iff id/ prefix properties should be added to the
properties.
java.lang.Exception - In case of a velocity exception/ properties reading
exception.
public org.apache.velocity.app.VelocityEngine getVelocityEngine(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> overProps,
boolean addIdPrefix)
throws java.lang.Exception
overProps - Properties which will be added to velocity configuration.
java.lang.Exception - In case of a velocity exception/ properties reading
exception.public static boolean isEmbedded()
public static void setup()
public static void initializeContentManager(java.lang.String implementation)
public static ContentManager getContentManager()
public static ContentManager getContentManager(java.lang.String prefix)
prefix - Prefix for the new content manager (all paths will have this
prepended).
public static ContentManager getContentManager(java.lang.String id,
java.lang.String prefix)
id - Id of the content manager.prefix - Prefix for the new content manager (all paths will have this
prepended).
public static long getProperty(java.lang.String name,
long defaultValue)
name - Name of the property to get.defaultValue - Value to return in case the given property is not set.
public static int getProperty(java.lang.String name,
int defaultValue)
name - Name of the property to get.defaultValue - Value to return in case the given property is not set.
public static java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
name - Name of the property to get.defaultValue - Value to return in case the given property is not set.
public static int getTransferBufferSize()
public static int getDefaultServiceInterval()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||