cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [50/51] [partial] Reformat all source code. Added checkstyle to check the source code
Date Wed, 20 Nov 2013 15:35:37 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/Agent.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java
index c4f17b2..9674510 100755
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -99,28 +99,28 @@ public class Agent implements HandlerFactory, IAgentControl {
         }
     }
 
-    List<IAgentControlListener> _controlListeners     = new ArrayList<IAgentControlListener>();
-
-    IAgentShell                 _shell;
-    NioConnection               _connection;
-    ServerResource              _resource;
-    Link                        _link;
-    Long                        _id;
-
-    Timer                       _timer                = new Timer("Agent Timer");
-
-    List<WatchTask>             _watchList            = new ArrayList<WatchTask>();
-    long                        _sequence             = 0;
-    long                        _lastPingResponseTime = 0;
-    long                        _pingInterval         = 0;
-    AtomicInteger               _inProgress           = new AtomicInteger();
-
-    StartupTask                 _startup              = null;
-    long  _startupWaitDefault = 180000;
-    long  _startupWait = _startupWaitDefault;
-    boolean                     _reconnectAllowed     = true;
+    List<IAgentControlListener> _controlListeners = new ArrayList<IAgentControlListener>();
+
+    IAgentShell _shell;
+    NioConnection _connection;
+    ServerResource _resource;
+    Link _link;
+    Long _id;
+
+    Timer _timer = new Timer("Agent Timer");
+
+    List<WatchTask> _watchList = new ArrayList<WatchTask>();
+    long _sequence = 0;
+    long _lastPingResponseTime = 0;
+    long _pingInterval = 0;
+    AtomicInteger _inProgress = new AtomicInteger();
+
+    StartupTask _startup = null;
+    long _startupWaitDefault = 180000;
+    long _startupWait = _startupWaitDefault;
+    boolean _reconnectAllowed = true;
     //For time sentitive task, e.g. PingTask
-    private ThreadPoolExecutor     _ugentTaskPool;
+    private ThreadPoolExecutor _ugentTaskPool;
     ExecutorService _executor;
 
     // for simulator use only
@@ -132,11 +132,11 @@ public class Agent implements HandlerFactory, IAgentControl {
 
         Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
 
-        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES,
-                                                new SynchronousQueue<Runnable>(), new NamedThreadFactory("UgentTask")
-                                                );
-        
-        _executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory("agentRequest-Handler"));
+        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory(
+            "UgentTask"));
+
+        _executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
+            "agentRequest-Handler"));
     }
 
     public Agent(IAgentShell shell, int localAgentId, ServerResource resource) throws ConfigurationException {
@@ -168,16 +168,14 @@ public class Agent implements HandlerFactory, IAgentControl {
         s_logger.debug("Adding shutdown hook");
         Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
 
-        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES,
-                                                new SynchronousQueue<Runnable>(), new NamedThreadFactory("UgentTask")
-                                                );
+        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory(
+            "UgentTask"));
 
-        
-        _executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory("agentRequest-Handler"));
-        
+        _executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
+            "agentRequest-Handler"));
 
-        s_logger.info("Agent [id = " + (_id != null ? _id : "new") + " : type = " + getResourceName() + " : zone = " + _shell.getZone() + " : pod = " + _shell.getPod() + " : workers = "
-                + _shell.getWorkers() + " : host = " + _shell.getHost() + " : port = " + _shell.getPort());
+        s_logger.info("Agent [id = " + (_id != null ? _id : "new") + " : type = " + getResourceName() + " : zone = " + _shell.getZone() + " : pod = " + _shell.getPod() +
+                      " : workers = " + _shell.getWorkers() + " : host = " + _shell.getHost() + " : port = " + _shell.getPort());
     }
 
     public String getVersion() {
@@ -218,13 +216,13 @@ public class Agent implements HandlerFactory, IAgentControl {
             s_logger.error("Unable to start the resource: " + _resource.getName());
             throw new CloudRuntimeException("Unable to start the resource: " + _resource.getName());
         }
-   
+
         _connection.start();
-       while (!_connection.isStartup()) {
-           _shell.getBackoffAlgorithm().waitBeforeRetry();
-           _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
-           _connection.start();
-       }
+        while (!_connection.isStartup()) {
+            _shell.getBackoffAlgorithm().waitBeforeRetry();
+            _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
+            _connection.start();
+        }
     }
 
     public void stop(final String reason, final String detail) {
@@ -408,7 +406,7 @@ public class Agent implements HandlerFactory, IAgentControl {
             }
         }
 
