Search in sources :

Example 1 with KeyType

use of software.amazon.awssdk.services.dynamodb.model.KeyType in project cas by apereo.

the class DynamoDbTicketRegistryFacilitator method createTicketTables.

/**
 * Create ticket tables.
 *
 * @param deleteTables the delete tables
 */
public void createTicketTables(final boolean deleteTables) {
    val metadata = this.ticketCatalog.findAll();
    metadata.forEach(Unchecked.consumer(r -> {
        DynamoDbTableUtils.createTable(amazonDynamoDBClient, dynamoDbProperties, r.getProperties().getStorageName(), deleteTables, List.of(AttributeDefinition.builder().attributeName(ColumnNames.ID.getColumnName()).attributeType(ScalarAttributeType.S).build()), List.of(KeySchemaElement.builder().attributeName(ColumnNames.ID.getColumnName()).keyType(KeyType.HASH).build()));
    }));
}
Also used : lombok.val(lombok.val) Getter(lombok.Getter) GetItemRequest(software.amazon.awssdk.services.dynamodb.model.GetItemRequest) RequiredArgsConstructor(lombok.RequiredArgsConstructor) SerializationUtils(org.apache.commons.lang3.SerializationUtils) HashMap(java.util.HashMap) DynamoDbTableUtils(org.apereo.cas.dynamodb.DynamoDbTableUtils) SdkBytes(software.amazon.awssdk.core.SdkBytes) ByteBuffer(java.nio.ByteBuffer) ArrayList(java.util.ArrayList) LoggingUtils(org.apereo.cas.util.LoggingUtils) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ScanRequest(software.amazon.awssdk.services.dynamodb.model.ScanRequest) Map(java.util.Map) CollectionUtils(org.apereo.cas.util.CollectionUtils) ScalarAttributeType(software.amazon.awssdk.services.dynamodb.model.ScalarAttributeType) TicketCatalog(org.apereo.cas.ticket.TicketCatalog) DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Unchecked(org.jooq.lambda.Unchecked) Collection(java.util.Collection) lombok.val(lombok.val) KeyType(software.amazon.awssdk.services.dynamodb.model.KeyType) AttributeDefinition(software.amazon.awssdk.services.dynamodb.model.AttributeDefinition) Collectors(java.util.stream.Collectors) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) DynamoDbTicketRegistryProperties(org.apereo.cas.configuration.model.support.dynamodb.DynamoDbTicketRegistryProperties) KeySchemaElement(software.amazon.awssdk.services.dynamodb.model.KeySchemaElement) PutItemRequest(software.amazon.awssdk.services.dynamodb.model.PutItemRequest) AttributeValue(software.amazon.awssdk.services.dynamodb.model.AttributeValue) DeleteItemRequest(software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest) Ticket(org.apereo.cas.ticket.Ticket)

Aggregations

ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Collectors (java.util.stream.Collectors)1 Getter (lombok.Getter)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 Slf4j (lombok.extern.slf4j.Slf4j)1 lombok.val (lombok.val)1 SerializationUtils (org.apache.commons.lang3.SerializationUtils)1 DynamoDbTicketRegistryProperties (org.apereo.cas.configuration.model.support.dynamodb.DynamoDbTicketRegistryProperties)1 DynamoDbTableUtils (org.apereo.cas.dynamodb.DynamoDbTableUtils)1 Ticket (org.apereo.cas.ticket.Ticket)1 TicketCatalog (org.apereo.cas.ticket.TicketCatalog)1 CollectionUtils (org.apereo.cas.util.CollectionUtils)1 LoggingUtils (org.apereo.cas.util.LoggingUtils)1 Unchecked (org.jooq.lambda.Unchecked)1