Class 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Initialize the object, removing any existing state
      void 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 any
      TdbAccessRights getReadAccess()
      Retrieve read access level
      java.lang.String getReadScope()
      Retrieve the read scope statement
      TdbAccessRights getWriteAccess()
      Retrieve write access level
      java.lang.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​(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 cluster
      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.
      void setReadAccess​(TdbAccessRights rights)
      Establish read access level
      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.
      void setReadScope​(java.lang.String scope)
      Establish the read scope statement
      void setWriteAccess​(TdbAccessRights rights)
      Establish write access level
      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.
      void setWriteScope​(java.lang.String scope)
      Establish the write scope statement
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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 Detail

      • 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 is selected.
        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 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 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 is selected.
        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 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​(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 retrieved
        ug - 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 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​(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 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