Class AbstractAmazonCloudWatchEvents
- All Implemented Interfaces:
AmazonCloudWatchEvents
- Direct Known Subclasses:
AbstractAmazonCloudWatchEventsAsync
AmazonCloudWatchEvents
. Convenient method
forms pass through to the corresponding overload that takes a request object,
which throws an UnsupportedOperationException
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteRule
(DeleteRuleRequest request) Deletes a rule.describeRule
(DescribeRuleRequest request) Describes the details of the specified rule.disableRule
(DisableRuleRequest request) Disables a rule.enableRule
(EnableRuleRequest request) Enables a rule.Returns additional metadata for a previously executed successful request, typically used for debugging issues where a service isn't acting as expected.Lists the names of the rules that the given target is put to.listRules
(ListRulesRequest request) Lists the Amazon CloudWatch Events rules in your account.Lists of targets assigned to the rule.putEvents
(PutEventsRequest request) Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.putRule
(PutRuleRequest request) Creates or updates a rule.putTargets
(PutTargetsRequest request) Adds target(s) to a rule.removeTargets
(RemoveTargetsRequest request) Removes target(s) from a rule so that when the rule is triggered, those targets will no longer be invoked.void
setEndpoint
(String endpoint) Overrides the default endpoint for this client ("events.us-east-1.amazonaws.com").void
An alternative toAmazonCloudWatchEvents.setEndpoint(String)
, sets the regional endpoint for this client's service calls.void
shutdown()
Shuts down this client object, releasing any resources that might be held open.testEventPattern
(TestEventPatternRequest request) Tests whether an event pattern matches the provided event.
-
Constructor Details
-
AbstractAmazonCloudWatchEvents
protected AbstractAmazonCloudWatchEvents()
-
-
Method Details
-
setEndpoint
Description copied from interface:AmazonCloudWatchEvents
Overrides the default endpoint for this client ("events.us-east-1.amazonaws.com"). Callers can use this method to control which AWS region they want to work with.Callers can pass in just the endpoint (ex: "events.us-east-1.amazonaws.com") or a full URL, including the protocol (ex: "events.us-east-1.amazonaws.com"). If the protocol is not specified here, the default protocol from this client's
ClientConfiguration
will be used, which by default is HTTPS.For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID= 3912
This method is not threadsafe. An endpoint should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
- Specified by:
setEndpoint
in interfaceAmazonCloudWatchEvents
- Parameters:
endpoint
- The endpoint (ex: "events.us-east-1.amazonaws.com") or a full URL, including the protocol (ex: "events.us-east-1.amazonaws.com") of the region specific AWS endpoint this client will communicate with.
-
setRegion
Description copied from interface:AmazonCloudWatchEvents
An alternative toAmazonCloudWatchEvents.setEndpoint(String)
, sets the regional endpoint for this client's service calls. Callers can use this method to control which AWS region they want to work with.By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the
ClientConfiguration
supplied at construction.This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
- Specified by:
setRegion
in interfaceAmazonCloudWatchEvents
- Parameters:
region
- The region this client will communicate with. SeeRegion.getRegion(com.amazonaws.regions.Regions)
for accessing a given region. Must not be null and must be a region where the service is available.- See Also:
-
deleteRule
Description copied from interface:AmazonCloudWatchEvents
Deletes a rule. You must remove all targets from a rule using RemoveTargets before you can delete the rule.
Note: When you delete a rule, incoming events might still continue to match to the deleted rule. Please allow a short period of time for changes to take effect.
- Specified by:
deleteRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the DeleteRule operation.- Returns:
- Result of the DeleteRule operation returned by the service.
-
describeRule
Description copied from interface:AmazonCloudWatchEvents
Describes the details of the specified rule.
- Specified by:
describeRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the DescribeRule operation.- Returns:
- Result of the DescribeRule operation returned by the service.
-
disableRule
Description copied from interface:AmazonCloudWatchEvents
Disables a rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression.
Note: When you disable a rule, incoming events might still continue to match to the disabled rule. Please allow a short period of time for changes to take effect.
- Specified by:
disableRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the DisableRule operation.- Returns:
- Result of the DisableRule operation returned by the service.
-
enableRule
Description copied from interface:AmazonCloudWatchEvents
Enables a rule. If the rule does not exist, the operation fails.
Note: When you enable a rule, incoming events might not immediately start matching to a newly enabled rule. Please allow a short period of time for changes to take effect.
- Specified by:
enableRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the EnableRule operation.- Returns:
- Result of the EnableRule operation returned by the service.
-
listRuleNamesByTarget
Description copied from interface:AmazonCloudWatchEvents
Lists the names of the rules that the given target is put to. You can see which of the rules in Amazon CloudWatch Events can invoke a specific target in your account. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRulesByTarget until the NextToken in the response is returned as null.
- Specified by:
listRuleNamesByTarget
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the ListRuleNamesByTarget operation.- Returns:
- Result of the ListRuleNamesByTarget operation returned by the service.
-
listRules
Description copied from interface:AmazonCloudWatchEvents
Lists the Amazon CloudWatch Events rules in your account. You can either list all the rules or you can provide a prefix to match to the rule names. If you have more rules in your account than the given limit, the results will be paginated. In that case, use the next token returned in the response and repeat ListRules until the NextToken in the response is returned as null.
- Specified by:
listRules
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the ListRules operation.- Returns:
- Result of the ListRules operation returned by the service.
-
listTargetsByRule
Description copied from interface:AmazonCloudWatchEvents
Lists of targets assigned to the rule.
- Specified by:
listTargetsByRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the ListTargetsByRule operation.- Returns:
- Result of the ListTargetsByRule operation returned by the service.
-
putEvents
Description copied from interface:AmazonCloudWatchEvents
Sends custom events to Amazon CloudWatch Events so that they can be matched to rules.
- Specified by:
putEvents
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the PutEvents operation.- Returns:
- Result of the PutEvents operation returned by the service.
-
putRule
Description copied from interface:AmazonCloudWatchEvents
Creates or updates a rule. Rules are enabled by default, or based on value of the State parameter. You can disable a rule using DisableRule.
Note: When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Please allow a short period of time for changes to take effect.
A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule will trigger on matching events as well as on a schedule.
Note: Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
- Specified by:
putRule
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the PutRule operation.- Returns:
- Result of the PutRule operation returned by the service.
-
putTargets
Description copied from interface:AmazonCloudWatchEvents
Adds target(s) to a rule. Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets. Updates the target(s) if they are already associated with the role. In other words, if there is already a target with the given target ID, then the target associated with that ID is updated.
In order to be able to make API calls against the resources you own, Amazon CloudWatch Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, CloudWatch Events relies on resource-based policies. For Amazon Kinesis streams, CloudWatch Events relies on IAM roles. For more information, see Permissions for Sending Events to Targets in the Amazon CloudWatch Developer Guide.
Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:
- Neither Input nor InputPath is specified, then the entire event is passed to the target in JSON form.
- InputPath is specified in the form of JSONPath (e.g. $.detail), then only the part of the event specified in the path is passed to the target (e.g. only the detail part of the event is passed).
- Input is specified in the form of a valid JSON, then the matched event is overridden with this constant.
Note: When you add targets to a rule, when the associated rule triggers, new or updated targets might not be immediately invoked. Please allow a short period of time for changes to take effect.
- Specified by:
putTargets
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the PutTargets operation.- Returns:
- Result of the PutTargets operation returned by the service.
-
removeTargets
Description copied from interface:AmazonCloudWatchEvents
Removes target(s) from a rule so that when the rule is triggered, those targets will no longer be invoked.
Note: When you remove a target, when the associated rule triggers, removed targets might still continue to be invoked. Please allow a short period of time for changes to take effect.
- Specified by:
removeTargets
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the RemoveTargets operation.- Returns:
- Result of the RemoveTargets operation returned by the service.
-
testEventPattern
Description copied from interface:AmazonCloudWatchEvents
Tests whether an event pattern matches the provided event.
Note: Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
- Specified by:
testEventPattern
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- Container for the parameters to the TestEventPattern operation.- Returns:
- Result of the TestEventPattern operation returned by the service.
-
shutdown
public void shutdown()Description copied from interface:AmazonCloudWatchEvents
Shuts down this client object, releasing any resources that might be held open. This is an optional method, and callers are not expected to call it, but can if they want to explicitly release any open resources. Once a client has been shutdown, it should not be used to make any more requests.- Specified by:
shutdown
in interfaceAmazonCloudWatchEvents
-
getCachedResponseMetadata
Description copied from interface:AmazonCloudWatchEvents
Returns additional metadata for a previously executed successful request, typically used for debugging issues where a service isn't acting as expected. This data isn't considered part of the result data returned by an operation, so it's available through this separate, diagnostic interface.Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing a request.
- Specified by:
getCachedResponseMetadata
in interfaceAmazonCloudWatchEvents
- Parameters:
request
- The originally executed request.- Returns:
- The response metadata for the specified request, or null if none is available.
-