hudson.plugins.vmware
Class PluginImpl

java.lang.Object
  extended by hudson.Plugin
      extended by hudson.plugins.vmware.PluginImpl

public class PluginImpl
extends hudson.Plugin

Entry point of vmware plugin.

Author:
Stephen Connolly

Constructor Summary
PluginImpl()
           
 
Method Summary
static void awaitVMIP(java.lang.String key)
          Waits until the specified key has been set.
static boolean awaitVMIP(java.lang.String key, long timeout, java.util.concurrent.TimeUnit unit)
          Waits at most timeout for the specified key to be set.
static void clearVMIP(java.lang.String key)
          Clears the key.
 void doQuery(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Stapler handler for querying a VM IP.
 void doSet(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Stapler handler for setting a VM IP.
 void doUnset(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Stapler handler for unsetting a VM IP.
 void doVixLibraryCheck(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Checks if the VIX path is a valid VIX path.
static java.lang.String getVMIP(java.lang.String key)
          Returns the current value of the key.
 java.util.Map<java.lang.String,java.lang.String> getVmIPAddresses()
          Gets the current name-value pairs of virtual machine names and IP addresses.
static java.util.Set<java.lang.String> getVMs()
          Gets a set of all the current names.
static void setVMIP(java.lang.String key, java.lang.String ip)
          Sets the key, releasing any threads that were waiting for it to be set.
 void start()
           
static void watchVMIP(java.lang.String key)
           
 
Methods inherited from class hudson.Plugin
doDynamic, setServletContext, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginImpl

public PluginImpl()
Method Detail

start

public void start()
           throws java.lang.Exception
Overrides:
start in class hudson.Plugin
Throws:
java.lang.Exception

doVixLibraryCheck

public void doVixLibraryCheck(org.kohsuke.stapler.StaplerRequest req,
                              org.kohsuke.stapler.StaplerResponse rsp)
                       throws java.io.IOException,
                              javax.servlet.ServletException
Checks if the VIX path is a valid VIX path.

Throws:
java.io.IOException
javax.servlet.ServletException

getVmIPAddresses

public java.util.Map<java.lang.String,java.lang.String> getVmIPAddresses()
Gets the current name-value pairs of virtual machine names and IP addresses.

Returns:
The name-value pairs.

doSet

public void doSet(org.kohsuke.stapler.StaplerRequest req,
                  org.kohsuke.stapler.StaplerResponse rsp)
           throws java.io.IOException
Stapler handler for setting a VM IP.

Parameters:
req - The request.
rsp - The response.
Throws:
java.io.IOException - If there are problems with IO.

doUnset

public void doUnset(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException
Stapler handler for unsetting a VM IP.

Parameters:
req - The request.
rsp - The response.
Throws:
java.io.IOException - If there are problems with IO.

doQuery

public void doQuery(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException
Stapler handler for querying a VM IP.

Parameters:
req - The request.
rsp - The response.
Throws:
java.io.IOException - If there are problems with IO.

awaitVMIP

public static void awaitVMIP(java.lang.String key)
                      throws java.lang.InterruptedException
Waits until the specified key has been set. Will return immediately if the key is already set.

Parameters:
key - The key to look for.
Throws:
java.lang.InterruptedException - If interrupted.

awaitVMIP

public static boolean awaitVMIP(java.lang.String key,
                                long timeout,
                                java.util.concurrent.TimeUnit unit)
                         throws java.lang.InterruptedException
Waits at most timeout for the specified key to be set. Will return immediately if the key is already set.

Parameters:
key - The key to look for.
timeout - The timeout.
unit - The units of the timeout.
Returns:
true if the key has been set.
Throws:
java.lang.InterruptedException - If interrupted.

watchVMIP

public static void watchVMIP(java.lang.String key)

setVMIP

public static void setVMIP(java.lang.String key,
                           java.lang.String ip)
Sets the key, releasing any threads that were waiting for it to be set.

Parameters:
key - The name.
ip - The value.

clearVMIP

public static void clearVMIP(java.lang.String key)
Clears the key.

Parameters:
key - The name.

getVMIP

public static java.lang.String getVMIP(java.lang.String key)
Returns the current value of the key.

Parameters:
key - The key.
Returns:
The current value or null if empty.

getVMs

public static java.util.Set<java.lang.String> getVMs()
Gets a set of all the current names.

Returns:
all the current names.


Copyright © 2008. All Rights Reserved.