summaryrefslogtreecommitdiffstats
path: root/model/src
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@ericsson.com>2018-09-11 12:55:27 +0100
committerramverma <ram.krishna.verma@ericsson.com>2018-09-12 13:53:08 +0100
commite52c9ed74a40d86f1494befd89f55f499b28dcfe (patch)
tree38fe808c4179dfda0f9834c2b2bdaaaf2a68c17e /model/src
parent1b5763e20c91f40da4ad44b2d6bd09331705b27a (diff)
Adding policy forwarder for apex-pdp
* Adding policy forwarder for apex-pdp * Adding ApexPdpPolicy to hold policies related to apex-pdp * Adding forwarder parameter for configuring apex-pdp forwarder * Adding test cases for all code changes. Change-Id: Ic1cb9bfc11b2b95321ea2d81882c588b025d33fb Issue-ID: POLICY-1101 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java b/model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java
new file mode 100644
index 00000000..a8f45764
--- /dev/null
+++ b/model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018 Ericsson. All rights reserved.
+ * ================================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.distribution.model;
+
+import java.io.InputStream;
+
+/**
+ * This class represents an apex-pdp policy which can be decoded by a relevant {@link PolicyDecoder}.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
+ */
+public class ApexPdpPolicy implements Policy {
+ private String policyName;
+ private InputStream policyInputStream;
+
+ /**
+ * Constructor for creating instance of {@link ApexPdpPolicy}.
+ *
+ * @param policyName the policy file name
+ * @param policyInputStream the input stream
+ */
+ public ApexPdpPolicy(final String policyName, final InputStream policyInputStream) {
+ this.policyName = policyName;
+ this.policyInputStream = policyInputStream;
+ }
+
+ /**
+ * Returns the policyInputStream of this ApexPdpPolicy instance.
+ *
+ * @return the policyInputStream
+ */
+ public InputStream getPolicyInputStream() {
+ return policyInputStream;
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public String getPolicyName() {
+ return policyName;
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public String getPolicyType() {
+ return "Method not supported";
+ }
+}