|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsystemic.sif.sbpframework.persist.servcie.DBService
systemic.sif.sbpframework.persist.servcie.DOCService
public class DOCService
Constructor Summary | |
---|---|
DOCService()
|
Method Summary | |
---|---|
void |
cacheObject(DOCache sifObjectToCache,
java.lang.String agentId,
java.lang.String applicationId,
java.lang.String zoneId)
This method will save the DOCache object with all its child elements. |
void |
checkAndRemoveDependency(openadk.library.SIFDataObject sifObject,
java.lang.String applicationId,
java.lang.String zoneId)
This method checks if there are any objects cached that depend on this object. |
void |
checkAndRemoveDependency(java.lang.String sifObjectName,
java.lang.String flatKey,
java.lang.String applicationId,
java.lang.String zoneId)
|
java.util.List<DOCObject> |
extractDependentObjectsFromSIFObject(openadk.library.SIFDataObject sifObject)
This method checks SIF Object Cache if the given sifObject has dependencies and if so it will extract all dependencies and returns them. |
java.lang.String |
extractFlatKey(openadk.library.SIFDataObject sifObject)
This method attempts to extract the primary key from the SIF Object as defined by the SIF Spec and flattens it. |
BaseDAO |
getDAO()
|
java.util.List<DOCObject> |
getDependenciesFromSIFObjectAndCache(openadk.library.SIFDataObject sifObject,
java.lang.String applicationId,
java.lang.String zoneId)
This method extracts the dependency info for the given sifObject and then looks up the DOC and marks already requested dependent objects for the given zone and application. |
java.util.List<DOCache> |
getExpiredObjects(java.lang.String applicationId,
java.lang.String agentId)
This method returns all objects in the cache that have remaining dependencies but have an expiry date older than the current date and time. |
java.util.List<DOCObject> |
getNotYetRequestedObjects(java.lang.String sifObjectName,
java.lang.String applicationId,
java.lang.String zoneId)
This method returns a list of DOC Objects. |
java.util.List<DOCache> |
getObjectsWithoutDependencies(java.lang.String sifObjectName,
java.lang.String applicationId,
java.lang.String agentId)
This method gets all cached objects of a given type for a particular application and agent that have no remaining dependencies. |
boolean |
hasPotentialDependencies(java.lang.String sifObjectName)
This method simply checks if the SIF object given by its name (i.e StudentSchoolEnrolment) has potential dependencies based on the metadata that is available on the object. |
void |
markDependentObjectAsRequested(DOCObject docObject,
java.lang.String agentId,
java.lang.String zoneId)
This method updates the given docObject and marks it as requested. |
void |
mergeWithCachedDependencies(java.util.List<DOCObject> dependentObjectList,
java.lang.String applicationId,
java.lang.String zoneId)
This method iterates through the dependentObjectList and replaces elements in that list with the requested information. |
void |
removeCachedObject(DOCache cacheObject)
This method removes the given object and all its dependencies from the cache. |
DOCache |
retrieveCachedObject(openadk.library.SIFDataObject sifObject,
java.lang.String applicationId,
java.lang.String zoneId,
boolean loadAll)
This method attempts to retrieve a cached SIF Object based on the object name, object key (flatten key) and the agentId. |
DOCache |
retrieveCachedObject(java.lang.String sifObjectName,
java.lang.String flatKey,
java.lang.String applicationId,
java.lang.String zoneId,
boolean loadAll)
|
void |
updateExpiredObjects(java.lang.String applicationId,
java.lang.String agentId)
This method updates all Cached Objects and their dependencies according to the expiry strategy. |
Methods inherited from class systemic.sif.sbpframework.persist.servcie.DBService |
---|
commit, loadSubObject, rollback, startTransaction |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOCService()
Method Detail |
---|
public BaseDAO getDAO()
getDAO
in class DBService
public java.util.List<DOCObject> getDependenciesFromSIFObjectAndCache(openadk.library.SIFDataObject sifObject, java.lang.String applicationId, java.lang.String zoneId) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
sifObject
- The SIF Object from which all dependencies need to be returned.applicationId
- Check if dependent objects have already been requested for this application.zoneId
- Check if dependent objects have already been requested for this zone.
javax.persistence.PersistenceException
- If there is an error in the underlying DB. The error is logged.
java.lang.IllegalArgumentException
- If any of the parameters is null or empty.
java.lang.Exception
- some underlying issue. Error is logged.public DOCache retrieveCachedObject(openadk.library.SIFDataObject sifObject, java.lang.String applicationId, java.lang.String zoneId, boolean loadAll) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
sifObject
- The SIF Object for which the DOCache info shall be returned.applicationId
- The application ID for which the DOCache info shall be returned.zoneId
- The Zone ID for which the DOCache info shall be returned.loadAll
- Indicates if all dependent objects shall be loaded into memory. This is required since information
is 'lazy' loaded by hibernate.
javax.persistence.PersistenceException
- If there is an error in the underlying DB. The error is logged.
java.lang.IllegalArgumentException
- If any of the parameters is null or empty.
java.lang.Exception
- some underlying issue. Error is logged.public DOCache retrieveCachedObject(java.lang.String sifObjectName, java.lang.String flatKey, java.lang.String applicationId, java.lang.String zoneId, boolean loadAll) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
javax.persistence.PersistenceException
java.lang.IllegalArgumentException
public void cacheObject(DOCache sifObjectToCache, java.lang.String agentId, java.lang.String applicationId, java.lang.String zoneId) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
sifObjectToCache
- The object to save to the DOC.agentId
- The agent that requests this save.applicationId
- The application for which the entry is stored. Will be used to pre-populate some information.zoneId
- The zone from which the SIF Object has been received. This will be the zone from which dependent objects
will be requested at some stage.
javax.persistence.PersistenceException
- If the object cannot be persisted. The error is logged.
java.lang.IllegalArgumentException
- If any of the parameters is null or empty. Metadata Cache is not available.public void markDependentObjectAsRequested(DOCObject docObject, java.lang.String agentId, java.lang.String zoneId) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
docObject
- The dependent object to update (must have an id of not null!!)agentId
- The agent that has requested the object.zoneId
- The zone to which the request has been sent.
javax.persistence.PersistenceException
- If the object cannot be persisted. The error is logged.
java.lang.IllegalArgumentException
- If any of the parameters is null or empty. The property docObject.id is null.public void mergeWithCachedDependencies(java.util.List<DOCObject> dependentObjectList, java.lang.String applicationId, java.lang.String zoneId) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
dependentObjectList
- The list of objects to testapplicationId
- The application to test for.zoneId
- The zone to test for.
javax.persistence.PersistenceException
- If there are any errors with the underlying data store. Error is logged.
java.lang.IllegalArgumentException
- applicationId or zoneId is empty or null.public void checkAndRemoveDependency(openadk.library.SIFDataObject sifObject, java.lang.String applicationId, java.lang.String zoneId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
sifObject
- The object for which it is checked if there are dependencies.applicationId
- The application for which to check.zoneId
- The zone this object has been received from.
javax.persistence.PersistenceException
- If there are any errors with the underlying data store. Error is logged.
java.lang.IllegalArgumentException
- sifObject, applicationId or zoneId is empty or null. Metadata Cache is not available.public void checkAndRemoveDependency(java.lang.String sifObjectName, java.lang.String flatKey, java.lang.String applicationId, java.lang.String zoneId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
java.lang.IllegalArgumentException
javax.persistence.PersistenceException
public java.util.List<DOCObject> getNotYetRequestedObjects(java.lang.String sifObjectName, java.lang.String applicationId, java.lang.String zoneId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
sifObjectName
- The SIF Object names to search for (i.e StudentPersonal)applicationId
- Only return objects marked for this application.zoneId
- Only return objects marked for this zone.
java.lang.IllegalArgumentException
- docObject is null or any of the properties listed above is empty or null.
Metadata Cache is not available.
javax.persistence.PersistenceException
- A database error occurred.public java.util.List<DOCache> getObjectsWithoutDependencies(java.lang.String sifObjectName, java.lang.String applicationId, java.lang.String agentId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
sifObjectName
- The type of cached objects to be returned.applicationId
- The application for which the objects shall be returned.agentId
- The agent for which to get the object list.
java.lang.IllegalArgumentException
- Any of the parameters is null or empty.
javax.persistence.PersistenceException
- A database error occurred. Error is logged.public java.util.List<DOCache> getExpiredObjects(java.lang.String applicationId, java.lang.String agentId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
applicationId
- Only return expired objects for this application.agentId
- Only return expired object that were initially cached by this agent.
java.lang.IllegalArgumentException
- Any of the parameters is null or empty.
javax.persistence.PersistenceException
- A database error occurred. Error is logged.public void removeCachedObject(DOCache cacheObject) throws javax.persistence.PersistenceException
cacheObject
- The object to remove from the DO Cache.
javax.persistence.PersistenceException
- A database error occurred.public void updateExpiredObjects(java.lang.String applicationId, java.lang.String agentId) throws java.lang.IllegalArgumentException, javax.persistence.PersistenceException
applicationId
- Only update/remove expired objects for this application.agentId
- Only update/remove expired object that were initially cached by this agent.
java.lang.IllegalArgumentException
- Any of the parameters is null or empty.
javax.persistence.PersistenceException
- A database error occurred. Error is logged.public boolean hasPotentialDependencies(java.lang.String sifObjectName)
sifObjectName
- The name of the SIF Object to test for.
public java.lang.String extractFlatKey(openadk.library.SIFDataObject sifObject) throws java.lang.IllegalArgumentException
sifObject
- From which the primary key shall be extracted and flattened.
java.lang.IllegalArgumentException
- Object is null or doesn't contain the primary key as expected by the SIF Spec.public java.util.List<DOCObject> extractDependentObjectsFromSIFObject(openadk.library.SIFDataObject sifObject) throws javax.persistence.PersistenceException, java.lang.IllegalArgumentException
javax.persistence.PersistenceException
- If there are any errors with the underlying data store. Error is logged.
java.lang.IllegalArgumentException
- Metadata Cache is not available. Error is logged.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |