diff options
Diffstat (limited to 'controlloop/common/simulators/src/main')
-rw-r--r-- | controlloop/common/simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java index 7415130ea..4551cf246 100644 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -30,14 +30,15 @@ import org.json.JSONObject; @Path("/pdp/api") public class GuardSimulatorJaxRs { + public static final String DENY_CLNAME = "denyGuard"; @POST @Path("/getDecision") @Consumes(MediaType.APPLICATION_JSON) @Produces("application/json") - public String getGuardDecision(String req){ + public String getGuardDecision(String req){ String clName = new JSONObject(req).getJSONObject("decisionAttributes").getString("clname"); - if ("denyGuard".equals(clName)) + if (DENY_CLNAME.equals(clName)) { return "{\"decision\": \"DENY\", \"details\": \"Decision Deny. You asked for it\"}"; } |