Class | Description |
---|---|
ICAT |
Represents a RESTful ICAT instance from which sessions may be obtained.
|
ParameterForLucene | |
Session |
A RESTful ICAT session.
|
Enum | Description |
---|---|
IcatException.IcatExceptionType |
The type of the IcatException
|
Session.Attributes |
Control the attributes to be imported or exported
|
Session.DuplicateAction |
Control the action when a duplicate entry is encountered on import
|
Exception | Description |
---|---|
IcatException |
An ICAT Exception with various types
|
To get started instantiate an ICAT
with
the URL of an ICAT server and call the login method on that ICAT.
Subsequently make calls upon the Session
.
For example:
ICAT icat = new ICAT("https://example.com:8181"));
Map<String, String> credentials = new HashMap<>();
credentials.put("username", "fred");
credentials.put("password", "secret");
Session session = icat.login("db", credentials);
System.out.println(session.getUserName());
System.out.println(session.getRemainingMinutes());
System.out.println(session.search("Facility");
session.logout();
The code makes us of javax.json which is part of Java EE 7 and is not in the Java SE so you will need to include an extra jar. For example add to your pom:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
</dependency>
Copyright © 2022 The ICAT Collaboration. All rights reserved.