Commit 0ba1723d authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

code cleanup - made nearly all classes final

parent 7056f7f5
...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.yammer.dropwizard.config.Configuration; import com.yammer.dropwizard.config.Configuration;
import org.hibernate.validator.constraints.NotEmpty; import org.hibernate.validator.constraints.NotEmpty;
public class NesstarDropConfiguration extends Configuration { public final class NesstarDropConfiguration extends Configuration {
@NotEmpty @NotEmpty
@JsonProperty @JsonProperty
private String serverURI; private String serverURI;
......
...@@ -24,7 +24,7 @@ import com.yammer.dropwizard.config.Bootstrap; ...@@ -24,7 +24,7 @@ import com.yammer.dropwizard.config.Bootstrap;
import com.yammer.dropwizard.config.Environment; import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.config.FilterBuilder; import com.yammer.dropwizard.config.FilterBuilder;
public class NesstarDropService extends Service<NesstarDropConfiguration> { public final class NesstarDropService extends Service<NesstarDropConfiguration> {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
new NesstarDropService().run(args); new NesstarDropService().run(args);
......
...@@ -11,7 +11,7 @@ import com.nesstar.api.NesstarList; ...@@ -11,7 +11,7 @@ import com.nesstar.api.NesstarList;
import com.nesstar.api.NesstarObject; import com.nesstar.api.NesstarObject;
import com.nesstar.api.NotAuthorizedException; import com.nesstar.api.NotAuthorizedException;
public class ETag { public final class ETag {
public static final String HEADER_NAME = "ETag"; public static final String HEADER_NAME = "ETag";
private static final Date zeroDate = new Date(0l); private static final Date zeroDate = new Date(0l);
private String hash; private String hash;
......
...@@ -9,7 +9,7 @@ public abstract class Operation { ...@@ -9,7 +9,7 @@ public abstract class Operation {
public abstract Object run() throws Exception; public abstract Object run() throws Exception;
public boolean tryToRecover(Exception e, ServerHandler serverHandler) { public final boolean tryToRecover(Exception e, ServerHandler serverHandler) {
if (e instanceof NotAuthorizedException) { if (e instanceof NotAuthorizedException) {
try { try {
Server server = serverHandler.getServer(); Server server = serverHandler.getServer();
......
...@@ -21,7 +21,7 @@ import com.nesstar.api.VariableGroup; ...@@ -21,7 +21,7 @@ import com.nesstar.api.VariableGroup;
import com.nesstar.rest.common.ETag; import com.nesstar.rest.common.ETag;
import com.nesstar.rest.common.ServerHandler; import com.nesstar.rest.common.ServerHandler;
public class EntityTagFilter implements Filter { public final class EntityTagFilter implements Filter {
private static final String HEADER_NAME = "If-None-Match"; private static final String HEADER_NAME = "If-None-Match";
private ServerHandler serverHandler; private ServerHandler serverHandler;
......
...@@ -7,7 +7,7 @@ import javax.servlet.*; ...@@ -7,7 +7,7 @@ import javax.servlet.*;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
public class LanguageFilter implements Filter { public final class LanguageFilter implements Filter {
@Override @Override
public void init(FilterConfig filterConfig) throws ServletException { public void init(FilterConfig filterConfig) throws ServletException {
......
...@@ -11,7 +11,7 @@ import java.io.IOException; ...@@ -11,7 +11,7 @@ import java.io.IOException;
import static com.yammer.metrics.core.HealthCheck.Result.healthy; import static com.yammer.metrics.core.HealthCheck.Result.healthy;
import static com.yammer.metrics.core.HealthCheck.Result.unhealthy; import static com.yammer.metrics.core.HealthCheck.Result.unhealthy;
public class NesstarHealthCheck extends HealthCheck { public final class NesstarHealthCheck extends HealthCheck {
private ServerHandler serverHandler; private ServerHandler serverHandler;
public NesstarHealthCheck(ServerHandler serverHandler) { public NesstarHealthCheck(ServerHandler serverHandler) {
......
...@@ -8,7 +8,7 @@ import java.io.IOException; ...@@ -8,7 +8,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class CubeRequest { public final class CubeRequest {
private static final Logger LOGGER = LoggerFactory.getLogger(CubeRequest.class); private static final Logger LOGGER = LoggerFactory.getLogger(CubeRequest.class);
private static ObjectMapper objectMapper = new ObjectMapper(); private static ObjectMapper objectMapper = new ObjectMapper();
......
...@@ -7,7 +7,7 @@ import com.nesstar.api.NesstarObject; ...@@ -7,7 +7,7 @@ import com.nesstar.api.NesstarObject;
import com.nesstar.rest.common.ETag; import com.nesstar.rest.common.ETag;
import com.nesstar.rest.common.ServerHandler; import com.nesstar.rest.common.ServerHandler;
public class AbstractResource { class AbstractResource {
protected ServerHandler serverHandler; protected ServerHandler serverHandler;
protected AbstractResource(ServerHandler serverHandler) { protected AbstractResource(ServerHandler serverHandler) {
......
...@@ -28,7 +28,7 @@ import java.util.Map; ...@@ -28,7 +28,7 @@ import java.util.Map;
@Path("study/{studyId}/correlate") @Path("study/{studyId}/correlate")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class CorrelationResource extends AbstractResource { public final class CorrelationResource extends AbstractResource {
public CorrelationResource(ServerHandler serverHandler) { public CorrelationResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -38,7 +38,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -38,7 +38,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("cube/{cubeId}") @Path("cube/{cubeId}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class CubeResource extends AbstractResource{ public final class CubeResource extends AbstractResource{
public CubeResource(ServerHandler serverHandler) { public CubeResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -12,7 +12,7 @@ import javax.ws.rs.core.Response; ...@@ -12,7 +12,7 @@ import javax.ws.rs.core.Response;
import java.util.List; import java.util.List;
@Path("study/{studyId}/download") @Path("study/{studyId}/download")
public class DownloadResource extends AbstractResource { public final class DownloadResource extends AbstractResource {
public DownloadResource(ServerHandler serverHandler) { public DownloadResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -29,7 +29,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -29,7 +29,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("search") @Path("search")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class QueryResource extends AbstractResource { public final class QueryResource extends AbstractResource {
private static Map<String, Class<? extends NesstarObject>> supportedReturnTypes; private static Map<String, Class<? extends NesstarObject>> supportedReturnTypes;
public QueryResource(ServerHandler serverHandler) { public QueryResource(ServerHandler serverHandler) {
......
...@@ -29,7 +29,7 @@ import java.util.Map; ...@@ -29,7 +29,7 @@ import java.util.Map;
@Path("study/{studyId}/regress") @Path("study/{studyId}/regress")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class RegressionResource extends AbstractResource { public final class RegressionResource extends AbstractResource {
public RegressionResource(ServerHandler serverHandler) { public RegressionResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -32,7 +32,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -32,7 +32,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("/studies") @Path("/studies")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class StudyListResource extends AbstractResource { public final class StudyListResource extends AbstractResource {
public StudyListResource(ServerHandler serverHandler) { public StudyListResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -31,7 +31,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -31,7 +31,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("study/{studyId}") @Path("study/{studyId}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class StudyResource extends AbstractResource { public final class StudyResource extends AbstractResource {
public static final String STUDY_ID_PARAM_NAME = "studyId"; public static final String STUDY_ID_PARAM_NAME = "studyId";
......
...@@ -30,7 +30,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -30,7 +30,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("study/{studyId}/tabulate") @Path("study/{studyId}/tabulate")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class TabulateResource extends AbstractResource { public final class TabulateResource extends AbstractResource {
public TabulateResource(ServerHandler serverHandler) { public TabulateResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
} }
......
...@@ -19,7 +19,7 @@ import java.util.Scanner; ...@@ -19,7 +19,7 @@ import java.util.Scanner;
@Path("metadata-translation/{languageCode}") @Path("metadata-translation/{languageCode}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class TranslationResource extends AbstractResource { public final class TranslationResource extends AbstractResource {
public TranslationResource(ServerHandler serverHandler) { public TranslationResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
} }
......
...@@ -22,7 +22,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -22,7 +22,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("variable-group/{groupId}") @Path("variable-group/{groupId}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class VariableGroupResource extends AbstractResource { public final class VariableGroupResource extends AbstractResource {
public VariableGroupResource(ServerHandler serverHandler) { public VariableGroupResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
......
...@@ -20,7 +20,7 @@ import com.yammer.metrics.annotation.Timed; ...@@ -20,7 +20,7 @@ import com.yammer.metrics.annotation.Timed;
@Path("/variable/{variableId}") @Path("/variable/{variableId}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class VariableResource extends AbstractResource{ public final class VariableResource extends AbstractResource{
public VariableResource(ServerHandler serverHandler) { public VariableResource(ServerHandler serverHandler) {
super(serverHandler); super(serverHandler);
} }
......
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