Interface Connection

  • All Known Implementing Classes:
    BasicConnection

    public interface Connection
    This simple object shows how to set up a SPBM connection. It is intended as a utility class for use by Samples that will need to connect before they can do anything useful. This is a light weight POJO that should be very easy to make portable.
    See Also:
    ConnectedServiceBase
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method 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()
      Returns the vCenter Single Sign-On STS service URL
      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
    • Method Detail

      • connect

        @Before
        Connection connect()
        Establishes the authenticated connection to the various services
        Returns:
      • disconnect

        @After
        Connection disconnect()
        Disconnects all the services
        Returns:
      • getPassword

        java.lang.String getPassword()
        Returns the password used for this connection
        Returns:
      • getPbmPort

        com.vmware.pbm.PbmPortType getPbmPort()
        Returns the PbmPortType instance for the SPBM service
        Returns:
      • getPbmService

        com.vmware.pbm.PbmService getPbmService()
        Returns the PbmService instance for the SPBM service
        Returns:
      • getPbmServiceContent

        com.vmware.pbm.PbmServiceInstanceContent getPbmServiceContent()
        Returns the PbmServiceInstanceContentinstance for the SPBM service
        Returns:
      • getPbmServiceInstanceReference

        com.vmware.vim25.ManagedObjectReference getPbmServiceInstanceReference()
        Returns the ManagedObjectReference for the ServiceInstance for the SPBM Service
        Returns:
      • getSpbmURL

        java.net.URL getSpbmURL()
        Returns the SPBM Service URL
        Returns:
      • getSsoURL

        java.net.URL getSsoURL()
        Returns the vCenter Single Sign-On STS service URL
        Returns:
      • getUsername

        java.lang.String getUsername()
        Returns the username used for this connection
        Returns:
      • getUserSession

        com.vmware.vim25.UserSession getUserSession()
        Returns the UserSession instance associated with the current connection
        Returns:
      • getVcURL

        java.net.URL getVcURL()
        Returns the vSphere web services URL
        Returns:
      • getVimPort

        com.vmware.vim25.VimPortType getVimPort()
        Returns the VimPortType instance for the vsphere service
        Returns:
      • getVimService

        com.vmware.vim25.VimService getVimService()
        Returns the VimService instance for the vsphere service
        Returns:
      • getVimServiceContent

        com.vmware.vim25.ServiceContent getVimServiceContent()
        Returns the ServiceContent instance for the vsphere service
        Returns:
      • getVimServiceInstanceReference

        com.vmware.vim25.ManagedObjectReference getVimServiceInstanceReference()
        Returns the ManagedObjectReference for the ServiceInstance for the vsphere service
        Returns:
      • isConnected

        boolean isConnected()
        Returns if an authenticated connection to the vCenter Server is established
        Returns:
      • setIgnoreCert

        @Option(name="ignorecert",
                systemProperty="ssl.trustAll.enabled",
                description="Ignore the SSL certificate check",
                parameter=false,
                required=false)
        void setIgnoreCert​(java.lang.Boolean ignorecert)
        DEV ONLY option to ignore the SSL certificate check. DO NOT USE THIS OPTION FOR PRODUCTION CODE
        Parameters:
        ignorecert -
      • setPassword

        @Option(name="password",
                systemProperty="connection.password",
                description="password on remote system")
        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
        Parameters:
        password -
      • setSpbmUrl

        @Option(name="spbmurl",
                systemProperty="spbmService.url",
                description="full url to the SPBM service on vCenter",
                required=false)
        void setSpbmUrl​(java.lang.String spbmurl)
        SPBM Service URL e.g. https://\<vcenter>/pbm
        Parameters:
        spbmurl -
      • setSsoUrl

        @Option(name="ssourl",
                systemProperty="sso.url",
                description="full url to the STS service",
                required=false)
        void setSsoUrl​(java.lang.String ssourl)
        vCenter Single Sign-On STS service URL
        Parameters:
        ssourl -
      • setUsername

        @Option(name="username",
                systemProperty="connection.username",
                description="username on remote system")
        void setUsername​(java.lang.String username)
        Username to be used to acquire SAML token from the STS Service for accessing vCenter Server
        Parameters:
        username -
      • setVcUrl

        @Option(name="vcurl",
                systemProperty="vimService.url",
                description="full url to the vSphere WS SDK service on vCenter")
        void setVcUrl​(java.lang.String vcurl)
        vSphere web services URL e.g https://\<vcenter>/sdk
        Parameters:
        vcurl -