Skip navigation links

Package org.icatproject.icat.client

RESTFul ICAT Interface.

See: Description

Package org.icatproject.icat.client Description

RESTFul ICAT Interface.

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>
Skip navigation links

Copyright © 2022 The ICAT Collaboration. All rights reserved.