public class LockInfo extends SampMap
AbstractMap.SimpleEntry, AbstractMap.SimpleImmutableEntry
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_VERSION_VALUE
SAMP Standard Profile version for this toolkit implementation.
|
static String |
SECRET_KEY
Key for opaque text string required by the hub for registration.
|
static String |
VERSION_KEY
Key for the SAMP Standard Profile version implemented by the hub.
|
static String |
XMLRPCURL_KEY
Key for XML-RPC endpoint for communication with the hub.
|
Constructor and Description |
---|
LockInfo()
Constructs an empty LockInfo.
|
LockInfo(Map map)
Constructs a LockInfo based on an existing map.
|
LockInfo(String secret,
String xmlrpcurl)
Constructs a LockInfo from a given SAMP secret and XML-RPC URL.
|
Modifier and Type | Method and Description |
---|---|
static LockInfo |
asLockInfo(Map map)
Returns a given map as a LockInfo object.
|
void |
check()
Checks that this object is ready for use with the SAMP toolkit.
|
String |
getSecret()
Returns the value of the
SECRET_KEY key. |
String |
getVersion()
Returns the value of the
VERSION_KEY key. |
URL |
getXmlrpcUrl()
Returns the value of the
XMLRPCURL_KEY key. |
static LockInfo |
readLockFile(InputStream in)
Returns the LockInfo read from a given stream.
|
static LockInfo |
readLockFile(URL url)
Returns a LockInfo as read from a lockfile at a given location.
|
checkHasKeys, entrySet, getList, getMap, getString, getUrl, put
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final String SECRET_KEY
public static final String XMLRPCURL_KEY
public static final String VERSION_KEY
public static final String DEFAULT_VERSION_VALUE
public LockInfo()
public LockInfo(Map map)
map
- map containing initial data for this objectpublic LockInfo(String secret, String xmlrpcurl)
secret
- value for SECRET_KEY
keyxmlrpcurl
- value for XMLRPCURL_KEY
keypublic URL getXmlrpcUrl()
XMLRPCURL_KEY
key.public String getVersion()
VERSION_KEY
key.public String getSecret()
SECRET_KEY
key.public void check()
SampMap
SampUtils.checkMap(java.util.Map)
(ensuring that all keys
are Strings, and all values Strings, Lists or Maps), subclass-specific
invariants may be checked. In the case that there's something wrong,
an informative DataException
will be thrown.public static LockInfo readLockFile(URL url) throws IOException
url
- lockfile locationIOException
public static LockInfo readLockFile(InputStream in) throws IOException
in
- input stream to readIOException
Copyright © 2008–2024. All rights reserved.