Commit b212e037 authored by Michael Ritter's avatar Michael Ritter
Browse files

Formatting updates

parent 7cf6660c
......@@ -33,16 +33,17 @@ package edu.umiacs.ace.driver;
import edu.umiacs.ace.driver.benchmark.BenchmarkAccess;
import edu.umiacs.ace.driver.irods.IrodsAccess;
import edu.umiacs.ace.driver.localfile.LocalFileAccess;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.driver.srb.SrbAccess;
import edu.umiacs.ace.driver.swap.SwapFileAccess;
import edu.umiacs.ace.monitor.core.Collection;
import javax.persistence.EntityManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
/**
* Factory to register all storage resources supported by this monitor.
......@@ -56,7 +57,7 @@ public final class StorageDriverFactory {
* Map to track descriptive storage type name to implementing class
*/
private static final Map<String, Class<? extends StorageDriver>> implementationMap =
new HashMap<String, Class<? extends StorageDriver>>();
new HashMap<>();
/**
* All available storage gateways must be registered here
......@@ -71,7 +72,7 @@ public final class StorageDriverFactory {
}
public static final List<String> listResources() {
List<String> lt = new ArrayList<String>(implementationMap.keySet());
List<String> lt = new ArrayList<>(implementationMap.keySet());
Collections.sort(lt,comp);
return lt;
}
......
......@@ -31,12 +31,12 @@
package edu.umiacs.ace.monitor.peers;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.peers.PartnerSiteContextListener.PartnerList;
import edu.umiacs.ace.remote.StatusBean.CollectionBean;
import java.io.IOException;
import java.util.List;
import edu.umiacs.ace.util.EntityManagerServlet;
import org.apache.log4j.Logger;
import javax.persistence.EntityManager;
import javax.persistence.EntityNotFoundException;
import javax.persistence.EntityTransaction;
......@@ -44,7 +44,8 @@ import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.util.List;
/**
* Add or remove peers from the list of available
......
......@@ -31,17 +31,18 @@
package edu.umiacs.ace.monitor.peers;
import edu.umiacs.ace.remote.PeerAuthenticator;
import edu.umiacs.ace.remote.JsonGateway;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.ace.remote.PeerAuthenticator;
import edu.umiacs.ace.remote.StatusBean.CollectionBean;
import java.net.Authenticator;
import java.util.ArrayList;
import java.util.List;
import edu.umiacs.ace.util.PersistUtil;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.net.Authenticator;
import java.util.ArrayList;
import java.util.List;
/**
* Add a partner list to the application context.
......@@ -74,7 +75,7 @@ public class PartnerSiteContextListener implements ServletContextListener {
Query q = em.createNamedQuery("PartnerSite.listAll");
List l = q.getResultList();
if ( l != null ) {
List ret = new ArrayList();
List<ExtendedPartnerSite> ret = new ArrayList<>();
for ( Object o : l ) {
PartnerSite ps = (PartnerSite) o;
ret.add(new ExtendedPartnerSite(ps));
......
......@@ -106,7 +106,7 @@ public class SettingsUtil {
// Get the names of all current settings
public static Set<String> getParamNames() {
List<SettingsParameter> settings = getCurrentSettings();
Set<String> paramSet = new HashSet<String>();
Set<String> paramSet = new HashSet<>();
for ( SettingsParameter s : settings ) {
paramSet.add(s.getName());
}
......@@ -115,7 +115,7 @@ public class SettingsUtil {
public static List<SettingsParameter> getDefaultSettings() {
List<SettingsParameter> defaults = new ArrayList<SettingsParameter>();
List<SettingsParameter> defaults = new ArrayList<>();
defaults.add(new SettingsParameter(SettingsConstants.PARAM_IMS,
SettingsConstants.ims,false));
......@@ -174,8 +174,8 @@ public class SettingsUtil {
/**
*
* @param c
* @param attr
* @param c The collection to query
* @param attr The attribute to query for
* @return true if collection, settings are not null and parameter is "true"
*/
public static boolean getBoolean(Collection c, String attr) {
......@@ -190,8 +190,8 @@ public class SettingsUtil {
if (!containsKey(c, attr)) {
return null;
}
return c.getSettings().get(attr);
return c.getSettings().get(attr);
}
public static int getInt(Collection c, String attr, int def) {
......@@ -205,10 +205,9 @@ public class SettingsUtil {
}
}
public static boolean containsKey(Collection c, String attr) {
private static boolean containsKey(Collection c, String attr) {
return (c != null && c.getSettings() != null
&& c.getSettings().containsKey(attr));
}
// Update the settings our context listeners would normally do
......
......@@ -233,6 +233,7 @@ public final class IMSService
}
}
// TODO: This should really be in a circuit breaker type class
private <E> E blockUntil(Method m, Object... args) throws Exception {
boolean done = false;
E fin = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment