Class TdbDatabaseAccess
- java.lang.Object
-
- com.tietoenator.trip.jxp.session.TdbSessionObject
-
- com.tietoenator.trip.jxp.TdbMessageProvider
-
- com.tietoenator.trip.jxp.database.TdbDatabaseAccess
-
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
,TdbControlObjectProvider
public class TdbDatabaseAccess extends TdbMessageProvider implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider
Container and manipulation logic for database access rights to a particular database, thesaurus or database cluster.
-
-
Constructor Summary
Constructors Constructor Description TdbDatabaseAccess(TdbSession session)
Constructor, creates a blank container with no specific associationTdbDatabaseAccess(TdbSession session, TdbControlObject ob)
Constructor, creates a blank container associated with a particular database, thesaurus or cluster, as identified by the Control object providedTdbDatabaseAccess(TdbSession session, TdbControlObjectProvider prv)
Constructor, creates a blank container associated with a particular database, thesaurus or cluster as identified by the object that provides a Control reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Initialize the object, removing any existing statevoid
get(java.lang.String ug)
Retrieve the named user's (or group's) access rights for the current database, i.e.void
get(java.lang.String db, java.lang.String ug)
Retrieve the named user's (or group's) access rights for the named database, thesaurus or cluster.TdbControlObject
getControlObject()
Retrieve the Control object reference passed into the constructor, if anyTdbAccessRights
getReadAccess()
Retrieve read access leveljava.lang.String
getReadScope()
Retrieve the read scope statementTdbAccessRights
getWriteAccess()
Retrieve write access leveljava.lang.String
getWriteScope()
Retrieve the write scope statementvoid
put()
Store the accumulated access rights; this call can only follow a successful call to theget
method, as the database and user name established during that call are used here.void
put(java.lang.String db, java.lang.String ug)
Store the accumulated access rights as the named user's (or group's) access privileges for the named database, thesaurus or clusterjava.util.List<java.lang.Integer>
readFields()
Retrieve the collection of fields (identified by their field number) to which the user has selected read access.void
setReadAccess(TdbAccessRights rights)
Establish read access levelvoid
setReadFields(java.util.Collection<java.lang.Integer> fields)
Establish the collection of fields (identified by their field number) to which the user has selected read access.void
setReadScope(java.lang.String scope)
Establish the read scope statementvoid
setWriteAccess(TdbAccessRights rights)
Establish write access levelvoid
setWriteFields(java.util.Collection<java.lang.Integer> fields)
Establish the collection of fields (identified by their field number) to which the user has selected write access.void
setWriteScope(java.lang.String scope)
Establish the write scope statementjava.util.List<java.lang.Integer>
writeFields()
Retrieve the collection of fields (identified by their field number) to which the user has selected write access.-
Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
-
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
-
-
-
-
Constructor Detail
-
TdbDatabaseAccess
public TdbDatabaseAccess(TdbSession session, TdbControlObject ob) throws TdbException
Constructor, creates a blank container associated with a particular database, thesaurus or cluster, as identified by the Control object provided- Parameters:
session
- Active sessionob
- Control object referencing the database, thesaurus or cluster for which access rights are to be processed- Throws:
TdbException
-
TdbDatabaseAccess
public TdbDatabaseAccess(TdbSession session, TdbControlObjectProvider prv) throws TdbException
Constructor, creates a blank container associated with a particular database, thesaurus or cluster as identified by the object that provides a Control reference.- Parameters:
session
- Active sessionprv
- Control object reference provider, i.e. a database design- Throws:
TdbException
-
TdbDatabaseAccess
public TdbDatabaseAccess(TdbSession session) throws TdbException
Constructor, creates a blank container with no specific association- Parameters:
session
- Active session- Throws:
TdbException
-
-
Method Detail
-
getControlObject
public TdbControlObject getControlObject()
Retrieve the Control object reference passed into the constructor, if any- Specified by:
getControlObject
in interfaceTdbControlObjectProvider
- Returns:
- Control object reference with which the instance was created
-
getReadAccess
public TdbAccessRights getReadAccess()
Retrieve read access level- Returns:
- Read access
-
setReadAccess
public void setReadAccess(TdbAccessRights rights)
Establish read access level- Parameters:
rights
- Read access
-
getReadScope
public java.lang.String getReadScope()
Retrieve the read scope statement- Returns:
- Read scope, if any
-
setReadScope
public void setReadScope(java.lang.String scope)
Establish the read scope statement- Parameters:
scope
- Read scope statement
-
readFields
public java.util.List<java.lang.Integer> readFields()
Retrieve the collection of fields (identified by their field number) to which the user has selected read access. Note that this is only valid if the user's access isselected
.- Returns:
- Collection of field numbers
-
setReadFields
public void setReadFields(java.util.Collection<java.lang.Integer> fields)
Establish the collection of fields (identified by their field number) to which the user has selected read access. Note this is only valid if the user's access isselected
.- Parameters:
fields
- Collection of field numbers to which the user is to be granted read access
-
getWriteAccess
public TdbAccessRights getWriteAccess()
Retrieve write access level- Returns:
- Write access
-
setWriteAccess
public void setWriteAccess(TdbAccessRights rights)
Establish write access level- Parameters:
rights
- Write access
-
getWriteScope
public java.lang.String getWriteScope()
Retrieve the write scope statement- Returns:
- Write scope statement, if any
-
setWriteScope
public void setWriteScope(java.lang.String scope)
Establish the write scope statement- Parameters:
scope
- Write scope statement
-
writeFields
public java.util.List<java.lang.Integer> writeFields()
Retrieve the collection of fields (identified by their field number) to which the user has selected write access. Note that this is only valid if the user's access isselected
.- Returns:
- Collection of field numbers
-
setWriteFields
public void setWriteFields(java.util.Collection<java.lang.Integer> fields)
Establish the collection of fields (identified by their field number) to which the user has selected write access. Note this is only valid if the user's access isselected
.- Parameters:
fields
- Collection of field numbers to which the user is to be granted read access
-
clear
public void clear()
Initialize the object, removing any existing state
-
get
public void get(java.lang.String db, java.lang.String ug) throws TdbException
Retrieve the named user's (or group's) access rights for the named database, thesaurus or cluster.This method causes network I/O.
- Parameters:
db
- Name of database for which rights are to be retrievedug
- Name of user or group for whom rights are to be retrieved- Throws:
TdbException
-
get
public void get(java.lang.String ug) throws TdbException
Retrieve the named user's (or group's) access rights for the current database, i.e. the database identified by the Control object passed into the constructor of this objectThis method causes network I/O.
- Parameters:
ug
- Name of user or group for whom access rights are to be retrieved- Throws:
TdbException
-
put
public void put(java.lang.String db, java.lang.String ug) throws TdbException
Store the accumulated access rights as the named user's (or group's) access privileges for the named database, thesaurus or clusterThis method causes network I/O.
- Parameters:
db
- Name of database, thesaurus or cluster for which these rights are validug
- Name of user or group who's rights are being affected- Throws:
TdbException
-
put
public void put() throws TdbException
Store the accumulated access rights; this call can only follow a successful call to theget
method, as the database and user name established during that call are used here.- Throws:
TdbException
-
-