diff options
author | Jonathan Gathman <jonathan.gathman@att.com> | 2018-07-03 22:13:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-03 22:13:53 +0000 |
commit | 6261a19e61138e861f5c7eaf37835205f19f1fe0 (patch) | |
tree | 80a2189ce98b43980bd0504dec880248c7ef2613 /auth/auth-certman | |
parent | 442d8fb117c9086ec2ec468f661af082becafbb8 (diff) | |
parent | bb06037b182a69b37601e918db099740cdbfea72 (diff) |
Merge "Fixes sonar issues in API_Artifact"
Diffstat (limited to 'auth/auth-certman')
-rw-r--r-- | auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/api/API_Artifact.java | 11 | ||||
-rw-r--r-- | auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/api/API_Artifact.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/api/API_Artifact.java index 5c067ce1..134ad7c5 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/api/API_Artifact.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/api/API_Artifact.java @@ -40,16 +40,15 @@ import org.onap.aaf.auth.rserv.HttpMethods; */ public class API_Artifact { private static final String GET_ARTIFACTS = "Get Artifacts"; - + private static final String CERT_ARTIFACTS = "/cert/artifacts"; /** * Normal Init level APIs * * @param cmAPI - * @param facade * @throws Exception */ public static void init(final AAF_CM cmAPI) throws Exception { - cmAPI.route(HttpMethods.POST, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Create Artifacts") { + cmAPI.route(HttpMethods.POST, CERT_ARTIFACTS, API.ARTIFACTS, new Code(cmAPI,"Create Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.createArtifacts(trans, req, resp); @@ -64,7 +63,7 @@ public class API_Artifact { /** * Use Query Params to get Artifacts by Machine or MechID */ - cmAPI.route(HttpMethods.GET, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { + cmAPI.route(HttpMethods.GET, CERT_ARTIFACTS, API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.readArtifacts(trans, req, resp); @@ -91,7 +90,7 @@ public class API_Artifact { }); - cmAPI.route(HttpMethods.PUT, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Update Artifacts") { + cmAPI.route(HttpMethods.PUT, CERT_ARTIFACTS, API.ARTIFACTS, new Code(cmAPI,"Update Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.updateArtifacts(trans, req, resp); @@ -117,7 +116,7 @@ public class API_Artifact { }); - cmAPI.route(HttpMethods.DELETE, "/cert/artifacts", API.VOID, new Code(cmAPI,"Delete Artifacts") { + cmAPI.route(HttpMethods.DELETE, CERT_ARTIFACTS, API.VOID, new Code(cmAPI,"Delete Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.deleteArtifacts(trans, req, resp); diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java index 62a656fc..23a0c543 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java @@ -100,7 +100,7 @@ public class Mapper2_0 implements Mapper<BaseRequest,CertInfo,Artifacts,Error> { */ @Override public Result<CertInfo> toCert(AuthzTrans trans, Result<CertResp> in, boolean withTrustChain) throws IOException { - if(in.isOK()) { + if(!in.isOK()) { CertResp cin = in.value; CertInfo cout = newInstance(API.CERT); cout.setPrivatekey(cin.privateString()); |