com.waveset.object
Class AbstractLighthouseContext

java.lang.Object
  extended bycom.waveset.object.AbstractLighthouseContext
All Implemented Interfaces:
CacheConsistencyNumberLoader, LighthouseContext, ObjectLoader, ObjectSource
Direct Known Subclasses:
LighthouseSimulator, SimulatedLighthouseContext

public class AbstractLighthouseContext
extends java.lang.Object
implements LighthouseContext, ObjectLoader

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

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

AbstractLighthouseContext

public AbstractLighthouseContext()

AbstractLighthouseContext

public AbstractLighthouseContext(ObjectCache c)
Build a LighthouseContext wrapping an existing ObjectCache. This can be used to integrate older code uses an ObjectCache with newer code that wants a LighthouseContext. The context will obviously not be a functional as a true context.

Method Detail

getSystemConfiguration

public GenericObject getSystemConfiguration()
                                     throws WavesetException
Return the system configuration object.

Specified by:
getSystemConfiguration in interface ObjectSource
Throws:
WavesetException

getCache

public ObjectCache getCache()
Retrieve an object cache.

Specified by:
getCache in interface ObjectSource

getObject

public PersistentObject getObject(java.lang.Object type,
                                  java.lang.String id,
                                  java.util.Map options)
                           throws WavesetException
Get a read-only object from the cache.

Specified by:
getObject in interface ObjectSource
Throws:
WavesetException

getObject

public PersistentObject getObject(java.lang.Object type,
                                  java.lang.String id)
                           throws WavesetException
Description copied from interface: ObjectSource
Get a read-only copy of an object. If you wish to obtain an object for editing, use the checkoutObject method.

Specified by:
getObject in interface ObjectSource
Throws:
WavesetException

getObjectIfExists

public PersistentObject getObjectIfExists(java.lang.Object type,
                                          java.lang.String id,
                                          java.util.Map options)
                                   throws WavesetException
Get a read-only object from the cache, but ignore if it doesn't exist.

Specified by:
getObjectIfExists in interface ObjectSource
Throws:
WavesetException

getObjectIfExists

public PersistentObject getObjectIfExists(java.lang.Object type,
                                          java.lang.String id)
                                   throws WavesetException
Description copied from interface: ObjectSource
Get a read-only object copy of an object, but do not throw an exception if it does not exist.

Specified by:
getObjectIfExists in interface ObjectSource
Throws:
WavesetException

lockObject

public LockInfo lockObject(java.lang.Object type,
                           java.lang.String id,
                           java.util.Map options)
                    throws ItemNotFound,
                           LockedByAnother,
                           WavesetException
Lock an object, without retrieving it. We assume we're in an environment that does not require locking.

Specified by:
lockObject in interface ObjectSource
Throws:
ItemNotFound
LockedByAnother
WavesetException

getLock

public LockInfo getLock(java.lang.Object type,
                        java.lang.String id)
                 throws ItemNotFound,
                        WavesetException
Obtain current lock status.

Specified by:
getLock in interface ObjectSource
Throws:
ItemNotFound
WavesetException

unlockObject

public void unlockObject(java.lang.Object type,
                         java.lang.String id,
                         java.util.Map options)
                  throws ItemNotFound,
                         ItemNotLocked,
                         LockedByAnother,
                         WavesetException
Unlock a previously locked object. We assume we're in an environment that does not require locking.

Specified by:
unlockObject in interface ObjectSource
Throws:
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException

breakLock

public boolean breakLock(java.lang.Object type,
                         java.lang.String id,
                         java.util.Map options)
                  throws ItemNotFound,
                         WavesetException
Break a lock held on an object. We assume we're in an environment that does not require locking.

Specified by:
breakLock in interface ObjectSource
Throws:
ItemNotFound
WavesetException

checkoutObject