-        final StartupAnswer startup = (StartupAnswer) answer;
+        final StartupAnswer startup = (StartupAnswer)answer;
         if (!startup.getResult()) {
             s_logger.error("Not allowed to connect to the server: " + answer.getDetails());
             System.exit(1);
@@ -426,7 +424,7 @@ public class Agent implements HandlerFactory, IAgentControl {
         setLastPingResponseTime();
         scheduleWatch(link, response, _pingInterval, _pingInterval);
 
-        _ugentTaskPool.setKeepAliveTime(2* _pingInterval, TimeUnit.MILLISECONDS);
+        _ugentTaskPool.setKeepAliveTime(2 * _pingInterval, TimeUnit.MILLISECONDS);
 
         s_logger.info("Startup Response Received: agent id = " + getId());
     }
@@ -442,42 +440,42 @@ public class Agent implements HandlerFactory, IAgentControl {
                 final Command cmd = cmds[i];
                 Answer answer;
                 try {
-                	if (s_logger.isDebugEnabled()) {
-                		if (!requestLogged) // ensures request is logged only once per method call
-                		{
-                			String requestMsg = request.toString();
-                			if (requestMsg != null) {
-                				s_logger.debug("Request:" + requestMsg);
-                			}
-                			requestLogged = true;
-                		}
-                		s_logger.debug("Processing command: " + cmd.toString());
-                	}
+                    if (s_logger.isDebugEnabled()) {
+                        if (!requestLogged) // ensures request is logged only once per method call
+                        {
+                            String requestMsg = request.toString();
+                            if (requestMsg != null) {
+                                s_logger.debug("Request:" + requestMsg);
+                            }
+                            requestLogged = true;
+                        }
+                        s_logger.debug("Processing command: " + cmd.toString());
+                    }
 
                     if (cmd instanceof CronCommand) {
-                        final CronCommand watch = (CronCommand) cmd;
+                        final CronCommand watch = (CronCommand)cmd;
                         scheduleWatch(link, request, watch.getInterval() * 1000, watch.getInterval() * 1000);
                         answer = new Answer(cmd, true, null);
                     } else if (cmd instanceof ShutdownCommand) {
-                        ShutdownCommand shutdown = (ShutdownCommand) cmd;
+                        ShutdownCommand shutdown = (ShutdownCommand)cmd;
                         s_logger.debug("Received shutdownCommand, due to: " + shutdown.getReason());
                         cancelTasks();
                         _reconnectAllowed = false;
                         answer = new Answer(cmd, true, null);
                     } else if (cmd instanceof ReadyCommand && ((ReadyCommand)cmd).getDetails() != null) {
-                		s_logger.debug("Not ready to connect to mgt server: " + ((ReadyCommand)cmd).getDetails());
-                		System.exit(1);
-                    	return;
+                        s_logger.debug("Not ready to connect to mgt server: " + ((ReadyCommand)cmd).getDetails());
+                        System.exit(1);
+                        return;
                     } else if (cmd instanceof MaintainCommand) {
-                          s_logger.debug("Received maintainCommand" );
-                          cancelTasks();
-                          _reconnectAllowed = false;
-                          answer = new MaintainAnswer((MaintainCommand)cmd);
+                        s_logger.debug("Received maintainCommand");
+                        cancelTasks();
+                        _reconnectAllowed = false;
+                        answer = new MaintainAnswer((MaintainCommand)cmd);
                     } else if (cmd instanceof AgentControlCommand) {
                         answer = null;
                         synchronized (_controlListeners) {
                             for (IAgentControlListener listener : _controlListeners) {
-                                answer = listener.processControlRequest(request, (AgentControlCommand) cmd);
+                                answer = listener.processControlRequest(request, (AgentControlCommand)cmd);
                                 if (answer != null) {
                                     break;
                                 }
@@ -522,10 +520,10 @@ public class Agent implements HandlerFactory, IAgentControl {
             response = new Response(request, answers);
         } finally {
             if (s_logger.isDebugEnabled()) {
-            	String responseMsg = response.toString();
-            	if (responseMsg != null) {
-            		s_logger.debug(response.toString());
-            	}
+                String responseMsg = response.toString();
+                if (responseMsg != null) {
+                    s_logger.debug(response.toString());
+                }
             }
 
             if (response != null) {
@@ -549,19 +547,18 @@ public class Agent implements HandlerFactory, IAgentControl {
             // Notice, we are doing callback while holding a lock!
             synchronized (_controlListeners) {
                 for (IAgentControlListener listener : _controlListeners) {
-                    listener.processControlResponse(response, (AgentControlAnswer) answer);
+                    listener.processControlResponse(response, (AgentControlAnswer)answer);
                 }
             }
         } else {
             setLastPingResponseTime();
         }
     }
-    
-    
+
     public void processReadyCommand(Command cmd) {
 
-        final ReadyCommand ready = (ReadyCommand) cmd;
-        
+        final ReadyCommand ready = (ReadyCommand)cmd;
+
         s_logger.info("Proccess agent ready command, agent id = " + ready.getHostId());
         if (ready.getHostId() != null) {
             setId(ready.getHostId());
@@ -594,9 +591,9 @@ public class Agent implements HandlerFactory, IAgentControl {
             } catch (final ClosedChannelException e) {
                 s_logger.warn("Unable to send request: " + request.toString());
             }
-            
+
         } else if (obj instanceof Request) {
-            final Request req = (Request) obj;
+            final Request req = (Request)obj;
             final Command command = req.getCommand();
             Answer answer = null;
             _inProgress.incrementAndGet();
@@ -646,7 +643,7 @@ public class Agent implements HandlerFactory, IAgentControl {
 
     @Override
     public AgentControlAnswer sendRequest(AgentControlCommand cmd, int timeoutInMilliseconds) throws AgentControlChannelException {
-        Request request = new Request(this.getId(), -1, new Command[] { cmd } , true, false);
+        Request request = new Request(this.getId(), -1, new Command[] {cmd}, true, false);
         request.setSequence(getNextSequence());
 
         AgentControlListener listener = new AgentControlListener(request);
@@ -670,7 +667,7 @@ public class Agent implements HandlerFactory, IAgentControl {
 
     @Override
     public void postRequest(AgentControlCommand cmd) throws AgentControlChannelException {
-        Request request = new Request(this.getId(), -1, new Command[] { cmd } , true, false);
+        Request request = new Request(this.getId(), -1, new Command[] {cmd}, true, false);
         request.setSequence(getNextSequence());
         postRequest(request);
     }
@@ -690,7 +687,7 @@ public class Agent implements HandlerFactory, IAgentControl {
 
     public class AgentControlListener implements IAgentControlListener {
         private AgentControlAnswer _answer;
-        private final Request      _request;
+        private final Request _request;
 
         public AgentControlListener(Request request) {
             _request = request;
@@ -732,8 +729,8 @@ public class Agent implements HandlerFactory, IAgentControl {
 
     public class WatchTask extends ManagedContextTimerTask {
         protected Request _request;
-        protected Agent   _agent;
-        protected Link    _link;
+        protected Agent _agent;
+        protected Link _link;
 
         public WatchTask(final Link link, final Request request, final Agent agent) {
             super();
@@ -760,7 +757,7 @@ public class Agent implements HandlerFactory, IAgentControl {
     }
 
     public class StartupTask extends ManagedContextTimerTask {
-        protected Link             _link;
+        protected Link _link;
         protected volatile boolean cancelled = false;
 
         public StartupTask(final Link link) {
@@ -788,16 +785,16 @@ public class Agent implements HandlerFactory, IAgentControl {
                 }
                 cancelled = true;
                 _startup = null;
-                _startupWait = _startupWaitDefault *2;
+                _startupWait = _startupWaitDefault * 2;
                 reconnect(_link);
             }
         }
     }
-    
+
     public class AgentRequestHandler extends Task {
-          public AgentRequestHandler(Task.Type type, Link link, Request req) {
-              super(type, link, req);
-          }
+        public AgentRequestHandler(Task.Type type, Link link, Request req) {
+            super(type, link, req);
+        }
 
         @Override
         protected void doTask(Task task) throws Exception {
@@ -829,7 +826,7 @@ public class Agent implements HandlerFactory, IAgentControl {
                     request = Request.parse(task.getData());
                     if (request instanceof Response) {
                         //It's for pinganswer etc, should be processed immediately.
-                        processResponse((Response) request, task.getLink());
+                        processResponse((Response)request, task.getLink());
                     } else {
                         //put the requests from mgt server into another thread pool, as the request may take a longer time to finish. Don't block the NIO main thread pool
                         //processRequest(request, task.getLink());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/AgentShell.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index 900a13f..1bab042 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -55,8 +55,7 @@ import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 public class AgentShell implements IAgentShell, Daemon {
-    private static final Logger s_logger = Logger.getLogger(AgentShell.class
-            .getName());
+    private static final Logger s_logger = Logger.getLogger(AgentShell.class.getName());
 
     private final Properties _properties = new Properties();
     private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
@@ -76,7 +75,6 @@ public class AgentShell implements IAgentShell, Daemon {
     private int _pingRetries;
     private final List<Agent> _agents = new ArrayList<Agent>();
 
-
     public AgentShell() {
     }
 
@@ -180,18 +178,15 @@ public class AgentShell implements IAgentShell, Daemon {
             propertiesStream = new FileInputStream(file);
             _properties.load(propertiesStream);
         } catch (final FileNotFoundException ex) {
-            throw new CloudRuntimeException("Cannot find the file: "
-                    + file.getAbsolutePath(), ex);
+            throw new CloudRuntimeException("Cannot find the file: " + file.getAbsolutePath(), ex);
         } catch (final IOException ex) {
-            throw new CloudRuntimeException("IOException in reading "
-                    + file.getAbsolutePath(), ex);
+            throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex);
         } finally {
             IOUtils.closeQuietly(propertiesStream);
         }
     }
 
-    protected boolean parseCommand(final String[] args)
-            throws ConfigurationException {
+    protected boolean parseCommand(final String[] args) throws ConfigurationException {
         String host = null;
         String workers = null;
         String port = null;
@@ -233,8 +228,7 @@ public class AgentShell implements IAgentShell, Daemon {
 
         _port = NumberUtils.toInt(port, 8250);
 
-        _proxyPort = NumberUtils.toInt(
-                getProperty(null, "consoleproxy.httpListenPort"), 443);
+        _proxyPort = NumberUtils.toInt(getProperty(null, "consoleproxy.httpListenPort"), 443);
 
         if (workers == null) {
             workers = getProperty(null, "workers");
@@ -268,8 +262,7 @@ public class AgentShell implements IAgentShell, Daemon {
         }
 
         if (_host == null || (_host.startsWith("@") && _host.endsWith("@"))) {
-            throw new ConfigurationException(
-                    "Host is not configured correctly: " + _host);
+            throw new ConfigurationException("Host is not configured correctly: " + _host);
         }
 
         final String retries = getProperty(null, "ping.retries");
@@ -292,7 +285,7 @@ public class AgentShell implements IAgentShell, Daemon {
 
         return true;
     }
-    
+
     @Override
     public void init(DaemonContext dc) throws DaemonInitException {
         s_logger.debug("Initializing AgentShell from JSVC");
@@ -302,26 +295,25 @@ public class AgentShell implements IAgentShell, Daemon {
             throw new DaemonInitException("Initialization failed", ex);
         }
     }
-    
+
     public void init(String[] args) throws ConfigurationException {
 
-    	// PropertiesUtil is used both in management server and agent packages,
-    	// it searches path under class path and common J2EE containers
-    	// For KVM agent, do it specially here
-    	
-    	File file = new File("/etc/cloudstack/agent/log4j-cloud.xml");
-    	if(!file.exists()) {
-    		file = PropertiesUtil.findConfigFile("log4j-cloud.xml");
-    	}
-    	DOMConfigurator.configureAndWatch(file.getAbsolutePath());
-
-    	s_logger.info("Agent started");
-    	
+        // PropertiesUtil is used both in management server and agent packages,
+        // it searches path under class path and common J2EE containers
+        // For KVM agent, do it specially here
+
+        File file = new File("/etc/cloudstack/agent/log4j-cloud.xml");
+        if (!file.exists()) {
+            file = PropertiesUtil.findConfigFile("log4j-cloud.xml");
+        }
+        DOMConfigurator.configureAndWatch(file.getAbsolutePath());
+
+        s_logger.info("Agent started");
+
         final Class<?> c = this.getClass();
         _version = c.getPackage().getImplementationVersion();
         if (_version == null) {
-            throw new CloudRuntimeException(
-                    "Unable to find the implementation version of this agent");
+            throw new CloudRuntimeException("Unable to find the implementation version of this agent");
         }
         s_logger.info("Implementation Version is " + _version);
 
@@ -330,19 +322,18 @@ public class AgentShell implements IAgentShell, Daemon {
 
         if (s_logger.isDebugEnabled()) {
             List<String> properties = Collections.list((Enumeration<String>)_properties.propertyNames());
-            for (String property:properties){
+            for (String property : properties) {
                 s_logger.debug("Found property: " + property);
             }
         }
-            
+
         s_logger.info("Defaulting to using properties file for storage");
         _storage = new PropertiesStorage();
         _storage.configure("Storage", new HashMap<String, Object>());
 
         // merge with properties from command line to let resource access
         // command line parameters
-        for (Map.Entry<String, Object> cmdLineProp : getCmdLineProperties()
-                .entrySet()) {
+        for (Map.Entry<String, Object> cmdLineProp : getCmdLineProperties().entrySet()) {
             _properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
         }
 
@@ -362,46 +353,30 @@ public class AgentShell implements IAgentShell, Daemon {
         launchAgentFromTypeInfo();
     }
 
-    private void launchAgentFromClassInfo(String resourceClassNames)
-            throws ConfigurationException {
+    private void launchAgentFromClassInfo(String resourceClassNames) throws ConfigurationException {
         String[] names = resourceClassNames.split("\\|");
         for (String name : names) {
             Class<?> impl;
             try {
                 impl = Class.forName(name);
-                final Constructor<?> constructor = impl
-                        .getDeclaredConstructor();
+                final Constructor<?> constructor = impl.getDeclaredConstructor();
                 constructor.setAccessible(true);
-                ServerResource resource = (ServerResource) constructor
-                        .newInstance();
+                ServerResource resource = (ServerResource)constructor.newInstance();
                 launchAgent(getNextAgentId(), resource);
             } catch (final ClassNotFoundException e) {
-                throw new ConfigurationException("Resource class not found: "
-                        + name + " due to: " + e.toString());
+                throw new ConfigurationException("Resource class not found: " + name + " due to: " + e.toString());
             } catch (final SecurityException e) {
-                throw new ConfigurationException(
-                        "Security excetion when loading resource: " + name
-                        + " due to: " + e.toString());
+                throw new ConfigurationException("Security excetion when loading resource: " + name + " due to: " + e.toString());
             } catch (final NoSuchMethodException e) {
-                throw new ConfigurationException(
-                        "Method not found excetion when loading resource: "
-                                + name + " due to: " + e.toString());
+                throw new ConfigurationException("Method not found excetion when loading resource: " + name + " due to: " + e.toString());
             } catch (final IllegalArgumentException e) {
-                throw new ConfigurationException(
-                        "Illegal argument excetion when loading resource: "
-                                + name + " due to: " + e.toString());
+                throw new ConfigurationException("Illegal argument excetion when loading resource: " + name + " due to: " + e.toString());
             } catch (final InstantiationException e) {
-                throw new ConfigurationException(
-                        "Instantiation excetion when loading resource: " + name
-                        + " due to: " + e.toString());
+                throw new ConfigurationException("Instantiation excetion when loading resource: " + name + " due to: " + e.toString());
             } catch (final IllegalAccessException e) {
-                throw new ConfigurationException(
-                        "Illegal access exception when loading resource: "
-                                + name + " due to: " + e.toString());
+                throw new ConfigurationException("Illegal access exception when loading resource: " + name + " due to: " + e.toString());
             } catch (final InvocationTargetException e) {
-                throw new ConfigurationException(
-                        "Invocation target exception when loading resource: "
-                                + name + " due to: " + e.toString());
+                throw new ConfigurationException("Invocation target exception when loading resource: " + name + " due to: " + e.toString());
             }
         }
     }
@@ -410,14 +385,12 @@ public class AgentShell implements IAgentShell, Daemon {
         String typeInfo = getProperty(null, "type");
         if (typeInfo == null) {
             s_logger.error("Unable to retrieve the type");
-            throw new ConfigurationException(
-                    "Unable to retrieve the type of this agent.");
+            throw new ConfigurationException("Unable to retrieve the type of this agent.");
         }
         s_logger.trace("Launching agent based on type=" + typeInfo);
     }
 
-    private void launchAgent(int localAgentId, ServerResource resource)
-            throws ConfigurationException {
+    private void launchAgent(int localAgentId, ServerResource resource) throws ConfigurationException {
         // we don't track agent after it is launched for now
         Agent agent = new Agent(this, localAgentId, resource);
         _agents.add(agent);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
index 0c100b3..f37dbf3 100755
--- a/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
+++ b/agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java
@@ -37,10 +37,9 @@ import com.cloud.utils.PropertiesUtil;
  * @config {@table || Param Name | Description | Values | Default || || path |
  *         path to the properties _file | String | db/db.properties || * }
  **/
-@Local(value = { StorageComponent.class })
+@Local(value = {StorageComponent.class})
 public class PropertiesStorage implements StorageComponent {
-    private static final Logger s_logger = Logger
-            .getLogger(PropertiesStorage.class);
+    private static final Logger s_logger = Logger.getLogger(PropertiesStorage.class);
     Properties _properties = new Properties();
     File _file;
     String _name;
@@ -69,7 +68,7 @@ public class PropertiesStorage implements StorageComponent {
     @Override
     public boolean configure(String name, Map<String, Object> params) {
         _name = name;
-        String path = (String) params.get("path");
+        String path = (String)params.get("path");
         if (path == null) {
             path = "agent.properties";
         }
@@ -79,13 +78,11 @@ public class PropertiesStorage implements StorageComponent {
             file = new File(path);
             try {
                 if (!file.createNewFile()) {
-                    s_logger.error("Unable to create _file: "
-                            + file.getAbsolutePath());
+                    s_logger.error("Unable to create _file: " + file.getAbsolutePath());
                     return false;
                 }
             } catch (IOException e) {
-                s_logger.error(
-                        "Unable to create _file: " + file.getAbsolutePath(), e);
+                s_logger.error("Unable to create _file: " + file.getAbsolutePath(), e);
                 return false;
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
index 94aa274..9d4cda6 100644
--- a/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
+++ b/agent/src/com/cloud/agent/dhcp/DhcpProtocolParserServer.java
@@ -31,25 +31,21 @@ import org.apache.log4j.Logger;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 
 public class DhcpProtocolParserServer extends Thread {
-    private static final Logger s_logger = Logger
-            .getLogger(DhcpProtocolParserServer.class);;
+    private static final Logger s_logger = Logger.getLogger(DhcpProtocolParserServer.class);;
     protected ExecutorService _executor;
     private int dhcpServerPort = 67;
     private int bufferSize = 300;
     protected boolean _running = false;
 
     public DhcpProtocolParserServer(int workers) {
-        _executor = new ThreadPoolExecutor(workers, 10 * workers, 1,
-                TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(),
-                new NamedThreadFactory("DhcpListener"));
+        _executor = new ThreadPoolExecutor(workers, 10 * workers, 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory("DhcpListener"));
         _running = true;
     }
 
     public void run() {
         while (_running) {
             try {
-                DatagramSocket dhcpSocket = new DatagramSocket(dhcpServerPort,
-                        InetAddress.getByAddress(new byte[] { 0, 0, 0, 0 }));
+                DatagramSocket dhcpSocket = new DatagramSocket(dhcpServerPort, InetAddress.getByAddress(new byte[] {0, 0, 0, 0}));
                 dhcpSocket.setBroadcast(true);
 
                 while (true) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
index 432caa6..8509b43 100644
--- a/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
+++ b/agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java
@@ -32,18 +32,16 @@ import org.apache.log4j.Logger;
 import com.cloud.utils.Pair;
 import com.cloud.utils.net.NetUtils;
 
-@Local(value = { DhcpSnooper.class })
+@Local(value = {DhcpSnooper.class})
 public class FakeDhcpSnooper implements DhcpSnooper {
-    private static final Logger s_logger = Logger
-            .getLogger(FakeDhcpSnooper.class);
+    private static final Logger s_logger = Logger.getLogger(FakeDhcpSnooper.class);
     private Queue<String> _ipAddresses = new ConcurrentLinkedQueue<String>();
     private Map<String, String> _macIpMap = new ConcurrentHashMap<String, String>();
     private Map<String, InetAddress> _vmIpMap = new ConcurrentHashMap<String, InetAddress>();
 
     @Override
-    public boolean configure(String name, Map<String, Object> params)
-            throws ConfigurationException {
-        String guestIpRange = (String) params.get("guest.ip.range");
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        String guestIpRange = (String)params.get("guest.ip.range");
         if (guestIpRange != null) {
             String[] guestIps = guestIpRange.split("-");
             if (guestIps.length == 2) {
@@ -78,8 +76,7 @@ public class FakeDhcpSnooper implements DhcpSnooper {
             InetAddress inetAddr = InetAddress.getByName(ipAddr);
             _macIpMap.put(macAddr.toLowerCase(), ipAddr);
             _vmIpMap.put(vmName, inetAddr);
-            s_logger.info("Got ip address " + ipAddr + " for vm " + vmName
-                    + " mac=" + macAddr.toLowerCase());
+            s_logger.info("Got ip address " + ipAddr + " for vm " + vmName + " mac=" + macAddr.toLowerCase());
             return inetAddr;
         } catch (UnknownHostException e) {
             s_logger.warn("Failed to get InetAddress for " + ipAddr);
@@ -103,8 +100,7 @@ public class FakeDhcpSnooper implements DhcpSnooper {
             }
             ipAddr = _macIpMap.remove(macAddr);
 
-            s_logger.info("Cleaning up for mac address: " + macAddr + " ip="
-                    + ipAddr + " inetAddr=" + inetAddr);
+            s_logger.info("Cleaning up for mac address: " + macAddr + " ip=" + ipAddr + " inetAddr=" + inetAddr);
             if (ipAddr != null) {
                 _ipAddresses.offer(ipAddr);
             }
@@ -134,34 +130,34 @@ public class FakeDhcpSnooper implements DhcpSnooper {
         return null;
     }
 
-	@Override
-	public void setName(String name) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void setConfigParams(Map<String, Object> params) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public Map<String, Object> getConfigParams() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getRunLevel() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public void setRunLevel(int level) {
-		// TODO Auto-generated method stub
-		
-	}
+    @Override
+    public void setName(String name) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void setConfigParams(Map<String, Object> params) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public Map<String, Object> getConfigParams() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public int getRunLevel() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    @Override
+    public void setRunLevel(int level) {
+        // TODO Auto-generated method stub
+
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/mockvm/MockVm.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/mockvm/MockVm.java b/agent/src/com/cloud/agent/mockvm/MockVm.java
index 8a806ee..00d6725 100644
--- a/agent/src/com/cloud/agent/mockvm/MockVm.java
+++ b/agent/src/com/cloud/agent/mockvm/MockVm.java
@@ -28,13 +28,12 @@ public class MockVm {
     private int cpuCount;
     private int utilization; // in percentage
     private int vncPort; // 0-based allocation, real port number needs to be
-                            // applied with base
+                         // applied with base
 
     public MockVm() {
     }
 
-    public MockVm(String vmName, State state, long ramSize, int cpuCount,
-            int utilization, int vncPort) {
+    public MockVm(String vmName, State state, long ramSize, int cpuCount, int utilization, int vncPort) {
         this.vmName = vmName;
         this.state = state;
         this.ramSize = ramSize;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
index c89a135..ff0d41e 100644
--- a/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
+++ b/agent/src/com/cloud/agent/mockvm/MockVmMgr.java
@@ -53,22 +53,15 @@ public class MockVmMgr implements VmMgr {
     }
 
     @Override
-    public String startVM(String vmName, String vnetId, String gateway,
-            String dns, String privateIP, String privateMac,
-            String privateMask, String publicIP, String publicMac,
-            String publicMask, int cpuCount, int cpuUtilization, long ramSize,
-            String localPath, String vncPassword) {
+    public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP, String publicMac,
+        String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword) {
 
         if (s_logger.isInfoEnabled()) {
             StringBuffer sb = new StringBuffer();
-            sb.append("Start VM. name: " + vmName + ", vnet: " + vnetId
-                    + ", dns: " + dns);
-            sb.append(", privateIP: " + privateIP + ", privateMac: "
-                    + privateMac + ", privateMask: " + privateMask);
-            sb.append(", publicIP: " + publicIP + ", publicMac: " + publicMac
-                    + ", publicMask: " + publicMask);
-            sb.append(", cpu count: " + cpuCount + ", cpuUtilization: "
-                    + cpuUtilization + ", ram : " + ramSize);
+            sb.append("Start VM. name: " + vmName + ", vnet: " + vnetId + ", dns: " + dns);
+            sb.append(", privateIP: " + privateIP + ", privateMac: " + privateMac + ", privateMask: " + privateMask);
+            sb.append(", publicIP: " + publicIP + ", publicMac: " + publicMac + ", publicMask: " + publicMask);
+            sb.append(", cpu count: " + cpuCount + ", cpuUtilization: " + cpuUtilization + ", ram : " + ramSize);
             sb.append(", localPath: " + localPath);
             s_logger.info(sb.toString());
         }
@@ -83,8 +76,7 @@ public class MockVmMgr implements VmMgr {
                 if (vncPort < 0)
                     return "Unable to allocate VNC port";
 
-                vm = new MockVm(vmName, State.Running, ramSize, cpuCount,
-                        cpuUtilization, vncPort);
+                vm = new MockVm(vmName, State.Running, ramSize, cpuCount, cpuUtilization, vncPort);
                 vms.put(vmName, vm);
             }
         }
@@ -272,12 +264,10 @@ public class MockVmMgr implements VmMgr {
                 int vncPort = allocVncPort();
                 if (vncPort < 0) {
                     s_logger.debug("Unable to allocate VNC port");
-                    throw new CloudRuntimeException(
-                            "Unable to allocate vnc port");
+                    throw new CloudRuntimeException("Unable to allocate vnc port");
                 }
 
-                vm = new MockVm(vmName, State.Running, ramSize,
-                        vmSpec.getCpus(), utilizationPercent, vncPort);
+                vm = new MockVm(vmName, State.Running, ramSize, vmSpec.getCpus(), utilizationPercent, vncPort);
                 vms.put(vmName, vm);
             }
         }
@@ -302,7 +292,7 @@ public class MockVmMgr implements VmMgr {
     }
 
     protected Long getConfiguredProperty(String key, Long defaultValue) {
-        String val = (String) _params.get(key);
+        String val = (String)_params.get(key);
 
         if (val != null) {
             Long result = Long.parseLong(val);
@@ -312,7 +302,7 @@ public class MockVmMgr implements VmMgr {
     }
 
     protected Integer getConfiguredProperty(String key, Integer defaultValue) {
-        String val = (String) _params.get(key);
+        String val = (String)_params.get(key);
 
         if (val != null) {
             Integer result = Integer.parseInt(val);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/mockvm/VmMgr.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/mockvm/VmMgr.java b/agent/src/com/cloud/agent/mockvm/VmMgr.java
index 1a7050c..95786aa 100644
--- a/agent/src/com/cloud/agent/mockvm/VmMgr.java
+++ b/agent/src/com/cloud/agent/mockvm/VmMgr.java
@@ -25,11 +25,8 @@ import com.cloud.vm.VirtualMachine.State;
 public interface VmMgr {
     public Set<String> getCurrentVMs();
 
-    public String startVM(String vmName, String vnetId, String gateway,
-            String dns, String privateIP, String privateMac,
-            String privateMask, String publicIP, String publicMac,
-            String publicMask, int cpuCount, int cpuUtilization, long ramSize,
-            String localPath, String vncPassword);
+    public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP, String publicMac,
+        String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword);
 
     public String stopVM(String vmName, boolean force);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/resource/DummyResource.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/resource/DummyResource.java b/agent/src/com/cloud/agent/resource/DummyResource.java
index 4918207..a316964 100755
--- a/agent/src/com/cloud/agent/resource/DummyResource.java
+++ b/agent/src/com/cloud/agent/resource/DummyResource.java
@@ -43,7 +43,7 @@ import com.cloud.resource.ServerResource;
 import com.cloud.storage.Storage;
 import com.cloud.storage.Storage.StoragePoolType;
 
-@Local(value = { ServerResource.class })
+@Local(value = {ServerResource.class})
 public class DummyResource implements ServerResource {
     String _name;
     Host.Type _type;
@@ -58,7 +58,7 @@ public class DummyResource implements ServerResource {
     @Override
     public Answer executeRequest(Command cmd) {
         if (cmd instanceof CheckNetworkCommand) {
-            return new CheckNetworkAnswer((CheckNetworkCommand) cmd, true, null);
+            return new CheckNetworkAnswer((CheckNetworkCommand)cmd, true, null);
         }
         System.out.println("Received Command: " + cmd.toString());
         Answer answer = new Answer(cmd, !_negative, "response");
@@ -77,12 +77,12 @@ public class DummyResource implements ServerResource {
     }
 
     protected String getConfiguredProperty(String key, String defaultValue) {
-        String val = (String) _params.get(key);
+        String val = (String)_params.get(key);
         return val == null ? defaultValue : val;
     }
 
     protected Long getConfiguredProperty(String key, Long defaultValue) {
-        String val = (String) _params.get(key);
+        String val = (String)_params.get(key);
 
         if (val != null) {
             Long result = Long.parseLong(val);
@@ -99,7 +99,7 @@ public class DummyResource implements ServerResource {
         long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L);
 
         String cap = getConfiguredProperty("capabilities", "hvm");
-        info.add((int) cpus);
+        info.add((int)cpus);
         info.add(speed);
         info.add(ram);
         info.add(cap);
@@ -110,53 +110,38 @@ public class DummyResource implements ServerResource {
 
     protected void fillNetworkInformation(final StartupCommand cmd) {
 
-        cmd.setPrivateIpAddress((String) getConfiguredProperty(
-                "private.ip.address", "127.0.0.1"));
-        cmd.setPrivateMacAddress((String) getConfiguredProperty(
-                "private.mac.address", "8A:D2:54:3F:7C:C3"));
-        cmd.setPrivateNetmask((String) getConfiguredProperty(
-                "private.ip.netmask", "255.255.255.0"));
-
-        cmd.setStorageIpAddress((String) getConfiguredProperty(
-                "private.ip.address", "127.0.0.1"));
-        cmd.setStorageMacAddress((String) getConfiguredProperty(
-                "private.mac.address", "8A:D2:54:3F:7C:C3"));
-        cmd.setStorageNetmask((String) getConfiguredProperty(
-                "private.ip.netmask", "255.255.255.0"));
-        cmd.setGatewayIpAddress((String) getConfiguredProperty(
-                "gateway.ip.address", "127.0.0.1"));
+        cmd.setPrivateIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1"));
+        cmd.setPrivateMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
+        cmd.setPrivateNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
+
+        cmd.setStorageIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1"));
+        cmd.setStorageMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
+        cmd.setStorageNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
+        cmd.setGatewayIpAddress((String)getConfiguredProperty("gateway.ip.address", "127.0.0.1"));
 
     }
 
     private Map<String, String> getVersionStrings() {
         Map<String, String> result = new HashMap<String, String>();
-        String hostOs = (String) _params.get("Host.OS");
-        String hostOsVer = (String) _params.get("Host.OS.Version");
-        String hostOsKernVer = (String) _params.get("Host.OS.Kernel.Version");
+        String hostOs = (String)_params.get("Host.OS");
+        String hostOsVer = (String)_params.get("Host.OS.Version");
+        String hostOsKernVer = (String)_params.get("Host.OS.Kernel.Version");
         result.put("Host.OS", hostOs == null ? "Fedora" : hostOs);
         result.put("Host.OS.Version", hostOsVer == null ? "14" : hostOsVer);
-        result.put("Host.OS.Kernel.Version",
-                hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64"
-                        : hostOsKernVer);
+        result.put("Host.OS.Kernel.Version", hostOsKernVer == null ? "2.6.35.6-45.fc14.x86_64" : hostOsKernVer);
         return result;
     }
 
     protected StoragePoolInfo initializeLocalStorage() {
-        String hostIp = (String) getConfiguredProperty("private.ip.address",
-                "127.0.0.1");
-        String localStoragePath = (String) getConfiguredProperty(
-                "local.storage.path", "/mnt");
+        String hostIp = (String)getConfiguredProperty("private.ip.address", "127.0.0.1");
+        String localStoragePath = (String)getConfiguredProperty("local.storage.path", "/mnt");
         String lh = hostIp + localStoragePath;
         String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString();
 
-        String capacity = (String) getConfiguredProperty(
-                "local.storage.capacity", "1000000000");
-        String available = (String) getConfiguredProperty(
-                "local.storage.avail", "10000000");
+        String capacity = (String)getConfiguredProperty("local.storage.capacity", "1000000000");
+        String available = (String)getConfiguredProperty("local.storage.avail", "10000000");
 
-        return new StoragePoolInfo(uuid, hostIp, localStoragePath,
-                localStoragePath, StoragePoolType.Filesystem,
-                Long.parseLong(capacity), Long.parseLong(available));
+        return new StoragePoolInfo(uuid, hostIp, localStoragePath, localStoragePath, StoragePoolType.Filesystem, Long.parseLong(capacity), Long.parseLong(available));
 
     }
 
@@ -166,10 +151,8 @@ public class DummyResource implements ServerResource {
 
         final List<Object> info = getHostInfo();
 
-        final StartupRoutingCommand cmd = new StartupRoutingCommand(
-                (Integer) info.get(0), (Long) info.get(1), (Long) info.get(2),
-                (Long) info.get(4), (String) info.get(3), HypervisorType.KVM,
-                RouterPrivateIpStrategy.HostLocal, changes, null);
+        final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3),
+            HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal, changes, null);
         fillNetworkInformation(cmd);
         cmd.getHostDetails().putAll(getVersionStrings());
         cmd.setCluster(getConfiguredProperty("cluster", "1"));
@@ -177,20 +160,20 @@ public class DummyResource implements ServerResource {
         StartupStorageCommand sscmd = new StartupStorageCommand();
         sscmd.setPoolInfo(pi);
         sscmd.setGuid(pi.getUuid());
-        sscmd.setDataCenter((String) _params.get("zone"));
+        sscmd.setDataCenter((String)_params.get("zone"));
         sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
 
-        return new StartupCommand[] { cmd, sscmd };
+        return new StartupCommand[] {cmd, sscmd};
     }
 
     @Override
     public boolean configure(String name, Map<String, Object> params) {
         _name = name;
 
-        String value = (String) params.get("type");
+        String value = (String)params.get("type");
         _type = Host.Type.valueOf(value);
 
-        value = (String) params.get("negative.reply");
+        value = (String)params.get("negative.reply");
         _negative = Boolean.parseBoolean(value);
         setParams(params);
         return true;
@@ -225,33 +208,33 @@ public class DummyResource implements ServerResource {
         _agentControl = agentControl;
     }
 
-	@Override
-	public void setName(String name) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void setConfigParams(Map<String, Object> params) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public Map<String, Object> getConfigParams() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getRunLevel() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public void setRunLevel(int level) {
-		// TODO Auto-generated method stub
-		
-	}
+    @Override
+    public void setName(String name) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void setConfigParams(Map<String, Object> params) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public Map<String, Object> getConfigParams() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public int getRunLevel() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    @Override
+    public void setRunLevel(int level) {
+        // TODO Auto-generated method stub
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java
index 0b9f797..130b104 100644
--- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java
+++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyAuthenticationResult.java
@@ -23,7 +23,7 @@ public class ConsoleProxyAuthenticationResult {
     private int port;
     private String tunnelUrl;
     private String tunnelSession;
-    
+
     public ConsoleProxyAuthenticationResult() {
         success = false;
         isReauthentication = false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
index 054acd1..06df4da 100644
--- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
+++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
@@ -81,8 +81,7 @@ import com.cloud.utils.script.Script;
  * server.
  * 
  */
-public class ConsoleProxyResource extends ServerResourceBase implements
-        ServerResource {
+public class ConsoleProxyResource extends ServerResourceBase implements ServerResource {
     static final Logger s_logger = Logger.getLogger(ConsoleProxyResource.class);
 
     private final Properties _properties = new Properties();
@@ -99,31 +98,30 @@ public class ConsoleProxyResource extends ServerResourceBase implements
     @Override
     public Answer executeRequest(final Command cmd) {
         if (cmd instanceof CheckConsoleProxyLoadCommand) {
-            return execute((CheckConsoleProxyLoadCommand) cmd);
+            return execute((CheckConsoleProxyLoadCommand)cmd);
         } else if (cmd instanceof WatchConsoleProxyLoadCommand) {
-            return execute((WatchConsoleProxyLoadCommand) cmd);
+            return execute((WatchConsoleProxyLoadCommand)cmd);
         } else if (cmd instanceof ReadyCommand) {
             s_logger.info("Receive ReadyCommand, response with ReadyAnswer");
-            return new ReadyAnswer((ReadyCommand) cmd);
+            return new ReadyAnswer((ReadyCommand)cmd);
         } else if (cmd instanceof CheckHealthCommand) {
-            return new CheckHealthAnswer((CheckHealthCommand) cmd, true);
+            return new CheckHealthAnswer((CheckHealthCommand)cmd, true);
         } else if (cmd instanceof StartConsoleProxyAgentHttpHandlerCommand) {
-            return execute((StartConsoleProxyAgentHttpHandlerCommand) cmd);
+            return execute((StartConsoleProxyAgentHttpHandlerCommand)cmd);
         } else {
             return Answer.createUnsupportedCommandAnswer(cmd);
         }
     }
 
     private Answer execute(StartConsoleProxyAgentHttpHandlerCommand cmd) {
-    	s_logger.info("Invoke launchConsoleProxy() in responding to StartConsoleProxyAgentHttpHandlerCommand");
+        s_logger.info("Invoke launchConsoleProxy() in responding to StartConsoleProxyAgentHttpHandlerCommand");
         launchConsoleProxy(cmd.getKeystoreBits(), cmd.getKeystorePassword(), cmd.getEncryptorPassword());
         return new Answer(cmd);
     }
 
     private void disableRpFilter() {
         try {
-            FileWriter fstream = new FileWriter(
-                    "/proc/sys/net/ipv4/conf/eth2/rp_filter");
+            FileWriter fstream = new FileWriter("/proc/sys/net/ipv4/conf/eth2/rp_filter");
             BufferedWriter out = new BufferedWriter(fstream);
             out.write("0");
             out.close();
@@ -133,25 +131,18 @@ public class ConsoleProxyResource extends ServerResourceBase implements
     }
 
     protected Answer execute(final CheckConsoleProxyLoadCommand cmd) {
-        return executeProxyLoadScan(cmd, cmd.getProxyVmId(),
-                cmd.getProxyVmName(), cmd.getProxyManagementIp(),
-                cmd.getProxyCmdPort());
+        return executeProxyLoadScan(cmd, cmd.getProxyVmId(), cmd.getProxyVmName(), cmd.getProxyManagementIp(), cmd.getProxyCmdPort());
     }
 
     protected Answer execute(final WatchConsoleProxyLoadCommand cmd) {
-        return executeProxyLoadScan(cmd, cmd.getProxyVmId(),
-                cmd.getProxyVmName(), cmd.getProxyManagementIp(),
-                cmd.getProxyCmdPort());
+        return executeProxyLoadScan(cmd, cmd.getProxyVmId(), cmd.getProxyVmName(), cmd.getProxyManagementIp(), cmd.getProxyCmdPort());
     }
 
-    private Answer executeProxyLoadScan(final Command cmd,
-            final long proxyVmId, final String proxyVmName,
-            final String proxyManagementIp, final int cmdPort) {
+    private Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, final String proxyVmName, final String proxyManagementIp, final int cmdPort) {
         String result = null;
 
         final StringBuffer sb = new StringBuffer();
-        sb.append("http://").append(proxyManagementIp).append(":" + cmdPort)
-                .append("/cmd/getstatus");
+        sb.append("http://").append(proxyManagementIp).append(":" + cmdPort).append("/cmd/getstatus");
 
         boolean success = true;
         try {
@@ -159,8 +150,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements
             final URLConnection conn = url.openConnection();
 
             final InputStream is = conn.getInputStream();
-            final BufferedReader reader = new BufferedReader(
-                    new InputStreamReader(is));
+            final BufferedReader reader = new BufferedReader(new InputStreamReader(is));
             final StringBuilder sb2 = new StringBuilder();
             String line = null;
             try {
@@ -173,19 +163,16 @@ public class ConsoleProxyResource extends ServerResourceBase implements
                 try {
                     is.close();
                 } catch (final IOException e) {
-                    s_logger.warn("Exception when closing , console proxy address : "
-                            + proxyManagementIp);
+                    s_logger.warn("Exception when closing , console proxy address : " + proxyManagementIp);
                     success = false;
                 }
             }
         } catch (final IOException e) {
-            s_logger.warn("Unable to open console proxy command port url, console proxy address : "
-                    + proxyManagementIp);
+            s_logger.warn("Unable to open console proxy command port url, console proxy address : " + proxyManagementIp);
             success = false;
         }
 
-        return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success,
-                result);
+        return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, result);
     }
 
     @Override
@@ -206,7 +193,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements
         cmd.setProxyVmId(_proxyVmId);
         if (_pubIp != null)
             cmd.setPublicIpAddress(_pubIp);
-        return new StartupCommand[] { cmd };
+        return new StartupCommand[] {cmd};
     }
 
     @Override
@@ -219,18 +206,17 @@ public class ConsoleProxyResource extends ServerResourceBase implements
     }
 
     @Override
-    public boolean configure(String name, Map<String, Object> params)
-            throws ConfigurationException {
-        _localgw = (String) params.get("localgw");
-        _eth1mask = (String) params.get("eth1mask");
-        _eth1ip = (String) params.get("eth1ip");
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        _localgw = (String)params.get("localgw");
+        _eth1mask = (String)params.get("eth1mask");
+        _eth1ip = (String)params.get("eth1ip");
         if (_eth1ip != null) {
             params.put("private.network.device", "eth1");
         } else {
             s_logger.info("eth1ip parameter has not been configured, assuming that we are not inside a system vm");
         }
 
-        String eth2ip = (String) params.get("eth2ip");
+        String eth2ip = (String)params.get("eth2ip");
         if (eth2ip != null) {
             params.put("public.network.device", "eth2");
         } else {
@@ -243,84 +229,69 @@ public class ConsoleProxyResource extends ServerResourceBase implements
             _properties.put(entry.getKey(), entry.getValue());
         }
 
-        String value = (String) params.get("premium");
+        String value = (String)params.get("premium");
         if (value != null && value.equals("premium"))
             _proxyPort = 443;
         else {
-            value = (String) params.get("consoleproxy.httpListenPort");
+            value = (String)params.get("consoleproxy.httpListenPort");
             _proxyPort = NumbersUtil.parseInt(value, 80);
         }
 
-        value = (String) params.get("proxy_vm");
+        value = (String)params.get("proxy_vm");
         _proxyVmId = NumbersUtil.parseLong(value, 0);
 
         if (_localgw != null) {
-            String mgmtHost = (String) params.get("host");
+            String mgmtHost = (String)params.get("host");
             addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
 
-            String internalDns1 = (String) params.get("internaldns1");
+            String internalDns1 = (String)params.get("internaldns1");
             if (internalDns1 == null) {
                 s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
             } else {
-                addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask,
-                        internalDns1);
+                addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
             }
 
-            String internalDns2 = (String) params.get("internaldns2");
+            String internalDns2 = (String)params.get("internaldns2");
             if (internalDns2 != null) {
-                addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask,
-                        internalDns2);
+                addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
             }
         }
 
-        _pubIp = (String) params.get("public.ip");
+        _pubIp = (String)params.get("public.ip");
 
-        value = (String) params.get("disable_rp_filter");
+        value = (String)params.get("disable_rp_filter");
         if (value != null && value.equalsIgnoreCase("true")) {
             disableRpFilter();
         }
 
         if (s_logger.isInfoEnabled())
-            s_logger.info("Receive proxyVmId in ConsoleProxyResource configuration as "
-                    + _proxyVmId);
+            s_logger.info("Receive proxyVmId in ConsoleProxyResource configuration as " + _proxyVmId);
 
         return true;
     }
 
-    private void addRouteToInternalIpOrCidr(String localgw, String eth1ip,
-            String eth1mask, String destIpOrCidr) {
-        s_logger.debug("addRouteToInternalIp: localgw=" + localgw + ", eth1ip="
-                + eth1ip + ", eth1mask=" + eth1mask + ",destIp=" + destIpOrCidr);
+    private void addRouteToInternalIpOrCidr(String localgw, String eth1ip, String eth1mask, String destIpOrCidr) {
+        s_logger.debug("addRouteToInternalIp: localgw=" + localgw + ", eth1ip=" + eth1ip + ", eth1mask=" + eth1mask + ",destIp=" + destIpOrCidr);
         if (destIpOrCidr == null) {
             s_logger.debug("addRouteToInternalIp: destIp is null");
             return;
         }
-        if (!NetUtils.isValidIp(destIpOrCidr)
-                && !NetUtils.isValidCIDR(destIpOrCidr)) {
-            s_logger.warn(" destIp is not a valid ip address or cidr destIp="
-                    + destIpOrCidr);
+        if (!NetUtils.isValidIp(destIpOrCidr) && !NetUtils.isValidCIDR(destIpOrCidr)) {
+            s_logger.warn(" destIp is not a valid ip address or cidr destIp=" + destIpOrCidr);
             return;
         }
         boolean inSameSubnet = false;
         if (NetUtils.isValidIp(destIpOrCidr)) {
             if (eth1ip != null && eth1mask != null) {
-                inSameSubnet = NetUtils.sameSubnet(eth1ip, destIpOrCidr,
-                        eth1mask);
+                inSameSubnet = NetUtils.sameSubnet(eth1ip, destIpOrCidr, eth1mask);
             } else {
-                s_logger.warn("addRouteToInternalIp: unable to determine same subnet: _eth1ip="
-                        + eth1ip
-                        + ", dest ip="
-                        + destIpOrCidr
-                        + ", _eth1mask="
-                        + eth1mask);
+                s_logger.warn("addRouteToInternalIp: unable to determine same subnet: _eth1ip=" + eth1ip + ", dest ip=" + destIpOrCidr + ", _eth1mask=" + eth1mask);
             }
         } else {
-            inSameSubnet = NetUtils.isNetworkAWithinNetworkB(destIpOrCidr,
-                    NetUtils.ipAndNetMaskToCidr(eth1ip, eth1mask));
+            inSameSubnet = NetUtils.isNetworkAWithinNetworkB(destIpOrCidr, NetUtils.ipAndNetMaskToCidr(eth1ip, eth1mask));
         }
         if (inSameSubnet) {
-            s_logger.debug("addRouteToInternalIp: dest ip " + destIpOrCidr
-                    + " is in the same subnet as eth1 ip " + eth1ip);
+            s_logger.debug("addRouteToInternalIp: dest ip " + destIpOrCidr + " is in the same subnet as eth1 ip " + eth1ip);
             return;
         }
         Script command = new Script("/bin/bash", s_logger);
@@ -332,11 +303,9 @@ public class ConsoleProxyResource extends ServerResourceBase implements
         command.add("ip route add " + destIpOrCidr + " via " + localgw);
         String result = command.execute();
         if (result != null) {
-            s_logger.warn("Error in configuring route to internal ip err="
-                    + result);
+            s_logger.warn("Error in configuring route to internal ip err=" + result);
         } else {
-            s_logger.debug("addRouteToInternalIp: added route to internal ip="
-                    + destIpOrCidr + " via " + localgw);
+            s_logger.debug("addRouteToInternalIp: added route to internal ip=" + destIpOrCidr + " via " + localgw);
         }
     }
 
@@ -354,17 +323,13 @@ public class ConsoleProxyResource extends ServerResourceBase implements
                     try {
                         Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
                         try {
-                        	s_logger.info("Invoke setEncryptorPassword(), ecnryptorPassword: " + encryptorPassword);
-                            Method methodSetup = consoleProxyClazz.getMethod(
-                                    "setEncryptorPassword", String.class);
+                            s_logger.info("Invoke setEncryptorPassword(), ecnryptorPassword: " + encryptorPassword);
+                            Method methodSetup = consoleProxyClazz.getMethod("setEncryptorPassword", String.class);
                             methodSetup.invoke(null, encryptorPassword);
-                            
-                        	s_logger.info("Invoke startWithContext()");
-                            Method method = consoleProxyClazz.getMethod(
-                                    "startWithContext", Properties.class,
-                                    Object.class, byte[].class, String.class);
-                            method.invoke(null, _properties, resource, ksBits,
-                                    ksPassword);
+
+                            s_logger.info("Invoke startWithContext()");
+                            Method method = consoleProxyClazz.getMethod("startWithContext", Properties.class, Object.class, byte[].class, String.class);
+                            method.invoke(null, _properties, resource, ksBits, ksPassword);
                         } catch (SecurityException e) {
                             s_logger.error("Unable to launch console proxy due to SecurityException", e);
                             System.exit(ExitStatus.Error.value());
@@ -391,7 +356,7 @@ public class ConsoleProxyResource extends ServerResourceBase implements
             _consoleProxyMain.start();
         } else {
             s_logger.info("com.cloud.consoleproxy.ConsoleProxy is already running");
-            
+
             try {
                 Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
                 Method methodSetup = consoleProxyClazz.getMethod("setEncryptorPassword", String.class);
@@ -418,20 +383,18 @@ public class ConsoleProxyResource extends ServerResourceBase implements
         }
     }
 
-    public String authenticateConsoleAccess(String host, String port,
-        String vmId, String sid, String ticket, Boolean isReauthentication) {
-        
-        ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand(
-                host, port, vmId, sid, ticket);
+    public String authenticateConsoleAccess(String host, String port, String vmId, String sid, String ticket, Boolean isReauthentication) {
+
+        ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand(host, port, vmId, sid, ticket);
         cmd.setReauthenticating(isReauthentication);
-        
+
         ConsoleProxyAuthenticationResult result = new ConsoleProxyAuthenticationResult();
         result.setSuccess(false);
         result.setReauthentication(isReauthentication);
 
         try {
             AgentControlAnswer answer = getAgentControl().sendRequest(cmd, 10000);
-            
+
             if (answer != null) {
                 ConsoleAccessAuthenticationAnswer authAnswer = (ConsoleAccessAuthenticationAnswer)answer;
                 result.setSuccess(authAnswer.succeeded());
@@ -443,68 +406,60 @@ public class ConsoleProxyResource extends ServerResourceBase implements
                 s_logger.error("Authentication failed for vm: " + vmId + " with sid: " + sid);
             }
         } catch (AgentControlChannelException e) {
-            s_logger.error("Unable to send out console access authentication request due to "
-                + e.getMessage(), e);
+            s_logger.error("Unable to send out console access authentication request due to " + e.getMessage(), e);
         }
 
         return new Gson().toJson(result);
     }
 
     public void reportLoadInfo(String gsonLoadInfo) {
-        ConsoleProxyLoadReportCommand cmd = new ConsoleProxyLoadReportCommand(
-                _proxyVmId, gsonLoadInfo);
+        ConsoleProxyLoadReportCommand cmd = new ConsoleProxyLoadReportCommand(_proxyVmId, gsonLoadInfo);
         try {
             getAgentControl().postRequest(cmd);
 
             if (s_logger.isDebugEnabled())
-                s_logger.debug("Report proxy load info, proxy : " + _proxyVmId
-                        + ", load: " + gsonLoadInfo);
+                s_logger.debug("Report proxy load info, proxy : " + _proxyVmId + ", load: " + gsonLoadInfo);
         } catch (AgentControlChannelException e) {
-            s_logger.error(
-                    "Unable to send out load info due to " + e.getMessage(), e);
+            s_logger.error("Unable to send out load info due to " + e.getMessage(), e);
         }
     }
 
     public void ensureRoute(String address) {
         if (_localgw != null) {
             if (s_logger.isDebugEnabled())
-                s_logger.debug("Ensure route for " + address + " via "
-                        + _localgw);
+                s_logger.debug("Ensure route for " + address + " via " + _localgw);
 
             // this method won't be called in high frequency, serialize access
             // to script execution
             synchronized (this) {
                 try {
-                    addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask,
-                            address);
+                    addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, address);
                 } catch (Throwable e) {
-                    s_logger.warn(
-                            "Unexpected exception while adding internal route to "
-                                    + address, e);
+                    s_logger.warn("Unexpected exception while adding internal route to " + address, e);
                 }
             }
         }
     }
 
-	@Override
-	public void setName(String name) {
-	}
+    @Override
+    public void setName(String name) {
+    }
 
-	@Override
-	public void setConfigParams(Map<String, Object> params) {
-	}
+    @Override
+    public void setConfigParams(Map<String, Object> params) {
+    }
 
-	@Override
-	public Map<String, Object> getConfigParams() {
-		return new HashMap<String, Object>();
-	}
+    @Override
+    public Map<String, Object> getConfigParams() {
+        return new HashMap<String, Object>();
+    }
 
-	@Override
-	public int getRunLevel() {
-		return 0;
-	}
+    @Override
+    public int getRunLevel() {
+        return 0;
+    }
 
-	@Override
-	public void setRunLevel(int level) {
-	}
+    @Override
+    public void setRunLevel(int level) {
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/test/com/cloud/agent/AgentShellTest.java
----------------------------------------------------------------------
diff --git a/agent/test/com/cloud/agent/AgentShellTest.java b/agent/test/com/cloud/agent/AgentShellTest.java
index d92accb..1f60d87 100644
--- a/agent/test/com/cloud/agent/AgentShellTest.java
+++ b/agent/test/com/cloud/agent/AgentShellTest.java
@@ -29,8 +29,7 @@ public class AgentShellTest {
     public void parseCommand() throws ConfigurationException {
         AgentShell shell = new AgentShell();
         UUID anyUuid = UUID.randomUUID();
-        shell.parseCommand(new String[] { "port=55555", "threads=4",
-                "host=localhost", "pod=pod1", "guid=" + anyUuid, "zone=zone1" });
+        shell.parseCommand(new String[] {"port=55555", "threads=4", "host=localhost", "pod=pod1", "guid=" + anyUuid, "zone=zone1"});
         Assert.assertEquals(55555, shell.getPort());
         Assert.assertEquals(4, shell.getWorkers());
         Assert.assertEquals("localhost", shell.getHost());
@@ -38,6 +37,7 @@ public class AgentShellTest {
         Assert.assertEquals("pod1", shell.getPod());
         Assert.assertEquals("zone1", shell.getZone());
     }
+
     @Test
     public void loadProperties() throws ConfigurationException {
         AgentShell shell = new AgentShell();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
----------------------------------------------------------------------
diff --git a/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java b/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
index adaebc6..9a428a8 100644
--- a/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
+++ b/agent/test/com/cloud/agent/dao/impl/PropertiesStorageTest.java
@@ -30,8 +30,7 @@ import org.junit.Test;
 public class PropertiesStorageTest {
     @Test
     public void configureWithNotExistingFile() {
-        String fileName = "target/notyetexistingfile"
-                + System.currentTimeMillis();
+        String fileName = "target/notyetexistingfile" + System.currentTimeMillis();
         File file = new File(fileName);
 
         PropertiesStorage storage = new PropertiesStorage();
@@ -48,8 +47,7 @@ public class PropertiesStorageTest {
 
     @Test
     public void configureWithExistingFile() throws IOException {
-        String fileName = "target/existingfile"
-                + System.currentTimeMillis();
+        String fileName = "target/existingfile" + System.currentTimeMillis();
         File file = new File(fileName);
 
         FileUtils.writeStringToFile(file, "a=b\n\n");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/HostVmStateReportEntry.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/HostVmStateReportEntry.java b/api/src/com/cloud/agent/api/HostVmStateReportEntry.java
index 0b1a01e..f582d90 100644
--- a/api/src/com/cloud/agent/api/HostVmStateReportEntry.java
+++ b/api/src/com/cloud/agent/api/HostVmStateReportEntry.java
@@ -28,31 +28,31 @@ import com.cloud.vm.VirtualMachine.PowerState;
 //
 public class HostVmStateReportEntry {
     VirtualMachine.PowerState state;
-    
+
     // host name or host uuid
     String host;
 
     // XS needs Xen Tools version info
     String hostToolsVersion;
-    
+
     public HostVmStateReportEntry() {
     }
-    
+
     public HostVmStateReportEntry(PowerState state, String host, String hostToolsVersion) {
         this.state = state;
         this.host = host;
         this.hostToolsVersion = hostToolsVersion;
     }
-    
+
     public PowerState getState() {
         return state;
     }
-    
+
     public String getHost() {
         return host;
     }
-    
+
     public String getHostToolsVersion() {
-    	return hostToolsVersion;
+        return hostToolsVersion;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/LogLevel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/LogLevel.java b/api/src/com/cloud/agent/api/LogLevel.java
index 6eeeefb..a8da272 100644
--- a/api/src/com/cloud/agent/api/LogLevel.java
+++ b/api/src/com/cloud/agent/api/LogLevel.java
@@ -28,13 +28,11 @@ import org.apache.log4j.Logger;
 
 /**
  */
-@Target({ TYPE, FIELD })
+@Target({TYPE, FIELD})
 @Retention(RUNTIME)
 public @interface LogLevel {
     public enum Log4jLevel { // Had to do this because Level is not primitive.
-        Off(Level.OFF),
-        Trace(Level.TRACE),
-        Debug(Level.DEBUG);
+        Off(Level.OFF), Trace(Level.TRACE), Debug(Level.DEBUG);
 
         Level _level;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/PvlanSetupCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/PvlanSetupCommand.java b/api/src/com/cloud/agent/api/PvlanSetupCommand.java
index ee1f046..512d1bc 100644
--- a/api/src/com/cloud/agent/api/PvlanSetupCommand.java
+++ b/api/src/com/cloud/agent/api/PvlanSetupCommand.java
@@ -21,101 +21,99 @@ import java.net.URI;
 import com.cloud.utils.net.NetUtils;
 
 public class PvlanSetupCommand extends Command {
-	public enum Type {
-		DHCP,
-		VM
-	}
-	private String op;
-	private String primary;
-	private String isolated;
-	private String vmMac;
-	private String dhcpName;
-	private String dhcpMac;
-	private String dhcpIp;
-	private Type type;
-	private String networkTag;
-
-	protected PvlanSetupCommand() {}
-	
-	protected PvlanSetupCommand(Type type, String op, URI uri, String networkTag)
-	{
-		this.type = type;
-		this.op = op;
-		this.primary = NetUtils.getPrimaryPvlanFromUri(uri);
-		this.isolated = NetUtils.getIsolatedPvlanFromUri(uri);
-		this.networkTag = networkTag;
-	}
-	
-	static public PvlanSetupCommand createDhcpSetup(String op, URI uri, String networkTag, String dhcpName, String dhcpMac, String dhcpIp)
-	{
-		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, uri, networkTag);
-		cmd.setDhcpName(dhcpName);
-		cmd.setDhcpMac(dhcpMac);
-		cmd.setDhcpIp(dhcpIp);
-		return cmd;
-	}
-	
-	static public PvlanSetupCommand createVmSetup(String op, URI uri, String networkTag, String vmMac)
-	{
-		PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, uri, networkTag);
-		cmd.setVmMac(vmMac);
-		return cmd;
-	}
-	
-	@Override
-	public boolean executeInSequence() {
-		return true;
-	}
-
-	public String getOp() {
-		return op;
-	}
-
-	public String getPrimary() {
-		return primary;
-	}
-
-	public String getIsolated() {
-		return isolated;
-	}
-
-	public String getVmMac() {
-		return vmMac;
-	}
-
-	protected void setVmMac(String vmMac) {
-		this.vmMac = vmMac;
-	}
-
-	public String getDhcpMac() {
-		return dhcpMac;
-	}
-
-	protected void setDhcpMac(String dhcpMac) {
-		this.dhcpMac = dhcpMac;
-	}
-
-	public String getDhcpIp() {
-		return dhcpIp;
-	}
-
-	protected void setDhcpIp(String dhcpIp) {
-		this.dhcpIp = dhcpIp;
-	}
-
-	public Type getType() {
-		return type;
-	}
-
-	public String getDhcpName() {
-		return dhcpName;
-	}
-
-	public void setDhcpName(String dhcpName) {
-		this.dhcpName = dhcpName;
-	}
-
-	public String getNetworkTag() {
-		return networkTag;
-	}
+    public enum Type {
+        DHCP, VM
+    }
+
+    private String op;
+    private String primary;
+    private String isolated;
+    private String vmMac;
+    private String dhcpName;
+    private String dhcpMac;
+    private String dhcpIp;
+    private Type type;
+    private String networkTag;
+
+    protected PvlanSetupCommand() {
+    }
+
+    protected PvlanSetupCommand(Type type, String op, URI uri, String networkTag) {
+        this.type = type;
+        this.op = op;
+        this.primary = NetUtils.getPrimaryPvlanFromUri(uri);
+        this.isolated = NetUtils.getIsolatedPvlanFromUri(uri);
+        this.networkTag = networkTag;
+    }
+
+    static public PvlanSetupCommand createDhcpSetup(String op, URI uri, String networkTag, String dhcpName, String dhcpMac, String dhcpIp) {
+        PvlanSetupCommand cmd = new PvlanSetupCommand(Type.DHCP, op, uri, networkTag);
+        cmd.setDhcpName(dhcpName);
+        cmd.setDhcpMac(dhcpMac);
+        cmd.setDhcpIp(dhcpIp);
+        return cmd;
+    }
+
+    static public PvlanSetupCommand createVmSetup(String op, URI uri, String networkTag, String vmMac) {
+        PvlanSetupCommand cmd = new PvlanSetupCommand(Type.VM, op, uri, networkTag);
+        cmd.setVmMac(vmMac);
+        return cmd;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return true;
+    }
+
+    public String getOp() {
+        return op;
+    }
+
+    public String getPrimary() {
+        return primary;
+    }
+
+    public String getIsolated() {
+        return isolated;
+    }
+
+    public String getVmMac() {
+        return vmMac;
+    }
+
+    protected void setVmMac(String vmMac) {
+        this.vmMac = vmMac;
+    }
+
+    public String getDhcpMac() {
+        return dhcpMac;
+    }
+
+    protected void setDhcpMac(String dhcpMac) {
+        this.dhcpMac = dhcpMac;
+    }
+
+    public String getDhcpIp() {
+        return dhcpIp;
+    }
+
+    protected void setDhcpIp(String dhcpIp) {
+        this.dhcpIp = dhcpIp;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public String getDhcpName() {
+        return dhcpName;
+    }
+
+    public void setDhcpName(String dhcpName) {
+        this.dhcpName = dhcpName;
+    }
+
+    public String getNetworkTag() {
+        return networkTag;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/StoragePoolInfo.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/StoragePoolInfo.java b/api/src/com/cloud/agent/api/StoragePoolInfo.java
index 475205f..7d1e238 100644
--- a/api/src/com/cloud/agent/api/StoragePoolInfo.java
+++ b/api/src/com/cloud/agent/api/StoragePoolInfo.java
@@ -21,67 +21,69 @@ import java.util.Map;
 import com.cloud.storage.Storage.StoragePoolType;
 
 public class StoragePoolInfo {
-	String uuid;
-	String host;
-	String localPath;
-	String hostPath;
-	StoragePoolType poolType;
-	long capacityBytes;
-	long availableBytes;
-	Map<String, String> details;
+    String uuid;
+    String host;
+    String localPath;
+    String hostPath;
+    StoragePoolType poolType;
+    long capacityBytes;
+    long availableBytes;
+    Map<String, String> details;
 
-	protected StoragePoolInfo() {
-		super();
-	}
+    protected StoragePoolInfo() {
+        super();
+    }
 
-	public StoragePoolInfo(String uuid, String host, String hostPath,
-			String localPath, StoragePoolType poolType, long capacityBytes,
-			long availableBytes) {
-		super();
-		this.uuid = uuid;
-		this.host = host;
-		this.localPath = localPath;
-		this.hostPath = hostPath;
-		this.poolType = poolType;
-		this.capacityBytes = capacityBytes;
-		this.availableBytes = availableBytes;
-	}
+    public StoragePoolInfo(String uuid, String host, String hostPath, String localPath, StoragePoolType poolType, long capacityBytes, long availableBytes) {
+        super();
+        this.uuid = uuid;
+        this.host = host;
+        this.localPath = localPath;
+        this.hostPath = hostPath;
+        this.poolType = poolType;
+        this.capacityBytes = capacityBytes;
+        this.availableBytes = availableBytes;
+    }
 
-    public StoragePoolInfo(String uuid, String host, String hostPath,
-            String localPath, StoragePoolType poolType, long capacityBytes,
-            long availableBytes, Map<String, String> details) {
+    public StoragePoolInfo(String uuid, String host, String hostPath, String localPath, StoragePoolType poolType, long capacityBytes, long availableBytes,
+            Map<String, String> details) {
         this(uuid, host, hostPath, localPath, poolType, capacityBytes, availableBytes);
         this.details = details;
     }
 
-	public long getCapacityBytes() {
-		return capacityBytes;
-	}
-	public long getAvailableBytes() {
-		return availableBytes;
-	}
+    public long getCapacityBytes() {
+        return capacityBytes;
+    }
+
+    public long getAvailableBytes() {
+        return availableBytes;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public String getLocalPath() {
+        return localPath;
+    }
+
+    public String getHostPath() {
+        return hostPath;
+    }
 
-	public String getUuid() {
-		return uuid;
-	}
-	public String getHost() {
-		return host;
-	}
-	public String getLocalPath() {
-		return localPath;
-	}
-	public String getHostPath() {
-		return hostPath;
-	}
-	public StoragePoolType getPoolType() {
-		return poolType;
-	}
+    public StoragePoolType getPoolType() {
+        return poolType;
+    }
 
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
 
-	public Map<String, String> getDetails() {
-	    return details;
-	}
+    public Map<String, String> getDetails() {
+        return details;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java b/api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java
index ecc8e57..901dfd7 100644
--- a/api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java
@@ -1,4 +1,5 @@
 package com.cloud.agent.api.storage;
+
 // Licensed to the Apache Software Foundation (ASF) under one
 // or more contributor license agreements.  See the NOTICE file
 // distributed with this work for additional information

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java b/api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java
index 52a57db..a703ab5 100755
--- a/api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CreateVolumeOVAAnswer.java
@@ -23,4 +23,4 @@ public class CreateVolumeOVAAnswer extends Answer {
         super(cmd, result, details);
     }
 
-} 
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d627446/api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java b/api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java
index 224b7c80..cec48ee 100755
--- a/api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java
+++ b/api/src/com/cloud/agent/api/storage/CreateVolumeOVACommand.java
@@ -21,40 +21,40 @@ import com.cloud.agent.api.to.StorageFilerTO;
 import com.cloud.storage.StoragePool;
 
 public class CreateVolumeOVACommand extends Command {
-        String secUrl;
-        String volPath;
-        String volName;
-        StorageFilerTO pool;
+    String secUrl;
+    String volPath;
+    String volName;
+    StorageFilerTO pool;
 
-        public CreateVolumeOVACommand() {
-        }
+    public CreateVolumeOVACommand() {
+    }
 
-        public CreateVolumeOVACommand(String secUrl, String volPath, String volName, StoragePool pool, int wait) {
+    public CreateVolumeOVACommand(String secUrl, String volPath, String volName, StoragePool pool, int wait) {
         this.secUrl = secUrl;
         this.volPath = volPath;
         this.volName = volName;
         this.pool = new StorageFilerTO(pool);
         setWait(wait);
-   }
+    }
 
-        @Override
+    @Override
     public boolean executeInSequence() {
         return true;
     }
 
-        public String getVolPath() {
-                return this.volPath;
-        }
+    public String getVolPath() {
+        return this.volPath;
+    }
 
-        public String getVolName() {
-                return this.volName;
-        }
-        public String getSecondaryStorageUrl() {
-                return this.secUrl;
+    public String getVolName() {
+        return this.volName;
     }
+
+    public String getSecondaryStorageUrl() {
+        return this.secUrl;
+    }
+
     public StorageFilerTO getPool() {
-            return pool;
+        return pool;
     }
 }
-
- 


Mime
View raw message