|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.virtualbox.util.MachineUtils
@Singleton public class MachineUtils
Utilities for executing functions on a VirtualBox machine.
| Field Summary | |
|---|---|
String |
IP_V4_ADDRESS_PATTERN
|
protected Logger |
logger
|
| Constructor Summary | |
|---|---|
MachineUtils(com.google.common.base.Supplier<org.virtualbox_4_1.VirtualBoxManager> manager,
RunScriptOnNode.Factory scriptRunner)
|
|
| Method Summary | ||
|---|---|---|
|
applyForMachine(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
|
|
String |
getIpAddressFromBridgedNIC(String machineName)
|
|
String |
getIpAddressFromHostOnlyNIC(String machineName)
|
|
protected
|
lockSessionOnMachineAndApply(String machineId,
org.virtualbox_4_1.LockType type,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
Locks the machine and executes the given function using the current session. |
|
static boolean |
machineNotFoundException(org.virtualbox_4_1.VBoxException e)
|
|
com.google.common.util.concurrent.ListenableFuture<ExecResponse> |
runScriptOnNode(NodeMetadata metadata,
Statement statement,
RunScriptOptions options)
|
|
|
sharedLockMachineAndApply(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
Locks the machine and executes the given function using the machine matching the given id. |
|
|
sharedLockMachineAndApplyToSession(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
Locks the machine and executes the given function to the session using the machine matching the given id. |
|
|
writeLockMachineAndApply(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
Locks the machine and executes the given function using the machine matching the given id. |
|
|
writeLockMachineAndApplyToSession(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
Locks the machine and executes the given function using the machine matching the given id. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final String IP_V4_ADDRESS_PATTERN
@Named(value="jclouds.compute") protected Logger logger
| Constructor Detail |
|---|
@Inject
public MachineUtils(com.google.common.base.Supplier<org.virtualbox_4_1.VirtualBoxManager> manager,
RunScriptOnNode.Factory scriptRunner)
| Method Detail |
|---|
public com.google.common.util.concurrent.ListenableFuture<ExecResponse> runScriptOnNode(NodeMetadata metadata,
Statement statement,
RunScriptOptions options)
public <T> T writeLockMachineAndApply(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
machineId - the id of the machinefunction - the function to execute
public <T> T writeLockMachineAndApplyToSession(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
machineId - the id of the machinefunction - the function to execute
public <T> T sharedLockMachineAndApply(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
machineId - the id of the machinefunction - the function to execute
public <T> T sharedLockMachineAndApplyToSession(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
machineId - the id of the machinefunction - the function to execute
protected <T> T lockSessionOnMachineAndApply(String machineId,
org.virtualbox_4_1.LockType type,
com.google.common.base.Function<org.virtualbox_4_1.ISession,T> function)
type - the kind of lock to use when initially locking the machine.machineId - the id of the machinefunction - the function to execute
public <T> T applyForMachine(String machineId,
com.google.common.base.Function<org.virtualbox_4_1.IMachine,T> function)
machineId - function -
public static boolean machineNotFoundException(org.virtualbox_4_1.VBoxException e)
public String getIpAddressFromBridgedNIC(String machineName)
public String getIpAddressFromHostOnlyNIC(String machineName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||