com.amazonaws.auth.policy.conditions

## クラス ConditionFactory

- java.lang.Object
- - com.amazonaws.auth.policy.conditions.ConditionFactory

-     public class ConditionFactory
      extends java.lang.Object

  Factory for creating common AWS access control policy conditions. These conditions are common for AWS services and can be expected to work across any service that supports AWS access control policies.

- - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `static java.lang.String` | `CURRENT_TIME_CONDITION_KEY` Condition key for the current time.
    `static java.lang.String` | `EPOCH_TIME_CONDITION_KEY` Condition key for the current time, in epoch seconds.
    `static java.lang.String` | `REFERER_CONDITION_KEY` Condition key for the referer specified by a request.
    `static java.lang.String` | `SECURE_TRANSPORT_CONDITION_KEY` Condition key for whether or not an incoming request is using a secure transport to make the request (i.e.
    `static java.lang.String` | `SOURCE_ARN_CONDITION_KEY` Condition key for the Amazon Resource Name (ARN) of the source specified in a request.
    `static java.lang.String` | `SOURCE_IP_CONDITION_KEY` Condition key for the source IP from which a request originates.
    `static java.lang.String` | `USER_AGENT_CONDITION_KEY` Condition key for the user agent included in a request.

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `static Condition` | `newRefererCondition(StringCondition.StringComparisonType comparisonType, java.lang.String value)` Constructs a new access control policy condition that tests the incoming request's referer field against the specified value, using the specified comparison type.
    `static Condition` | `newSecureTransportCondition()` Constructs a new access control policy condition that tests if the incoming request was sent over a secure transport (HTTPS).
    `static Condition` | `newSourceArnCondition(java.lang.String arnPattern)` Constructs a new access policy condition that compares the Amazon Resource Name (ARN) of the source of an AWS resource that is modifying another AWS resource with the specified pattern.
    `static Condition` | `newUserAgentCondition(StringCondition.StringComparisonType comparisonType, java.lang.String value)` Constructs a new access control policy condition that tests the incoming request's user agent field against the specified value, using the specified comparison type.

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### フィールドの詳細

    - #### CURRENT_TIME_CONDITION_KEY

          public static final java.lang.String CURRENT_TIME_CONDITION_KEY

      Condition key for the current time.

      This condition key should only be used with `DateCondition` objects.

      関連項目:
        定数フィールド値

    - #### SECURE_TRANSPORT_CONDITION_KEY

          public static final java.lang.String SECURE_TRANSPORT_CONDITION_KEY

      Condition key for whether or not an incoming request is using a secure transport to make the request (i.e. HTTPS instead of HTTP).

      This condition key should only be used with `BooleanCondition` objects.

      関連項目:
        定数フィールド値

    - #### SOURCE_IP_CONDITION_KEY

          public static final java.lang.String SOURCE_IP_CONDITION_KEY

      Condition key for the source IP from which a request originates.

      This condition key should only be used with `IpAddressCondition` objects.

      関連項目:
        定数フィールド値

    - #### USER_AGENT_CONDITION_KEY

          public static final java.lang.String USER_AGENT_CONDITION_KEY

      Condition key for the user agent included in a request.

      This condition key should only be used with `StringCondition` objects.

      関連項目:
        定数フィールド値

    - #### EPOCH_TIME_CONDITION_KEY

          public static final java.lang.String EPOCH_TIME_CONDITION_KEY

      Condition key for the current time, in epoch seconds.

      This condition key should only be used with `NumericCondition` objects.

      関連項目:
        定数フィールド値

    - #### REFERER_CONDITION_KEY

          public static final java.lang.String REFERER_CONDITION_KEY

      Condition key for the referer specified by a request.

      This condition key should only be used with `StringCondition` objects.

      関連項目:
        定数フィールド値

    - #### SOURCE_ARN_CONDITION_KEY

          public static final java.lang.String SOURCE_ARN_CONDITION_KEY

      Condition key for the Amazon Resource Name (ARN) of the source specified in a request. The source ARN indicates which resource is affecting the resource listed in your policy. For example, an SNS topic is the source ARN when publishing messages from the topic to an SQS queue.

      This condition key should only be used with `ArnCondition` objects.

      関連項目:
        定数フィールド値

  - ### メソッドの詳細

    - #### newSourceArnCondition

          public static Condition newSourceArnCondition(java.lang.String arnPattern)

      Constructs a new access policy condition that compares the Amazon Resource Name (ARN) of the source of an AWS resource that is modifying another AWS resource with the specified pattern.

      For example, the source ARN could be an Amazon SNS topic ARN that is sending messages to an Amazon SQS queue. In that case, the SNS topic ARN would be compared the ARN pattern specified here.

      The endpoint pattern may optionally contain the multi-character wildcard (*) or the single-character wildcard (?). Each of the six colon-delimited components of the ARN is checked separately and each can include a wildcard.

           Policy policy = new Policy("MyQueuePolicy");
           policy.withStatements(new Statement("AllowSNSMessages", Effect.Allow)
                   .withPrincipals(new Principal("*")).withActions(SQSActions.SendMessage)
                   .withResources(new Resource(myQueueArn))
                   .withConditions(ConditionFactory.newSourceArnCondition(myTopicArn)));

      パラメータ:
        `sourceArnPattern` - The ARN pattern against which the source ARN will be compared. Each of the six colon-delimited components of the ARN is checked separately and each can include a wildcard.
      戻り値:
        A new access control policy condition that compares the ARN of the source specified in an incoming request with the ARN pattern specified here.

    - #### newSecureTransportCondition

          public static Condition newSecureTransportCondition()

      Constructs a new access control policy condition that tests if the incoming request was sent over a secure transport (HTTPS).
      戻り値:
        A new access control policy condition that tests if the incoming request was sent over a secure transport (HTTPS).

    - #### newUserAgentCondition

          public static Condition newUserAgentCondition(StringCondition.StringComparisonType comparisonType,
                                        java.lang.String value)

      Constructs a new access control policy condition that tests the incoming request's user agent field against the specified value, using the specified comparison type. This condition can be used to allow or deny access to a resource based on what user agent is specified in the request.
      パラメータ:
        `comparisonType` - The type of string comparison to perform when testing an incoming request's user agent field with the specified value.
        `value` - The value against which to compare the incoming request's user agent.
      戻り値:
        A new access control policy condition that tests an incoming request's user agent field.

    - #### newRefererCondition

          public static Condition newRefererCondition(StringCondition.StringComparisonType comparisonType,
                                      java.lang.String value)

      Constructs a new access control policy condition that tests the incoming request's referer field against the specified value, using the specified comparison type.
      パラメータ:
        `comparisonType` - The type of string comparison to perform when testing an incoming request's referer field with the specified value.
        `value` - The value against which to compare the incoming request's referer field.
      戻り値:
        A new access control policy condition that tests an incoming request's referer field.