public PersistentObject checkoutObject(java.lang.Object type,
                                       java.lang.String id,
                                       java.util.Map options)
                                throws ItemNotFound,
                                       LockedByAnother,
                                       WavesetException
Checkout a persistent object for editing. The default is to assume we're not in an environment that supports locking and return what is in the cache.

Specified by:
checkoutObject in interface ObjectSource
Throws:
ItemNotFound
LockedByAnother
WavesetException

checkinObject

public WavesetResult checkinObject(PersistentObject obj,
                                   java.util.Map options)
                            throws ItemNotFound,
                                   ItemNotLocked,
                                   LockedByAnother,
                                   WavesetException
Check changes to an object back into the system. Default implmentation is to simply add it to the cache.

Specified by:
checkinObject in interface ObjectSource
Throws:
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException

deleteObject

public void deleteObject(java.lang.Object type,
                         java.lang.String id,
                         java.util.Map options)
                  throws ItemNotFound,
                         LockedByAnother,
                         WavesetException
Delete an object.

The force flag may be set to bypass any constraint checking that the context implementation may perform.

Specified by:
deleteObject in interface ObjectSource
Throws:
ItemNotFound
LockedByAnother
WavesetException

deleteObjects

public void deleteObjects(java.lang.Object type,
                          java.util.Map options)
                   throws LockedByAnother,
                          WavesetException
Delete all objects matching certain conditions. Used only by Scheduler, is this the best interface? !! Conditions be passed through options like the query interfaces.

Specified by:
deleteObjects in interface ObjectSource
Throws:
LockedByAnother
WavesetException

renameObject

public void renameObject(java.lang.Object type,
                         java.lang.String id,
                         java.lang.String newName,
                         java.util.Map options)
                  throws ItemNotFound,
                         LockedByAnother,
                         AlreadyExists,
                         WavesetException
Rename an object.

The object must unlocked, or locked by the current user. It will be implicitly locked to perform the rename.

Specified by:
renameObject in interface ObjectSource
Throws:
ItemNotFound
LockedByAnother
AlreadyExists
WavesetException

listObjects

public QueryResult listObjects(java.lang.Object type,
                               java.util.Map options)
                        throws WavesetException
Get a list of summary attributes for objects of a given type. Query options may be passed are passed in a Map, which will normally be a QueryOptions object. See QueryOptions for more information on the structure of the map. The default implementation just returns whatever is in the cache.

Specified by:
listObjects in interface ObjectSource
Throws:
WavesetException

getObjects

public QueryResult getObjects(java.lang.Object type,
                              java.util.Map options)
                       throws WavesetException
Get a list of objects of a given type. Query options may be passed are passed in a Map, which will normally be a QueryOptions object. See QueryOptions for more information on the structure of the map. The default implementation just returns whatever is in the object cache.

Specified by:
getObjects in interface ObjectSource
Throws:
WavesetException

getView

public GenericObject getView(java.lang.String id,
                             java.util.Map options)
                      throws WavesetException
Description copied from interface: ObjectSource
Get a view.

Specified by:
getView in interface ObjectSource
Throws:
WavesetException

getForm

public Form getForm(GenericObject view,
                    java.util.Map options)
             throws WavesetException
Description copied from interface: ObjectSource
Get the form to be used with a view.

Specified by:
getForm in interface ObjectSource
Throws:
WavesetException

createView

public GenericObject createView(java.lang.String id,
                                java.util.Map options)
                         throws WavesetException
Description copied from interface: ObjectSource
Create a view.

Specified by:
createView in interface ObjectSource
Throws:
WavesetException

checkoutView

public GenericObject checkoutView(java.lang.String id,
                                  java.util.Map options)
                           throws WavesetException
Description copied from interface: ObjectSource
Checkout a view.

Specified by:
checkoutView in interface ObjectSource
Throws:
WavesetException

refreshView

