From c3b11755ae6c306a739ae2becf1189d374fc8c40 Mon Sep 17 00:00:00 2001 From: msimonin Date: Fri, 22 Nov 2013 14:42:42 +0100 Subject: [PATCH] fix checkstyle. M --- .../org/inria/myriads/snoozeec2/Main.java | 32 ++++++++++--------- .../snoozeec2/backend/SnoozeEC2Backend.java | 28 ++++++++-------- .../configurator/api/EC2Configuration.java | 5 ++- .../api/impl/JavaPropertyEC2Configurator.java | 17 +++++----- .../snoozeec2/resource/SnoozeEC2Resource.java | 9 ++---- 5 files changed, 44 insertions(+), 47 deletions(-) diff --git a/src/main/java/org/inria/myriads/snoozeec2/Main.java b/src/main/java/org/inria/myriads/snoozeec2/Main.java index e031ec5..8152e09 100644 --- a/src/main/java/org/inria/myriads/snoozeec2/Main.java +++ b/src/main/java/org/inria/myriads/snoozeec2/Main.java @@ -83,21 +83,21 @@ public static void main(String[] args) } LoggerUtils.configureLogger(logFile); - EC2Configuration EC2Configuration = null; - EC2Instances EC2Instances = null; + EC2Configuration ec2Configuration = null; + EC2Instances ec2Instances = null; try { EC2Configurator imageServiceConfigurator = EC2ConfiguratorFactory.newNodeConfigurator(configurationFile); - EC2Configuration = imageServiceConfigurator.getImageServiceConfiguration(); + ec2Configuration = imageServiceConfigurator.getImageServiceConfiguration(); EC2InstancesGenerator instancesGenerator = EC2InstancesGeneratorFactory.newInstancesGenerator(instancesFile); - EC2Instances = instancesGenerator.generate(); + ec2Instances = instancesGenerator.generate(); - startNode(EC2Configuration, EC2Instances); + startNode(ec2Configuration, ec2Instances); } catch (EC2ConfiguratorException exception) { @@ -140,29 +140,31 @@ private static void initializeRESTletComponent(Component component, component.getServers().add(jettyServer); } - /** - * Main routine to start the node. - * - * @param EC2Configuration The node configuration - * @param eC2Instances - * @throws Exception + + /** + * + * Main routine to start the ec2 service. + * + * @param ec2Configuration EC2 Configuration + * @param ec2Instances EC2 instances file + * @throws Exception Exception */ - private static void startNode(EC2Configuration EC2Configuration, EC2Instances ec2Instances) + private static void startNode(EC2Configuration ec2Configuration, EC2Instances ec2Instances) throws Exception { - Guard.check(EC2Configuration); + Guard.check(ec2Configuration); log_.debug("Starting the node initialization"); Component component = new Component(); Context context = component.getContext().createChildContext(); - initializeRESTletComponent(component, context, EC2Configuration); + initializeRESTletComponent(component, context, ec2Configuration); Application application = null; log_.debug("Starting the ec2 API"); application = new EC2Application(context); attachApplication(component, application); - SnoozeEC2Backend backend = new SnoozeEC2Backend(EC2Configuration, ec2Instances); + SnoozeEC2Backend backend = new SnoozeEC2Backend(ec2Configuration, ec2Instances); context.getAttributes().put("backend", backend); } diff --git a/src/main/java/org/inria/myriads/snoozeec2/backend/SnoozeEC2Backend.java b/src/main/java/org/inria/myriads/snoozeec2/backend/SnoozeEC2Backend.java index f2e0e2f..ba023ad 100644 --- a/src/main/java/org/inria/myriads/snoozeec2/backend/SnoozeEC2Backend.java +++ b/src/main/java/org/inria/myriads/snoozeec2/backend/SnoozeEC2Backend.java @@ -43,10 +43,10 @@ public class SnoozeEC2Backend private static final Logger log_ = LoggerFactory.getLogger(SnoozeEC2Backend.class); /** Image repository settings. */ - private EC2Configuration EC2Configuration_; + private EC2Configuration ec2Configuration_; /** Instances.*/ - private EC2Instances EC2Instances_; + private EC2Instances ec2Instances_; /** * @@ -57,8 +57,8 @@ public class SnoozeEC2Backend */ public SnoozeEC2Backend(EC2Configuration imageServiceConfiguration, EC2Instances ec2Instances) { - EC2Configuration_ = imageServiceConfiguration; - EC2Instances_ = ec2Instances; + ec2Configuration_ = imageServiceConfiguration; + ec2Instances_ = ec2Instances; } /** @@ -70,7 +70,7 @@ public SnoozeEC2Backend(EC2Configuration imageServiceConfiguration, EC2Instances public List describeInstances() { log_.debug("Describe instances"); - NetworkAddress bootstrapAddress = EC2Configuration_.getBootstrapSettings(); + NetworkAddress bootstrapAddress = ec2Configuration_.getBootstrapSettings(); BootstrapAPI bootstrapCommunicator = org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory .newBootstrapCommunicator(bootstrapAddress); @@ -91,7 +91,7 @@ public List describeInstances() public ArrayList describeImages() { log_.debug("Getting the images from the image repository"); - NetworkAddress imageRepositoryAddress = EC2Configuration_.getImageRepositorySettings(); + NetworkAddress imageRepositoryAddress = ec2Configuration_.getImageRepositorySettings(); ImagesRepositoryAPI imagesRepositoryCommunicator = org.inria.myriads.snoozeimages.communication.rest.CommunicatorFactory @@ -118,7 +118,7 @@ public ArrayList describeImages() public String runInstances(VirtualClusterSubmissionRequest submissionRequest) { log_.debug("Starting instances"); - NetworkAddress bootstrapAddress = EC2Configuration_.getBootstrapSettings(); + NetworkAddress bootstrapAddress = ec2Configuration_.getBootstrapSettings(); BootstrapAPI bootstrapCommunicator = org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory .newBootstrapCommunicator(bootstrapAddress); @@ -131,7 +131,7 @@ public String runInstances(VirtualClusterSubmissionRequest submissionRequest) */ public EC2Configuration getEC2Configuration() { - return EC2Configuration_; + return ec2Configuration_; } /** @@ -139,7 +139,7 @@ public EC2Configuration getEC2Configuration() */ public void setEC2Configuration(EC2Configuration eC2Configuration) { - EC2Configuration_ = eC2Configuration; + ec2Configuration_ = eC2Configuration; } /** @@ -147,7 +147,7 @@ public void setEC2Configuration(EC2Configuration eC2Configuration) */ public EC2Instances getEC2Instances() { - return EC2Instances_; + return ec2Instances_; } /** @@ -155,7 +155,7 @@ public EC2Instances getEC2Instances() */ public void setEC2Instances(EC2Instances eC2Instances) { - EC2Instances_ = eC2Instances; + ec2Instances_ = eC2Instances; } /** @@ -168,7 +168,7 @@ public void setEC2Instances(EC2Instances eC2Instances) public boolean rebootInstances(List listInstances) { log_.debug("Rebooting instances"); - NetworkAddress bootstrapAddress = EC2Configuration_.getBootstrapSettings(); + NetworkAddress bootstrapAddress = ec2Configuration_.getBootstrapSettings(); BootstrapAPI bootstrapCommunicator = org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory .newBootstrapCommunicator(bootstrapAddress); @@ -191,7 +191,7 @@ public boolean rebootInstances(List listInstances) public InstanceStateChangeSetType terminateInstances(List listInstances) { log_.debug("Terminating instances"); - NetworkAddress bootstrapAddress = EC2Configuration_.getBootstrapSettings(); + NetworkAddress bootstrapAddress = ec2Configuration_.getBootstrapSettings(); BootstrapAPI bootstrapCommunicator = org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory .newBootstrapCommunicator(bootstrapAddress); @@ -247,7 +247,7 @@ public int getPollingInterval() public VirtualClusterSubmissionResponse getVirtualClusterResponse(String taskIdentifier) { log_.debug("Describe instances"); - NetworkAddress bootstrapAddress = EC2Configuration_.getBootstrapSettings(); + NetworkAddress bootstrapAddress = ec2Configuration_.getBootstrapSettings(); BootstrapAPI bootstrapCommunicator = org.inria.myriads.snoozecommon.communication.rest.CommunicatorFactory .newBootstrapCommunicator(bootstrapAddress); diff --git a/src/main/java/org/inria/myriads/snoozeec2/configurator/api/EC2Configuration.java b/src/main/java/org/inria/myriads/snoozeec2/configurator/api/EC2Configuration.java index b2dd907..7c0ee64 100644 --- a/src/main/java/org/inria/myriads/snoozeec2/configurator/api/EC2Configuration.java +++ b/src/main/java/org/inria/myriads/snoozeec2/configurator/api/EC2Configuration.java @@ -22,7 +22,6 @@ import java.io.Serializable; import org.inria.myriads.snoozecommon.communication.NetworkAddress; -import org.inria.myriads.snoozeec2.configurator.networking.NetworkingSettings; @@ -40,10 +39,10 @@ public class EC2Configuration /** Networking settings.*/ private NetworkAddress networkingSettings_; - /** Image repository address */; + /** Image repository address. */; private NetworkAddress imageRepositorySettings_; - /** bootstrap repository address */; + /** bootstrap repository address. */; private NetworkAddress bootstrapSettings_; diff --git a/src/main/java/org/inria/myriads/snoozeec2/configurator/api/impl/JavaPropertyEC2Configurator.java b/src/main/java/org/inria/myriads/snoozeec2/configurator/api/impl/JavaPropertyEC2Configurator.java index a816719..40d22b5 100644 --- a/src/main/java/org/inria/myriads/snoozeec2/configurator/api/impl/JavaPropertyEC2Configurator.java +++ b/src/main/java/org/inria/myriads/snoozeec2/configurator/api/impl/JavaPropertyEC2Configurator.java @@ -31,7 +31,6 @@ import org.inria.myriads.snoozecommon.util.NetworkUtils; import org.inria.myriads.snoozeec2.configurator.api.EC2Configuration; import org.inria.myriads.snoozeec2.configurator.api.EC2Configurator; -import org.inria.myriads.snoozeec2.configurator.networking.NetworkingSettings; import org.inria.myriads.snoozeec2.exception.EC2ConfiguratorException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,7 +50,7 @@ public final class JavaPropertyEC2Configurator private static final Logger log_ = LoggerFactory.getLogger(JavaPropertyEC2Configurator.class); /** NodeParams. */ - private EC2Configuration EC2Configuration_; + private EC2Configuration ec2Configuration_; /** Properties. */ private Properties properties_; @@ -67,7 +66,7 @@ public JavaPropertyEC2Configurator(String configurationFile) throws EC2ConfiguratorException, IOException { Guard.check(configurationFile); - EC2Configuration_ = new EC2Configuration(); + ec2Configuration_ = new EC2Configuration(); properties_ = new Properties(); FileInputStream fileInput = new FileInputStream(configurationFile); @@ -93,7 +92,7 @@ private void setContextPath() throws EC2ConfiguratorException String contextPath = properties_.getProperty("config.ec2.package.contextpath"); if (!StringUtils.isBlank(contextPath)) { - EC2Configuration_.setContextPath(contextPath); + ec2Configuration_.setContextPath(contextPath); } else { @@ -130,7 +129,7 @@ private void setBootstrapSettings() throws EC2ConfiguratorException int controlDataPort = Integer.valueOf(getProperty("bootstrap.port")); NetworkAddress controlDataAddress = NetworkUtils.createNetworkAddress(listenAddress, controlDataPort); - EC2Configuration_.setBootstrapSettings(controlDataAddress); + ec2Configuration_.setBootstrapSettings(controlDataAddress); log_.debug("bootstrap setting set"); } catch (Exception exception) @@ -164,9 +163,9 @@ private void setImageRepositorySettings() throws EC2ConfiguratorException int controlDataPort = Integer.valueOf(getProperty("imageRepository.port")); NetworkAddress controlDataAddress = NetworkUtils.createNetworkAddress(listenAddress, controlDataPort); - EC2Configuration_.setImageRepositorySettings(controlDataAddress); + ec2Configuration_.setImageRepositorySettings(controlDataAddress); } - catch( Exception exception) + catch (Exception exception) { log_.debug("Unable to set the image reposirory settings : " + exception.getMessage()); throw new EC2ConfiguratorException(exception.getMessage()); @@ -179,7 +178,7 @@ private void setImageRepositorySettings() throws EC2ConfiguratorException @Override public EC2Configuration getImageServiceConfiguration() { - return EC2Configuration_; + return ec2Configuration_; } /** @@ -205,7 +204,7 @@ private void setNetworkingSettings() int controlDataPort = Integer.valueOf(getProperty("network.listen.port")); NetworkAddress controlDataAddress = NetworkUtils.createNetworkAddress(listenAddress, controlDataPort); - EC2Configuration_.setNetworkingSettings(controlDataAddress); + ec2Configuration_.setNetworkingSettings(controlDataAddress); } catch (Exception exception) { diff --git a/src/main/java/org/inria/myriads/snoozeec2/resource/SnoozeEC2Resource.java b/src/main/java/org/inria/myriads/snoozeec2/resource/SnoozeEC2Resource.java index 41b961f..5072b49 100644 --- a/src/main/java/org/inria/myriads/snoozeec2/resource/SnoozeEC2Resource.java +++ b/src/main/java/org/inria/myriads/snoozeec2/resource/SnoozeEC2Resource.java @@ -45,13 +45,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - - - - - /** + * + * Snooze EC2 resource. + * * @author msimonin * */