@Component public class ReservedNameListImpl extends java.lang.Object implements ReservedNameList
RESERVE_SECONDS_DEFAULT
Constructor and Description |
---|
ReservedNameListImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clearReservation(java.util.UUID reservation)
Releases a reservation for a name.
|
java.lang.String |
getName(java.util.UUID reservation)
Returns a reserved name.
|
java.util.UUID |
reserve(java.lang.String name)
Attempts to reserve the provided name.
|
public java.util.UUID reserve(java.lang.String name) throws AlreadyExistsException
ReservedNameList
If the name is available, returns a token representing your reservation for the name. If you obtain a reservation for a name, you must present the reservation when creating an account; otherwise account creation fails since there is a reservation for that name.
reserve
in interface ReservedNameList
name
- Name to reserveReservedNameList.RESERVE_SECONDS_DEFAULT
seconds.AlreadyExistsException
- If name has an active reservation.public void clearReservation(java.util.UUID reservation)
ReservedNameList
clearReservation
in interface ReservedNameList
reservation
- The reservation to release.public java.lang.String getName(java.util.UUID reservation)
ReservedNameList
getName
in interface ReservedNameList
reservation
- The reservation for a name