public GenericObject refreshView(GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Description copied from interface: ObjectSource
Refresh a view.

Specified by:
refreshView in interface ObjectSource
Throws:
WavesetException

checkinView

public WavesetResult checkinView(GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Description copied from interface: ObjectSource
Checkin a view.

Specified by:
checkinView in interface ObjectSource
Throws:
WavesetException

commitView

public WavesetResult commitView(GenericObject view,
                                java.util.Map options)
                         throws WavesetException
Description copied from interface: ObjectSource
Commit a view.

Specified by:
commitView in interface ObjectSource
Throws:
WavesetException

unlockView

public void unlockView(GenericObject view,
                       java.util.Map options)
                throws WavesetException
Description copied from interface: ObjectSource
Unlock a view.

Specified by:
unlockView in interface ObjectSource
Throws:
WavesetException

deleteView

public WavesetResult deleteView(java.lang.String id,
                                java.util.Map options)
                         throws WavesetException
Description copied from interface: ObjectSource
Delete the repository objects that are associated with the view id. This usually doesn't do much more than the deleteObject method, but some objects need to perform special processing when they are deleted, such as launching a workflow. Since workflows are hooked into the create, modify, and update operations through the view handlers, it makes sense to encapsulate delete behavior here too, even though there isn't a view object being exchanged.

Specified by:
deleteView in interface ObjectSource
Throws:
WavesetException

getAuthenticatedContext

public LighthouseContext getAuthenticatedContext(java.lang.String user)
                                          throws WavesetException
Description copied from interface: LighthouseContext
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of the named user. An authenticated context does not need to pass the OP_USER option to methods such as checkinObject.

Specified by:
getAuthenticatedContext in interface LighthouseContext
Throws:
WavesetException

getAuthenticatedContext

public LighthouseContext getAuthenticatedContext(Subject subject)
                                          throws WavesetException
Description copied from interface: LighthouseContext
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with a Subject.

Specified by:
getAuthenticatedContext in interface LighthouseContext
Throws:
WavesetException

getAuthenticatedContext

public LighthouseContext getAuthenticatedContext(WSUser user)
                                          throws WavesetException
Description copied from interface: LighthouseContext
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with a WSUser

Specified by:
getAuthenticatedContext in interface LighthouseContext
Throws:
WavesetException

getAuthenticatedContext

public LighthouseContext getAuthenticatedContext(IDMXUser user)
                                          throws WavesetException
Description copied from interface: LighthouseContext
Derive a LighthouseContext from this one, that is configured to perform operations on behalf of a user specified with an IDMXUser

Specified by:
getAuthenticatedContext in interface LighthouseContext
Throws:
WavesetException

setUser

public void setUser(java.lang.String name)
             throws WavesetException
Description copied from interface: LighthouseContext
Change the effective user for logical locking. This should only be called if you know this is a private context that won't be shared by another thread. Here the user is specified by name.

Specified by:
setUser in interface LighthouseContext
Throws:
WavesetException

setSubject

public void setSubject(Subject subject)
                throws WavesetException
Description copied from interface: LighthouseContext
Change the effective user for logical locking. This should only be called if you know this is a private context that won't be shared by another thread. Here the user is specified by Subject.

Specified by:
setSubject in interface LighthouseContext
Throws:
WavesetException

getUser

public java.lang.String getUser()
Description copied from interface: LighthouseContext
Returns the effective user name for an authenticated context. Returns null for an anonymous context.

Specified by:
getUser in interface LighthouseContext

getSubject

public Subject getSubject()
Description copied from interface: LighthouseContext
Returns the Subject for an authenticated context. Returns null for an anonymous context, or if the context was created with only the user name rather than a full subject.

Specified by:
getSubject in interface LighthouseContext

checkPermission

public void checkPermission(PersistentObject obj,
                            Right right)
                     throws WSAuthorizationException,
                            WavesetException
Check permissions for a subject against the given object and right.

Specified by:
checkPermission in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

checkPermission

public void checkPermission(Type type,
                            Right right)
                     throws WSAuthorizationException,
                            WavesetException
Check permissions for the given subject, against the given type and right.

Specified by:
checkPermission in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

checkPermissionToAnyAuthTypeSubType

public void checkPermissionToAnyAuthTypeSubType(Type type,
                                                Right right)
                                         throws WSAuthorizationException,
                                                WavesetException
Check permissions for the given subject, against the given type or any of its authtype subtypes and right.

Specified by:
checkPermissionToAnyAuthTypeSubType in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

testPermission

public boolean testPermission(PersistentObject obj,
                              Right right)
                       throws WSAuthorizationException,
                              WavesetException
Test permissions without throwing an exception.

Specified by:
testPermission in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

testPermission

public boolean testPermission(Type type,
                              java.lang.String id,
                              Right right)
                       throws WSAuthorizationException,
                              WavesetException
Test permissions without throwing an exception.

Specified by:
testPermission in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

subjectHasRight

public boolean subjectHasRight(java.lang.String type,
                               Right right)
                        throws WavesetException
Description copied from interface: LighthouseContext
This method will return true if the subject has the specified right to the specified type. It does not imply that the subject has the specified right to all objects of the specified type, since a given object may or may not be in the subject's scope of control or if it is the subject may not have the specified right to the object in that scope. Therefore, this method is primarily used to determine if the subject has the specified right to at least one object of the specified type.

Specified by:
subjectHasRight in interface LighthouseContext
Throws:
WavesetException

subjectHasRightToAnyAuthTypeSubType

public boolean subjectHasRightToAnyAuthTypeSubType(java.lang.String type,
                                                   Right right)
                                            throws WavesetException
Description copied from interface: LighthouseContext
This method will return true if the subject has the specified right to the specified type or any of its authtype subtypes. It does not imply that the subject has the specified right to all objects of the specified type or any of its authtype subtypes, since a given object may or may not be in the subject's scope of control or if it is the subject may not have the specified right to the object in that scope.

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.

Specified by:
subjectHasRightToAnyAuthTypeSubType in interface LighthouseContext
Throws:
WavesetException

subjectIsAssignedAdminGroups

public boolean subjectIsAssignedAdminGroups(java.util.List admingroups)
                                     throws WavesetException
Description copied from interface: LighthouseContext
This method will return true if the current subject has the specified capabilities; otherwise, returns false. The supported list of capabilities include those returned by listing all objects of type AdminGroup (e.g. "Account Administrator")

Specified by:
subjectIsAssignedAdminGroups in interface LighthouseContext
Throws:
WavesetException

subjectControlsObjectGroup

public boolean subjectControlsObjectGroup(java.util.List objectgroups)
                                   throws WavesetException
Description copied from interface: LighthouseContext
This method will return true if the current subject controls any one of the organizations in the list; otherwise, returns false. The supported list of organizations include those returned by listing all objects of type ObjectGroup

Specified by:
subjectControlsObjectGroup in interface LighthouseContext
Throws:
WavesetException

checkReferencePermissions

public void checkReferencePermissions(PersistentObject obj)
                               throws WSAuthorizationException,
                                      WavesetException
Description copied from interface: LighthouseContext
Check connect/disconnect permissions to objects referenced by another object.

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.

Specified by:
checkReferencePermissions in interface LighthouseContext
Throws:
WSAuthorizationException
WavesetException

getTopControlledObjectGroups

public ObjectGroup[] getTopControlledObjectGroups(Subject subject)
                                           throws WavesetException
Get Top Controlled Object Groups for a Subject

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.

Specified by:
getTopControlledObjectGroups in interface LighthouseContext
Throws:
WavesetException

log

public void log(AuditEvent event)
         throws WavesetException
Description copied from interface: LighthouseContext
Log an event fully specified with an AuditEvent object.

Specified by:
log in interface LighthouseContext
Throws:
WavesetException

logFailure

public void logFailure(PersistentObject obj,
                       java.lang.String action,
                       java.lang.String reason)
                throws WavesetException
Log a failure event for an object.

Specified by:
logFailure in interface LighthouseContext
Throws:
WavesetException

logFailure

public void logFailure(java.lang.String objectName,
                       java.lang.String objType,
                       java.lang.String action,
                       java.lang.String reason)
                throws WavesetException
Log a failure event with an object name and type mask.

Specified by:
logFailure in interface LighthouseContext
Throws:
WavesetException

logSuccess

public void logSuccess(PersistentObject obj,
                       java.lang.String action)
                throws WavesetException
Log a success event for an object.

Specified by:
logSuccess in interface LighthouseContext
Throws:
WavesetException

logSuccess

public void logSuccess(PersistentObject obj,
                       java.lang.String action,
                       java.util.Map oldValues,
                       java.util.Map newValues)
                throws WavesetException
Log a success event for an object, include new and old values that will be stored in the blob of the audit table.

Specified by:
logSuccess in interface LighthouseContext
Throws:
WavesetException

logResultErrors

public void logResultErrors(PersistentObject obj,
                            java.lang.String action,
                            WavesetResult result)
                     throws WavesetException
Log any errors found within a WavesetResult.

Specified by:
logResultErrors in interface LighthouseContext
Throws:
WavesetException

getResourceObject

public GenericObject getResourceObject(java.lang.String resourceId,
                                       java.lang.String objectType,
                                       java.lang.String objectId,
                                       java.util.Map options)
                                throws WavesetException
Return the requested object given the resource, object type and object id.

Specified by:
getResourceObject in interface LighthouseContext
Throws:
WavesetException

listResourceObjects

public java.util.List listResourceObjects(java.lang.String objectType,
                                          java.util.List resourceList,
                                          java.util.Map options)
                                   throws WavesetException
Return a List of object names of a given type and a list of resources

Specified by:
listResourceObjects in interface LighthouseContext
Throws:
WavesetException

listResourceObjects

public java.util.List listResourceObjects(java.lang.String objectType,
                                          java.lang.String resourceId,
                                          java.util.Map options)
                                   throws WavesetException
Return a List of object names of a given type on a resource.

Specified by:
listResourceObjects in interface LighthouseContext
Throws:
WavesetException

getResourceObjects

public java.util.List getResourceObjects(java.lang.String objectType,
                                         java.lang.String resourceId,
                                         java.util.Map options)
                                  throws WavesetException
Return a List of GenericObjects representing objects in a resource.

Specified by:
getResourceObjects in interface LighthouseContext
Throws:
WavesetException

clearResourceObjectListCache

public void clearResourceObjectListCache(java.lang.String subjectName,
                                         java.lang.String objectType,
                                         java.lang.String resourceId)
                                  throws WavesetException
Clear all resource object lists from the cache for all users including default

Specified by:
clearResourceObjectListCache in interface LighthouseContext
Throws:
WavesetException

clearResourceObjectListCache

public void clearResourceObjectListCache(java.util.Map options)
                                  throws WavesetException
Clear specified resource object lists from the cache

Specified by:
clearResourceObjectListCache in interface LighthouseContext
Throws:
WavesetException

clearResourceObjectGetCache

public void clearResourceObjectGetCache(java.lang.String subjectName,
                                        java.lang.String objectType,
                                        java.lang.String resourceId)
                                 throws WavesetException
Clear all resource object lists from the cache for all users including default

Specified by:
clearResourceObjectGetCache in interface LighthouseContext
Throws:
WavesetException

clearResourceObjectGetCache

public void clearResourceObjectGetCache(java.util.Map options)
                                 throws WavesetException
Clear specified resource object lists from the cache

Specified by:
clearResourceObjectGetCache in interface LighthouseContext
Throws:
WavesetException

callResourceMethod

public java.lang.Object callResourceMethod(java.lang.String resourceId,
                                           java.lang.String methodName,
                                           java.util.Map args)
                                    throws WavesetException
Description copied from interface: LighthouseContext
Call a resource adapter specific method. The method names, arguments, and return values are all resource specific.

Specified by:
callResourceMethod in interface LighthouseContext
Throws:
WavesetException

runTask

public TaskInstance runTask(TaskTemplate tt)
                     throws WavesetException
Launch a task defined by a task template.

Specified by:
runTask in interface LighthouseContext
Throws:
WavesetException

getComponent

public java.lang.Object getComponent(java.lang.String name)
Return a handle to another system component identified by name. The context is not required to provide every component. The purpose of this method is primarily to eliminate compile time dependencies on internal server components so this interface may be used in many contexts.

Specified by:
getComponent in interface LighthouseContext

extendedOperation

public java.lang.Object extendedOperation(java.lang.String op,
                                          java.util.Map arguments)
                                   throws WavesetException
No extended opertation support by default.

Specified by:
extendedOperation in interface LighthouseContext
Throws:
WavesetException

getCacheConsistencyNumber

public long getCacheConsistencyNumber(Type type)
                               throws WavesetException
Description copied from interface: CacheConsistencyNumberLoader
Return a Cache Consistency Number. This will be called by the ObjectCache prior to any operation that wants to keep the cache up to date. The number returned will be stored in the cache, when it changes, the cache will be flushed.

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.

Specified by:
getCacheConsistencyNumber in interface CacheConsistencyNumberLoader
Throws:
WavesetException

loadObject

public PersistentObject loadObject(Type type,
                                   java.lang.String id,
                                   boolean tolerateMissing,
                                   boolean tolerateAuthzFailure,
                                   java.util.Map options)
                            throws WavesetException
Description copied from interface: ObjectLoader
Load an object from the storage manager. If tolerateMissing is true, silently return null if the object did not exist. If tolerateAuthzFailure is true, silently return null if the requesting admin doesn't have access to the requested object

Specified by:
loadObject in interface ObjectLoader
Throws:
WavesetException - if the object was not found in the storage manager, or an internal error was encountered.

loadObjects

public java.util.ArrayList loadObjects(Type type,
                                       AttributeCondition[] attrConds)
                                throws WavesetException
Description copied from interface: ObjectLoader
Load all objects of a given type. If the optional attribute list is specified, only those objects with matching "query" attributes is returned.

Specified by:
loadObjects in interface ObjectLoader
Throws:
WavesetException - if an internal error was encountered.

countObjects

public int countObjects(RepositoryResult repoResult)
                 throws WavesetException
Specified by:
countObjects in interface ObjectLoader
Returns:
the estimated number of rows in the "virtual result" of the specified RepositoryResult. That is, the number of rows the result would contain if it were unbuffered.
Throws:
WavesetException - if an internal error was encountered.

countObjects

public int countObjects(java.lang.Object type,
                        java.util.Map optins)
                 throws WavesetException
Description copied from interface: ObjectSource
Get a count of objects of a given type. Query options may be passed are passed in a Map, which will normally be a QueryOptions object. See QueryOptions for more information on the structure of the map.

Specified by:
countObjects in interface ObjectSource
Throws:
WavesetException

nextBlock

public void nextBlock(RepositoryResult previousResult)
               throws WavesetException
Description copied from interface: ObjectLoader
Load the next blockful of objects into the specified RepositoryResult.

Specified by:
nextBlock in interface ObjectLoader
Throws:
WavesetException - if an internal error was encountered.

previousBlock

public void previousBlock(RepositoryResult previousResult)
                   throws WavesetException
Description copied from interface: ObjectLoader
Load the previous blockful of objects into the specified RepositoryResult.

Specified by:
previousBlock in interface ObjectLoader
Throws:
WavesetException - if an internal error was encountered.