Class RestSession

  • All Implemented Interfaces:
    Session
    Direct Known Subclasses:
    RestAdmin, RestUser

    public abstract class RestSession
    extends java.lang.Object
    implements Session
    • Field Summary

      Fields 
      Modifier and Type Field Description
      javax.ws.rs.client.WebTarget service  
    • Constructor Summary

      Constructors 
      Constructor Description
      RestSession​(java.lang.String id, java.lang.String serviceUrl)
      Instantiates a session object from an existing session ID
      RestSession​(Credentials credentials, java.lang.String serviceUrl)
      The base class for API sessions
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      UserResponse fetchUser​(java.lang.String username)
      Fetch a user by username.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface wappsto.api.session.Session

        getId
    • Field Detail

      • service

        public final javax.ws.rs.client.WebTarget service
    • Constructor Detail

      • RestSession

        public RestSession​(Credentials credentials,
                           java.lang.String serviceUrl)
                    throws java.lang.Exception
        The base class for API sessions
        Parameters:
        credentials - Login credentials
        serviceUrl - URL to the API
        Throws:
        java.lang.Exception
      • RestSession

        public RestSession​(java.lang.String id,
                           java.lang.String serviceUrl)
        Instantiates a session object from an existing session ID
        Parameters:
        id - Session ID
        serviceUrl - URL to the API
    • Method Detail

      • fetchUser

        public UserResponse fetchUser​(java.lang.String username)
                               throws java.lang.Exception
        Fetch a user by username. Currently, only the username gets deserialized from the server response, so this method is only useful for validating the correctness of other methods.
        Specified by:
        fetchUser in interface Session
        Parameters:
        username -
        Returns:
        Throws:
        java.lang.Exception