public interface CloudWatchFacade
CloudWatchLogWriter.
Instances are created by FacadeFactory, and are tied to a single
writer's configuration.
All operations may throw CloudWatchFacadeException. Callers are expected
to catch this exception (it's checked), and take action based on the reason code
that it exposes.
| Modifier and Type | Method and Description |
|---|---|
void |
createLogGroup()
Attempts to create the configured log group.
|
void |
createLogStream()
Attempts to create the configured log stream.
|
String |
findLogGroup()
Determines whether the configured log group exists, and returns its ARN
if it does.
|
String |
findLogStream()
Determines whether the configured log stream exists, returning its ARN
if it does.
|
String |
putEvents(String sequenceToken,
List<LogMessage> messages)
Attempts to send a batch of messages.
|
String |
retrieveSequenceToken()
If the configured stream exists, returns the sequence token needed to write to it.
|
void |
setLogGroupRetention()
Sets the retention period on the configured log group.
|
void |
shutdown()
Shuts down the underlying client.
|
String findLogGroup()
null if the log group doesn't exist or
the call is throttled.void createLogGroup()
Log group creation is an asynchronous operation: the group may not be available
for use for several seconds afterward. You should call findLogGroup() in
a loop (with delays) until it returns the group's ARN.
void setLogGroupRetention()
String findLogStream()
null if the log group doesn't exist or
the call is throttled.void createLogStream()
Stream creation is an asynchronous operation: the stream may not be available for
several seconds after creation. You should call retrieveSequenceToken() in
a loop (with delays) until it returns a value.
String retrieveSequenceToken()
null if the stream does not exist or the retrieve operation
is thottled.
Note: if the log group does not exist, this is treated as if the stream does not exist. The log-writer must use other mechanism (eg, failed write) to determine that it needs to recreate the log group.
String putEvents(String sequenceToken, List<LogMessage> messages)
sequenceToken - Sequence token from a prior call to this method or an explicit
call to retrieveSequenceToken().messages - The messages to send. These messages must meet all of the
requirements for PutLogEvents (sorted by
timestamp, and within acceptable timestamp ranges).void shutdown()
Copyright © 2023. All rights reserved.