|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.jetspeed.services.psmlmanager.CastorPsmlManagerService
This service is responsible for loading and saving PSML documents.
Nested Class Summary | |
protected class |
CastorPsmlManagerService.QueryState
|
Field Summary | |
protected int |
cacheSize
the default cache size |
protected static java.lang.String |
CONFIG_CACHE_SIZE
|
protected static java.lang.String |
CONFIG_EXT
|
protected static java.lang.String |
CONFIG_ROOT
|
protected static java.lang.String |
CONFIG_SCAN_RATE
|
protected PsmlManagerService |
consumer
the import/export consumer service |
static java.lang.String |
DEFAULT_EXT
|
static java.lang.String |
DEFAULT_MAPPING
|
static java.lang.String |
DEFAULT_RESOURCE
|
static java.lang.String |
DEFAULT_ROOT
|
protected java.lang.String |
defaultEncoding
The default encoding used to serialize PSML files to disk |
protected FileCache |
documents
The documents loaded by this manager |
protected boolean |
enableMessaging
|
protected java.lang.String |
ext
|
protected org.apache.xml.serialize.OutputFormat |
format
the output format for pretty printing when saving registries |
protected boolean |
importFlag
|
protected static JetspeedLogger |
logger
Static initialization of the logger for this class |
protected java.lang.String |
mapFile
|
protected org.exolab.castor.mapping.Mapping |
mapping
the Castor mapping file name |
protected static java.lang.String |
PATH_GROUP
|
protected static java.lang.String |
PATH_ROLE
|
protected static java.lang.String |
PATH_USER
|
protected java.lang.String |
root
|
protected java.io.File |
rootDir
|
protected long |
scanRate
the base refresh rate for documents |
protected static int |
STATE_BASE
|
protected static int |
STATE_COUNTRY
|
protected static int |
STATE_INIT
|
protected static int |
STATE_LANGUAGE
|
protected static int |
STATE_MEDIA
|
protected static int |
STATE_NAME
|
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, properties, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.jetspeed.services.psmlmanager.PsmlManagerService |
SERVICE_NAME |
Constructor Summary | |
CastorPsmlManagerService()
|
Method Summary | |
PSMLDocument |
createDocument(Profile profile)
Create a new document. |
protected javax.jms.Message |
createMessage(java.io.Serializable messageObject)
|
protected Profile |
createProfile()
Create a profile based on import flag. |
protected Profile |
createProfile(ProfileLocator locator)
|
protected void |
dump(java.util.Iterator it)
|
protected void |
dumpProfile(Profile profile)
|
void |
evict(FileCacheEntry entry)
Evict event, called when the entry is being evicted out of the cache |
int |
export(PsmlManagerService consumer,
QueryLocator locator)
Query for a collection of profiles given a profile locator criteria. |
PSMLDocument |
getDocument(java.util.List locators)
Given a ordered list of locators, find the first document matching a profile locator, starting from the beginning of the list and working to the end. |
PSMLDocument |
getDocument(ProfileLocator locator)
Returns a cached PSML document for the given locator |
protected PSMLDocument |
getDocument(ProfileLocator locator,
boolean getCached)
Returns a PSML document for the given locator |
PSMLDocument |
getDocument(java.lang.String name)
Deprecated. |
protected java.io.File |
getFile(java.lang.String fileOrUrl)
Tests wether the passed argument is an URL string or a file name and returns the corresponding file object, using diskcache for remote URLs |
void |
init()
Late init method from Turbine Service model |
void |
init(javax.servlet.ServletConfig conf)
This is the early initialization method called by the Turbine Service framework |
protected Portlets |
load(java.io.Reader reader)
Deserializes a PSML structure read from the reader using Castor XML unmarshaller |
protected PSMLDocument |
loadDocument(java.lang.String fileOrUrl)
Load a PSMLDOcument from disk |
protected void |
loadMapping()
|
protected java.lang.String |
mapLocatorToFile(ProfileLocator locator)
Maps a ProfileLocator to a file. |
void |
onMessage(javax.jms.Message message)
|
java.util.Iterator |
query(QueryLocator locator)
Query for a collection of profiles given a profile locator criteria. |
void |
refresh(FileCacheEntry entry)
Refresh event, called when the entry is being refreshed from file system. |
PSMLDocument |
refresh(ProfileLocator locator)
Loads a PSML document from disk bypassing the cache |
void |
removeDocument(ProfileLocator locator)
Removes a document. |
void |
removeDocument(ProfileLocator locator,
boolean sendMessage)
|
void |
removeGroupDocuments(Group group)
Removes all documents for a given group. |
void |
removeGroupDocuments(Group group,
boolean sendMessage)
|
void |
removeRoleDocuments(Role role)
Removes all documents for a given role. |
void |
removeRoleDocuments(Role role,
boolean sendMessage)
|
void |
removeUserDocuments(JetspeedUser user)
Removes all documents for a given user. |
void |
removeUserDocuments(JetspeedUser user,
boolean sendMessage)
|
protected void |
save(java.io.Writer writer,
Portlets portlets)
Serializes a PSML structure using the specified writer with Castor XML marshaller and a Xerces serializer for pretty printing |
boolean |
saveDocument(PSMLDocument doc)
Deprecated. |
boolean |
saveDocument(java.lang.String fileOrUrl,
PSMLDocument doc)
Save the PSML document on disk to the specififed fileOrUrl |
void |
shutdown()
This is the shutdown method called by the Turbine Service framework |
boolean |
store(Profile profile)
Store the PSML document on disk, using its locator |
protected void |
subQuery(CastorPsmlManagerService.QueryState qs,
java.lang.String path)
Query for a collection of profiles given a profile locator criteria. |
protected void |
testCases()
|
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker |
Field Detail |
protected static final JetspeedLogger logger
protected static final java.lang.String PATH_GROUP
protected static final java.lang.String PATH_ROLE
protected static final java.lang.String PATH_USER
protected static final java.lang.String CONFIG_ROOT
protected static final java.lang.String CONFIG_EXT
protected static final java.lang.String CONFIG_SCAN_RATE
protected static final java.lang.String CONFIG_CACHE_SIZE
public static final java.lang.String DEFAULT_ROOT
public static final java.lang.String DEFAULT_EXT
public static final java.lang.String DEFAULT_RESOURCE
protected java.lang.String root
protected java.io.File rootDir
protected java.lang.String ext
protected FileCache documents
protected org.apache.xml.serialize.OutputFormat format
protected long scanRate
protected int cacheSize
protected PsmlManagerService consumer
protected boolean importFlag
public static final java.lang.String DEFAULT_MAPPING
protected java.lang.String mapFile
protected org.exolab.castor.mapping.Mapping mapping
protected java.lang.String defaultEncoding
protected boolean enableMessaging
protected static int STATE_INIT
protected static int STATE_BASE
protected static int STATE_NAME
protected static int STATE_MEDIA
protected static int STATE_LANGUAGE
protected static int STATE_COUNTRY
Constructor Detail |
public CastorPsmlManagerService()
Method Detail |
public void init(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
Service
framework
org.apache.turbine.services.InitializationException
public void init() throws org.apache.turbine.services.InitializationException
init
in interface org.apache.turbine.services.Initable
org.apache.turbine.services.InitializationException
public void shutdown()
Service
framework
shutdown
in interface org.apache.turbine.services.Initable
public PSMLDocument getDocument(java.lang.String name)
getDocument
in interface PsmlManagerService
name
- the name of the document to retrievepublic PSMLDocument getDocument(ProfileLocator locator)
getDocument
in interface PsmlManagerService
locator
- The locator descriptor of the document to be retrieved.
protected PSMLDocument getDocument(ProfileLocator locator, boolean getCached)
locator
- The locator descriptor of the document to be retrieved.getCached
- Look in the cache (true) or umarshall a fresh copy from disk (false)
public PSMLDocument refresh(ProfileLocator locator)
refresh
in interface PsmlManagerService
locator
-
protected PSMLDocument loadDocument(java.lang.String fileOrUrl)
fileOrUrl
- a String representing either an absolute URL or an
absolute filepathpublic boolean store(Profile profile)
store
in interface PsmlManagerService
profile
- the profile locator description.
public boolean saveDocument(PSMLDocument doc)
saveDocument
in interface PsmlManagerService
doc
- the document to save
public boolean saveDocument(java.lang.String fileOrUrl, PSMLDocument doc)
saveDocument
in interface PsmlManagerService
fileOrUrl
- a String representing either an absolute URL
or an absolute filepathdoc
- the document to save
protected Portlets load(java.io.Reader reader) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, org.exolab.castor.mapping.MappingException
reader
- the reader to load the PSML from
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
org.exolab.castor.mapping.MappingException
protected void loadMapping() throws org.apache.turbine.services.InitializationException
org.apache.turbine.services.InitializationException
protected void save(java.io.Writer writer, Portlets portlets) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, org.exolab.castor.mapping.MappingException
writer
- the writer to use for serializationportlets
- the structure to save
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
org.exolab.castor.mapping.MappingException
protected java.io.File getFile(java.lang.String fileOrUrl)
fileOrUrl
- the URL string or file path
public PSMLDocument createDocument(Profile profile)
createDocument
in interface PsmlManagerService
profile
- The description and default value for the new document.
public PSMLDocument getDocument(java.util.List locators)
getDocument
in interface PsmlManagerService
public void removeDocument(ProfileLocator locator)
removeDocument
in interface PsmlManagerService
locator
- The description of the profile resource to be removed.public void removeDocument(ProfileLocator locator, boolean sendMessage)
public void removeUserDocuments(JetspeedUser user)
removeUserDocuments
in interface PsmlManagerService
user
- The user object.public void removeUserDocuments(JetspeedUser user, boolean sendMessage)
public void removeRoleDocuments(Role role)
removeRoleDocuments
in interface PsmlManagerService
role
- The role object.public void removeRoleDocuments(Role role, boolean sendMessage)
public void removeGroupDocuments(Group group)
removeGroupDocuments
in interface PsmlManagerService
group
- The group object.public void removeGroupDocuments(Group group, boolean sendMessage)
protected java.lang.String mapLocatorToFile(ProfileLocator locator)
locator
- The profile locator describing the PSML resource to be found.
public java.util.Iterator query(QueryLocator locator)
query
in interface PsmlManagerService
locator
- The profile locator criteria.
protected Profile createProfile()
protected Profile createProfile(ProfileLocator locator)
public int export(PsmlManagerService consumer, QueryLocator locator)
export
in interface PsmlManagerService
locator
- The profile locator criteria.consumer
- The PSML consumer service, receives PSML from this service.
protected void subQuery(CastorPsmlManagerService.QueryState qs, java.lang.String path)
protected void testCases()
protected void dump(java.util.Iterator it)
protected void dumpProfile(Profile profile)
public void refresh(FileCacheEntry entry)
refresh
in interface FileCacheEventListener
entry
- the entry being refreshed.public void evict(FileCacheEntry entry)
evict
in interface FileCacheEventListener
entry
- the entry being refreshed.protected javax.jms.Message createMessage(java.io.Serializable messageObject)
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |