Package com.tietoenator.trip.jxp.database

# 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 association
  `TdbDatabaseAccess(TdbSession session, TdbControlObject ob)`
  Constructor, creates a blank container associated with a particular database, thesaurus or cluster, as identified by the Control object provided
  `TdbDatabaseAccess(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

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Initialize the object, removing any existing state
  `void`
  `get(String ug)`
  Retrieve the named user's (or group's) access rights for the current database, i.e.
  `void`
  `get(String db, 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 any
  `TdbAccessRights`
  `getReadAccess()`
  Retrieve read access level
  `String`
  `getReadScope()`
  Retrieve the read scope statement
  `TdbAccessRights`
  `getWriteAccess()`
  Retrieve write access level
  `String`
  `getWriteScope()`
  Retrieve the write scope statement
  `void`
  `put()`
  Store the accumulated access rights; this call can only follow a successful call to the `get` method, as the database and user name established during that call are used here.
  `void`
  `put(String db, String ug)`
  Store the accumulated access rights as the named user's (or group's) access privileges for the named database, thesaurus or cluster
  `List<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 level
  `void`
  `setReadFields(Collection<Integer> fields)`
  Establish the collection of fields (identified by their field number) to which the user has selected read access.
  `void`
  `setReadScope(String scope)`
  Establish the read scope statement
  `void`
  `setWriteAccess(TdbAccessRights rights)`
  Establish write access level
  `void`
  `setWriteFields(Collection<Integer> fields)`
  Establish the collection of fields (identified by their field number) to which the user has selected write access.
  `void`
  `setWriteScope(String scope)`
  Establish the write scope statement
  `List<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`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### 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 session
      `ob` - 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 session
      `prv` - 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 Details

  - ### getControlObject

    public TdbControlObject getControlObject()
    Retrieve the Control object reference passed into the constructor, if any
    Specified by:
      `getControlObject` in interface `TdbControlObjectProvider`
    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 String getReadScope()
    Retrieve the read scope statement
    Returns:
      Read scope, if any

  - ### setReadScope

    public void setReadScope(String scope)
    Establish the read scope statement
    Parameters:
      `scope` - Read scope statement

  - ### readFields

    public List<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 is `selected`.
    Returns:
      Collection of field numbers

  - ### setReadFields

    public void setReadFields(Collection<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 is `selected`.
    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 String getWriteScope()
    Retrieve the write scope statement
    Returns:
      Write scope statement, if any

  - ### setWriteScope

    public void setWriteScope(String scope)
    Establish the write scope statement
    Parameters:
      `scope` - Write scope statement

  - ### writeFields

    public List<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 is `selected`.
    Returns:
      Collection of field numbers

  - ### setWriteFields

    public void setWriteFields(Collection<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 is `selected`.
    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(String db, 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 retrieved
      `ug` - Name of user or group for whom rights are to be retrieved
    Throws:
      `TdbException`

  - ### get

    public void get(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 object

    This 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(String db, 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 cluster

    This method causes network I/O.

    Parameters:
      `db` - Name of database, thesaurus or cluster for which these rights are valid
      `ug` - 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 the `get` method, as the database and user name established during that call are used here.
    Throws:
      `TdbException`