Class MetadataUtils
- java.lang.Object
-
- com.nimbusds.infinispan.persistence.dynamodb.MetadataUtils
-
public class MetadataUtils extends Object
Infinispan metadata persistence utilities.
-
-
Constructor Summary
Constructors Constructor Description MetadataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.amazonaws.services.dynamodbv2.document.Item
addMetadata(com.amazonaws.services.dynamodbv2.document.Item item, org.infinispan.metadata.InternalMetadata metadata)
Adds Infinispan metadata to the specified DynamoDB item.static com.amazonaws.services.dynamodbv2.document.Item
addMetadata(com.amazonaws.services.dynamodbv2.document.Item item, org.infinispan.metadata.InternalMetadata metadata, boolean withTTL)
Adds Infinispan metadata to the specified DynamoDB item.static org.infinispan.metadata.InternalMetadata
parseMetadata(com.amazonaws.services.dynamodbv2.document.Item item)
Parses Infinispan metadata encoded withaddMetadata(com.amazonaws.services.dynamodbv2.document.Item, org.infinispan.metadata.InternalMetadata)
from the specified DynamoDB item.
-
-
-
Constructor Detail
-
MetadataUtils
public MetadataUtils()
-
-
Method Detail
-
addMetadata
public static com.amazonaws.services.dynamodbv2.document.Item addMetadata(com.amazonaws.services.dynamodbv2.document.Item item, org.infinispan.metadata.InternalMetadata metadata)
Adds Infinispan metadata to the specified DynamoDB item.Each metadata timestamp, if set (greater than -1) is encoded as long integer representing the number of milliseconds since the Unix spec:
- created - "iat"
- lifespan - "max"
- max idle - "idl"
- last used - "lat"
- Parameters:
item
- The DynamoDB item.metadata
- The Infinispan metadata,null
if not specified.- Returns:
- The DynamoDB item.
-
addMetadata
public static com.amazonaws.services.dynamodbv2.document.Item addMetadata(com.amazonaws.services.dynamodbv2.document.Item item, org.infinispan.metadata.InternalMetadata metadata, boolean withTTL)
Adds Infinispan metadata to the specified DynamoDB item.Each metadata timestamp, if set (greater than -1) is encoded as long integer representing the number of milliseconds since the Unix spec:
- created - "iat"
- lifespan - "max"
- max idle - "idl"
- last used - "lat"
- automatic DynamoDB item expiration - "ttl"
- Parameters:
item
- The DynamoDB item.metadata
- The Infinispan metadata,null
if not specified.withTTL
-true
to include a "ttl" attribute as Unix Unix timestamp, with second precision, for automatic DynamoDB item expiration.- Returns:
- The DynamoDB item.
-
parseMetadata
public static org.infinispan.metadata.InternalMetadata parseMetadata(com.amazonaws.services.dynamodbv2.document.Item item)
Parses Infinispan metadata encoded withaddMetadata(com.amazonaws.services.dynamodbv2.document.Item, org.infinispan.metadata.InternalMetadata)
from the specified DynamoDB item.- Parameters:
item
- The DynamoDB item.- Returns:
- The Infinispan metadata.
-
-