public class LeaseSerializer extends Object implements ILeaseSerializer<Lease>
| Modifier and Type | Field and Description |
|---|---|
Class<? extends Lease> |
clazz |
String |
LEASE_COUNTER_KEY |
String |
LEASE_KEY_KEY |
String |
LEASE_OWNER_KEY |
| Constructor and Description |
|---|
LeaseSerializer() |
LeaseSerializer(Class<? extends Lease> clazz) |
| Modifier and Type | Method and Description |
|---|---|
Lease |
fromDynamoRecord(Map<String,AttributeValue> dynamoRecord)
Construct a Lease object out of a DynamoDB record.
|
Collection<AttributeDefinition> |
getAttributeDefinitions() |
Map<String,AttributeValueUpdate> |
getDynamoEvictLeaseUpdate(Lease lease) |
Map<String,AttributeValue> |
getDynamoHashKey(Lease lease) |
Map<String,AttributeValue> |
getDynamoHashKey(String leaseKey)
Special getDynamoHashKey implementation used by ILeaseManager.getLease().
|
Map<String,ExpectedAttributeValue> |
getDynamoLeaseCounterExpectation(Lease lease) |
Map<String,ExpectedAttributeValue> |
getDynamoLeaseCounterExpectation(Long leaseCounter) |
Map<String,AttributeValueUpdate> |
getDynamoLeaseCounterUpdate(Lease lease) |
Map<String,AttributeValueUpdate> |
getDynamoLeaseCounterUpdate(Long leaseCounter) |
Map<String,ExpectedAttributeValue> |
getDynamoLeaseOwnerExpectation(Lease lease) |
Map<String,ExpectedAttributeValue> |
getDynamoNonexistantExpectation() |
Map<String,AttributeValueUpdate> |
getDynamoTakeLeaseUpdate(Lease lease,
String owner) |
Map<String,AttributeValueUpdate> |
getDynamoUpdateLeaseUpdate(Lease lease) |
Collection<KeySchemaElement> |
getKeySchema() |
Map<String,AttributeValue> |
toDynamoRecord(Lease lease)
Construct a DynamoDB record out of a Lease object
|
public final String LEASE_KEY_KEY
public final String LEASE_OWNER_KEY
public final String LEASE_COUNTER_KEY
public Map<String,AttributeValue> toDynamoRecord(Lease lease)
ILeaseSerializertoDynamoRecord in interface ILeaseSerializer<Lease>lease - lease object to serializepublic Lease fromDynamoRecord(Map<String,AttributeValue> dynamoRecord)
ILeaseSerializerfromDynamoRecord in interface ILeaseSerializer<Lease>dynamoRecord - attribute value map from DynamoDBpublic Map<String,AttributeValue> getDynamoHashKey(String leaseKey)
ILeaseSerializergetDynamoHashKey in interface ILeaseSerializer<Lease>public Map<String,AttributeValue> getDynamoHashKey(Lease lease)
getDynamoHashKey in interface ILeaseSerializer<Lease>public Map<String,ExpectedAttributeValue> getDynamoLeaseCounterExpectation(Lease lease)
getDynamoLeaseCounterExpectation in interface ILeaseSerializer<Lease>public Map<String,ExpectedAttributeValue> getDynamoLeaseCounterExpectation(Long leaseCounter)
public Map<String,ExpectedAttributeValue> getDynamoLeaseOwnerExpectation(Lease lease)
getDynamoLeaseOwnerExpectation in interface ILeaseSerializer<Lease>public Map<String,ExpectedAttributeValue> getDynamoNonexistantExpectation()
getDynamoNonexistantExpectation in interface ILeaseSerializer<Lease>public Map<String,AttributeValueUpdate> getDynamoLeaseCounterUpdate(Lease lease)
getDynamoLeaseCounterUpdate in interface ILeaseSerializer<Lease>public Map<String,AttributeValueUpdate> getDynamoLeaseCounterUpdate(Long leaseCounter)
public Map<String,AttributeValueUpdate> getDynamoTakeLeaseUpdate(Lease lease, String owner)
getDynamoTakeLeaseUpdate in interface ILeaseSerializer<Lease>public Map<String,AttributeValueUpdate> getDynamoEvictLeaseUpdate(Lease lease)
getDynamoEvictLeaseUpdate in interface ILeaseSerializer<Lease>public Map<String,AttributeValueUpdate> getDynamoUpdateLeaseUpdate(Lease lease)
getDynamoUpdateLeaseUpdate in interface ILeaseSerializer<Lease>public Collection<KeySchemaElement> getKeySchema()
getKeySchema in interface ILeaseSerializer<Lease>public Collection<AttributeDefinition> getAttributeDefinitions()
getAttributeDefinitions in interface ILeaseSerializer<Lease>