Package com.xensource.xenapi
Class Connection
java.lang.Object
com.xensource.xenapi.Connection
Represents a connection to a XenServer. Creating a new instance of this class initialises a new XmlRpcClient that is
then used by all method calls: each method call in xenapi takes a Connection as a parameter, composes an XMLRPC
method call, and dispatches it on the Connection's client via the dispatch method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
Default connection timeout for xml-rpc calls in secondsprotected static final int
Default reply timeout for xml-rpc calls in seconds -
Constructor Summary
ConstructorsConstructorDescriptionConnection
(URL url) Creates a connection to a particular server using a given url.Connection
(URL url, int replyTimeout, int connTimeout) Creates a connection to a particular server using a given url.Connection
(URL url, String sessionReference) Creates a connection to a particular server using a given url.Connection
(URL url, String sessionReference, int replyTimeout, int connTimeout) Creates a connection to a particular server using a given url. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map
The (auto-generated parts of) the bindings dispatch XMLRPC calls on this Connection's client through this method.Updated when Session.login_with_password() is called.org.apache.xmlrpc.client.XmlRpcClientConfigImpl
-
Field Details
-
DEFAULT_REPLY_TIMEOUT
protected static final int DEFAULT_REPLY_TIMEOUTDefault reply timeout for xml-rpc calls in seconds- See Also:
-
DEFAULT_CONNECTION_TIMEOUT
protected static final int DEFAULT_CONNECTION_TIMEOUTDefault connection timeout for xml-rpc calls in seconds- See Also:
-
-
Constructor Details
-
Connection
Creates a connection to a particular server using a given url. This object can then be passed in to any other API calls. Note this constructor does NOT call Session.loginWithPassword; the programmer is responsible for calling it, passing the Connection as a parameter. No attempt to connect to the server is made until login is called. When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually logging out the Session. This constructor uses the default values of the reply and connection timeouts for the xmlrpc calls (600 seconds and 5 seconds respectively).- Parameters:
url
- The URL of the server to connect to
-
Connection
Creates a connection to a particular server using a given url. This object can then be passed in to any other API calls. Note this constructor does NOT call Session.loginWithPassword; the programmer is responsible for calling it, passing the Connection as a parameter. No attempt to connect to the server is made until login is called. When this constructor is used, a call to dispose() will do nothing. The programmer is responsible for manually logging out the Session.- Parameters:
url
- The URL of the server to connect toreplyTimeout
- The reply timeout for xml-rpc calls in secondsconnTimeout
- The connection timeout for xml-rpc calls in seconds
-
Connection
Creates a connection to a particular server using a given url. This object can then be passed in to any other API calls. This constructor uses the default values of the reply and connection timeouts for the xmlrpc calls (600 seconds and 5 seconds respectively).- Parameters:
url
- The URL of the server to connect tosessionReference
- A reference to a logged-in Session. Any method calls on this Connection will use it. This constructor does not call Session.loginWithPassword, and dispose() on the resulting Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged in and out correctly.
-
Connection
Creates a connection to a particular server using a given url. This object can then be passed in to any other API calls.- Parameters:
url
- The URL of the server to connect tosessionReference
- A reference to a logged-in Session. Any method calls on this Connection will use it. This constructor does not call Session.loginWithPassword, and dispose() on the resulting Connection object does not call Session.logout. The programmer is responsible for ensuring the Session is logged in and out correctly.replyTimeout
- The reply timeout for xml-rpc calls in secondsconnTimeout
- The connection timeout for xml-rpc calls in seconds
-
-
Method Details
-
getAPIVersion
Updated when Session.login_with_password() is called. -
getConfig
public org.apache.xmlrpc.client.XmlRpcClientConfigImpl getConfig() -
getSessionReference
-
dispatch
protected Map dispatch(String method_call, Object[] method_params) throws org.apache.xmlrpc.XmlRpcException, Types.XenAPIException The (auto-generated parts of) the bindings dispatch XMLRPC calls on this Connection's client through this method.- Throws:
org.apache.xmlrpc.XmlRpcException
Types.XenAPIException
-