Class AnjayAccessControl


  • public final class AnjayAccessControl
    extends java.lang.Object
    Access Control module.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AnjayAccessControl.AccessMask
      Possible values of an ACL Resource Instance which can be combined together, as described in the Access Control definition.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AnjayAccessControl install​(Anjay anjay)
      Installs the Access Control Object in an Anjay instance.
      boolean isModified()
      Checks whether the Access Control has been modified since last successful call to persist() or restore().
      void persist​(java.io.OutputStream outputStream)
      Dumps all set access rights to the output stream.
      void purge()
      Removes all existing access rights leaving Access Control Object without any instances.
      void restore​(java.io.InputStream inputStream)
      Attempts to restore access rights from specified input stream.
      void setAcl​(int oid, int iid, int ssid, int mask)
      Creates a new instance of the Access Control Object or updates an existing instance if access rights of a particular Object Instance have already been set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • install

        public static AnjayAccessControl install​(Anjay anjay)
                                          throws java.lang.Exception
        Installs the Access Control Object in an Anjay instance.
        Parameters:
        anjay - Anjay instance for which the Access Control Object is installed.
        Returns:
        Access Control Object.
        Throws:
        java.lang.Exception - In case of failure.
      • setAcl

        public void setAcl​(int oid,
                           int iid,
                           int ssid,
                           int mask)
        Creates a new instance of the Access Control Object or updates an existing instance if access rights of a particular Object Instance have already been set.
        Parameters:
        oid - Object ID of an Object to create an ACL for.
        iid - Instance ID of an Object Instance to create an ACL for.
        ssid - SSID of a Server Object for which access rights are valid.
        mask - A number which defines access rights for a specified Object Instance.
      • purge

        public void purge()
        Removes all existing access rights leaving Access Control Object without any instances.
      • persist

        public void persist​(java.io.OutputStream outputStream)
                     throws java.lang.Exception
        Dumps all set access rights to the output stream.
        Parameters:
        outputStream - Stream to write to.
        Throws:
        java.lang.Exception - If the persist operation failed.
      • restore

        public void restore​(java.io.InputStream inputStream)
                     throws java.lang.Exception
        Attempts to restore access rights from specified input stream.
        Parameters:
        inputStream - Stream to read from.
        Throws:
        java.lang.Exception - If the restoration failed.
      • isModified

        public boolean isModified()
        Checks whether the Access Control has been modified since last successful call to persist() or restore().
        Returns:
        true if Access Control has been modified, false otherwise.