|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.session.AbstractSession
com.waveset.session.RemoteSession
Nested Class Summary |
Nested classes inherited from class com.waveset.session.Session |
Session.Scope |
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
DEFAULT_HOST
Default host. |
static java.lang.String |
DEFAULT_PORT
Defualt port. |
static java.lang.String |
DEFAULT_SERVLET
Default servlet URL. |
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 |
Fields inherited from interface com.sun.idm.idmx.api.IDMXConstants |
COMP_AUTHENTICATOR, COMP_CHANGE_NOTIFIER, COMP_PERSISTENT_TRANSACTION_STORE, COMP_TRANSACTION_MANAGER, CONFIGURATION_ID, LOCAL_HOST, OP_ATTRS_TO_GET, OP_AUDIT, OP_NO_TRANSACTIONS, PRE_AUTHENTICATED_USER_LOGIN_TYPE, SPE_LOGIN_USER_INTERFACE, USER_LOGIN_TYPE |
Constructor Summary | |
RemoteSession()
|
|
RemoteSession(java.lang.String user,
EncryptedData pass)
Build a remote session to the local host. |
|
RemoteSession(java.lang.String host,
java.lang.String user,
EncryptedData pass)
Build a session given a host name. |
|
RemoteSession(java.net.URL url,
java.lang.String user,
EncryptedData pass)
Build a session with a fully specified URL. |
Method Summary | |
void |
breakLock(Type type,
java.lang.String id)
Forcibly remove the lock on an object. |
WavesetResult |
checkinObject(PersistentObject object,
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. |
void |
clearCache()
Clears the cache managed by this session. |
void |
clearSubject()
Removes the subject from this session. |
java.lang.String |
consoleCommand(java.lang.String command)
Run a consolea command and return the result. |
void |
createObject(PersistentObject object)
Creates a new object in the repository. |
GenericObject |
createView(java.lang.String id,
java.util.Map options)
Create a view. |
void |
deleteObject(java.lang.Object typeid,
java.lang.String id,
java.util.Map options)
Delete an object. |
void |
deleteObject(Type type,
java.lang.String id,
boolean force)
Permanently remove an object from the repository. |
WavesetResult |
deleteView(java.lang.String id,
java.util.Map options)
Delete the repository objects that are associated with the view id. |
protected java.lang.Object |
deserialize(org.w3c.dom.Element element)
|
java.lang.String |
getApplicationName()
|
java.lang.String |
getApplicationType()
|
ObjectCache |
getCache()
Returns the cache being maintained for this session. |
long |
getCacheConsistencyNumber(Type t)
Return a Cache Consistency Number. |
Form |
getForm(GenericObject view,
java.util.Map options)
Get the form to be used with a view. |
java.lang.String |
getHost()
Make this public so the console knows where we're going. |
java.util.Locale |
getLocale()
Get the locale |
LockInfo |
getLockInfo(Type type,
java.lang.String id)
Retrieve information about a lock held on the object. |
LoginConfig |
getLoginConfig()
|
WavesetResult |
getLoginResult()
Returns the login result messages, if any. |
PersistentObject |
getObjectIfExists(java.lang.Object typeid,
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 typeid,
java.util.Map options)
Get a list of objects of a given type. |
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. |
java.lang.String |
getSessionToken()
|
Subject |
getSubject()
Returns the subject that is authenticated for this session. |
GenericObject |
getSystemConfiguration()
Obtain the system configuration object. |
java.lang.String |
getUser()
Get the name of the administrator or end-user that has authenticated to this session. |
GenericObject |
getView(java.lang.String id,
java.util.Map options)
Get a view. |
Form |
getViewForm(GenericObject view,
java.lang.String formId,
java.util.Map options)
Get an alternate view form. |
java.lang.String[] |
listControlledApprovers()
Like listApprovers, below - this lists all approvers in groups that the current administrator controls. |
QueryResult |
listObjects(java.lang.Object type,
java.util.Map options)
This is the cannonical implementation, the AbstractSession interface of all the others funnel through here. |
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 |
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 typeid,
java.lang.String id,
java.util.Map options)
Acquire a logical lock an object, without retrieving it. |
void |
login()
Perform authentication of the subject (user or administrator) that was specified using the the LoginInfo object given to the Session constructor. |
void |
logout()
Remove authentication credentials from this session, and release resources held by the session. |
static void |
println(java.lang.String msg)
|
GenericObject |
refreshView(GenericObject view,
java.util.Map options)
Refresh a view. |
void |
renameObject(Type type,
java.lang.String id,
java.lang.String newName)
Changes the name of an existing object. |
protected void |
serialize(java.lang.StringBuffer buf,
int indent,
java.lang.Object obj)
|
void |
setApplicationName(java.lang.String applicationName)
|
void |
setApplicationType(java.lang.String appType)
|
void |
setCache(PersistentObject obj)
Connects an object to the session's object cache. |
void |
setLocale(java.util.Locale locale)
Set the locale |
void |
setSubjectOptions(java.util.Map map)
Sets the subject. |
void |
setURL(java.lang.String url)
|
void |
setURL(java.net.URL url)
|
void |
unlockObject(java.lang.Object typeid,
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
public static final java.lang.String DEFAULT_HOST
public static final java.lang.String DEFAULT_PORT
public static final java.lang.String DEFAULT_SERVLET
Constructor Detail |
public RemoteSession() throws WavesetException
public RemoteSession(java.lang.String user, EncryptedData pass) throws WavesetException
public RemoteSession(java.lang.String host, java.lang.String user, EncryptedData pass) throws WavesetException
public RemoteSession(java.net.URL url, java.lang.String user, EncryptedData pass) throws WavesetException
Method Detail |
public void setURL(java.net.URL url)
public void setURL(java.lang.String url) throws WavesetException
WavesetException
public java.lang.String getHost()
public ObjectCache getCache()
Session
getCache
in interface Session
getCache
in class AbstractSession
public void clearCache() throws WavesetException
Session
This is intended for testing. Applications may want to clear the cache periodically as part of a "refresh" operation to ensure that the displayed data is up to date.
clearCache
in interface Session
clearCache
in class AbstractSession
WavesetException
public void setCache(PersistentObject obj) throws WavesetException
Session
This method is no longer necessary. You may use
getCache
to obtain the session's cache then
use Persistentobject.setCache
to assign it.
There is a subtle difference between adding an object to
a cache, and setting the cache. ObjectCache.addObject
will store a reference to the object in the cache, thereby
making it visible to getObject
method.
The setCache
method will store a reference to the
cache in the object, but will not put a reference to the object
in the cache. This will allow the
object to perform auto-resolution, but the object will be invisible
to the cache. The latter behavior is what you normally want
when manipulating temporary objects that are in the process
of being created.
setCache
in interface Session
setCache
in class AbstractSession
WavesetException
public long getCacheConsistencyNumber(Type t) 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
getCacheConsistencyNumber
in class AbstractSession
WavesetException
public java.util.ArrayList loadObjects(Type type, AttributeCondition[] attrConds) throws WavesetException
ObjectLoader
loadObjects
in interface ObjectLoader
loadObjects
in class AbstractSession
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
loadObject
in class AbstractSession
WavesetException
public void login() throws WSLoginException, WavesetException
Session
When using the SessionFactory, the login call happens automatically, there is no need for the application to explicitly call login.
login
in interface Session
login
in class AbstractSession
WSLoginException
WavesetException
public void logout() throws WavesetException
Session
After a logout
call, the session object may
no longer be used. It is important that an application call logout()
when they know that the user's session has completed. For web
applications, the servlet or JSP may call
SessionFactory.poolSession
to keep the authenticated
session alive for some period of time. But the application should
also support the concept of an explicit logout, and call the
logout
method.
logout
in interface Session
logout
in class AbstractSession
WavesetException
public Subject getSubject()
Session
This will be either an Administrator
or
a WSUser
object. Applications will have to use
the Java operator instanceof
to perform the
appropriate downcast.
If the goal is to obtain the name of the administrator or end-user
that has authenticated to this session, you may use the
convenience method getUser
instead.
getSubject
in interface Session
getSubject
in class AbstractSession
public void setSubjectOptions(java.util.Map map)
Session
setSubjectOptions
in interface Session
setSubjectOptions
in class AbstractSession
public java.lang.String getUser()
Session
This can be used as an alternative to getSubject
if all you need is the name.
getUser
in interface Session
getUser
in class AbstractSession
public void clearSubject() throws WavesetException
Session
This should be called only by the SessionFactory as part of the operation of session pooling.
jsl - Should this be protected?
clearSubject
in interface Session
clearSubject
in class AbstractSession
WavesetException
public WavesetResult getLoginResult()
Session
Null if no messages. Otherwise contains message (e.g. Password will expire in 'n' day(s).
getLoginResult
in interface Session
getLoginResult
in class AbstractSession
public GenericObject getSystemConfiguration() throws WavesetException
ObjectSource
getSystemConfiguration
in interface ObjectSource
getSystemConfiguration
in class AbstractSession
WavesetException
public java.lang.String getSessionToken()
public PersistentObject getObjectIfExists(java.lang.Object typeid, java.lang.String id, java.util.Map options) throws WSAuthorizationException, WavesetException
ObjectSource
getObjectIfExists
in interface ObjectSource
getObjectIfExists
in class AbstractSession
WSAuthorizationException
WavesetException
public LockInfo lockObject(java.lang.Object typeid, java.lang.String id, java.util.Map options) throws WSAuthorizationException, ItemNotFound, LockedByAnother, WavesetException
ObjectSource
The OP_USER
option may be used to specify the
name of the user considered to be acquiring the lock.
lockObject
in interface ObjectSource
lockObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
LockedByAnother
WavesetException
public LockInfo getLockInfo(Type type, java.lang.String id) throws WSAuthorizationException, ItemNotFound, WavesetException
Session
A lock may be placed on an object through either
the lockObject
or checkoutObject
methods.
This mehtod may be used to determine whether or not such a lock exists.
getLockInfo
in interface Session
getLockInfo
in class AbstractSession
WSAuthorizationException
ItemNotFound
WavesetException
public void createObject(PersistentObject object) throws WSAuthorizationException, AlreadyExists, ValidationFailed, WavesetException
Session
Objects are created by first instantiating a subclass of
PersistentObject
, then calling appropriate
accessor methods to specify the object's attributes, and
finally calling the createObject
method to store
the object in the repository.
The new object must be given a name that is unique within the repository. If an object with this name already exist, an exception is thrown.
Other type specific validation may also be performed before the
object is stored in the repository. If any of these validation
tests fail, a ValidationFailed
exception will be
thrown describing the nature of the failure.
After the method returns, the supplied object will be in the session's cache, but the server will not retain any references to this object.
createObject
in interface Session
createObject
in class AbstractSession
WSAuthorizationException
AlreadyExists
ValidationFailed
WavesetException
public PersistentObject checkoutObject(java.lang.Object type, java.lang.String id, java.util.Map options) throws WSAuthorizationException, ItemNotFound, LockedByAnother, WavesetException
ObjectSource
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
.
checkoutObject
in interface ObjectSource
checkoutObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
LockedByAnother
WavesetException
public WavesetResult checkinObject(PersistentObject object, java.util.Map options) throws WSAuthorizationException, ItemNotFound, ItemNotLocked, LockedByAnother, AlreadyExists, ValidationFailed, WavesetException
ObjectSource
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.
checkinObject
in interface ObjectSource
checkinObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
ItemNotLocked
LockedByAnother
AlreadyExists
ValidationFailed
WavesetException
public void unlockObject(java.lang.Object typeid, java.lang.String id, java.util.Map options) throws WSAuthorizationException, ItemNotFound, ItemNotLocked, LockedByAnother, WavesetException
ObjectSource
The OP_USER
option may be used to specify the
name of the user considered to be releasing the lock.
unlockObject
in interface ObjectSource
unlockObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException
public void breakLock(Type type, java.lang.String id) throws WSAuthorizationException, ItemNotFound, ItemNotLocked, LockedByAnother, WavesetException
Session
This was originally added for the unit tests, which would sometimes crash and leave locks behind. It can also be useful to allow administrators to steal each others locks in case someone goes to lunch.
The user must have authorization to modify the object in order to break a lock. If no lock is held on the object, the method has no effect.
breakLock
in interface Session
breakLock
in class AbstractSession
WSAuthorizationException
ItemNotFound
ItemNotLocked
LockedByAnother
WavesetException
public void renameObject(Type type, java.lang.String id, java.lang.String newName) throws WSAuthorizationException, ItemNotFound, LockedByAnother, WavesetException
Session
The object must either be unlocked, or locked by the current user. References to this object will still exist after the name change, references are made using the object's generated system identifier which does not change when the name changes.
renameObject
in interface Session
renameObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
LockedByAnother
WavesetException
public void deleteObject(Type type, java.lang.String id, boolean force) throws WSAuthorizationException, ItemNotFound, LockedByAnother, ObjectInUse, ObjectProtected, WavesetException
Session
This is the same as deleteObject, except that we will allow the object to be deleted even if there are references to it from another object. This is the signature we should move to, the other can be deprecated.
deleteObject
in interface Session
deleteObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
LockedByAnother
ObjectInUse
ObjectProtected
WavesetException
public void deleteObject(java.lang.Object typeid, java.lang.String id, java.util.Map options) throws WSAuthorizationException, ItemNotFound, LockedByAnother, ObjectInUse, ObjectProtected, WavesetException
ObjectSource
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.
deleteObject
in interface ObjectSource
deleteObject
in class AbstractSession
WSAuthorizationException
ItemNotFound
LockedByAnother
ObjectInUse
ObjectProtected
WavesetException
public java.util.List getResourceObjects(java.lang.String objectType, java.lang.String resourceId, java.util.Map options) throws WavesetException
LighthouseContext
getResourceObjects
in interface LighthouseContext
getResourceObjects
in class AbstractSession
WavesetException
public java.util.List listResourceObjects(java.lang.String objectType, java.util.List resourceList, java.util.Map options) throws WavesetException
LighthouseContext
listResourceObjects
in interface LighthouseContext
listResourceObjects
in class AbstractSession
WavesetException
public QueryResult getObjects(java.lang.Object typeid, java.util.Map options) throws WavesetException
ObjectSource
getObjects
in interface ObjectSource
getObjects
in class AbstractSession
WavesetException
public QueryResult listObjects(java.lang.Object type, java.util.Map options) throws WavesetException
listObjects
in interface ObjectSource
listObjects
in class AbstractSession
WavesetException
public LoginConfig getLoginConfig() throws WavesetException
getLoginConfig
in interface Session
getLoginConfig
in class AbstractSession
WavesetException
public java.lang.String[] listControlledApprovers() throws WavesetException
Session
listControlledApprovers
in interface Session
listControlledApprovers
in class AbstractSession
WavesetException
AbstractSession.getAdministrators(Map)
public GenericObject createView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
createView
in interface ObjectSource
createView
in class AbstractSession
WavesetException
public WavesetResult deleteView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
WavesetException
public GenericObject getView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
getView
in interface ObjectSource
getView
in class AbstractSession
WavesetException
public Form getForm(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
getForm
in interface ObjectSource
getForm
in class AbstractSession
WavesetException
public Form getViewForm(GenericObject view, java.lang.String formId, java.util.Map options) throws WavesetException
Session
getViewForm
in interface Session
getViewForm
in class AbstractSession
WavesetException
public GenericObject checkoutView(java.lang.String id, java.util.Map options) throws WavesetException
ObjectSource
checkoutView
in interface ObjectSource
checkoutView
in class AbstractSession
WavesetException
public WavesetResult checkinView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
checkinView
in interface ObjectSource
checkinView
in class AbstractSession
WavesetException
public void unlockView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
unlockView
in interface ObjectSource
unlockView
in class AbstractSession
WavesetException
public GenericObject refreshView(GenericObject view, java.util.Map options) throws WavesetException
ObjectSource
refreshView
in interface ObjectSource
refreshView
in class AbstractSession
WavesetException
public java.lang.String consoleCommand(java.lang.String command) throws WavesetException
WavesetException
public static void println(java.lang.String msg)
public java.util.Locale getLocale()
getLocale
in interface Session
getLocale
in class AbstractSession
public void setLocale(java.util.Locale locale)
setLocale
in interface Session
setLocale
in class AbstractSession
public java.lang.String getApplicationName()
public void setApplicationName(java.lang.String applicationName)
public java.lang.String getApplicationType()
public void setApplicationType(java.lang.String appType)
protected void serialize(java.lang.StringBuffer buf, int indent, java.lang.Object obj)
protected java.lang.Object deserialize(org.w3c.dom.Element element) throws WavesetException
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |