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

code cleanup - made nearly all classes final

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