Constructor
new SalmonFileSequencer(sequenceFile, serializer)
Instantiate a nonce file sequencer.
Parameters:
Name | Type | Description |
---|---|---|
sequenceFile |
The sequence file (json format). | |
serializer |
The serializer to be used. |
Throws:
-
IOException Thrown if there is an IO error.
-
SequenceException Thrown if error with the nonce sequence
Classes
Methods
close()
Close this file sequencer.
(async) createSequence(driveId, authId)
Create a sequence for the drive ID and auth ID provided.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. | |
authId |
The authorization ID of the drive. |
Throws:
SequenceException Thrown if error with the nonce sequence
(async) getContents()
Get the contents of a sequence file.
Throws:
SequenceException Thrown if error with the nonce sequence
Returns:
(async) getSequence(driveId)
Get the sequence by the drive ID.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. |
Throws:
SequenceException Thrown if error with the nonce sequence
Returns:
(async) initializeSequence(driveId, authId, startNonce, maxNonce)
Initialize the sequence.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. | |
authId |
The auth ID of the device for the drive. | |
startNonce |
The starting nonce. | |
maxNonce |
The maximum nonce. |
Throws:
-
SequenceException Thrown if error with the nonce sequence
-
IOException Thrown if there is an IO error.
(async) nextNonce(driveId)
Get the next nonce.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. |
Throws:
-
SequenceException Thrown if error with the nonce sequence
-
SalmonRangeExceededException Thrown if nonce has exceeded range
Returns:
(async) revokeSequence(driveId)
Revoke the current sequence for a specific drive.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. |
Throws:
SequenceException Thrown if error with the nonce sequence
(async) saveContents(contents)
Save the contents of the file
Parameters:
Name | Type | Description |
---|---|---|
contents |
The contents |
(async) saveSequenceFile(sequences)
Save the sequence file.
Parameters:
Name | Type | Description |
---|---|---|
sequences |
The sequences. |
Throws:
SequenceException Thrown if error with the nonce sequence
(async) setMaxNonce(driveId, authId, maxNonce)
Set the maximum nonce.
Parameters:
Name | Type | Description |
---|---|---|
driveId |
The drive ID. | |
authId |
The auth ID of the device for the drive. | |
maxNonce |
The maximum nonce. |
Throws:
SequenceException Thrown if error with the nonce sequence