Package com.mku.sequence
Interface INonceSequencer
- All Known Implementing Classes:
SalmonFileSequencer,WinClientSequencer,WinFileSequencer
public interface INonceSequencer
Nonce sequencer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the sequencer and any associated resources.voidcreateSequence(String driveId, String authId) Create a sequence.getSequence(String driveId) Get the sequence used for this drive.voidinitializeSequence(String driveId, String authId, byte[] startNonce, byte[] maxNonce) Initialize the sequence.byte[]Get the next nonce.voidrevokeSequence(String driveId) Revoke the sequencer.voidsetMaxNonce(String driveId, String authId, byte[] maxNonce) Set the max nonce
-
Method Details
-
createSequence
Create a sequence.- Parameters:
driveId- The drive ID.authId- The authorization ID of the drive.- Throws:
SequenceException- Thrown if there is an error with the nonce sequence
-
initializeSequence
void initializeSequence(String driveId, String authId, byte[] startNonce, byte[] maxNonce) throws IOException Initialize the sequence.- Parameters:
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 there is an error with the nonce sequenceIOException- Thrown if there is an IO error.
-
setMaxNonce
Set the max nonce- Parameters:
driveId- The drive ID.authId- The auth ID of the device for the drive.maxNonce- The maximum nonce.- Throws:
SequenceException- Thrown if there is an error with the nonce sequenceIOException- Thrown if there is an IO error.
-
nextNonce
Get the next nonce.- Parameters:
driveId- The drive ID.- Returns:
- The next nonce.
- Throws:
SequenceException- Thrown if there is an error with the nonce sequenceSalmonRangeExceededException- Thrown if the nonce exceeds its range
-
revokeSequence
Revoke the sequencer. This terminates the sequencer and de-authorizes the device- Parameters:
driveId- The drive Id- Throws:
SequenceException- Thrown if there is an error with the nonce sequence
-
getSequence
Get the sequence used for this drive.- Parameters:
driveId- The drive ID.- Returns:
- The current sequence.
- Throws:
SequenceException- Thrown if there is an error with the nonce sequence
-
close
void close()Close the sequencer and any associated resources.
-