Package com.mku.salmon.sequence
Interface INonceSequencer
-
- All Known Implementing Classes:
FileSequencer,WinClientSequencer,WinFileSequencer
public interface INonceSequencerNonce sequencer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the sequencer and any associated resources.voidcreateSequence(java.lang.String driveId, java.lang.String authId)Create a sequence.NonceSequencegetSequence(java.lang.String driveId)Get the sequence used for this drive.voidinitializeSequence(java.lang.String driveId, java.lang.String authId, byte[] startNonce, byte[] maxNonce)Initialize the sequence.byte[]nextNonce(java.lang.String driveId)Get the next nonce.voidrevokeSequence(java.lang.String driveId)Revoke the sequencer.voidsetMaxNonce(java.lang.String driveId, java.lang.String authId, byte[] maxNonce)Set the max nonce
-
-
-
Method Detail
-
createSequence
void createSequence(java.lang.String driveId, java.lang.String authId)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(java.lang.String driveId, java.lang.String authId, byte[] startNonce, byte[] maxNonce) throws java.io.IOExceptionInitialize 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 sequencejava.io.IOException- Thrown if there is an IO error.
-
setMaxNonce
void setMaxNonce(java.lang.String driveId, java.lang.String authId, byte[] maxNonce) throws java.io.IOExceptionSet 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 sequencejava.io.IOException- Thrown if there is an IO error.
-
nextNonce
byte[] nextNonce(java.lang.String driveId)
Get the next nonce.- Parameters:
driveId- The drive ID.- Returns:
- The next nonce.
- Throws:
SequenceException- Thrown if there is an error with the nonce sequenceRangeExceededException- Thrown if the nonce exceeds its range
-
revokeSequence
void revokeSequence(java.lang.String driveId)
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
NonceSequence getSequence(java.lang.String driveId)
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.
-
-