|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.BaseInitable org.apache.turbine.services.BaseService org.apache.turbine.services.TurbineBaseService org.apache.jetspeed.services.psmlmanager.db.DatabasePsmlManagerService
This service is responsible for loading and saving PSML documents. It uses database to persist the PSML documents.
Field Summary | |
protected static java.lang.String |
CACHING_ON
|
protected boolean |
cachingOn
whether caching is allowed |
protected PsmlManagerService |
consumer
the import/export consumer service |
protected static boolean |
DEFAULT_CACHING_ON
|
static java.lang.String |
DEFAULT_MAPPING
|
protected static long |
DEFAULT_REFRESH_RATE
|
protected boolean |
enableMessaging
|
protected static JetspeedLogger |
logger
Static initialization of the logger for this class |
protected org.exolab.castor.mapping.Mapping |
mapping
the Castor mapping file name |
protected static java.lang.String |
POOL_NAME
|
protected java.lang.String |
poolName
The pool name to use for database requests. |
protected java.util.Map |
psmlCache
|
protected static java.lang.String |
REFRESH_RATE
|
protected org.apache.jetspeed.services.psmlmanager.db.DatabasePsmlManagerService.CacheRefresher |
refresher
The watcher for the document locations |
protected long |
refreshRate
the base refresh rate for documents |
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 |
Fields inherited from interface org.apache.jetspeed.services.psmlmanager.db.DBOperations |
DELETE, INSERT, UPDATE |
Constructor Summary | |
DatabasePsmlManagerService()
|
Method Summary | |
PSMLDocument |
createDocument(Profile profile)
Stores the PSML document in DB for the given profile |
Profile |
createGroupProfile(org.apache.jetspeed.om.dbpsml.JetspeedGroupProfile entity,
Portlets portlets)
Creates a group profile from a JetspeedGroupProfile database object. |
protected PSMLDocument |
createOrSaveDocument(Profile profile,
int operation)
|
Profile |
createRoleProfile(org.apache.jetspeed.om.dbpsml.JetspeedRoleProfile entity,
Portlets portlets)
Creates a role profile from a JetspeedRoleProfile database object. |
Profile |
createUserProfile(org.apache.jetspeed.om.dbpsml.JetspeedUserProfile entity,
Portlets portlets)
Creates a user profile from a JetspeedUserProfile database object. |
int |
export(PsmlManagerService consumer,
QueryLocator locator)
Query for a collection of profiles given a profile locator criteria. |
protected java.sql.Connection |
getDbConnection()
Get a database connection to the default or specifed torque database pool |
PSMLDocument |
getDocument(java.util.List locators)
Given 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 PSML document for the given locator |
PSMLDocument |
getDocument(java.lang.String name)
Returns a PSML document of the given name. |
org.exolab.castor.mapping.Mapping |
getMapping()
|
protected java.util.List |
getProfiles(java.util.List data)
Get profile iterator from given list of objects. |
protected PSMLDocument |
getPSMLDocument(java.lang.String page,
Portlets portlets)
Get PSMLDocument object for given pagename and portlets. |
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 void |
initConfiguration(javax.servlet.ServletConfig conf)
Loads the configuration parameters for this service from the JetspeedResources.properties file. |
protected void |
loadMapping()
|
protected java.lang.String |
locatorToString(ProfileLocator locator)
Return a unique string identifying this object. |
void |
onMessage(javax.jms.Message message)
|
java.util.Iterator |
query(QueryLocator locator)
Query for a collection of profiles given a profile locator criteria. |
PSMLDocument |
refresh(ProfileLocator locator)
Returns a PSML document for the given locator, it is called by the cache refresher |
void |
removeDocument(ProfileLocator locator)
Remove the PSMLDocument/profile for given locator object. |
void |
removeGroupDocuments(Group group)
Removes all documents for a given group. |
void |
removeRoleDocuments(Role role)
Removes all documents for a given role. |
void |
removeUserDocuments(JetspeedUser user)
Removes all documents for a given user. |
boolean |
saveDocument(PSMLDocument doc)
Save the PSML document on disk, using its name as filepath |
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)
Update the PSML document in DB for the given profile |
protected ProfileLocator |
stringToLocator(java.lang.String locstr)
|
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 java.util.Map psmlCache
protected org.apache.jetspeed.services.psmlmanager.db.DatabasePsmlManagerService.CacheRefresher refresher
protected long refreshRate
protected static final java.lang.String REFRESH_RATE
protected static final long DEFAULT_REFRESH_RATE
protected boolean cachingOn
protected static final java.lang.String CACHING_ON
protected static final boolean DEFAULT_CACHING_ON
protected static final java.lang.String POOL_NAME
protected PsmlManagerService consumer
public static final java.lang.String DEFAULT_MAPPING
protected org.exolab.castor.mapping.Mapping mapping
protected java.lang.String poolName
protected boolean enableMessaging
Constructor Detail |
public DatabasePsmlManagerService()
Method Detail |
public void init(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
Service
framework
org.apache.turbine.services.InitializationException
protected void initConfiguration(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
throws
- a InitializationException
if the service
fails to initialize
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
protected void loadMapping() throws org.apache.turbine.services.InitializationException
org.apache.turbine.services.InitializationException
public void shutdown()
Service
framework
shutdown
in interface org.apache.turbine.services.Initable
protected java.lang.String locatorToString(ProfileLocator locator)
protected ProfileLocator stringToLocator(java.lang.String locstr) throws java.lang.Exception
java.lang.Exception
public PSMLDocument getDocument(java.lang.String name)
PsmlManagerService
getDocument
in interface PsmlManagerService
name
- the name of the document to retrievepublic boolean saveDocument(java.lang.String fileOrUrl, PSMLDocument doc)
PsmlManagerService
saveDocument
in interface PsmlManagerService
fileOrUrl
- a String representing either an absolute URL
or an absolute filepathdoc
- the document to save
public boolean saveDocument(PSMLDocument doc)
PsmlManagerService
saveDocument
in interface PsmlManagerService
doc
- the document to save
public PSMLDocument getDocument(ProfileLocator locator)
getDocument
in interface PsmlManagerService
locator
- The locator descriptor(ProfileLocator object) of the
document to be retrieved.
public PSMLDocument createDocument(Profile profile)
createDocument
in interface PsmlManagerService
profile
- The profile that holds the PSMLDocument.
public boolean store(Profile profile)
store
in interface PsmlManagerService
profile
- The profile that holds the PSMLDocument.
protected PSMLDocument createOrSaveDocument(Profile profile, int operation)
public void removeDocument(ProfileLocator locator)
removeDocument
in interface PsmlManagerService
locator
- The profile locator criteria for profile to be removed.public java.util.Iterator query(QueryLocator locator)
query
in interface PsmlManagerService
locator
- The profile locator criteria.
protected java.util.List getProfiles(java.util.List data)
data
- List of JetspeedUserProfile, JetspeedGroupProfile,
JetspeedRoleProfile, objects
protected PSMLDocument getPSMLDocument(java.lang.String page, Portlets portlets)
portlets
- Portlets for the given page namepage
- page name for this resource
public PSMLDocument getDocument(java.util.List locators)
getDocument
in interface PsmlManagerService
public PSMLDocument refresh(ProfileLocator locator)
refresh
in interface PsmlManagerService
locator
- The locator descriptor(ProfileLocator object) of the
document to be retrieved.
public void removeUserDocuments(JetspeedUser user)
removeUserDocuments
in interface PsmlManagerService
user
- The user object.public void removeRoleDocuments(Role role)
removeRoleDocuments
in interface PsmlManagerService
role
- The role object.public void removeGroupDocuments(Group group)
removeGroupDocuments
in interface PsmlManagerService
group
- The group object.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.
public org.exolab.castor.mapping.Mapping getMapping()
getMapping
in interface DatabasePsmlManager
public Profile createUserProfile(org.apache.jetspeed.om.dbpsml.JetspeedUserProfile entity, Portlets portlets)
entity
- The user profile entity in the database.portlets
- The PSML blob.
public Profile createGroupProfile(org.apache.jetspeed.om.dbpsml.JetspeedGroupProfile entity, Portlets portlets)
entity
- The group profile entity in the database.portlets
- The PSML blob.
public Profile createRoleProfile(org.apache.jetspeed.om.dbpsml.JetspeedRoleProfile entity, Portlets portlets)
entity
- The group profile entity in the database.portlets
- The PSML blob.
protected java.sql.Connection getDbConnection()
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 |