com.xensource.xenapi
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() |
isNullprotected final java.lang.String ref
public java.lang.String toWireString()
toWireString in class XenAPIObjectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Session.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Session getByUuid(Connection c, java.lang.String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
uuid - UUID of object to returnTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic Host getThisHost(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic User getThisUser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.util.Date getLastActive(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.Boolean getPool(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.Boolean getIsLocalSuperuser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic Subject getSubject(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.util.Date getValidationTime(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.String getAuthUserSid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.String getAuthUserName(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.util.Set<java.lang.String> getRbacPermissions(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.util.Set<Task> getTasks(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic Session getParent(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic java.lang.String getOriginator(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic void setOtherConfig(Connection c, java.util.Map<java.lang.String,java.lang.String> otherConfig) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
otherConfig - New value to setTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic void addToOtherConfig(Connection c, java.lang.String key, java.lang.String value) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
key - Key to addvalue - Value to addTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic void removeFromOtherConfig(Connection c, java.lang.String key) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
key - Key to removeTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic 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
uname - Username for login.pwd - Password for login.Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionTypes.SessionAuthenticationFailedTypes.HostIsSlavepublic 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
uname - Username for login.pwd - Password for login.version - Client API version. First published in XenServer 4.1.Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionTypes.SessionAuthenticationFailedTypes.HostIsSlavepublic 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
uname - 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.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionTypes.SessionAuthenticationFailedTypes.HostIsSlavepublic static void logout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static void changePassword(Connection c, java.lang.String oldPwd, java.lang.String newPwd) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
oldPwd - Old password for accountnewPwd - New password for accountTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Session slaveLocalLoginWithPassword(Connection c, java.lang.String uname, java.lang.String pwd) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
uname - Username for login.pwd - Password for login.Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Task createFromDbFileAsync(Connection c, java.lang.String filename) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
filename - Database dump filename.Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Session createFromDbFile(Connection c, java.lang.String filename) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
filename - Database dump filename.Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static void localLogout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Task getAllSubjectIdentifiersAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static java.util.Set<java.lang.String> getAllSubjectIdentifiers(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static Task logoutSubjectIdentifierAsync(Connection c, java.lang.String subjectIdentifier) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
subjectIdentifier - User subject-identifier of the sessions to be destroyedTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcExceptionpublic static void logoutSubjectIdentifier(Connection c, java.lang.String subjectIdentifier) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
subjectIdentifier - User subject-identifier of the sessions to be destroyedTypes.BadServerResponseTypes.XenAPIExceptionorg.apache.xmlrpc.XmlRpcException