public final class Decision extends Object
Constructor and Description |
---|
Decision(String resource,
Map<String,Boolean> actions,
Map<String,List<String>> attributes,
Map<String,List<String>> advices)
Creates an immutable policy decision.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<String,Boolean> |
getActions()
A unmodifiable map of action name keys to Boolean values that indicate whether the action is allowed
true
or denied false for the specified resource. |
Map<String,List<String>> |
getAdvices()
Returns an unmodifiable map of advice names to their values, if any advice is returned according to applicable
policies.
|
Map<String,List<String>> |
getAttributes()
Returns an unmodifiable map of attribute names to their values, if any response attributes are returned according
to applicable policies.
|
String |
getResource()
Returns the resource to which apply the decision.
|
boolean |
hasAdvices()
Returns
true if this policy decision has any advices, false otherwise. |
int |
hashCode() |
boolean |
isAllowed(String action)
Returns
true if the requested action is allowed for this resource, false otherwise. |
public Decision(String resource, Map<String,Boolean> actions, Map<String,List<String>> attributes, Map<String,List<String>> advices)
resource
- The requested resource, not null
.actions
- A map of action name keys to Boolean values that indicate whether the action is allowed true
or
denied false
for the specified resource, not null
.attributes
- An immutable map of attribute names to their values, if any response attributes
are returned according to applicable policies, not null
.advices
- An immutable map of advice names to their values, if any advice is returned
according to applicable policies, not null
.public String getResource()
public Map<String,Boolean> getActions()
true
or denied false
for the specified resource.true
or denied false
for the specified resource.public boolean isAllowed(String action)
true
if the requested action is allowed for this resource, false
otherwise.action
- The requested action on this resource.true
if the requested action is allowed, false
otherwise.public Map<String,List<String>> getAttributes()
public Map<String,List<String>> getAdvices()
public boolean hasAdvices()
true
if this policy decision has any advices, false
otherwise.true
if this policy decision has any advices, false
otherwise.Copyright 2011-2017 ForgeRock AS.