public class BasicConnection extends java.lang.Object implements Connection
AcquireHoKTokenByUserCredentialSample from the
ssoclient sample set for acquiring a HoK token
2. Use this HoK token to perform LoginByToken using another sample
LoginByTokenSample from the ssoclient sample set to establish
authenticated session
3. Uses the authenticates session cookie from the established session and
sets the PbmPortType to use the same session to make further SPBM API callsConnectedServiceBase| Constructor and Description |
|---|
BasicConnection() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
connect()
Establishes the authenticated connection to the various services
|
Connection |
disconnect()
Disconnects all the services
|
java.lang.String |
getPassword()
Returns the password used for this connection
|
com.vmware.pbm.PbmPortType |
getPbmPort()
Returns the
PbmPortType instance for the SPBM service |
com.vmware.pbm.PbmService |
getPbmService()
Returns the
PbmService instance for the SPBM service |
com.vmware.pbm.PbmServiceInstanceContent |
getPbmServiceContent()
Returns the
PbmServiceInstanceContentinstance for the SPBM service |
com.vmware.vim25.ManagedObjectReference |
getPbmServiceInstanceReference()
Returns the
ManagedObjectReference for the ServiceInstance for the
SPBM Service |
java.net.URL |
getSpbmURL()
Returns the SPBM Service URL
|
java.net.URL |
getSsoURL()
Will attempt to return the SSO URL you set from the command line, if you
forgot or didn't set one it will call getDefaultSsoUrl to attempt to
calculate what the URL should have been.
|
java.lang.String |
getUsername()
Returns the username used for this connection
|
com.vmware.vim25.UserSession |
getUserSession()
Returns the
UserSession instance associated with the current
connection |
java.net.URL |
getVcURL()
Returns the vSphere web services URL
|
com.vmware.vim25.VimPortType |
getVimPort()
Returns the
VimPortType instance for the vsphere service |
com.vmware.vim25.VimService |
getVimService()
Returns the
VimService instance for the vsphere service |
com.vmware.vim25.ServiceContent |
getVimServiceContent()
Returns the
ServiceContent instance for the vsphere service |
com.vmware.vim25.ManagedObjectReference |
getVimServiceInstanceReference()
Returns the
ManagedObjectReference for the ServiceInstance for the
vsphere service |
boolean |
isConnected()
Returns if an authenticated connection to the vCenter Server is
established
|
void |
setIgnoreCert(java.lang.Boolean ignorecert)
DEV ONLY option to ignore the SSL certificate check.
|
void |
setPassword(java.lang.String password)
Password for the user to be used to acquire SAML token from the STS
Service for accessing vCenter Server
|
void |
setSpbmUrl(java.lang.String spbmurl)
SPBM Service URL e.g.
|
void |
setSsoUrl(java.lang.String ssourl)
vCenter Single Sign-On STS service URL
|
void |
setUsername(java.lang.String username)
Username to be used to acquire SAML token from the STS Service for
accessing vCenter Server
|
void |
setVcUrl(java.lang.String vcurl)
vSphere web services URL e.g https://\<vcenter>/sdk
|
public Connection connect()
Connectionconnect in interface Connectionpublic Connection disconnect()
Connectiondisconnect in interface Connectionpublic java.lang.String getPassword()
ConnectiongetPassword in interface Connectionpublic com.vmware.pbm.PbmPortType getPbmPort()
ConnectionPbmPortType instance for the SPBM servicegetPbmPort in interface Connectionpublic com.vmware.pbm.PbmService getPbmService()
ConnectionPbmService instance for the SPBM servicegetPbmService in interface Connectionpublic com.vmware.pbm.PbmServiceInstanceContent getPbmServiceContent()
ConnectionPbmServiceInstanceContentinstance for the SPBM servicegetPbmServiceContent in interface Connectionpublic com.vmware.vim25.ManagedObjectReference getPbmServiceInstanceReference()
ConnectionManagedObjectReference for the ServiceInstance for the
SPBM ServicegetPbmServiceInstanceReference in interface Connectionpublic java.net.URL getSpbmURL()
ConnectiongetSpbmURL in interface Connectionpublic java.net.URL getSsoURL()
getSsoURL in interface Connectionpublic java.lang.String getUsername()
ConnectiongetUsername in interface Connectionpublic com.vmware.vim25.UserSession getUserSession()
ConnectionUserSession instance associated with the current
connectiongetUserSession in interface Connectionpublic java.net.URL getVcURL()
ConnectiongetVcURL in interface Connectionpublic com.vmware.vim25.VimPortType getVimPort()
ConnectionVimPortType instance for the vsphere servicegetVimPort in interface Connectionpublic com.vmware.vim25.VimService getVimService()
ConnectionVimService instance for the vsphere servicegetVimService in interface Connectionpublic com.vmware.vim25.ServiceContent getVimServiceContent()
ConnectionServiceContent instance for the vsphere servicegetVimServiceContent in interface Connectionpublic com.vmware.vim25.ManagedObjectReference getVimServiceInstanceReference()
ConnectionManagedObjectReference for the ServiceInstance for the
vsphere servicegetVimServiceInstanceReference in interface Connectionpublic boolean isConnected()
ConnectionisConnected in interface Connectionpublic void setIgnoreCert(java.lang.Boolean ignorecert)
ConnectionsetIgnoreCert in interface Connectionpublic void setPassword(java.lang.String password)
ConnectionsetPassword in interface Connectionpublic void setSpbmUrl(java.lang.String spbmurl)
ConnectionsetSpbmUrl in interface Connectionpublic void setSsoUrl(java.lang.String ssourl)
ConnectionsetSsoUrl in interface Connectionpublic void setUsername(java.lang.String username)
ConnectionsetUsername in interface Connection@Option(name="vcurl",
systemProperty="vimService.url",
description="full url to the vSphere WS SDK service on vCenter")
public void setVcUrl(java.lang.String vcurl)
ConnectionsetVcUrl in interface Connection