Class SecuredItemImpl

    • Field Detail

      • MAX_CACHE

        public static int MAX_CACHE
      • COUNT

        public static final java.lang.ThreadLocal<java.lang.Integer> COUNT
    • Method Detail

      • decrementUse

        public static void decrementUse()
        Decrement the number of instances of SecuredItem.
      • incrementUse

        public static void incrementUse()
        Increment the number of instances of SecuredItem.
      • toString

        public final java.lang.String toString()
                                        throws AuthenticationRequiredException
        Return a string representation of the resource. Returns the URI of the resource unless the resource is anonymous in which case it returns the id of the resource enclosed in square brackets. If the user can not read the graph the toString() returns the hashcode in hex
        Overrides:
        toString in class java.lang.Object
        Returns:
        Return a string representation of the resource.
        Throws:
        AuthenticationRequiredException
      • canCreate

        public boolean canCreate​(Triple triple)
                          throws AuthenticationRequiredException
        Description copied from interface: SecuredItem
        Return true if the triple can be created. If any s,p or o is SecNode.ANY then this method must return false if there are any restrictions where the remaining nodes and held constant and the ANY node is allowed to vary. See canRead(Triple t)
        Specified by:
        canCreate in interface SecuredItem
        Parameters:
        triple - The triple to check
        Returns:
        true if the triple can be created.
        Throws:
        AuthenticationRequiredException - if user is not authenticated and is required to be.
      • canDelete

        public boolean canDelete​(Triple triple)
                          throws AuthenticationRequiredException
        Description copied from interface: SecuredItem
        Return true if the triple can be deleted. If any s,p or o is SecNode.ANY then this method must return false if there are any restrictions where the remaining nodes and held constant and the ANY node is allowed to vary. See canRead(Triple t)
        Specified by:
        canDelete in interface SecuredItem
        Parameters:
        triple - The triple to check
        Returns:
        true if the triple can be deleted.
        Throws:
        AuthenticationRequiredException - if user is not authenticated and is required to be.
      • canRead

        public boolean canRead​(Triple triple)
                        throws AuthenticationRequiredException
        Description copied from interface: SecuredItem
        Return true if the triple can be read. If any s,p or o is SecNode.ANY then this method must return false if there are any restrictions where the remaining nodes and held constant and the ANY node is allowed to vary. (S, P, O) check if S,P,O can be read. (S, P, ANY) check if there are any S,P,x restrictions. (S, ANY, P) check if there are any S,x,P restrictions. (ANY, ANY, ANY) check if there are any restrictions on reading.
        Specified by:
        canRead in interface SecuredItem
        Parameters:
        triple - The triple to check
        Returns:
        true if the triple can be read.
        Throws:
        AuthenticationRequiredException - if user is not authenticated and is required to be.
      • canUpdate

        public boolean canUpdate​(Triple f,
                                 Triple t)
                          throws AuthenticationRequiredException
        Description copied from interface: SecuredItem
        Return true if the triple can be updated. If any s,p or o is SecNode.ANY then this method must return false if there are any restrictions where the remaining nodes and held constant and the ANY node is allowed to vary. See canRead(Triple t)
        Specified by:
        canUpdate in interface SecuredItem
        Parameters:
        f - The triple that will be changed
        t - The resulting triple.
        Returns:
        true if the from triple can be updated as the to triple.
        Throws:
        AuthenticationRequiredException - if user is not authenticated and is required to be.
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface SecuredItem
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getBaseItem

        public java.lang.Object getBaseItem()
        Specified by:
        getBaseItem in interface SecuredItem
        Returns:
        the base item that is being secured.
      • getModelIRI

        public java.lang.String getModelIRI()
        Specified by:
        getModelIRI in interface SecuredItem
        Returns:
        The IRI of the securedModel that the item belongs to.
      • getModelNode

        public Node getModelNode()
        get the name of the model.
        Specified by:
        getModelNode in interface SecuredItem
        Returns:
        The node representation of the securedModel IRI.
      • getSecurityEvaluator

        public SecurityEvaluator getSecurityEvaluator()
        Description copied from interface: SecuredItem
        The SecurityEvaluator implementation that is being used to determine access.
        Specified by:
        getSecurityEvaluator in interface SecuredItem
        Returns:
        The SecurityEvaluator implementation.
      • isEquivalent

        public boolean isEquivalent​(SecuredItem securedItem)
        Description copied from interface: SecuredItem
        Return true if this secured item is equivalent to another secured item. Generally implemented by calling SecuredItem.Util.isEquivalent
        Specified by:
        isEquivalent in interface SecuredItem
        Parameters:
        securedItem - the other secured item.
        Returns:
        True if they are equivalent, false otherwise.