Interface AuthorizationConstraint
-
- All Known Subinterfaces:
EndUserAuthorizationConstraint
public interface AuthorizationConstraint
Encapsulates the authorization constraints that restrict access to a given resource.- Author:
- cdivilly
-
<section role="region">
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
authorized(java.security.Principal principal)
Determines if aPrincipal
is authorized to access this privilege.AuthenticationChallenge[]
challenges()
Returns the authenticationAuthenticationChallenge
s that are bound to this constraint.boolean
equals(java.lang.Object obj)
AllAuthorizationConstraint
implementations MUST implement theObject.equals(Object)
method correctly.boolean
equals(AuthorizationConstraint constraint)
AllAuthorizationConstraint
implementations MUST implement theequals(AuthorizationConstraint)
method correctly.int
hashCode()
AllAuthorizationConstraint
implementations MUST implement theObject.hashCode()
method correctly.java.lang.String
name()
The unique name assigned to this constraint.
-
-
<section role="region">
-
Method Detail
-
name
java.lang.String name()
The unique name assigned to this constraint. It is an error for more than oneAuthorizationConstraint
to share the same name.- Returns:
- The name
-
challenges
AuthenticationChallenge[] challenges()
Returns the authenticationAuthenticationChallenge
s that are bound to this constraint.- Returns:
- Array of
AuthenticationChallenge
instances that the constraint is bound to
-
authorized
boolean authorized(java.security.Principal principal)
Determines if aPrincipal
is authorized to access this privilege.- Parameters:
principal
- ThePrincipal
to test for authorization- Returns:
- true if the principal is authorized to access the resource, false otherwise
-
equals
boolean equals(java.lang.Object obj)
AllAuthorizationConstraint
implementations MUST implement theObject.equals(Object)
method correctly. Typical implementations of this method should check if the specified object is an instance ofAuthorizationConstraint
. If it is then delegate toequals(AuthorizationConstraint)
. If not then return false.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object to test for equality.- Returns:
- true if this instance and the specified instance are equal.
- See Also:
equals(AuthorizationConstraint)
-
equals
boolean equals(AuthorizationConstraint constraint)
AllAuthorizationConstraint
implementations MUST implement theequals(AuthorizationConstraint)
method correctly. Typical implementations of this method should check if the specified object is an instance of the same sub-type ofAuthorizationConstraint
. If it is then compare each of the properties of the sub-type for equality. If it is not of the same sub-type then return false.- Parameters:
constraint
- TheAuthorizationConstraint
to test for equality- Returns:
- true if this instance and the specified instance are equal.
-
hashCode
int hashCode()
AllAuthorizationConstraint
implementations MUST implement theObject.hashCode()
method correctly.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
-