|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--arlut.csd.ganymede.GanymedeSession
User-level session object in the Ganymede server. Each client
that logs in to the Ganymede server through the GanymedeServer login() method gets a GanymedeSession object, which oversees that
client's interactions with the server. The client talks to its
GanymedeSession object through the Session RMI interface, making calls to
access schema information and database objects in the server.
The GanymedeSession class provides query and editing services to
the client, tracks the client's status, and manages permissions.
Most of the actual database handling is done through a second,
database-layer session object called a DBSession that GanymedeSession
maintains for each user. GanymedeSession methods like view_db_object() and edit_db_object() make calls on the DBSession to actually access
DBObjects in the Ganymede
database. The client then receives a serialized ReturnVal which may include a remote
db_object reference so that
the client can directly talk to the DBObject or
DBEditObject over RMI.
Once a GanymedeSession is created by the GanymedeServer's login()
method, the client is considered to be authenticated, and may make
as many Session calls as it likes, until the GanymedeSession's
logout() method
is called. If the client dies or loses its network connection to
the Ganymede server for more than 10 minutes, the RMI system will
automatically call GanymedeSession's
unreferenced()
method, which will log the client out from the server.
The Ganymede server is transactional, and the client must call
openTransaction() before making any changes via edit_db_object()
or other editing methods. In turn, changes made by the client
using the edit_db_object() and related methods will not actually be
'locked-in' to the Ganymede database until the commitTransaction() method is called.
Most methods in this class are synchronized to avoid race condition security holes between the persona change logic and the actual operations.
| Field Summary | |
(package private) boolean |
beforeversupergash
GanymedeSessions created for internal operations always operate with supergash privileges. |
(package private) arlut.csd.ganymede.Client |
client
Remote reference to our client |
(package private) java.lang.String |
clienthost
The DNS name for the client's host |
(package private) arlut.csd.ganymede.serverClientProxy |
clientProxy
Async partial proxy for sending messages to the client. |
(package private) java.util.Date |
connecttime
The time that this client initially connected to the server. |
(package private) static boolean |
debug
|
(package private) arlut.csd.ganymede.DBObject |
defaultObj
A reference to the Ganymede DBObject
storing our default permissions,
or the permissions that applies when we are not in supergash mode
and we do not have any ownership over the object in question. |
(package private) arlut.csd.ganymede.PermMatrix |
defaultPerms
This variable stores the permission bits that are applicable to generic objects not specifically owned by this persona. |
(package private) arlut.csd.ganymede.PermMatrix |
delegatableDefaultPerms
This variable stores the permission bits that are applicable to generic objects not specifically owned by this persona and which the current admin has permission to delegate to subordinate roles. |
(package private) arlut.csd.ganymede.PermMatrix |
delegatablePersonaPerms
This variable stores the permission bits that are applicable to objects that the current persona has ownership privilege over and which the current admin has permission to delegate to subordinate roles. |
boolean |
enableOversight
If this variable is set to false, no custom wizard code will ever be invoked, and required fields will not be forced. |
boolean |
enableWizards
This variable tracks whether or not the client desires to have wizards presented. |
private arlut.csd.Util.booleanSemaphore |
forcingSemaphore
A flag to let the forceOff() logic know that another thread has already tried to knock off the user. |
(package private) java.util.Date |
lastActionTime
The time of the user's last top-level operation.. |
(package private) java.lang.String |
lastEvent
Description of the last action recorded for this client. |
private arlut.csd.Util.booleanSemaphore |
loggedInSemaphore
If true, the user is currently logged in. |
(package private) java.util.Vector |
newObjectOwnerInvids
This variable is a vector of object references ( Invid's) to the owner groups
that the client has requested newly created objects be placed in. |
(package private) int |
objectsCheckedOut
A count of how many objects this session has currently checked out. |
(package private) arlut.csd.ganymede.DBObjectBase |
permBase
Convenience persistent reference to the Permission Matrix object base |
(package private) static boolean |
permsdebug
|
(package private) java.util.Date |
permTimeStamp
When did we last update our local cache/summary of permissions records? |
(package private) arlut.csd.ganymede.DBObjectBase |
personaBase
Convenience persistent reference to the adminPersonae object base |
(package private) arlut.csd.ganymede.Invid |
personaInvid
The object reference identifier for the current persona, if any. |
(package private) java.lang.String |
personaName
The name of the current persona, of the form '<username>:<description>', for example, 'broccol:GASH Admin'. |
(package private) arlut.csd.ganymede.DBObject |
personaObj
A reference to our current persona object. |
(package private) arlut.csd.ganymede.PermMatrix |
personaPerms
This variable stores the permission bits that are applicable to objects that the current persona has ownership privilege over. |
(package private) java.util.Date |
personaTimeStamp
When did we last check our persona permissions? |
(package private) boolean |
remotelyAccessible
If true, this GanymedeSession will export its objects and fields for direct access via RMI. |
(package private) boolean |
semaphoreLocked
if this session is on the GanymedeServer's lSemaphore, this boolean will be true. |
(package private) arlut.csd.ganymede.DBSession |
session
Our DBSession object. |
(package private) java.lang.String |
status
The current status message for this client. |
(package private) boolean |
supergashMode
A flag indicating whether the client has supergash priviliges. |
(package private) boolean |
timedout
If true, the user has had a soft timeout and needs to re-authenticate with their password, even for their non-privileged username |
(package private) arlut.csd.ganymede.AdminEntry |
userInfo
This variable caches the AdminEntry
object which is reported to admin consoles connected to the
server when the console is updated. |
(package private) arlut.csd.ganymede.Invid |
userInvid
The object reference identifier for the logged in user, if any. |
(package private) java.lang.String |
username
The unique name that the user is connected to the server under.. |
(package private) java.util.Vector |
visibilityFilterInvids
This variable is a vector of object references (Invid's) to the owner groups that the client has requested the listing of objects be restricted to. |
(package private) arlut.csd.ganymede.GanymediatorWizard |
wizard
A GanymedeSession can have a single wizard active. |
(package private) arlut.csd.ganymede.GanymedeXMLSession |
xSession
If this session is being driven by a GanymedeXMLSession, this reference will be non-null. |
| Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
| Fields inherited from class java.rmi.server.RemoteServer |
|
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
GanymedeSession()
Constructor for a server-internal GanymedeSession. |
|
GanymedeSession(arlut.csd.ganymede.Client client,
java.lang.String loginName,
arlut.csd.ganymede.DBObject userObject,
arlut.csd.ganymede.DBObject personaObject,
boolean exportObjects)
Constructor used to create a server-side attachment for a Ganymede client. |
|
GanymedeSession(java.lang.String sessionLabel)
Constructor for a server-internal GanymedeSession. |
|
| Method Summary | |
arlut.csd.ganymede.ReturnVal |
abortTransaction()
This method causes all changes made by the client to be thrown out by the database, and the transaction is closed. |
private void |
addResultRow(arlut.csd.ganymede.DBObject obj,
arlut.csd.ganymede.Query query,
arlut.csd.ganymede.QueryResult result,
boolean internal,
arlut.csd.ganymede.DBEditObject perspectiveObject)
This private method takes care of adding an object to a query result, checking permissions and what-not as needed. |
void |
checkIn()
This method is used by the server to decrement the admin console's display of the number of objects this user session has checked out and/or created. |
(package private) void |
checklogin()
This private method is called by all methods in GanymedeSession that require the client to be logged in to operate. |
void |
checkOut()
This method is used by the server to increment the admin console's display of the number of objects this user session has checked out and/or created. |
void |
checkpoint(java.lang.String key)
Pass-through method for schema kit code. |
arlut.csd.ganymede.ReturnVal |
clone_db_object(arlut.csd.ganymede.Invid invid)
Clone a new object from object <invid>. |
arlut.csd.ganymede.ReturnVal |
commitTransaction()
This method causes all changes made by the client to be 'locked in' to the database. |
arlut.csd.ganymede.ReturnVal |
commitTransaction(boolean abortOnFail)
This method causes all changes made by the client to be 'locked in' to the database. |
arlut.csd.ganymede.ReturnVal |
create_db_object(short type)
Create a new object of the given type. |
arlut.csd.ganymede.ReturnVal |
create_db_object(short type,
boolean embedded)
Create a new object of the given type. |
java.lang.String |
describe(arlut.csd.ganymede.Invid invid)
This method is intended as a lightweight way of returning a handy description of the type and label of the specified invid. |
arlut.csd.ganymede.DumpResult |
dump(arlut.csd.ganymede.Query query)
This method provides the hook for doing a fast database dump to a string form. |
arlut.csd.ganymede.ReturnVal |
edit_db_object(arlut.csd.ganymede.Invid invid)
Check an object out from the database for editing. |
void |
enableOversight(boolean val)
This method is used to allow local server-side code to request that no oversight be maintained over changes made to the server through this GanymedeSession. |
void |
enableWizards(boolean val)
This method is used to allow a client to request that wizards not be provided in response to actions by the client. |
private boolean |
filterMatch(arlut.csd.ganymede.DBObject obj)
This method returns true if the visibility filter vector allows visibility of the object in question. |
arlut.csd.ganymede.ReturnVal |
filterQueries(java.util.Vector ownerInvids)
This method may be used to cause the server to pre-filter any object listing to only show those objects directly owned by owner groups referenced in the ownerInvids list. |
arlut.csd.ganymede.QueryResult |
filterQueryResult(arlut.csd.ganymede.QueryResult qr)
This method applies this GanymedeSession's current owner filter to the given QueryResult <qr> and returns a QueryResult with any object handles that are not matched by the filter stripped. |
arlut.csd.ganymede.Invid |
findLabeledObject(java.lang.String name,
short type)
Returns an Invid for an object of a specified type and name, or null if no such object could be found. |
(package private) void |
forceOff(java.lang.String reason)
If the server decides this person needs to get off (if the user times out, is forced off by an admin, or if the server is going down), it will call this method to knock them off. |
arlut.csd.ganymede.AdminEntry |
getAdminEntry()
This method is used to generate a serializable AdminEntry
object summarizing this GanymedeSession's state for
the admin console. |
arlut.csd.ganymede.BaseListTransport |
getBaseList()
Returns a serialized representation of the object types defined on the server. |
arlut.csd.ganymede.CategoryTransport |
getCategoryTree()
Returns a serialized representation of the basic category and base structure on the server. |
arlut.csd.ganymede.CategoryTransport |
getCategoryTree(boolean hideNonEditables)
Returns a serialized representation of the basic category and base structure on the server. |
java.lang.String |
getClientHostName()
This method returns the name of the system that the client is connected from. |
(package private) arlut.csd.ganymede.DBObject |
getContainingObj(arlut.csd.ganymede.DBObject object)
This method finds the ultimate owner of an embedded object |
arlut.csd.ganymede.ReturnVal |
getDataXML(arlut.csd.ganymede.FileReceiver receiver,
boolean logOffOnFailure)
This method is called by the XML client to initiate a dump of the entire data contents of the server. |
java.util.Vector |
getFieldTemplateVector(short baseId)
Returns a vector of field definition templates, in display order. |
java.lang.String |
getHelpBase()
This method is used to tell the client where to look to access the Ganymede help document tree. |
java.lang.StringBuffer |
getMessage(java.lang.String key,
boolean onlyShowIfNew)
This method is used to allow the client to retrieve messages like the motd from the server. |
java.lang.StringBuffer |
getMessageHTML(java.lang.String key,
boolean onlyShowIfNew)
This method is used to allow the client to retrieve messages like the motd from the server. |
java.lang.String |
getMyUserName()
This method returns the identification string that the server has assigned to the user. |
java.util.Vector |
getObjects(short baseid)
This is a method to allow code in the server to quickly and safely get a full list of objects in an object base. |
arlut.csd.ganymede.QueryResult |
getOwnerGroups()
This method returns a QueryResult of owner groups that the current persona has access to. |
arlut.csd.ganymede.PermEntry |
getPerm(arlut.csd.ganymede.DBObject object)
This method takes the administrator's current persona, considers the owner groups the administrator is a member of, checks to see if the object is owned by that group, and determines the appropriate permission bits for the object. |
arlut.csd.ganymede.PermEntry |
getPerm(arlut.csd.ganymede.DBObject object,
short fieldId)
This method takes the administrator's current persona, considers the owner groups the administrator is a member of, checks to see if the object is owned by that group, and determines the appropriate permission bits for the field in the object. |
(package private) arlut.csd.ganymede.PermEntry |
getPerm(short baseID,
boolean includeOwnedPerms)
This method returns the generic permissions for a object type. |
(package private) arlut.csd.ganymede.PermEntry |
getPerm(short baseID,
short fieldID,
boolean includeOwnedPerms)
This method returns the current persona's default permissions for a base and field. |
arlut.csd.ganymede.DBObject |
getPersona()
This method gives access to the DBObject for the administrator's persona record, if any. |
java.util.Vector |
getPersonae()
This method returns a list of personae names available to the user logged in. |
arlut.csd.ganymede.Invid |
getPersonaInvid()
Convenience method to get access to this session's persona invid. |
arlut.csd.ganymede.Category |
getRootCategory()
Deprecated. Superseded by the more efficient getCategoryTree() |
arlut.csd.ganymede.ReturnVal |
getSchemaXML(arlut.csd.ganymede.FileReceiver receiver,
boolean logOffOnFailure)
This method is called by the XML client to initiate a dump of the server's schema definition in XML format. |
arlut.csd.ganymede.DBSession |
getSession()
This method returns a reference to the DBSession object encapsulated
by this GanymedeSession object. |
java.util.Vector |
getTypes()
Deprecated. Superseded by the more efficient getBaseList() |
(package private) arlut.csd.ganymede.DBObject |
getUser()
Convenience method to get access to this session's UserBase instance. |
arlut.csd.ganymede.Invid |
getUserInvid()
Convenience method to get access to this session's user invid. |
arlut.csd.ganymede.GanymediatorWizard |
getWizard()
Returns the active wizard, if any, for this GanymedeSession. |
arlut.csd.ganymede.ReturnVal |
getXMLDump(arlut.csd.ganymede.FileReceiver receiver,
boolean logOffOnFailure)
This method is called by the XML client to initiate a dump of the server's entire database, schema and data, in XML format. |
arlut.csd.ganymede.ReturnVal |
inactivate_db_object(arlut.csd.ganymede.Invid invid)
Inactivate an object in the database |
java.util.Vector |
internalQuery(arlut.csd.ganymede.Query query)
This method provides the hook for doing all manner of internal object listing for the Ganymede database. |
private arlut.csd.ganymede.QueryResult |
intersectQueries(arlut.csd.ganymede.Query query,
arlut.csd.ganymede.QueryResult temp_result,
arlut.csd.ganymede.DBLock rLock)
This private method takes care of intersecting the result of a query operation against any linked queries to filter a cluster of queries. |
boolean |
isLoggedIn()
|
private boolean |
isMemberAll(java.util.Vector owners)
This helper method iterates through the owners vector and checks to see if the current personaInvid is a member of all of the groups through either direct membership or through membership of an owning group. |
boolean |
isSuperGash()
|
boolean |
isWizardActive()
Returns true if a wizard is currently interacting with the user. |
boolean |
isWizardActive(arlut.csd.ganymede.GanymediatorWizard wizard)
Returns true if a particular wizard is currently interacting with the user. |
void |
logout()
Log out this session. |
void |
logout(boolean forced_off)
Log out this session. |
arlut.csd.ganymede.ReturnVal |
openTransaction(java.lang.String describe)
This method call initiates a transaction on the server. |
arlut.csd.ganymede.ReturnVal |
openTransaction(java.lang.String describe,
boolean interactive)
This method call initiates a transaction on the server. |
boolean |
personaMatch(arlut.csd.ganymede.DBObject obj)
Returns true if the active persona has some sort of owner/access relationship with the object in question through its list of owner groups. |
arlut.csd.ganymede.QueryResult |
query(arlut.csd.ganymede.Query query)
This method provides the hook for doing all manner of simple object listing for the Ganymede database. |
arlut.csd.ganymede.QueryResult |
query(arlut.csd.ganymede.Query query,
arlut.csd.ganymede.DBEditObject perspectiveObject)
Server-side method for doing object listing with support for DBObject's lookupLabel
method. |
arlut.csd.ganymede.QueryResult |
queryDispatch(arlut.csd.ganymede.Query query,
boolean internal,
boolean forTransport,
arlut.csd.ganymede.DBLock extantLock,
arlut.csd.ganymede.DBEditObject perspectiveObject)
This method is the primary Query engine for the Ganymede databases. |
arlut.csd.ganymede.QueryResult |
queryInvids(java.util.Vector invidVector)
This method allows the client to get a status update on a specific list of invids. |
arlut.csd.ganymede.ReturnVal |
reactivate_db_object(arlut.csd.ganymede.Invid invid)
Reactivates an inactivated object in the database |
private boolean |
recursePersonaMatch(arlut.csd.ganymede.Invid owner,
java.util.Vector alreadySeen)
Recursive helper method for personaMatch.. |
private boolean |
recursePersonasMatch(java.util.Vector owners,
java.util.Vector alreadySeen)
Recursive helper method for personaMatch.. |
boolean |
registerWizard(arlut.csd.ganymede.GanymediatorWizard wizard)
This method is used to register a wizard for this GanymedeSession. |
arlut.csd.ganymede.ReturnVal |
remove_db_object(arlut.csd.ganymede.Invid invid)
Remove an object from the database |
private void |
resetDefaultPerms()
This convenience method resets defaultPerms from the default permission object in the Ganymede database. |
boolean |
rollback(java.lang.String key)
Pass-through method for schema kit code. |
boolean |
selectPersona(java.lang.String persona,
java.lang.String password)
This method is used to select an admin persona, changing the permissions that the user has and the objects that are accessible in the database. |
void |
sendHTMLMail(java.lang.String address,
java.lang.String subject,
java.lang.StringBuffer body,
java.lang.StringBuffer HTMLbody)
This method allows clients to cause mail to be sent from the Ganymede server when they can't do it themselves. |
void |
sendMail(java.lang.String address,
java.lang.String subject,
java.lang.StringBuffer body)
This method allows clients to cause mail to be sent from the Ganymede server when they can't do it themselves. |
(package private) void |
sendMessage(int type,
java.lang.String message)
This method is used to send an asynchronous message to the client. |
private arlut.csd.ganymede.ReturnVal |
sendXML(arlut.csd.ganymede.FileReceiver receiver,
boolean sendData,
boolean sendSchema,
boolean logOffOnFailure)
Private server-side helper method used to transmit the server's database in XML format to an FileReceiver remote receiving
interface. |
arlut.csd.ganymede.ReturnVal |
setDefaultOwner(java.util.Vector ownerInvids)
This method may be used to set the owner groups of any objects created hereafter. |
(package private) void |
setLastError(java.lang.String error)
This method used to be used to flag an error condition that the client could then call getLastError() to look up. |
private void |
setLastEvent(java.lang.String text)
|
void |
setXSession(arlut.csd.ganymede.GanymedeXMLSession xSession)
|
(package private) void |
timeCheck()
This method is called by a background thread on the server, and knocks this user off if they are a remote user who has been inactive for a long time. |
java.lang.String |
toString()
This method provides a handy description of this session. |
void |
unreferenced()
This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects. |
void |
unregisterWizard(arlut.csd.ganymede.GanymediatorWizard wizard)
Unregisters a wizard from this GanymedeSession. |
void |
updatePerms(boolean forceUpdate)
This non-exported method is used to generate a comprehensive permissions matrix that applies to all objects owned by the active persona for this user. |
arlut.csd.ganymede.ReturnVal |
view_db_object(arlut.csd.ganymede.Invid invid)
View an object from the database. |
java.lang.StringBuffer |
viewAdminHistory(arlut.csd.ganymede.Invid invid,
java.util.Date since)
This method returns a multi-line string containing excerpts from the Ganymede log relating to <invid>, since time <since>. |
java.lang.StringBuffer |
viewObjectHistory(arlut.csd.ganymede.Invid invid,
java.util.Date since)
This method returns a multi-line string containing excerpts from the Ganymede log relating to <invid>, since time <since>. |
java.lang.StringBuffer |
viewObjectHistory(arlut.csd.ganymede.Invid invid,
java.util.Date since,
boolean fullTransactions)
This method returns a multi-line string containing excerpts from the Ganymede log relating to <invid>, since time <since>. |
java.lang.String |
viewObjectLabel(arlut.csd.ganymede.Invid invid)
This method is intended as a lightweight way of returning the current label of the specified invid. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
static final boolean debug
static final boolean permsdebug
arlut.csd.ganymede.Client client
arlut.csd.ganymede.serverClientProxy clientProxy
boolean semaphoreLocked
private arlut.csd.Util.booleanSemaphore loggedInSemaphore
boolean timedout
private arlut.csd.Util.booleanSemaphore forcingSemaphore
boolean supergashMode
boolean beforeversupergash
int objectsCheckedOut
public boolean enableWizards
This variable tracks whether or not the client desires to have
wizards presented. If this is false, custom plug-in code
for the object types stored in the
DBStore may either
refuse certain operations or will resort to taking a default action.
public boolean enableOversight
If this variable is set to false, no custom wizard code will ever be invoked, and required fields will not be forced. This is intended primarily for direct database loading.
This variable is not intended ever to be available to the client, but should only be set by local server code.
java.util.Date connecttime
java.util.Date lastActionTime
java.lang.String username
The unique name that the user is connected to the server under.. this may be <username>[2], <username>[3], etc., if the user is connected to the server multiple times. The username will be unique on the server at any given time.
username should never be null. If a client logs in directly to a persona, username will be that personaname plus an optional session id.
arlut.csd.ganymede.Invid userInvid
java.lang.String clienthost
java.lang.String status
The current status message for this client. The
GanymedeAdmin code
that manages the admin consoles will consult this String when it
updates the admin consoles.
java.lang.String lastEvent
Description of the last action recorded for this client. The
GanymedeAdmin
code that manages the admin consoles will consult
this String when it updates the admin consoles.
arlut.csd.ganymede.DBSession session
Our DBSession object. DBSession is the generic DBStore access layer. A GanymedeSession is layered on top of a DBSession to provide access control and remote access via RMI. The DBSession object is accessible to server-side code only and provides transaction support.
arlut.csd.ganymede.GanymediatorWizard wizard
A GanymedeSession can have a single wizard active. If this variable
is non-null, a custom type-specific
DBEditObject subclass has instantiated
a wizard to interact with the user.
arlut.csd.ganymede.DBObjectBase personaBase
java.util.Date personaTimeStamp
arlut.csd.ganymede.DBObject personaObj
A reference to our current persona object. We save this so we can look up owner groups and what not more quickly. An end-user logged in without any extra privileges will have a null personaObj value.
java.lang.String personaName
arlut.csd.ganymede.Invid personaInvid
arlut.csd.ganymede.DBObjectBase permBase
java.util.Date permTimeStamp
arlut.csd.ganymede.PermMatrix personaPerms
This variable stores the permission bits that are applicable to objects
that the current persona has ownership privilege over. This matrix
is always a permissive superset of
defaultPerms.
arlut.csd.ganymede.PermMatrix defaultPerms
This variable stores the permission bits that are applicable to generic objects not specifically owned by this persona.
Each permission object in the Ganymede database includes permissions as apply to objects owned by the persona and as apply to objects not owned by the persona.
This variable holds the union of the 'as apply to objects not owned by the persona' matrices across all permissions objects that apply to the current persona.
arlut.csd.ganymede.PermMatrix delegatablePersonaPerms
This variable stores the permission bits that are applicable to
objects that the current persona has ownership privilege over and
which the current admin has permission to delegate to subordinate
roles. This matrix is always a permissive superset of
delegatableDefaultPerms.
arlut.csd.ganymede.PermMatrix delegatableDefaultPerms
This variable stores the permission bits that are applicable to generic objects not specifically owned by this persona and which the current admin has permission to delegate to subordinate roles.
Each permission object in the Ganymede database includes permissions as apply to objects owned by the persona and as apply to objects not owned by the persona.
This variable holds the union of the 'as apply to objects not owned by the persona' matrices across all permissions objects that apply to the current persona.
arlut.csd.ganymede.DBObject defaultObj
A reference to the Ganymede DBObject
storing our default permissions,
or the permissions that applies when we are not in supergash mode
and we do not have any ownership over the object in question.
java.util.Vector newObjectOwnerInvids
This variable is a vector of object references
(Invid's) to the owner groups
that the client has requested newly created objects be placed in. While
this vector is not-null, any new objects created will be owned by the list
of ownergroups held here.
java.util.Vector visibilityFilterInvids
This variable is a vector of object references (Invid's) to the owner groups that the client has requested the listing of objects be restricted to. That is, the client has requested that the results of Queries and Dumps only include those objects owned by owner groups in this list. This feature is used primarily for when a client is logged in with supergash privileges, but the user wants to restrict the visibility of objects for convenience.
arlut.csd.ganymede.AdminEntry userInfo
This variable caches the AdminEntry
object which is reported to admin consoles connected to the
server when the console is updated.
boolean remotelyAccessible
If true, this GanymedeSession will export its objects and fields for direct access via RMI.
arlut.csd.ganymede.GanymedeXMLSession xSession
If this session is being driven by a GanymedeXMLSession, this reference will be non-null.
| Constructor Detail |
public GanymedeSession()
throws java.rmi.RemoteException
Note that all internal session activities (queries, etc.) are currently using a single, synchronized GanymedeSession object.. this mean that only one user at a time can currently be processed for login. 8-(
Internal sessions, as created by this constructor, have full privileges to do any possible operation.
public GanymedeSession(java.lang.String sessionLabel)
throws java.rmi.RemoteException
Note that all internal session activities (queries, etc.) are currently using a single, synchronized GanymedeSession object.. this mean that only one user at a time can currently be processed for login. 8-(
Internal sessions, as created by this constructor, have full privileges to do any possible operation.
public GanymedeSession(arlut.csd.ganymede.Client client,
java.lang.String loginName,
arlut.csd.ganymede.DBObject userObject,
arlut.csd.ganymede.DBObject personaObject,
boolean exportObjects)
throws java.rmi.RemoteException
Constructor used to create a server-side attachment for a Ganymede client.
This constructor is called by the
GanymedeServer
login()
method.
A Client can log in either as an end-user or as a admin persona. Typically, a client will log in with their end-user name and password, then use selectPersona to gain admin privileges. The server may allow users to login directly with an admin persona (supergash, say), if so configured.
client - Remote object exported by the client, provides id callbacksuserObject - The user record for this loginpersonaObject - The user's initial admin personaGanymedeServer.login(arlut.csd.ganymede.Client)| Method Detail |
public void setXSession(arlut.csd.ganymede.GanymedeXMLSession xSession)
public boolean isSuperGash()
public boolean isLoggedIn()
public void checkpoint(java.lang.String key)
Pass-through method for schema kit code. This method is not
intended to be available to the client over RMI anymore, as
DBSession.checkpoint() now does a thread comparison to make sure
that nothing is attempting to do interleaved checkpoint
operations, and RMI doesn't guarantee that successive remote
method calls from a client will be issued from the same server
thread.
public boolean rollback(java.lang.String key)
Pass-through method for schema kit code. This method is not
intended to be available to the client over RMI anymore, as
DBSession.checkpoint() now does a thread comparison to make sure
that nothing is attempting to do interleaved checkpoint
operations, and RMI doesn't guarantee that successive remote
method calls from a client will be issued from the same server
thread.
public void checkOut()
public void checkIn()
public arlut.csd.ganymede.AdminEntry getAdminEntry()
This method is used to generate a serializable
AdminEntry
object summarizing this GanymedeSession's state for
the admin console.
Used by code in
GanymedeAdmin.
void setLastError(java.lang.String error)
This method used to be used to flag an error condition that the client could then call getLastError() to look up. It has been deprecated from that usage, and now simply logs the error.
void timeCheck()
This method is called by a background thread on the server, and knocks this user off if they are a remote user who has been inactive for a long time.
Note that this method is not synchronized, to avoid nested-monitor deadlock by the timeOutTask between a GanymedeSession object and the GanymedeServer object.
void forceOff(java.lang.String reason)
If the server decides this person needs to get off (if the user times out, is forced off by an admin, or if the server is going down), it will call this method to knock them off.
Note that this method is not synchronized, to avoid the possibility of deadlocking the admin console in the case of a deadlocked GanymedeSession.
void sendMessage(int type,
java.lang.String message)
This method is used to send an asynchronous message to the client. It is used to update the clients so they know when a build is being processed.
See ClientMessage
for the list of acceptable client message types.
public void unreferenced()
This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects.
This method handles abnormal logouts and time outs for us. By default, the 1.1 RMI time-out is 10 minutes.
unreferenced in interface java.rmi.server.UnreferencedUnreferencedpublic void logout()
Log out this session. After this method is called, no other methods may be called on this session object.
This method is partially synchronized, to avoid locking up the admin console if this user's session has become deadlocked.
logout in interface SessionSessionpublic void logout(boolean forced_off)
Log out this session. After this method is called, no other methods may be called on this session object.
This method is partially synchronized, to avoid locking up the admin console if this user's session has become deadlocked.
public void enableWizards(boolean val)
This method is used to allow a client to request that wizards not be provided in response to actions by the client. This is intended to allow non-interactive or non-gui clients to do work without having to go through a wizard interaction sequence.
Wizards are enabled by default.
enableWizards in interface Sessionval - If true, wizards will be enabled.Sessionpublic void enableOversight(boolean val)
This method is used to allow local server-side code to request that no oversight be maintained over changes made to the server through this GanymedeSession.
This is intended only for trusted code that does its own checking and validation on changes made to the database. If oversight is turned off, no wizard code will be called, and the required field logic will be bypassed. Extreme care must be used in disabling oversight, and oversight should only be turned off for direct loading and other situations where there won't be multi-user use, to avoid breaking constraints that custom plug-ins count on.
Oversight is enabled by default.
val - If true, oversight will be enabled.public java.lang.String getHelpBase()
This method is used to tell the client where to look to access the Ganymede help document tree.
getHelpBase in interface SessionSession
public java.lang.StringBuffer getMessage(java.lang.String key,
boolean onlyShowIfNew)
This method is used to allow the client to retrieve messages like the motd from the server. The client can specify that it only wants to see a message if it has changed since the user last logged out. This is intended to support a message of the day type functionality. The server will not necessarily remember the last log out across server restart.
getMessage in interface Sessionkey - A string, like "motd", indicating what message to retrieve.onlyShowIfNew - If true, the message will only be returned if
it has changed since the user last logged out.
public java.lang.StringBuffer getMessageHTML(java.lang.String key,
boolean onlyShowIfNew)
This method is used to allow the client to retrieve messages like the motd from the server. The client can specify that it only wants to see a message if it has changed since the user last logged out. This is intended to support a message of the day type functionality. The server will not necessarily remember the last log out across server restart.
getMessageHTML in interface Sessionkey - A string, like "motd", indicating what message to retrieve.onlyShowIfNew - If true, the message will only be returned if
it has changed since the user last logged out.
public java.lang.String getMyUserName()
This method returns the identification string that the server has assigned to the user.
getMyUserName in interface SessionSessionpublic java.lang.String getClientHostName()
This method returns the name of the system that the client is connected from.
public java.lang.String toString()
This method provides a handy description of this session.
toString in class java.rmi.server.RemoteObjectpublic java.util.Vector getPersonae()
This method returns a list of personae names available to the user logged in.
getPersonae in interface SessionSession
public boolean selectPersona(java.lang.String persona,
java.lang.String password)
This method is used to select an admin persona, changing the permissions that the user has and the objects that are accessible in the database.
selectPersona in interface SessionSessionpublic arlut.csd.ganymede.QueryResult getOwnerGroups()
This method returns a QueryResult of owner groups that the current persona has access to. This list is the transitive closure of the list of owner groups in the current persona. That is, the list includes all the owner groups in the current persona along with all of the owner groups those owner groups own, and so on.
getOwnerGroups in interface Sessionpublic arlut.csd.ganymede.ReturnVal setDefaultOwner(java.util.Vector ownerInvids)
This method may be used to set the owner groups of any objects created hereafter.
setDefaultOwner in interface SessionownerInvids - a Vector of Invid objects pointing to
ownergroup objects.public arlut.csd.ganymede.ReturnVal filterQueries(java.util.Vector ownerInvids)
This method may be used to cause the server to pre-filter any object listing to only show those objects directly owned by owner groups referenced in the ownerInvids list. This filtering will not restrict the ability of the client to directly view any object that the client's persona would normally have access to, but will reduce clutter and allow the client to present the world as would be seen by administrator personas with just the listed ownerGroups accessible.
This method cannot be used to grant access to objects that are not accessible by the client's adminPersona.
Calling this method with ownerInvids set to null will turn off the filtering.
filterQueries in interface SessionownerInvids - a Vector of Invid objects pointing to ownergroup objects.public java.util.Vector getTypes()
This method returns a list of remote references to the Ganymede object type definitions. This method will throws a RuntimeException if it is called when the server is in schemaEditMode.
getTypes in interface SessionSessionpublic arlut.csd.ganymede.Category getRootCategory()
Returns the root of the category tree on the server
getRootCategory in interface SessionCategory,
Sessionpublic arlut.csd.ganymede.CategoryTransport getCategoryTree()
Returns a serialized representation of the basic category and base structure on the server. The returned CategoryTransport will include only object types that are editable by the user.
getCategoryTree in interface SessionCategory,
Sessionpublic arlut.csd.ganymede.CategoryTransport getCategoryTree(boolean hideNonEditables)
Returns a serialized representation of the basic category and base structure on the server.
This method is synchronized to avoid any possible deadlock between DBStore and GanymedeSession, as the CategoryTransport constructor calls other synchronized methods on GanymedeSession.
getCategoryTree in interface SessionhideNonEditables - If true, the CategoryTransport returned
will only include those object types that are editable by the
client.Category,
Sessionpublic arlut.csd.ganymede.BaseListTransport getBaseList()
Returns a serialized representation of the object types defined on the server. This BaseListTransport object will not include field information. The client is obliged to call getFieldTemplateVector() on any bases that it needs field information for.
This method is synchronized to avoid any possible deadlock between DBStore and GanymedeSession, as the BaseListTransport constructor calls other synchronized methods on GanymedeSession
getBaseList in interface SessionBaseListTransport,
Sessionpublic java.util.Vector getFieldTemplateVector(short baseId)
Returns a vector of field definition templates, in display order.
This vector may be cached, as it is static for this object type over the lifetime of any GanymedeSession.
getFieldTemplateVector in interface SessionFieldTemplate,
Sessionpublic arlut.csd.ganymede.ReturnVal openTransaction(java.lang.String describe)
This method call initiates a transaction on the server. This call must be executed before any objects are modified (created, edited, inactivated, removed).
Currently each client can only have one transaction open.. it is an error to call openTransaction() while another transaction is still open, and an error dialog will be returned in that case.
openTransaction in interface Sessiondescribe - An optional string containing a comment to be
stored in the modification history for objects modified by this
transaction.Session
public arlut.csd.ganymede.ReturnVal openTransaction(java.lang.String describe,
boolean interactive)
This method call initiates a transaction on the server. This call must be executed before any objects are modified (created, edited, inactivated, removed).
Currently each client can only have one transaction open.. it is an error to call openTransaction() while another transaction is still open, and an error dialog will be returned in that case.
openTransaction in interface Sessiondescribe - An optional string containing a comment to be
stored in the modification history for objects modified by this
transaction.Sessionpublic arlut.csd.ganymede.ReturnVal commitTransaction(boolean abortOnFail)
This method causes all changes made by the client to be 'locked in' to the database. When commitTransaction() is called, the changes made by the client during this transaction is logged to a journal file on the server, and the changes will become visible to other clients.
If the transaction cannot be committed for some reason, commitTransaction() will abort the transaction if abortOnFail is true. In any case, commitTransaction() will return a ReturnVal indicating whether or not the transaction could be committed, and whether or not the transaction remains open for further attempts at commit. If ReturnVal.doNormalProcessing is set to true, the transaction remains open and it is up to the client to decide whether to abort the transaction by calling abortTransaction(), or to attempt to fix the reported problem and try another call to commitTransaction().
This method is synchronized to avoid nested-monitor deadlock in
DBSession.commitTransaction()
commitTransaction in interface SessionabortOnFail - If true, the transaction will be aborted if it
could not be committed successfully.
Sessionpublic arlut.csd.ganymede.ReturnVal commitTransaction()
This method causes all changes made by the client to be 'locked in' to the database. When commitTransaction() is called, the changes made by the client during this transaction is logged to a journal file on the server, and the changes will become visible to other clients.
commitTransaction() will return a ReturnVal indicating whether or not the transaction could be committed, and whether or not the transaction remains open for further attempts at commit. If ReturnVal.doNormalProcessing is set to true, the transaction remains open and it is up to the client to decide whether to abort the transaction by calling abortTransaction(), or to attempt to fix the reported problem and try another call to commitTransaction().
commitTransaction in interface SessionSessionpublic arlut.csd.ganymede.ReturnVal abortTransaction()
abortTransaction in interface SessionSession
public void sendMail(java.lang.String address,
java.lang.String subject,
java.lang.StringBuffer body)
This method allows clients to cause mail to be sent from the Ganymede server when they can't do it themselves. The mail will have a From: header indicating the identity of the sender.
body and HTMLbody are StringBuffer's instead of Strings because RMI has a 64k serialization limit on the String class.
sendMail in interface Sessionaddress - The addresses to mail to, may have more than one
address separated by commas or spaces.subject - The subject of this mail, will have 'Ganymede:' prepended
by the server.body - The content of the message.
public void sendHTMLMail(java.lang.String address,
java.lang.String subject,
java.lang.StringBuffer body,
java.lang.StringBuffer HTMLbody)
This method allows clients to cause mail to be sent from the Ganymede server when they can't do it themselves. The mail will have a From: header indicating the identity of the sender.
body and HTMLbody are StringBuffer's instead of Strings because RMI has a 64k serialization limit on the String class.
sendHTMLMail in interface Sessionaddress - The addresses to mail to, may have more than one
address separated by commas or spaces.subject - The subject of this mail, will have 'Ganymede:' prepended
by the server.body - The plain-ASCII content of the message, or null if none.HTMLbody - The HTML content of the message, or null if none.public arlut.csd.ganymede.QueryResult queryInvids(java.util.Vector invidVector)
This method allows the client to get a status update on a specific list of invids.
If any of the invids are not currently defined in the server, or if the client doesn't have permission to view any of the invids, those invids' status will not be included in the returned QueryResult.
queryInvids in interface SessioninvidVector - Vector of Invid's to get the status for.Session
public arlut.csd.ganymede.Invid findLabeledObject(java.lang.String name,
short type)
Returns an Invid for an object of a specified type and name, or null if no such object could be found.
If the user does not have permission to view the object, null will be returned even if an object by that name does exist.
This method uses the GanymedeSession query() apparatus, and may not be called from a DBEditObject's commitPhase1/2() methods without risking deadlock.
findLabeledObject in interface Sessionname - Label for an objecttype - Object type id numberpublic arlut.csd.ganymede.DumpResult dump(arlut.csd.ganymede.Query query)
This method provides the hook for doing a
fast database dump to a string form. The
DumpResult
returned comprises a formatted dump of all visible
fields and objects that match the given query.
This method uses the GanymedeSession query() apparatus, and may not be called from a DBEditObject's commitPhase1/2() methods without risking deadlock.
dump in interface SessionQuery,
Sessionpublic arlut.csd.ganymede.QueryResult filterQueryResult(arlut.csd.ganymede.QueryResult qr)
This method applies this GanymedeSession's current owner filter to the given QueryResult <qr> and returns a QueryResult with any object handles that are not matched by the filter stripped.
If the submitted QueryResult <qr> is null, filterQueryResult() will itself return null.
public arlut.csd.ganymede.QueryResult query(arlut.csd.ganymede.Query query)
This method provides the hook for doing all manner of simple object listing for the Ganymede database.
This method may not be called from a DBEditOb