be.ac.ua.broker.utils
Class InputVerifier

java.lang.Object
  extended by be.ac.ua.broker.utils.InputVerifier

public class InputVerifier
extends java.lang.Object

This class contains some broker input verification utilities. It provides static methods to verify whether an existing EC2 instance, region or operating system is provided. It also enables the user to check whether an existing scheduling and allocation scheme option is provided to the broker. Make sure to call the setup function before using the utilities of this class.

Author:
Vermeersch Kurt

Constructor Summary
InputVerifier()
           
 
Method Summary
static boolean allocationVersionExists(java.lang.String version)
          Check whether a given allocation option is supported by the broker
static java.util.Set<java.lang.String> getAllocationsVersions()
          Getter for the set of supported allocation options of the broker
static java.util.Set<java.lang.String> getSchedulingVersions()
          Getter for the set of supported scheduling options of the broker
static boolean instanceExists(java.lang.String inst)
          Check whether a given instance type is supported by the broker
static boolean osExists(java.lang.String os)
          Check whether a given operating system is supported by the broker
static boolean regionExists(java.lang.String reg)
          Check whether a given geographical region is supported by the broker
static boolean schedulingVersionExists(java.lang.String version)
          Check whether a given scheduling option is supported by the broker
static void setup()
          Fill the sets with the values representing the supported items
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputVerifier

public InputVerifier()
Method Detail

setup

public static void setup()
Fill the sets with the values representing the supported items


instanceExists

public static boolean instanceExists(java.lang.String inst)
                              throws InvalidInputException
Check whether a given instance type is supported by the broker

Parameters:
inst - the instance type to check
Returns:
whether the instance type is supported by the broker
Throws:
InvalidInputException - exception thrown when the provided instance type is not supported by the broker

regionExists

public static boolean regionExists(java.lang.String reg)
                            throws InvalidInputException
Check whether a given geographical region is supported by the broker

Parameters:
reg - the geographical region to check
Returns:
whether the geographical region is supported by the broker
Throws:
InvalidInputException - exception thrown when the provided geographical region is not supported by the broker

osExists

public static boolean osExists(java.lang.String os)
                        throws InvalidInputException
Check whether a given operating system is supported by the broker

Parameters:
os - the operating system to check
Returns:
whether the operating system is supported by the broker
Throws:
InvalidInputException - exception thrown when the provided operating system is not supported by the broker

schedulingVersionExists

public static boolean schedulingVersionExists(java.lang.String version)
                                       throws InvalidInputException
Check whether a given scheduling option is supported by the broker

Parameters:
version - the scheduling option to check
Returns:
whether the scheduling option is supported by the broker
Throws:
InvalidInputException - exception thrown when the provided scheduling option is not supported by the broker

getSchedulingVersions

public static java.util.Set<java.lang.String> getSchedulingVersions()
Getter for the set of supported scheduling options of the broker

Returns:
the set of supported scheduling options

allocationVersionExists

public static boolean allocationVersionExists(java.lang.String version)
                                       throws InvalidInputException
Check whether a given allocation option is supported by the broker

Parameters:
version - the allocation option to check
Returns:
whether the allocation option is supported by the broker
Throws:
InvalidInputException - exception thrown when the provided allocation option is not supported by the broker

getAllocationsVersions

public static java.util.Set<java.lang.String> getAllocationsVersions()
Getter for the set of supported allocation options of the broker

Returns:
the set of supported allocation options