Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ releaseLock() or lockItem.close()

### Acquire lock with timeout
You can acquire a lock via two different methods: acquireLock or tryAcquireLock. The difference between the
two methods is that tryAcquireLock will return Optional.absent() if the lock was not acquired, whereas
two methods is that tryAcquireLock will return Optional.empty() if the lock was not acquired, whereas
acquireLock will throw a LockNotGrantedException. Both methods provide optional parameters where you can specify
an additional timeout for acquiring the lock. Then they will try to acquire the lock for that amount of time
before giving up. They do this by continually polling DynamoDB according to an interval you set up. Remember that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Map<String, AttributeValue> getAdditionalAttributes() {
/**
* Constructs a SessionMonitor object for LockItem instantiation
*
* @return <code>Optional.absent()</code> if no call to
* @return <code>Optional.empty()</code> if no call to
* {with,set}SessionMonitor was made, else a SessionMonitor object
* with the desired properties
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public AmazonDynamoDBLockClient(final AmazonDynamoDBLockClientOptions amazonDyna
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getOwnerName(), "Owner name cannot be null");
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getTimeUnit(), "Time unit cannot be null");
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getPartitionKeyName(), "Partition Key Name cannot be null");
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getSortKeyName(), "Sort Key Name cannot be null (use Optional.absent())");
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getSortKeyName(), "Sort Key Name cannot be null (use Optional.empty())");
Objects.requireNonNull(amazonDynamoDBLockClientOptions.getNamedThreadCreator(), "Named thread creator cannot be null");
this.dynamoDB = amazonDynamoDBLockClientOptions.getDynamoDBClient();
this.tableName = amazonDynamoDBLockClientOptions.getTableName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ String getPartitionKeyName() {

/**
* @return sortKeyName
* The sort key name. If this is set to Optional.absent(), then it means that the table only uses a partition key.
* The sort key name. If this is set to Optional.empty(), then it means that the table only uses a partition key.
*/
Optional<String> getSortKeyName() {
return this.sortKeyName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class LockItem implements Closeable {
* @param client The AmazonDynamoDBLockClient object associated with this lock
* @param partitionKey The key representing the lock
* @param sortKey The sort key, if the DynamoDB table supports sort keys (or
* Optional.absent otherwise)
* Optional.empty otherwise)
* @param data The data stored in the lock (can be null)
* @param deleteLockItemOnClose Whether or not to delete the lock item when releasing it
* @param ownerName The owner associated with the lock
Expand Down