public class ICAT extends Object
Constructor and Description |
---|
ICAT(String urlString)
Create a RESTful ICAT instance connected to the server at the specified
URI
|
Modifier and Type | Method and Description |
---|---|
String |
getApiVersion()
Deprecated.
|
String |
getProperties()
Return a json string of properties.
|
Session |
getSession(String sessionId)
Obtain a session knowing a sessionId.
|
String |
getVersion()
Return the version of the ICAT server
|
boolean |
isLoggedIn(String userName)
See whether or not someone is logged in.
|
String |
list(String sessionId,
String path) |
Session |
login(String plugin,
Map<String,String> credentials)
Login to a RESTful ICAT instance and return a Session
|
void |
waitMillis(String sessionId,
long ms) |
public ICAT(String urlString) throws URISyntaxException
urlString
- The URI of a server in the form https://example.com:443.URISyntaxException
- If the urlString is not a valid URIpublic boolean isLoggedIn(String userName) throws IcatException
userName
- which must include mnemonic if the authenticator plugin is
configured to return them.IcatException
- For various ICAT errorspublic Session login(String plugin, Map<String,String> credentials) throws IcatException
plugin
- The mnemonic of the authentication plugincredentials
- A map holding credential key/value pairsIcatException
- For various ICAT errorspublic Session getSession(String sessionId)
sessionId
- the sessionId to hold in the session.@Deprecated public String getApiVersion() throws IcatException
IcatException
- For various ICAT errorspublic String getVersion() throws IcatException
IcatException
- For various ICAT errorspublic String getProperties() throws IcatException
{"maxEntities":10000, "lifetimeMinutes":120, "authenticators":[ {"mnemonic":"db","description":{"keys":[{"name":"username"},{"name":"password","hide":true}]}}, {"mnemonic":"anon","description":{"keys":[]},"admin":true,"friendly":"Anonymous"} ]}which shows the values of maxEntities and lifetimeMinutes as as well as the two available authenticators. The first which has a mnemonic of db in the icat.properties file has two keys, the second of which, the password, should not be shown. The second authenticator, anon, should only be exposed to admin users and has a friendly name of "Anonymous". It is the responsibility of application writers to use these fields as desired.
IcatException
- For various ICAT errorspublic void waitMillis(String sessionId, long ms) throws IcatException
IcatException
public String list(String sessionId, String path) throws IcatException
IcatException
Copyright © 2022 The ICAT Collaboration. All rights reserved.