public class Session extends XenAPIObject
Modifier and Type | Class and Description |
---|---|
static class |
Session.Record
Represents all the fields in a Session
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
ref
The XenAPI reference (OpaqueRef) to this object.
|
Modifier and Type | Method and Description |
---|---|
void |
addToOtherConfig(Connection c,
java.lang.String key,
java.lang.String value)
Add the given key-value pair to the other_config field of the given session.
|
static void |
changePassword(Connection c,
java.lang.String oldPwd,
java.lang.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
First published in XenServer 4.0.
|
static Session |
createFromDbFile(Connection c,
java.lang.String filename)
First published in XenServer 7.0.
|
static Task |
createFromDbFileAsync(Connection c,
java.lang.String filename)
First published in XenServer 7.0.
|
boolean |
equals(java.lang.Object obj)
If obj is a Session, compares XenAPI references for equality.
|
static java.util.Set<java.lang.String> |
getAllSubjectIdentifiers(Connection c)
Return a list of all the user subject-identifiers of all existing sessions
First published in XenServer 5.5.
|
static Task |
getAllSubjectIdentifiersAsync(Connection c)
Return a list of all the user subject-identifiers of all existing sessions
First published in XenServer 5.5.
|
java.lang.String |
getAuthUserName(Connection c)
Get the auth_user_name field of the given session.
|
java.lang.String |
getAuthUserSid(Connection c)
Get the auth_user_sid field of the given session.
|
static Session |
getByUuid(Connection c,
java.lang.String uuid)
Get a reference to the session instance with the specified UUID.
|
java.lang.Boolean |
getIsLocalSuperuser(Connection c)
Get the is_local_superuser field of the given session.
|
java.util.Date |
getLastActive(Connection c)
Get the last_active field of the given session.
|
java.lang.String |
getOriginator(Connection c)
Get the originator field of the given session.
|
java.util.Map<java.lang.String,java.lang.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.
|
java.lang.Boolean |
getPool(Connection c)
Get the pool field of the given session.
|
java.util.Set<java.lang.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.
|
java.util.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.
|
java.lang.String |
getUuid(Connection c)
Get the uuid field of the given session.
|
java.util.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,
java.lang.String uname,
java.lang.String pwd)
Attempt to authenticate the user, returning a session reference if successful
First published in XenServer 4.0.
|
static Session |
loginWithPassword(Connection c,
java.lang.String uname,
java.lang.String pwd,
java.lang.String version)
Attempt to authenticate the user, returning a session reference if successful
First published in XenServer 4.0.
|
static Session |
loginWithPassword(Connection c,
java.lang.String uname,
java.lang.String pwd,
java.lang.String version,
java.lang.String originator)
Attempt to authenticate the user, returning a session reference if successful
First published in XenServer 4.0.
|
static void |
logout(Connection c)
Log out of a session
First published in XenServer 4.0.
|
static void |
logoutSubjectIdentifier(Connection c,
java.lang.String subjectIdentifier)
Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
First published in XenServer 5.5.
|
static Task |
logoutSubjectIdentifierAsync(Connection c,
java.lang.String subjectIdentifier)
Log out all sessions associated to a user subject-identifier, except the session associated with the context calling this function
First published in XenServer 5.5.
|
void |
removeFromOtherConfig(Connection c,
java.lang.String key)
Remove the given key and its corresponding value from the other_config field of the given session.
|
void |
setOtherConfig(Connection c,
java.util.Map<java.lang.String,java.lang.String> otherConfig)
Set the other_config field of the given session.
|
static Session |
slaveLocalLoginWithPassword(Connection c,
java.lang.String uname,
java.lang.String pwd)
Authenticate locally against a slave in emergency mode.
|
java.lang.String |
toWireString() |
isNull
protected final java.lang.String ref
public java.lang.String toWireString()
toWireString
in class XenAPIObject
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Session.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Session getByUuid(Connection c, java.lang.String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onuuid
- UUID of object to returnTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public Host getThisHost(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public User getThisUser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.util.Date getLastActive(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.Boolean getPool(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.Boolean getIsLocalSuperuser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public Subject getSubject(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.util.Date getValidationTime(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.String getAuthUserSid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.String getAuthUserName(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.util.Set<java.lang.String> getRbacPermissions(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.util.Set<Task> getTasks(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public Session getParent(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public java.lang.String getOriginator(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public void setOtherConfig(Connection c, java.util.Map<java.lang.String,java.lang.String> otherConfig) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onotherConfig
- New value to setTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public void addToOtherConfig(Connection c, java.lang.String key, java.lang.String value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onkey
- Key to addvalue
- Value to addTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public void removeFromOtherConfig(Connection c, java.lang.String key) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onkey
- Key to removeTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Session loginWithPassword(Connection c, java.lang.String uname, java.lang.String pwd) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.SessionAuthenticationFailed, Types.HostIsSlave
c
- The connection the call is made onuname
- Username for login.pwd
- Password for login.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.Types.SessionAuthenticationFailed
- The credentials given by the user are incorrect, so access has been denied, and you have not been issued a session handle.Types.HostIsSlave
- You cannot make regular API calls directly on a slave. Please pass API calls via the master host.public static Session loginWithPassword(Connection c, java.lang.String uname, java.lang.String pwd, java.lang.String version) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.SessionAuthenticationFailed, Types.HostIsSlave
c
- The connection the call is made onuname
- Username for login.pwd
- Password for login.version
- Client API version. First published in XenServer 4.1.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.Types.SessionAuthenticationFailed
- The credentials given by the user are incorrect, so access has been denied, and you have not been issued a session handle.Types.HostIsSlave
- You cannot make regular API calls directly on a slave. Please pass API calls via the master host.public static Session loginWithPassword(Connection c, java.lang.String uname, java.lang.String pwd, java.lang.String version, java.lang.String originator) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.SessionAuthenticationFailed, Types.HostIsSlave
c
- The connection the call is made onuname
- Username for login.pwd
- Password for login.version
- Client API version. First published in XenServer 4.1.originator
- Key string for distinguishing different API users sharing the same login name. First published in XenServer 6.2.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.Types.SessionAuthenticationFailed
- The credentials given by the user are incorrect, so access has been denied, and you have not been issued a session handle.Types.HostIsSlave
- You cannot make regular API calls directly on a slave. Please pass API calls via the master host.public static void logout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static void changePassword(Connection c, java.lang.String oldPwd, java.lang.String newPwd) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onoldPwd
- Old password for accountnewPwd
- New password for accountTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Session slaveLocalLoginWithPassword(Connection c, java.lang.String uname, java.lang.String pwd) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onuname
- Username for login.pwd
- Password for login.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Task createFromDbFileAsync(Connection c, java.lang.String filename) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onfilename
- Database dump filename.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Session createFromDbFile(Connection c, java.lang.String filename) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onfilename
- Database dump filename.Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static void localLogout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Task getAllSubjectIdentifiersAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static java.util.Set<java.lang.String> getAllSubjectIdentifiers(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static Task logoutSubjectIdentifierAsync(Connection c, java.lang.String subjectIdentifier) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onsubjectIdentifier
- User subject-identifier of the sessions to be destroyedTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.public static void logoutSubjectIdentifier(Connection c, java.lang.String subjectIdentifier) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
c
- The connection the call is made onsubjectIdentifier
- User subject-identifier of the sessions to be destroyedTypes.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- Thrown if the call failed.org.apache.xmlrpc.XmlRpcException
- Thrown if the result of an asynchronous call could not be parsed.