Class Session


  • public class Session
    extends java.lang.Object
    Contains Session data relevant for making API calls which require authentication. A Session instance is passed to all methods requiring previous authentication.
    Author:
    Janni Kovacs
    See Also:
    Authenticator
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Session createSession​(java.lang.String apiKey, java.lang.String secret, java.lang.String sessionKey)
      Restores a Session instance with the given session key.
      static Session createSession​(java.lang.String apiKey, java.lang.String secret, java.lang.String sessionKey, java.lang.String username, boolean subscriber)
      Restores a Session instance with the given session key.
      java.lang.String getApiKey()  
      java.lang.String getKey()  
      java.lang.String getSecret()  
      java.lang.String getUsername()  
      boolean isSubscriber()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createSession

        public static Session createSession​(java.lang.String apiKey,
                                            java.lang.String secret,
                                            java.lang.String sessionKey)
        Restores a Session instance with the given session key.
        Parameters:
        apiKey - An api key
        secret - A secret
        sessionKey - The previously obtained session key
        Returns:
        a Session instance
      • createSession

        public static Session createSession​(java.lang.String apiKey,
                                            java.lang.String secret,
                                            java.lang.String sessionKey,
                                            java.lang.String username,
                                            boolean subscriber)
        Restores a Session instance with the given session key.
        Parameters:
        apiKey - An api key
        secret - A secret
        sessionKey - The previously obtained session key
        username - A Last.fm username
        subscriber - Subscriber status
        Returns:
        a Session instance
      • getSecret

        public java.lang.String getSecret()
      • getApiKey

        public java.lang.String getApiKey()
      • getKey

        public java.lang.String getKey()
      • isSubscriber

        public boolean isSubscriber()
      • getUsername

        public java.lang.String getUsername()