aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-topology/src
diff options
context:
space:
mode:
authorJerry Flood <jflood@att.com>2019-04-16 09:06:17 -0400
committerJerry Flood <jflood@att.com>2019-04-16 11:29:13 -0400
commitb1ba8ef51edabee26acaf74e226eeb269297aec7 (patch)
tree54fcd741ae9b0f05ca1d438de1a4dbacf06cf1ac /cmso-topology/src
parent134ae90b8d8f5b19d9915adbc9b1a70d8c27540e (diff)
More checkstyle changes for Dublin
Issue-ID: OPTFRA-466 Change-Id: Ied602196284bf3aed56ff491a749f14503395c88 Signed-off-by: Jerry Flood <jflood@att.com>
Diffstat (limited to 'cmso-topology/src')
-rw-r--r--cmso-topology/src/main/java/org/onap/observations/MessageHeaders.java24
-rw-r--r--cmso-topology/src/main/java/org/onap/optf/cmso/topology/filters/CmsoContainerFilters.java6
2 files changed, 23 insertions, 7 deletions
diff --git a/cmso-topology/src/main/java/org/onap/observations/MessageHeaders.java b/cmso-topology/src/main/java/org/onap/observations/MessageHeaders.java
index fe6cea2..ccb7e56 100644
--- a/cmso-topology/src/main/java/org/onap/observations/MessageHeaders.java
+++ b/cmso-topology/src/main/java/org/onap/observations/MessageHeaders.java
@@ -65,7 +65,7 @@ public class MessageHeaders {
}
/** The Constant supportedMajorVersions. */
- public static final Map<String, String> supportedMajorVersions = new HashMap<String, String>();
+ private static final Map<String, String> supportedMajorVersions = new HashMap<String, String>();
static {
supportedMajorVersions.put("v1", "0");
@@ -73,7 +73,7 @@ public class MessageHeaders {
}
/** The Constant supportedMajorMinorVersions. */
- public static final Set<String> supportedMajorMinorVersions = new HashSet<String>();
+ private static final Set<String> supportedMajorMinorVersions = new HashSet<String>();
static {
supportedMajorMinorVersions.add("v1.0");
@@ -81,10 +81,10 @@ public class MessageHeaders {
}
/** The Constant latestVersion. */
- public static final String latestVersion = "2.0.0";
+ private static final String latestVersion = "2.0.0";
/** The Constant patchVersion. */
- public static final String patchVersion = "0";
+ private static final String patchVersion = "0";
/**
* From string.
@@ -152,4 +152,20 @@ public class MessageHeaders {
}
return true;
}
+
+ public static Map<String, String> getSupportedmajorversions() {
+ return supportedMajorVersions;
+ }
+
+ public static Set<String> getSupportedmajorminorversions() {
+ return supportedMajorMinorVersions;
+ }
+
+ public static String getLatestversion() {
+ return latestVersion;
+ }
+
+ public static String getPatchversion() {
+ return patchVersion;
+ }
}
diff --git a/cmso-topology/src/main/java/org/onap/optf/cmso/topology/filters/CmsoContainerFilters.java b/cmso-topology/src/main/java/org/onap/optf/cmso/topology/filters/CmsoContainerFilters.java
index 2418aec..2729613 100644
--- a/cmso-topology/src/main/java/org/onap/optf/cmso/topology/filters/CmsoContainerFilters.java
+++ b/cmso-topology/src/main/java/org/onap/optf/cmso/topology/filters/CmsoContainerFilters.java
@@ -68,8 +68,8 @@ public class CmsoContainerFilters implements ContainerRequestFilter, ContainerRe
MultivaluedMap<String, Object> respHeaders = responseContext.getHeaders();
String minorVersion = reqHeaders.getFirst(HeadersEnum.MinorVersion.toString());
respHeaders.add(HeadersEnum.MinorVersion.toString(), minorVersion);
- respHeaders.add(HeadersEnum.LatestVersion.toString(), MessageHeaders.latestVersion);
- respHeaders.add(HeadersEnum.PatchVersion.toString(), MessageHeaders.patchVersion);
+ respHeaders.add(HeadersEnum.LatestVersion.toString(), MessageHeaders.getLatestversion());
+ respHeaders.add(HeadersEnum.PatchVersion.toString(), MessageHeaders.getPatchVersion());
} catch (Exception e) {
if (e instanceof WebApplicationException) {
@@ -110,7 +110,7 @@ public class CmsoContainerFilters implements ContainerRequestFilter, ContainerRe
}
String minorVersion = headers.getFirst(HeadersEnum.MinorVersion.toString());
if (minorVersion == null) {
- minorVersion = MessageHeaders.supportedMajorVersions.get(majorVersion);
+ minorVersion = MessageHeaders.getSupportedmajorversions().get(majorVersion);
headers.add(HeadersEnum.MinorVersion.toString(), minorVersion);
}
if (!MessageHeaders.validateMajorMinorVersion(majorVersion, minorVersion)) {