Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.xensource.xenapi
Class Session

    java.lang.Object
      com.xensource.xenapi.XenAPIObject
          com.xensource.xenapi.Session

    public class Session

extends XenAPIObject

A session

Nested Class Summary
`static class` | `Session.Record` Represents all the fields in a Session

Field Summary
`protected String` | `ref` The XenAPI reference (OpaqueRef) to this object.

Method Summary
`void` | `addToOtherConfig(Connection c, String key, String value)` Add the given key-value pair to the other_config field of the given session.
`static void` | `changePassword(Connection c, String oldPwd, String newPwd)` Change the account password; if your session is authenticated with root priviledges then the old_pwd is validated and the new_pwd is set regardless
`boolean` | `equals(Object obj)` If obj is a Session, compares XenAPI references for equality.
`static Set<String>` | `getAllSubjectIdentifiers(Connection c)` Return a list of all the user subject-identifiers of all existing sessions
`static Task` | `getAllSubjectIdentifiersAsync(Connection c)` Return a list of all the user subject-identifiers of all existing sessions
`String` | `getAuthUserName(Connection c)` Get the auth_user_name field of the given session.
`String` | `getAuthUserSid(Connection c)` Get the auth_user_sid field of the given session.
`static Session` | `getByUuid(Connection c, String uuid)` Get a reference to the session instance with the specified UUID.
`Boolean` | `getIsLocalSuperuser(Connection c)` Get the is_local_superuser field of the given session.
`Date` | `getLastActive(Connection c)` Get the last_active field of the given session.
`Map<String,String>` | `getOtherConfig(Connection c)` Get the other_config field of the given session.
`Session` | `getParent(Connection c)` Get the parent field of the given session.
`Boolean` | `getPool(Connection c)` Get the pool field of the given session.
`Set<String>` | `getRbacPermissions(Connection c)` Get the rbac_permissions field of the given session.
`Session.Record` | `getRecord(Connection c)` Get a record containing the current state of the given session.
`Subject` | `getSubject(Connection c)` Get the subject field of the given session.
`Set<Task>` | `getTasks(Connection c)` Get the tasks field of the given session.
`Host` | `getThisHost(Connection c)` Get the this_host field of the given session.
`User` | `getThisUser(Connection c)` Get the this_user field of the given session.
`String` | `getUuid(Connection c)` Get the uuid field of the given session.
`Date` | `getValidationTime(Connection c)` Get the validation_time field of the given session.
`int` | `hashCode()`
`static void` | `localLogout(Connection c)` Log out of local session.
`static Session` | `loginWithPassword(Connection c, String uname, String pwd, String version)` Attempt to authenticate the user, returning a session reference if successful
`static void` | `logout(Connection c)` Log out of a session
`static void` | `logoutSubjectIdentifier(Connection c, String subjectIdentifier)` Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
`static Task` | `logoutSubjectIdentifierAsync(Connection c, String subjectIdentifier)` Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
`void` | `removeFromOtherConfig(Connection c, String key)` Remove the given key and its corresponding value from the other_config field of the given session.
`void` | `setOtherConfig(Connection c, Map<String,String> otherConfig)` Set the other_config field of the given session.
`static Session` | `slaveLocalLoginWithPassword(Connection c, String uname, String pwd)` Authenticate locally against a slave in emergency mode.
`String` | `toWireString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ref

    protected final String ref

  The XenAPI reference (OpaqueRef) to this object.

Method Detail

### toWireString

    public String toWireString()

  Specified by:
    `toWireString` in class `XenAPIObject`
  Returns:
    The XenAPI reference (OpaqueRef) to this object.

### equals

    public boolean equals(Object obj)

  If obj is a Session, compares XenAPI references for equality.

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### getRecord

    public Session.Record getRecord(Connection c)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException

  Get a record containing the current state of the given session.

  Returns:
    all fields from the object
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getByUuid

    public static Session getByUuid(Connection c,
                                    String uuid)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException

  Get a reference to the session instance with the specified UUID.

  Parameters:
    `uuid` - UUID of object to return
  Returns:
    reference to the object
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getUuid

    public String getUuid(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException

  Get the uuid field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getThisHost

    public Host getThisHost(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException

  Get the this_host field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getThisUser

    public User getThisUser(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException

  Get the this_user field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getLastActive

    public Date getLastActive(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Get the last_active field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getPool

    public Boolean getPool(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException

  Get the pool field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getOtherConfig

    public Map<String,String> getOtherConfig(Connection c)
                                      throws Types.BadServerResponse,
                                             Types.XenAPIException,
                                             org.apache.xmlrpc.XmlRpcException

  Get the other_config field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getIsLocalSuperuser

    public Boolean getIsLocalSuperuser(Connection c)
                                throws Types.BadServerResponse,
                                       Types.XenAPIException,
                                       org.apache.xmlrpc.XmlRpcException

  Get the is_local_superuser field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getSubject

    public Subject getSubject(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Get the subject field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getValidationTime

    public Date getValidationTime(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException

  Get the validation_time field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAuthUserSid

    public String getAuthUserSid(Connection c)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Get the auth_user_sid field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAuthUserName

    public String getAuthUserName(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException

  Get the auth_user_name field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getRbacPermissions

    public Set<String> getRbacPermissions(Connection c)
                                   throws Types.BadServerResponse,
                                          Types.XenAPIException,
                                          org.apache.xmlrpc.XmlRpcException

  Get the rbac_permissions field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getTasks

    public Set<Task> getTasks(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Get the tasks field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getParent

    public Session getParent(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException

  Get the parent field of the given session.

  Returns:
    value of the field
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### setOtherConfig

    public void setOtherConfig(Connection c,
                               Map<String,String> otherConfig)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException

  Set the other_config field of the given session.

  Parameters:
    `otherConfig` - New value to set
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### addToOtherConfig

    public void addToOtherConfig(Connection c,
                                 String key,
                                 String value)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException

  Add the given key-value pair to the other_config field of the given session.

  Parameters:
    `key` - Key to add
    `value` - Value to add
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### removeFromOtherConfig

    public void removeFromOtherConfig(Connection c,
                                      String key)
                               throws Types.BadServerResponse,
                                      Types.XenAPIException,
                                      org.apache.xmlrpc.XmlRpcException

  Remove the given key and its corresponding value from the other_config field of the given session. If the key is not in that Map, then do nothing.

  Parameters:
    `key` - Key to remove
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### loginWithPassword

    public static Session loginWithPassword(Connection c,
                                            String uname,
                                            String pwd,
                                            String version)
                                     throws Types.BadServerResponse,
                                            Types.XenAPIException,
                                            org.apache.xmlrpc.XmlRpcException,
                                            Types.SessionAuthenticationFailed

  Attempt to authenticate the user, returning a session reference if successful

  Parameters:
    `uname` - Username for login.
    `pwd` - Password for login.
    `version` - Client API version.
  Returns:
    reference of newly created session
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`
    `Types.SessionAuthenticationFailed`

