Class KinesisService
java.lang.Object
org.graylog.integrations.aws.service.KinesisService
Service for all AWS Kinesis business logic and SDK usages.
-
Constructor Summary
ConstructorDescriptionKinesisService
(software.amazon.awssdk.services.iam.IamClientBuilder iamClientBuilder, software.amazon.awssdk.services.kinesis.KinesisClientBuilder kinesisClientBuilder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Map<String, Codec.Factory<? extends Codec>> availableCodecs, AWSClientBuilderUtil awsClientBuilderUtil) -
Method Summary
Modifier and TypeMethodDescriptionCreates and sets the new role and permissions for Kinesis to talk to Cloudwatch.Creates a new Kinesis stream.getKinesisStreamNames
(AWSRequest request) healthCheck
(KinesisHealthCheckRequest request) The Health Check performs the following actions:static boolean
isCompressed
(byte[] bytes) Checks if the supplied stream is GZip compressed.
-
Constructor Details
-
KinesisService
@Inject public KinesisService(software.amazon.awssdk.services.iam.IamClientBuilder iamClientBuilder, software.amazon.awssdk.services.kinesis.KinesisClientBuilder kinesisClientBuilder, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Map<String, Codec.Factory<? extends Codec>> availableCodecs, AWSClientBuilderUtil awsClientBuilderUtil)
-
-
Method Details
-
healthCheck
public KinesisHealthCheckResponse healthCheck(KinesisHealthCheckRequest request) throws ExecutionException, IOException The Health Check performs the following actions:1) Get all the Kinesis streams. 2) Check if the supplied stream exists. 3) Retrieve one record from Kinesis stream. 4) Check if the payload is compressed. 5) Detect the type of log message. 6) Parse the message if is of a known type.
- Parameters:
request
- The request, which indicates which stream region to health check- Returns:
- a
KinesisHealthCheckResponse
, which indicates the type of detected message and a sample parsed message. - Throws:
ExecutionException
IOException
-
getKinesisStreamNames
- Throws:
ExecutionException
-
isCompressed
public static boolean isCompressed(byte[] bytes) Checks if the supplied stream is GZip compressed.- Parameters:
bytes
- a byte array.- Returns:
- true if the byte array is GZip compressed and false if not.
-
createNewKinesisStream
Creates a new Kinesis stream.- Parameters:
request
- request which contains region, access, secret, region, streamName and shardCount- Returns:
- the status response
-
autoKinesisPermissions
Creates and sets the new role and permissions for Kinesis to talk to Cloudwatch.- Parameters:
request
- The create permission request.- Returns:
- role Arn associated with the associated kinesis stream
-