Package io.crums.client
Class Client
java.lang.Object
io.crums.client.Client
public class Client
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REST_ROOT_URL
static java.lang.String
STAMP
-
Constructor Summary
Constructors Constructor Description Client()
-
Method Summary
Modifier and Type Method Description Client
addHash(byte[] hash)
Client
addHash(java.lang.String hash)
Client
addHash(java.nio.ByteBuffer hash)
Client
clearHashes()
TreeRef
getBeacon()
java.util.List<CrumRecord>
getCrumRecords()
Returns the CrumRecords for thejava.lang.Object
getCrumRecordsAsJson()
Returns the server response as a json object.java.lang.String
getHash()
java.util.List<java.lang.String>
getHashes()
static void
main(java.lang.String[] args)
Client
setHash(byte[] hash)
Client
setHash(java.lang.String hash)
Client
setHash(java.nio.ByteBuffer hash)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
REST_ROOT_URL
public static final java.lang.String REST_ROOT_URL- See Also:
- Constant Field Values
-
STAMP
public static final java.lang.String STAMP- See Also:
- Constant Field Values
-
-
Constructor Details
-
Client
public Client()
-
-
Method Details
-
getHash
public java.lang.String getHash()- Returns:
- the hash
-
setHash
- Parameters:
hash
- the hash to set (in hex)
-
setHash
-
setHash
-
addHash
- Parameters:
hash
- the hash to set (in hex)
-
addHash
-
addHash
-
clearHashes
-
getHashes
public java.util.List<java.lang.String> getHashes() -
getCrumRecords
Returns the CrumRecords for the- Returns:
- non-empty, immutable list of records
-
getCrumRecordsAsJson
Returns the server response as a json object.- Returns:
- either a JSONObject or JSONArray
- Throws:
ClientException
-
getBeacon
- Throws:
ClientException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-