### logout

    public static void logout(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException

  Log out of a session

  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### changePassword

    public static void changePassword(Connection c,
                                      String oldPwd,
                                      String newPwd)
                               throws Types.BadServerResponse,
                                      Types.XenAPIException,
                                      org.apache.xmlrpc.XmlRpcException

  Change the account password; if your session is authenticated with root priviledges then the old_pwd is validated and the new_pwd is set regardless

  Parameters:
    `oldPwd` - Old password for account
    `newPwd` - New password for account
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### slaveLocalLoginWithPassword

    public static Session slaveLocalLoginWithPassword(Connection c,
                                                      String uname,
                                                      String pwd)
                                               throws Types.BadServerResponse,
                                                      Types.XenAPIException,
                                                      org.apache.xmlrpc.XmlRpcException

  Authenticate locally against a slave in emergency mode. Note the resulting sessions are only good for use on this host.

  Parameters:
    `uname` - Username for login.
    `pwd` - Password for login.
  Returns:
    ID of newly created session
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### localLogout

    public static void localLogout(Connection c)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException

  Log out of local session.

  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAllSubjectIdentifiersAsync

    public static Task getAllSubjectIdentifiersAsync(Connection c)
                                              throws Types.BadServerResponse,
                                                     Types.XenAPIException,
                                                     org.apache.xmlrpc.XmlRpcException

  Return a list of all the user subject-identifiers of all existing sessions

  Returns:
    Task
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### getAllSubjectIdentifiers

    public static Set<String> getAllSubjectIdentifiers(Connection c)
                                                throws Types.BadServerResponse,
                                                       Types.XenAPIException,
                                                       org.apache.xmlrpc.XmlRpcException

  Return a list of all the user subject-identifiers of all existing sessions

  Returns:
    The list of user subject-identifiers of all existing sessions
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### logoutSubjectIdentifierAsync

    public static Task logoutSubjectIdentifierAsync(Connection c,
                                                    String subjectIdentifier)
                                             throws Types.BadServerResponse,
                                                    Types.XenAPIException,
                                                    org.apache.xmlrpc.XmlRpcException

  Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function

  Parameters:
    `subjectIdentifier` - User subject-identifier of the sessions to be destroyed
  Returns:
    Task
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

### logoutSubjectIdentifier

    public static void logoutSubjectIdentifier(Connection c,
                                               String subjectIdentifier)
                                        throws Types.BadServerResponse,
                                               Types.XenAPIException,
                                               org.apache.xmlrpc.XmlRpcException

  Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function

  Parameters:
    `subjectIdentifier` - User subject-identifier of the sessions to be destroyed
  Throws:
    `Types.BadServerResponse`
    `Types.XenAPIException`
    `org.apache.xmlrpc.XmlRpcException`

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD