Class KinesisService

java.lang.Object
org.graylog.integrations.aws.service.KinesisService

public class KinesisService extends Object
Service for all AWS Kinesis business logic and SDK usages.
  • 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

      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

      public StreamsResponse getKinesisStreamNames(AWSRequest request) throws ExecutionException
      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

      public KinesisNewStreamResponse createNewKinesisStream(KinesisNewStreamRequest request)
      Creates a new Kinesis stream.
      Parameters:
      request - request which contains region, access, secret, region, streamName and shardCount
      Returns:
      the status response
    • autoKinesisPermissions

      public CreateRolePermissionResponse autoKinesisPermissions(CreateRolePermissionRequest request)
      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