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 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
|
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
|
static Task |
getAllSubjectIdentifiersAsync(Connection c)
Return a list of all the user subject-identifiers of all existing sessions
|
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.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,
java.lang.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,
java.lang.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,
java.lang.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,
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() |
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
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public static Session getByUuid(Connection c, java.lang.String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
uuid
- UUID of object to returnTypes.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.lang.String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public Host getThisHost(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public User getThisUser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.util.Date getLastActive(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.lang.Boolean getPool(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.lang.Boolean getIsLocalSuperuser(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public Subject getSubject(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.util.Date getValidationTime(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.lang.String getAuthUserSid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.lang.String getAuthUserName(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.util.Set<java.lang.String> getRbacPermissions(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public java.util.Set<Task> getTasks(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public Session getParent(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public void removeFromOtherConfig(Connection c, java.lang.String key) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
key
- Key to removeTypes.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
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
uname
- Username for login.pwd
- Password for login.version
- Client API version.Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.SessionAuthenticationFailed
public static void logout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public static void localLogout(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public static Task getAllSubjectIdentifiersAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public static java.util.Set<java.lang.String> getAllSubjectIdentifiers(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
public 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.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException