|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.AbstractLighthouseContext
A base implementation of LighthouseContext that throws exceptions for unimplemented methods, and stubs out others. Custom contexts may wish to subclass this rather than implement LighthouseContext to reduce the number of methods that need to be implemented. // Note that while ordinarily this would be declared abstract // I like letting it be a real class so we can detect changes // to the interfaces at compile time. This also allows // to transition code that formerly dealt only with an ObjectCache // to LighthouseContext by creating one of these to wrap the cache.
Field Summary | |
static java.lang.String |
code_id
|
Fields inherited from interface com.waveset.object.LighthouseContext |
COMP_ACCESS_POLICY, COMP_AUTH_CACHE, COMP_LOGIN_CONFIG_INFO, COMP_PROVISIONER, COMP_RECONCILER, COMP_REPOSITORY, COMP_SUBJECT_AUTH_CACHE, COMP_TASK_MANAGER, COMP_WORKFLOW, OP_CACHE, OP_CACHE_TIMEOUT, OP_CLEAR_CACHE, OP_NO_RESULT |
Fields inherited from interface com.waveset.object.ObjectSource |
HIGH_VALUES, OP_ALLOW_NOT_FOUND, OP_ATTRIBUTES, OP_BLOCK_SIZE, OP_BUFFERED, OP_CONDITIONS, OP_END_BEFORE, OP_FAST, OP_FILTER, OP_FORCE, OP_KEEP_LOCK, OP_MAX_ROWS, OP_NO_CACHE, OP_NO_RULE_DRIVEN_MEMBERS, OP_ONLY_NAMES, OP_ORDER_BY, OP_START_AFTER, OP_SUBJECT, OP_SUBTYPES, OP_USER |
Constructor Summary | |
AbstractLighthouseContext()
|
|
AbstractLighthouseContext(ObjectCache c)
Build a LighthouseContext wrapping an existing ObjectCache. |
Method Summary | |
boolean |
breakLock(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Break a lock held on an object. |
java.lang.Object |
callResourceMethod(java.lang.String resourceId,
java.lang.String methodName,
java.util.Map args)
Call a resource adapter specific method. |
WavesetResult |
checkinObject(PersistentObject obj,
java.util.Map options)
Check changes to an object back into the system. |
WavesetResult |
checkinView(GenericObject view,
java.util.Map options)
Checkin a view. |
PersistentObject |
checkoutObject(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Checkout a persistent object for editing. |
GenericObject |
checkoutView(java.lang.String id,
java.util.Map options)
Checkout a view. |
void |
checkPermission(PersistentObject obj,
Right right)
Check permissions for a subject against the given object and right. |
void |
checkPermission(Type type,
Right right)
Check permissions for the given subject, against the given type and right. |
void |
checkPermissionToAnyAuthTypeSubType(Type type,
Right right)
Check permissions for the given subject, against the given type or any of its authtype subtypes and right. |
void |
checkReferencePermissions(PersistentObject obj)
Check connect/disconnect permissions to objects referenced by another object. |
void |
clearResourceObjectGetCache(java.util.Map options)
Clear specified resource object lists from the cache |
void |
clearResourceObjectGetCache(java.lang.String subjectName,
java.lang.String objectType,
java.lang.String resourceId)
Clear all resource object lists from the cache for all users including default |
void |
clearResourceObjectListCache(java.util.Map options)
Clear specified resource object lists from the cache |
void |
clearResourceObjectListCache(java.lang.String subjectName,
java.lang.String objectType,
java.lang.String resourceId)
Clear all resource object lists from the cache for all users including default |
WavesetResult |
commitView(GenericObject view,
java.util.Map options)
Commit a view. |
int |
countObjects(java.lang.Object type,
java.util.Map optins)
Get a count of objects of a given type. |
int |
countObjects(RepositoryResult repoResult)
|
GenericObject |
createView(java.lang.String id,
java.util.Map options)
Create a view. |
void |
deleteObject(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Delete an object. |
void |
deleteObjects(java.lang.Object type,
java.util.Map options)
Delete all objects matching certain conditions. |
WavesetResult |
deleteView(java.lang.String id,
java.util.Map options)
Delete the repository objects that are associated with the view id. |
java.lang.Object |
extendedOperation(java.lang.String op,
java.util.Map arguments)
No extended opertation support by default. |
LighthouseContext |
getAuthenticatedContext(IDMXUser user)
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with an IDMXUser |
LighthouseContext |
getAuthenticatedContext(java.lang.String user)
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of the named user. |
LighthouseContext |
getAuthenticatedContext(Subject subject)
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with a Subject. |
LighthouseContext |
getAuthenticatedContext(WSUser user)
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with a WSUser |
ObjectCache |
getCache()
Retrieve an object cache. |
long |
getCacheConsistencyNumber(Type type)
Return a Cache Consistency Number. |
java.lang.Object |
getComponent(java.lang.String name)
Return a handle to another system component identified by name. |
Form |
getForm(GenericObject view,
java.util.Map options)
Get the form to be used with a view. |
LockInfo |
getLock(java.lang.Object type,
java.lang.String id)
Obtain current lock status. |
PersistentObject |
getObject(java.lang.Object type,
java.lang.String id)
Get a read-only copy of an object. |
PersistentObject |
getObject(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Get a read-only object from the cache. |
PersistentObject |
getObjectIfExists(java.lang.Object type,
java.lang.String id)
Get a read-only object copy of an object, but do not throw an exception if it does not exist. |
PersistentObject |
getObjectIfExists(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Get a read-only object from the cache, but ignore if it doesn't exist. |
QueryResult |
getObjects(java.lang.Object type,
java.util.Map options)
Get a list of objects of a given type. |
GenericObject |
getResourceObject(java.lang.String resourceId,
java.lang.String objectType,
java.lang.String objectId,
java.util.Map options)
Return the requested object given the resource, object type and object id. |
java.util.List |
getResourceObjects(java.lang.String objectType,
java.lang.String resourceId,
java.util.Map options)
Return a List of GenericObjects representing objects in a resource. |
Subject |
getSubject()
Returns the Subject for an authenticated context. |
GenericObject |
getSystemConfiguration()
Return the system configuration object. |
ObjectGroup[] |
getTopControlledObjectGroups(Subject subject)
Get Top Controlled Object Groups for a Subject |
java.lang.String |
getUser()
Returns the effective user name for an authenticated context. |
GenericObject |
getView(java.lang.String id,
java.util.Map options)
Get a view. |
QueryResult |
listObjects(java.lang.Object type,
java.util.Map options)
Get a list of summary attributes for objects of a given type. |
java.util.List |
listResourceObjects(java.lang.String objectType,
java.util.List resourceList,
java.util.Map options)
Return a List of object names of a given type and a list of resources |
java.util.List |
listResourceObjects(java.lang.String objectType,
java.lang.String resourceId,
java.util.Map options)
Return a List of object names of a given type on a resource. |
PersistentObject |
loadObject(Type type,
java.lang.String id,
boolean tolerateMissing,
boolean tolerateAuthzFailure,
java.util.Map options)
Load an object from the storage manager. |
java.util.ArrayList |
loadObjects(Type type,
AttributeCondition[] attrConds)
Load all objects of a given type. |
LockInfo |
lockObject(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Lock an object, without retrieving it. |
void |
log(AuditEvent event)
Log an event fully specified with an AuditEvent object. |
void |
logFailure(PersistentObject obj,
java.lang.String action,
java.lang.String reason)
Log a failure event for an object. |
void |
logFailure(java.lang.String objectName,
java.lang.String objType,
java.lang.String action,
java.lang.String reason)
Log a failure event with an object name and type mask. |
void |
logResultErrors(PersistentObject obj,
java.lang.String action,
WavesetResult result)
Log any errors found within a WavesetResult. |
void |
logSuccess(PersistentObject obj,
java.lang.String action)
Log a success event for an object. |
void |
logSuccess(PersistentObject obj,
java.lang.String action,
java.util.Map oldValues,
java.util.Map newValues)
Log a success event for an object, include new and old values that will be stored in the blob of the audit table. |
void |
nextBlock(RepositoryResult previousResult)
Load the next blockful of objects into the specified RepositoryResult. |
void |
previousBlock(RepositoryResult previousResult)
Load the previous blockful of objects into the specified RepositoryResult. |
GenericObject |
refreshView(GenericObject view,
java.util.Map options)
Refresh a view. |
void |
renameObject(java.lang.Object type,
java.lang.String id,
java.lang.String newName,
java.util.Map options)
Rename an object. |
TaskInstance |
runTask(TaskTemplate tt)
Launch a task defined by a task template. |
void |
setSubject(Subject subject)
Change the effective user for logical locking. |
void |
setUser(java.lang.String name)
Change the effective user for logical locking. |
boolean |
subjectControlsObjectGroup(java.util.List objectgroups)
This method will return true if the current subject controls any one of the organizations in the list; otherwise, returns false. |
boolean |
subjectHasRight(java.lang.String type,
Right right)
This method will return true if the subject has the specified right to the specified type. |
boolean |
subjectHasRightToAnyAuthTypeSubType(java.lang.String type,
Right right)
This method will return true if the subject has the specified right to the specified type or any of its authtype subtypes. |
boolean |
subjectIsAssignedAdminGroups(java.util.List admingroups)
This method will return true if the current subject has the specified capabilities; otherwise, returns false. |
boolean |
testPermission(PersistentObject obj,
Right right)
Test permissions without throwing an exception. |
boolean |
testPermission(Type type,
java.lang.String id,
Right right)
Test permissions without throwing an exception. |
void |
unlockObject(java.lang.Object type,
java.lang.String id,
java.util.Map options)
Unlock a previously locked object. |
void |
unlockView(GenericObject view,
java.util.Map options)
Unlock a view. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public AbstractLighthouseContext()
public AbstractLighthouseContext(ObjectCache c)
Method Detail |
public GenericObject getSystemConfiguration() throws WavesetException
getSystemConfiguration
in interface ObjectSource
WavesetException
public ObjectCache getCache()
getCache
in interface ObjectSource
public PersistentObject getObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws WavesetException
getObject
in interface ObjectSource
WavesetException
public PersistentObject getObject(java.lang.Object type, java.lang.String id) throws WavesetException
ObjectSource
checkoutObject
method.
getObject
in interface ObjectSource
WavesetException
public PersistentObject getObjectIfExists(java.lang.Object type, java.lang.String id, java.util.Map options) throws WavesetException
getObjectIfExists
in interface ObjectSource
WavesetException
public PersistentObject getObjectIfExists(java.lang.Object type, java.lang.String id) throws WavesetException
ObjectSource
getObjectIfExists
in interface ObjectSource
WavesetException
public LockInfo lockObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws ItemNotFound, LockedByAnother, WavesetException
lockObject
in interface ObjectSource
ItemNotFound
LockedByAnother
WavesetException
public LockInfo getLock(java.lang.Object type, java.lang.String id) throws ItemNotFound, WavesetException
getLock
in interface ObjectSource
ItemNotFound
WavesetException
public void unlockObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws ItemNotFound, ItemNotLocked, LockedByAnother, WavesetException
unlockObject
in interface ObjectSource
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException
public boolean breakLock(java.lang.Object type, java.lang.String id, java.util.Map options) throws ItemNotFound, WavesetException
breakLock
in interface ObjectSource
ItemNotFound
WavesetException
public PersistentObject checkoutObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws ItemNotFound, LockedByAnother, WavesetException
checkoutObject
in interface ObjectSource
ItemNotFound
LockedByAnother
WavesetException
public WavesetResult checkinObject(PersistentObject obj, java.util.Map options) throws ItemNotFound, ItemNotLocked, LockedByAnother, WavesetException
checkinObject
in interface ObjectSource
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException
public void deleteObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws ItemNotFound, LockedByAnother, WavesetException
The force flag may be set to bypass any constraint checking that the context implementation may perform.
deleteObject
in interface ObjectSource
ItemNotFound
LockedByAnother
WavesetException
public void deleteObjects(java.lang.Object type, java.util.Map options) throws LockedByAnother, WavesetException
deleteObjects
in interface ObjectSource
LockedByAnother
WavesetException
public void renameObject(java.lang.Object type, java.lang.String id, java.lang.String newName, java.util.Map options) throws ItemNotFound, LockedByAnother, AlreadyExists, WavesetException
The object must unlocked, or locked by the current user. It will be implicitly locked to perform the rename.
renameObject
in interface ObjectSource
ItemNotFound
LockedByAnother
AlreadyExists
WavesetException
public QueryResult listObjects(java.lang.Object type, java.util.Map options) throws WavesetException
listObjects
in interface ObjectSource
WavesetException
public QueryResult getObjects(java.lang.Object type, java.util.Map options) throws WavesetException
getObjects
in interface ObjectSource
WavesetException
public GenericObject getView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
getView
in interface ObjectSource
WavesetException
public Form getForm(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
getForm
in interface ObjectSource
WavesetException
public GenericObject createView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
createView
in interface ObjectSource
WavesetException
public GenericObject checkoutView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
checkoutView
in interface ObjectSource
WavesetException
public GenericObject refreshView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
refreshView
in interface ObjectSource
WavesetException
public WavesetResult checkinView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
checkinView
in interface ObjectSource
WavesetException
public WavesetResult commitView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
commitView
in interface ObjectSource
WavesetException
public void unlockView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
unlockView
in interface ObjectSource
WavesetException
public WavesetResult deleteView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
deleteView
in interface ObjectSource
WavesetException
public LighthouseContext getAuthenticatedContext(java.lang.String user) throws WavesetException
LighthouseContext
getAuthenticatedContext
in interface LighthouseContext
WavesetException
public LighthouseContext getAuthenticatedContext(Subject subject) throws WavesetException
LighthouseContext
getAuthenticatedContext
in interface LighthouseContext
WavesetException
public LighthouseContext getAuthenticatedContext(WSUser user) throws WavesetException
LighthouseContext
getAuthenticatedContext
in interface LighthouseContext
WavesetException
public LighthouseContext getAuthenticatedContext(IDMXUser user) throws WavesetException
LighthouseContext
getAuthenticatedContext
in interface LighthouseContext
WavesetException
public void setUser(java.lang.String name) throws WavesetException
LighthouseContext
setUser
in interface LighthouseContext
WavesetException
public void setSubject(Subject subject) throws WavesetException
LighthouseContext
setSubject
in interface LighthouseContext
WavesetException
public java.lang.String getUser()
LighthouseContext
getUser
in interface LighthouseContext
public Subject getSubject()
LighthouseContext
getSubject
in interface LighthouseContext
public void checkPermission(PersistentObject obj, Right right) throws WSAuthorizationException, WavesetException
checkPermission
in interface LighthouseContext
WSAuthorizationException
WavesetException
public void checkPermission(Type type, Right right) throws WSAuthorizationException, WavesetException
checkPermission
in interface LighthouseContext
WSAuthorizationException
WavesetException
public void checkPermissionToAnyAuthTypeSubType(Type type, Right right) throws WSAuthorizationException, WavesetException
checkPermissionToAnyAuthTypeSubType
in interface LighthouseContext
WSAuthorizationException
WavesetException
public boolean testPermission(PersistentObject obj, Right right) throws WSAuthorizationException, WavesetException
testPermission
in interface LighthouseContext
WSAuthorizationException
WavesetException
public boolean testPermission(Type type, java.lang.String id, Right right) throws WSAuthorizationException, WavesetException
testPermission
in interface LighthouseContext
WSAuthorizationException
WavesetException
public boolean subjectHasRight(java.lang.String type, Right right) throws WavesetException
LighthouseContext
subjectHasRight
in interface LighthouseContext
WavesetException
public boolean subjectHasRightToAnyAuthTypeSubType(java.lang.String type, Right right) throws WavesetException
LighthouseContext
Therefore, this method is primarily used to determine if the subject has the specified right to at least one object of the specified type or any of its authtype subtypes. For example, this method is called by the UI to determine if the current subject should be able to view a given page or not. If the subject has the specified right to the specified type or one of the type's authtype subtypes, then they can view the page.
subjectHasRightToAnyAuthTypeSubType
in interface LighthouseContext
WavesetException
public boolean subjectIsAssignedAdminGroups(java.util.List admingroups) throws WavesetException
LighthouseContext
subjectIsAssignedAdminGroups
in interface LighthouseContext
WavesetException
public boolean subjectControlsObjectGroup(java.util.List objectgroups) throws WavesetException
LighthouseContext
subjectControlsObjectGroup
in interface LighthouseContext
WavesetException
public void checkReferencePermissions(PersistentObject obj) throws WSAuthorizationException, WavesetException
LighthouseContext
We might be able to assume this is done by checkinObject, but then we would want this disabled by default in most of the context implemetations.
checkReferencePermissions
in interface LighthouseContext
WSAuthorizationException
WavesetException
public ObjectGroup[] getTopControlledObjectGroups(Subject subject) throws WavesetException
Returns the set of 0 or more object groups controlled by the specified principal, each of which has no object group parent that is also controlled by the principal.
getTopControlledObjectGroups
in interface LighthouseContext
WavesetException
public void log(AuditEvent event) throws WavesetException
LighthouseContext
log
in interface LighthouseContext
WavesetException
public void logFailure(PersistentObject obj, java.lang.String action, java.lang.String reason) throws WavesetException
logFailure
in interface LighthouseContext
WavesetException
public void logFailure(java.lang.String objectName, java.lang.String objType, java.lang.String action, java.lang.String reason) throws WavesetException
logFailure
in interface LighthouseContext
WavesetException
public void logSuccess(PersistentObject obj, java.lang.String action) throws WavesetException
logSuccess
in interface LighthouseContext
WavesetException
public void logSuccess(PersistentObject obj, java.lang.String action, java.util.Map oldValues, java.util.Map newValues) throws WavesetException
logSuccess
in interface LighthouseContext
WavesetException
public void logResultErrors(PersistentObject obj, java.lang.String action, WavesetResult result) throws WavesetException
logResultErrors
in interface LighthouseContext
WavesetException
public GenericObject getResourceObject(java.lang.String resourceId, java.lang.String objectType, java.lang.String objectId, java.util.Map options) throws WavesetException
getResourceObject
in interface LighthouseContext
WavesetException
public java.util.List listResourceObjects(java.lang.String objectType, java.util.List resourceList, java.util.Map options) throws WavesetException
listResourceObjects
in interface LighthouseContext
WavesetException
public java.util.List listResourceObjects(java.lang.String objectType, java.lang.String resourceId, java.util.Map options) throws WavesetException
listResourceObjects
in interface LighthouseContext
WavesetException
public java.util.List getResourceObjects(java.lang.String objectType, java.lang.String resourceId, java.util.Map options) throws WavesetException
getResourceObjects
in interface LighthouseContext
WavesetException
public void clearResourceObjectListCache(java.lang.String subjectName, java.lang.String objectType, java.lang.String resourceId) throws WavesetException
clearResourceObjectListCache
in interface LighthouseContext
WavesetException
public void clearResourceObjectListCache(java.util.Map options) throws WavesetException
clearResourceObjectListCache
in interface LighthouseContext
WavesetException
public void clearResourceObjectGetCache(java.lang.String subjectName, java.lang.String objectType, java.lang.String resourceId) throws WavesetException
clearResourceObjectGetCache
in interface LighthouseContext
WavesetException
public void clearResourceObjectGetCache(java.util.Map options) throws WavesetException
clearResourceObjectGetCache
in interface LighthouseContext
WavesetException
public java.lang.Object callResourceMethod(java.lang.String resourceId, java.lang.String methodName, java.util.Map args) throws WavesetException
LighthouseContext
callResourceMethod
in interface LighthouseContext
WavesetException
public TaskInstance runTask(TaskTemplate tt) throws WavesetException
runTask
in interface LighthouseContext
WavesetException
public java.lang.Object getComponent(java.lang.String name)
getComponent
in interface LighthouseContext
public java.lang.Object extendedOperation(java.lang.String op, java.util.Map arguments) throws WavesetException
extendedOperation
in interface LighthouseContext
WavesetException
public long getCacheConsistencyNumber(Type type) throws WavesetException
CacheConsistencyNumberLoader
The loader typically runs a database query after some number of calls to this method, and returns the current CCN. The loader typically does NOT query the database on every call to this method. While that would ensure that the cache is always up to date, it would slow things down, defeating some of the purpose of the cache. The loader should maintain a timestamp of the last database query, and reissue the query after a configurable number of seconds has passed. This behavior is put into the loader rather than the cache so we have fewer objects to update in case the CCN "polling interval" changes.
getCacheConsistencyNumber
in interface CacheConsistencyNumberLoader
WavesetException
public PersistentObject loadObject(Type type, java.lang.String id, boolean tolerateMissing, boolean tolerateAuthzFailure, java.util.Map options) throws WavesetException
ObjectLoader
loadObject
in interface ObjectLoader
WavesetException
- if the object was not found in the storage manager, or
an internal error was encountered.public java.util.ArrayList loadObjects(Type type, AttributeCondition[] attrConds) throws WavesetException
ObjectLoader
loadObjects
in interface ObjectLoader
WavesetException
- if an internal error was encountered.public int countObjects(RepositoryResult repoResult) throws WavesetException
countObjects
in interface ObjectLoader
WavesetException
- if an internal error was encountered.public int countObjects(java.lang.Object type, java.util.Map optins) throws WavesetException
ObjectSource
countObjects
in interface ObjectSource
WavesetException
public void nextBlock(RepositoryResult previousResult) throws WavesetException
ObjectLoader
nextBlock
in interface ObjectLoader
WavesetException
- if an internal error was encountered.public void previousBlock(RepositoryResult previousResult) throws WavesetException
ObjectLoader
previousBlock
in interface ObjectLoader
WavesetException
- if an internal error was encountered.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |