public class AuthorizationResponse extends java.lang.Object implements java.lang.Comparable<AuthorizationResponse>
AuthorizationManager.authorizeDocids
method.Modifier and Type | Class and Description |
---|---|
static class |
AuthorizationResponse.Status
Authorization Status codes.
|
Constructor and Description |
---|
AuthorizationResponse(AuthorizationResponse.Status status,
java.lang.String docid)
Makes an
AuthorizationResponse . |
AuthorizationResponse(boolean valid,
java.lang.String docid)
Makes an
AuthorizationResponse . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AuthorizationResponse other)
Comparable for testing.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
java.lang.String |
getDocid()
Gets the docid.
|
AuthorizationResponse.Status |
getStatus()
Gets the status.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isValid()
Tests whether authorization was valid (permitted).
|
java.lang.String |
toString() |
public AuthorizationResponse(boolean valid, java.lang.String docid)
AuthorizationResponse
. If valid
is true
,
then status
is set to PERMIT
.
If valid
is false
, status
is set to
DENY
.valid
- indicates that authorization was successful (valid)docid
- the docid for which authorization succeeded - should not be
null
or emptypublic AuthorizationResponse(AuthorizationResponse.Status status, java.lang.String docid)
AuthorizationResponse
.status
- the Status
of this responsedocid
- The docid for which authorization succeeded - should not be
null
or emptypublic boolean isValid()
true
if status
is PERMIT
,
false
otherwisepublic java.lang.String getDocid()
null
or emptypublic AuthorizationResponse.Status getStatus()
Status
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
true
if this object is the same as the obj
argument; false
otherwisepublic int compareTo(AuthorizationResponse other)
compareTo
in interface java.lang.Comparable<AuthorizationResponse>