com.waveset.object
Interface ObjectSource

All Known Subinterfaces:
com.sun.idm.idmx.api.IDMXContext, LighthouseContext, Session
All Known Implementing Classes:
AbstractLighthouseContext, AbstractSession, com.waveset.server.InternalSession, LighthouseContextWrapper, LocalSession

public interface ObjectSource

An interface for an object that provides fundamental object access services to Lighthouse components and applications.


Field Summary
static java.lang.String HIGH_VALUES
          A sentinel value that represents the highest possible value of a sort key (e.g., OP_ORDER_BY).
static java.lang.String OP_ALLOW_NOT_FOUND
          An option that may be recognized by checkoutObject to return null if it cannot find the specified object.
static java.lang.String OP_ATTRIBUTES
          The name of a query option used to specify search conditions.
static java.lang.String OP_BLOCK_SIZE
          The size of the block used when buffering query results.
static java.lang.String OP_BUFFERED
          The name of a query option used to requst result buffering.
static java.lang.String OP_CONDITIONS
          The name of a query option used to specify search conditions.
static java.lang.String OP_END_BEFORE
          The name of a query option that specifies a concatenated key value.
static java.lang.String OP_FAST
          An option that may be recognized by checkinObject to perform the fastest possible checkin.
static java.lang.String OP_FILTER
           
static java.lang.String OP_FORCE
          An option that may be used with the checkinObject method to disable any constraint checking that might ordinarilly be performed during the checkin.
static java.lang.String OP_KEEP_LOCK
          An option that may be recognized by checkinObject to preserve the caller's logical lock on the specified object.
static java.lang.String OP_MAX_ROWS
          The name of a query option used to specify the maximum number of rows to return in a result.
static java.lang.String OP_NO_CACHE
          In some cases, the results of a listObjects call may be cached and reused.
static java.lang.String OP_NO_RULE_DRIVEN_MEMBERS
          The name of a query option used to specify that the query results should not include any rule driven members when a query includes the memberObjectGroup scoping attribute.
static java.lang.String OP_ONLY_NAMES
          Return only names (and IDs) in the query result.
static java.lang.String OP_ORDER_BY
          The name of a query option used to specify sorting of the result.
static java.lang.String OP_START_AFTER
          The name of a query option that specifies a concatenated key value.
static java.lang.String OP_SUBJECT
          The name of a query option used to specify the authorization filtering.
static java.lang.String OP_SUBTYPES
          A flag recognized by getObject and getObjectIfExists that will cause it to search repository subtypes of the given type.
static java.lang.String OP_USER
          The name of an option used with a number of PersistentObject access methods to specify the name of the Lighthouse user that is to be considered the performer of the requst.
 
Method Summary
 boolean breakLock(java.lang.Object type, java.lang.String id, java.util.Map options)
          Break a lock held on an object.
 WavesetResult checkinObject(PersistentObject obj, java.util.Map options)
          Store changes to an object and release the logical lock.
 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.
 WavesetResult commitView(GenericObject view, java.util.Map options)
          Commit a view.
 int countObjects(java.lang.Object type, java.util.Map options)
          Get a count of objects of a given type.
 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.
 ObjectCache getCache()
          Get a handle to the object cache.
 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 copy of an object.
 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 copy of an object, but do not throw an exception if it does not exist.
 QueryResult getObjects(java.lang.Object type, java.util.Map options)
          Get a list of objects of a given type.
 GenericObject getSystemConfiguration()
          Obtain the system configuration object.
 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.
 LockInfo lockObject(java.lang.Object type, java.lang.String id, java.util.Map options)
          Acquire a logical lock an object, without retrieving it.
 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.
 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.
 

Field Detail

OP_ORDER_BY

public static final java.lang.String OP_ORDER_BY
The name of a query option used to specify sorting of the result. The value is expected to be a list of attribute names.

See Also:
Constant Field Values

OP_START_AFTER

public static final java.lang.String OP_START_AFTER
The name of a query option that specifies a concatenated key value. The result of a query that specifies this option should contain only items whose 'orderBy' values are greater than the set of values that this option specifies.

The value is expected to be a list of string values that correspond positionally to the attribute names that are specified as the value of OP_ORDER_BY.

See Also:
Constant Field Values

OP_END_BEFORE

public static final java.lang.String OP_END_BEFORE
The name of a query option that specifies a concatenated key value. The result of a query that specifies this option should contain only items whose 'orderBy' values are less than the set of values that this option specifies.

The value is expected to be a list of string values that correspond positionally to the attribute names that are specified as the value of OP_ORDER_BY.

See Also:
Constant Field Values

HIGH_VALUES

public static final java.lang.String HIGH_VALUES
A sentinel value that represents the highest possible value of a sort key (e.g., OP_ORDER_BY). The result of a query that specifies HIGH_VALUES as the value of OP_END_BEFORE should contain the items with the highest 'orderBy' values.

