Class: SalmonFileSequencer

SalmonFileSequencer(sequenceFile, serializer)

Generates nonces based on a sequencer backed by a file.

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.
Source:
Throws:
  • IOException Thrown if there is an IO error.
  • SequenceException Thrown if error with the nonce sequence

Classes

SalmonFileSequencer

Methods

close()

Close this file sequencer.
Source:

(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.
Source:
Throws:
SequenceException Thrown if error with the nonce sequence

(async) getContents()

Get the contents of a sequence file.
Source:
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.
Source:
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.
Source:
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.
Source:
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.
Source:
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
Source:

(async) saveSequenceFile(sequences)

Save the sequence file.
Parameters:
Name Type Description
sequences The sequences.
Source:
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.
Source:
Throws:
SequenceException Thrown if error with the nonce sequence