diff options
author | 2021-12-03 11:27:32 +0000 | |
---|---|---|
committer | 2021-12-14 17:58:20 +0000 | |
commit | 4694c152f69380f4d3d64bde0a13d15fb59a71f3 (patch) | |
tree | 38c9e0b1117323c58536706a66830109225d6200 /main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java | |
parent | c51fa0d4e953518571a115af4afdea80a17ed605 (diff) |
Migrate pap startup & controllers to spring boot
This commit migrates pap config, startup and controllers to spring boot.
Change-Id: Icf91d728160a23db614dfba6b40ddccd2f6163a5
Issue-ID: POLICY-3754
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java')
-rw-r--r-- | main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java b/main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java index c8f67d75..5aaaf4ab 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeProvider.java @@ -36,12 +36,15 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.onap.policy.pap.main.comm.PdpMessageGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; /** * Provider for PAP component to change state of PDP group. * * @author Ram Krishna Verma (ram.krishna.verma@est.tech) */ +@Service public class PdpGroupStateChangeProvider extends PdpMessageGenerator { private static final Logger LOGGER = LoggerFactory.getLogger(PdpGroupStateChangeProvider.class); @@ -61,7 +64,7 @@ public class PdpGroupStateChangeProvider extends PdpMessageGenerator { * @return a pair containing the status and the response * @throws PfModelException in case of errors */ - public Pair<Response.Status, PdpGroupStateChangeResponse> changeGroupState(final String groupName, + public Pair<HttpStatus, PdpGroupStateChangeResponse> changeGroupState(final String groupName, final PdpState pdpGroupState) throws PfModelException { synchronized (updateLock) { switch (pdpGroupState) { @@ -75,7 +78,7 @@ public class PdpGroupStateChangeProvider extends PdpMessageGenerator { throw new PfModelException(Response.Status.BAD_REQUEST, "Only ACTIVE or PASSIVE state changes are allowed"); } - return Pair.of(Response.Status.OK, new PdpGroupStateChangeResponse()); + return Pair.of(HttpStatus.OK, new PdpGroupStateChangeResponse()); } } |