See Also:
Constant Field Values

OP_ATTRIBUTES

public static final java.lang.String OP_ATTRIBUTES
The name of a query option used to specify search conditions. The conditions are specified as a Map of name value pairs, where the names are attribute names, and the comparison is implicitly equals.

See Also:
Constant Field Values

OP_CONDITIONS

public static final java.lang.String OP_CONDITIONS
The name of a query option used to specify search conditions. The conditions are specified as a List of AttributeCondition objects.

See Also:
Constant Field Values

OP_MAX_ROWS

public static final java.lang.String OP_MAX_ROWS
The name of a query option used to specify the maximum number of rows to return in a result.

See Also:
Constant Field Values

OP_SUBJECT

public static final java.lang.String OP_SUBJECT
The name of a query option used to specify the authorization filtering. The value is expected to be a Subject object.

See Also:
Constant Field Values

OP_FILTER

public static final java.lang.String OP_FILTER
See Also:
Constant Field Values

OP_BUFFERED

public static final java.lang.String OP_BUFFERED
The name of a query option used to requst result buffering. If supported, this will cause large results to be incrementally brought into memory. The default is to bring all results into memory.

See Also:
Constant Field Values

OP_BLOCK_SIZE

public static final java.lang.String OP_BLOCK_SIZE
The size of the block used when buffering query results.

See Also:
Constant Field Values

OP_NO_CACHE

public static final java.lang.String OP_NO_CACHE
In some cases, the results of a listObjects call may be cached and reused. The cache typically adjusts itself for changes in the list every few seconds. This option can be used to disable the list cache. This is necessary in some of the timing sensitive unit tests.

This option will also be recognized by the PersistentObject access methods such as getObject and getObjectIfExists to avoid the object cache. The checkoutObject method will always bypass the cache when obtaining a lock.

See Also:
Constant Field Values

OP_ONLY_NAMES

public static final java.lang.String OP_ONLY_NAMES
Return only names (and IDs) in the query result. This allows use of the server cache to generate a list result

See Also:
Constant Field Values

OP_SUBTYPES

public static final java.lang.String OP_SUBTYPES
A flag recognized by getObject and getObjectIfExists that will cause it to search repository subtypes of the given type. This is necessary to locate some TaskDefinition and Configuration objects that used repository subtypes as a way to have more control over authorization. This authorization technique is obsolete with the introduction of Authorization Types in v4 and should gradually be eliminated. Until then, some internal parts of lighthouse may still need to use this option to locate tasks.

See Also:
Constant Field Values

OP_USER

public static final java.lang.String OP_USER
The name of an option used with a number of PersistentObject access methods to specify the name of the Lighthouse user that is to be considered the performer of the requst. This name will be used when checking logical locks, and recording the last modifier of an object.

The ObjectSource is not required to support this option, if it does not it will be silently ignored.

See Also:
Constant Field Values

OP_FORCE

public static final java.lang.String OP_FORCE
An option that may be used with the checkinObject method to disable any constraint checking that might ordinarilly be performed during the checkin. This may be used to improve the performance of the checkin in sitations where you know that the object is valid. The ObjectSource may ignore this option.

When used with the deleteObject method, it indiciates that inter-object delete constraints will not be checked. For WSUser objects, it indicates that the WSUser may be deleted even if the user has provisioned resource accounts.

See Also:
Constant Field Values

OP_FAST

public static final java.lang.String OP_FAST
An option that may be recognized by checkinObject to perform the fastest possible checkin. This may cause certain constraint checking that is performed even with the OP_FORCE option.

See Also:
Constant Field Values

OP_KEEP_LOCK

public static final java.lang.String OP_KEEP_LOCK
An option that may be recognized by checkinObject to preserve the caller's logical lock on the specified object. Otherwise, checkinObject releases any logical lock after updating the object.

See Also:
Constant Field Values

OP_ALLOW_NOT_FOUND

public static final java.lang.String OP_ALLOW_NOT_FOUND
An option that may be recognized by checkoutObject to return null if it cannot find the specified object. Otherwise, checkoutObject throws ItemNotFound if it cannot find the specified object.

See Also:
Constant Field Values

OP_NO_RULE_DRIVEN_MEMBERS

public static final java.lang.String OP_NO_RULE_DRIVEN_MEMBERS
The name of a query option used to specify that the query results should not include any rule driven members when a query includes the memberObjectGroup scoping attribute. Currently this is just used internally to prevent the call to getObjects within InternalSession#getRuleDrivenMembers from recalling getRuleDrivenMembers when searching for the list of Idm users matching the attr conditions returned in the object group's user member rule. The default is to include rule driven members in all user queries scoped by org.

See Also:
Constant Field Values
Method Detail

getSystemConfiguration

public GenericObject getSystemConfiguration()
                                     throws WavesetException
