Package com.mku.salmon.win.sequencer
Class WinClientSequencer
java.lang.Object
com.mku.salmon.win.sequencer.WinClientSequencer
- All Implemented Interfaces:
INonceSequencer
,Closeable
,AutoCloseable
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the sequencer and any associated resources.void
createSequence
(String driveId, String authId) Create a sequence.generateRequest
(String driveId, String authId, WinClientSequencer.RequestType type, byte[] nextNonce, byte[] maxNonce) getSequence
(String driveId) Get the sequence used for this drive.static String
getSIDString
(WinNT.PSID sid) void
initializeSequence
(String driveId, String authId, byte[] startNonce, byte[] maxNonce) Initialize the sequence.static boolean
isServiceAdmin
(String pipeName) byte[]
Get the next nonce.void
revokeSequence
(String driveId) Revoke the sequencer.void
setMaxNonce
(String driveId, String authId, byte[] maxNonce) Set the max nonce
-
Constructor Details
-
WinClientSequencer
- Throws:
Exception
-
-
Method Details
-
isServiceAdmin
-
createSequence
Description copied from interface:INonceSequencer
Create a sequence.- Specified by:
createSequence
in interfaceINonceSequencer
- Parameters:
driveId
- The drive ID.authId
- The authorization ID of the drive.
-
getSequence
Description copied from interface:INonceSequencer
Get the sequence used for this drive.- Specified by:
getSequence
in interfaceINonceSequencer
- Parameters:
driveId
- The drive ID.- Returns:
- The current sequence.
-
initializeSequence
Description copied from interface:INonceSequencer
Initialize the sequence.- Specified by:
initializeSequence
in interfaceINonceSequencer
- Parameters:
driveId
- The drive ID.authId
- The auth ID of the device for the drive.startNonce
- The starting nonce.maxNonce
- The maximum nonce.
-
nextNonce
Description copied from interface:INonceSequencer
Get the next nonce.- Specified by:
nextNonce
in interfaceINonceSequencer
- Parameters:
driveId
- The drive ID.- Returns:
- The next nonce.
-
revokeSequence
Description copied from interface:INonceSequencer
Revoke the sequencer. This terminates the sequencer and de-authorizes the device- Specified by:
revokeSequence
in interfaceINonceSequencer
- Parameters:
driveId
- The drive Id
-
setMaxNonce
Description copied from interface:INonceSequencer
Set the max nonce- Specified by:
setMaxNonce
in interfaceINonceSequencer
- Parameters:
driveId
- The drive ID.authId
- The auth ID of the device for the drive.maxNonce
- The maximum nonce.- Throws:
IOException
- Thrown if there is an IO error.
-
generateRequest
public String generateRequest(String driveId, String authId, WinClientSequencer.RequestType type, byte[] nextNonce, byte[] maxNonce) throws IOException - Throws:
IOException
-
close
public void close()Description copied from interface:INonceSequencer
Close the sequencer and any associated resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceINonceSequencer
-
getSIDString
-