public class Condition
extends java.lang.Object
Statement
objects, and affect when a statement is applied. For example, a statement
that allows access to an Amazon SQS queue could use a condition to only apply
the effect of that statement for requests that are made before a certain
date, or that originate from a range of IP addresses.
Multiple conditions can be included in a single statement, and all conditions must evaluate to true in order for the statement to take effect.
The set of conditions is D in the statement "A has permission to do B to C where D applies."
A condition is composed of three parts:
ConditionFactory.SOURCE_IP_CONDITION_KEY
will cause
AWS to pull in the current request's source IP as the first value to compare
against every time your policy is evaluated.
NumericCondition.NumericComparisonType
enumerates the ways a
NumericCondition
can be evaluated (less than, greater than, equals,
etc).
There are many expressive conditions available in the
com.amazonaws.auth.policy.conditions
package to use in access
control policy statements.
This class is not intended to be directly subclassed by users, instead users should use the many available conditions and condition factories in the com.amazonaws.auth.policy.conditions package.
Constructor and Description |
---|
Condition() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConditionKey()
Returns the name of the condition key involved in this condition.
|
java.lang.String |
getType()
Returns the type of this condition.
|
java.util.List<java.lang.String> |
getValues()
Returns the values specified for this access control policy condition.
|
void |
setConditionKey(java.lang.String conditionKey)
Sets the name of the condition key involved in this condition.
|
void |
setType(java.lang.String type)
Sets the type of this condition.
|
void |
setValues(java.util.List<java.lang.String> values)
Sets the values specified for this access control policy condition.
|
Condition |
withConditionKey(java.lang.String key)
Fluent version of
setConditionKey(String) |
Condition |
withType(java.lang.String type)
Fluent version of
setType(String) |
Condition |
withValues(java.util.List<java.lang.String> values)
Fluent version of
setValues(List) |
Condition |
withValues(java.lang.String... values)
Fluent version of
setValues(List) |
public java.lang.String getType()
public void setType(java.lang.String type)
type
- The type of this condition.public java.lang.String getConditionKey()
Your policy is evaluated for each incoming request, and condition keys specify what information to pull out of those incoming requests and plug into the conditions in your policy.
public void setConditionKey(java.lang.String conditionKey)
Your policy is evaluated for each incoming request, and condition keys specify what information to pull out of those incoming requests and plug into the conditions in your policy.
conditionKey
- The name of the condition key involved in this
condition.public java.util.List<java.lang.String> getValues()
Most conditions accept only one value, but multiple values are possible.
public void setValues(java.util.List<java.lang.String> values)
Most conditions accept only one value, but multiple values are possible.
values
- The values specified for this access control policy
condition.public Condition withType(java.lang.String type)
setType(String)
type
- the type.public Condition withConditionKey(java.lang.String key)
setConditionKey(String)
key
- the key.public Condition withValues(java.lang.String... values)
setValues(List)
values
- the values.public Condition withValues(java.util.List<java.lang.String> values)
setValues(List)
values
- the values.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.