Package com.vmware.spbm.connection
Class ConnectedServiceBase
- java.lang.Object
-
- com.vmware.spbm.connection.ConnectedServiceBase
-
- Direct Known Subclasses:
AboutInfo,CheckCompliance,CreateProfile,CreateVSANProfile,DeleteProfile,EditProfile,FcdAssociateProfile,ListProfiles,ViewProfile,VMClone,VMCreate,VMRelocate
public abstract class ConnectedServiceBase extends java.lang.ObjectAn abstract base class, extend this class if your common needs to open a connection to the virtual center server before it can do anything useful.Example: The simplest possible extension class merely forms a connection and specifies it's own common action.
@Sample(name = "connect") public class Connect extends ConnectedServiceBase { @Action public void action() { System.out.println("currently connected: " + this.isConnected()); } }This is provided as an alternative to extending the Connection class directly.
For a very simple connected sample:
-
-
Constructor Summary
Constructors Constructor Description ConnectedServiceBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetConnection(Connection connect)A method for dependency injection of the connection object.booleanstart()connects this object, returns true on successful connectbooleanstop()disconnects this object and returns true on successful disconnect
-
-
-
Method Detail
-
setConnection
@Option(name="connection", type=BasicConnection.class) public void setConnection(Connection connect)A method for dependency injection of the connection object.- Parameters:
connect- the connection object to use for this POJO- See Also:
Connection
-
start
@Before public boolean start()
connects this object, returns true on successful connect- Returns:
- true on successful connect
- Throws:
ConnectionException
-
stop
@After public boolean stop()
disconnects this object and returns true on successful disconnect- Returns:
- a disconnected reference to itself
- Throws:
ConnectionException
-
-