From e52c9ed74a40d86f1494befd89f55f499b28dcfe Mon Sep 17 00:00:00 2001 From: ramverma Date: Tue, 11 Sep 2018 12:55:27 +0100 Subject: 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 --- .../policy/distribution/model/ApexPdpPolicy.java | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 model/src/main/java/org/onap/policy/distribution/model/ApexPdpPolicy.java (limited to 'model') 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"; + } +} -- cgit 1.2.3-korg