Obtain the system configuration object. It is read-only. // This could also be done with getObject, but that would require // we publish a constant object id, and assume everyone knows // what Type to use. Since this is becomming a common place to // store component options, a more direct interface is warranted, // similar to WavesetProperties.

Throws:
WavesetException

getCache

public ObjectCache getCache()
Get a handle to the object cache. This is an older and even more constrained interface for object access. Whan an application has a ObjectSource, it usually just calls the object access methods defined on it. But occasionally it is necessary to pass an ObjectCache to another component, in which case you may obtain one here.


getObject

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

Throws:
WavesetException
ItemNotFound

getObject

public PersistentObject getObject(java.lang.Object type,
                                  java.lang.String id,
                                  java.util.Map options)
                           throws WavesetException,
                                  ItemNotFound
Get a read-only copy of an object. Options may may be used to specify the OP_NO_CACHE or OP_SUBTYPES option.

Throws:
WavesetException
ItemNotFound

getObjectIfExists

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

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 copy of an object, but do not throw an exception if it does not exist. Options may may be used to specify the OP_NO_CACHE or OP_SUBTYPES option.

Throws:
WavesetException

lockObject

public LockInfo lockObject(java.lang.Object type,
                           java.lang.String id,
                           java.util.Map options)
                    throws ItemNotFound,
                           LockedByAnother,
                           WavesetException
Acquire a logical lock an object, without retrieving it.

The OP_USER option may be used to specify the name of the user considered to be acquiring the lock.

Throws:
ItemNotFound
LockedByAnother
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. The object must already be locked by the current user.

The OP_USER option may be used to specify the name of the user considered to be releasing the lock.

Throws:
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException

getLock

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

Throws:
ItemNotFound
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.

There is no guarentee a lock will be broken, you normally must have authority over the user that is currently holding the lock.

The OP_USER option may be used to specify the name of the user considered to be breaking the lock.

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. This typically reads the object from the persistent store, acquires a logical lock, and adds the object to a cache.

It is usually more efficient to call checkoutObject rather than make individual calls to lockObject and getObject

The OP_USER option may be used to specify the name of the user considered to be checking out the object.

The OP_ALLOW_NOT_FOUND option may be passed to return null if cannot find the specified object. Otherwise, this method throws ItemNotFound.

Throws:
ItemNotFound
LockedByAnother
WavesetException

checkinObject

public WavesetResult checkinObject(PersistentObject obj,
                                   java.util.Map options)
                            throws ItemNotFound,
                                   ItemNotLocked,
                                   LockedByAnother,
                                   WavesetException
Store changes to an object and release the logical lock. If the object did not exist it will be created. If the object does exist, the persistent store may require that a lock be held.

The OP_USER option may be used to specify the name of the user considered to be checkin in the object.

The OP_FORCE option may be passed to inhibit any constraint checking that would ordinarilly be done prior to storage. This is normally off, but since constraint checking can be expensive, there may be performance reasons for turning it on if you can ensure that the object is correct.

The OP_KEEP_LOCK option may be passed to preserve the caller's logical lock on the specified object. Otherwise, this method releases any lock after updating the object.

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 OP_FORCE option may be passed to inhibit any constraint checking that would ordinarilly be done. This may be used to delete a WSUser object that has provisioned resource accounts, normally a WSUser cannot be deleted until it has been fully deprovisioned.

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, options map has the same structure as that for the listObjects and getObjects methods, and is typically passed as a QueryOptions object.

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.

The OP_USER option may be used to specify the name of the user considered to be renaming the object.

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.

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.

Throws:
WavesetException

countObjects

public int countObjects(java.lang.Object type,
                        java.util.Map options)
                 throws WavesetException
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.

Throws:
WavesetException

getView

public GenericObject getView(java.lang.String id,
                             java.util.Map options)
                      throws WavesetException
Get a view.

Throws:
WavesetException

getForm

public Form getForm(GenericObject view,
                    java.util.Map options)
             throws WavesetException
Get the form to be used with a view.

Throws:
WavesetException

createView

public GenericObject createView(java.lang.String id,
                                java.util.Map options)
                         throws WavesetException
Create a view.

Throws:
WavesetException

checkoutView

public GenericObject checkoutView(java.lang.String id,
                                  java.util.Map options)
                           throws WavesetException
Checkout a view.

Throws:
WavesetException

refreshView

public GenericObject refreshView(GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Refresh a view.

Throws:
WavesetException

checkinView

public WavesetResult checkinView(GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Checkin a view.

Throws:
WavesetException

commitView

public WavesetResult commitView(GenericObject view,
                                java.util.Map options)
                         throws WavesetException
Commit a view.

Throws:
WavesetException

unlockView

public void unlockView(GenericObject view,
                       java.util.Map options)
                throws WavesetException
Unlock a view.

Throws:
WavesetException

deleteView

public WavesetResult deleteView(java.lang.String id,
                                java.util.Map options)
                         throws WavesetException
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.

Throws:
WavesetException