* 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.forwarding;
import java.util.Collection;
-
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
/**
* Forwards polices.
- *
+ *
* <p>To create a policy forwarder a class implementing this interface must be created, along with a
* concrete sub class of PolicyForwarderConfigurationParameterGroup to handle configuration
* parameters for the policy forwarder.
/**
* Configure the policy forwarder.
- *
+ *
* <p>This method will be invoked immediately after instantiation in order for the policy forwarder
* to configure itself.
- *
+ *
* @param parameterGroupName the name of the parameter group which contains the configuration
* for the policy forwarder
*/
/**
* Forward the given policies.
- *
+ *
* @param policies the policies to forward
* @throws PolicyForwardingException if an error occurs when forwarding the given policy
*/
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.io.FileReader;
-
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.main.PolicyDistributionException;
import org.onap.policy.distribution.main.startstop.DistributionCommandLineArguments;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
-
import java.lang.reflect.Type;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.policy.common.endpoints.report.HealthCheckReport;
/**
import java.io.StringWriter;
import java.net.URL;
import java.util.Arrays;
-
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
package org.onap.policy.distribution.main.startstop;
import java.util.Arrays;
-
import org.onap.policy.distribution.main.PolicyDistributionException;
import org.onap.policy.distribution.main.parameters.DistributionParameterGroup;
import org.onap.policy.distribution.main.parameters.DistributionParameterHandler;
* 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=========================================================
*/
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class TestExceptions {
public void test() {
assertNotNull(new PolicyDistributionException("Message"));
assertNotNull(new PolicyDistributionException("Message", new IOException()));
-
+
assertNotNull(new PolicyDistributionRuntimeException("Message"));
assertNotNull(new PolicyDistributionRuntimeException("Message", new IOException()));
}
import java.io.File;
import java.util.HashMap;
import java.util.Map;
-
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import static org.junit.Assert.fail;
import java.util.Map;
-
import org.junit.Test;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.parameters.GroupValidationResult;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
-
import org.junit.Test;
import org.onap.policy.distribution.main.PolicyDistributionException;
import org.onap.policy.distribution.main.startstop.DistributionCommandLineArguments;
import static org.junit.Assert.fail;
import java.io.IOException;
-
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
-
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.junit.Test;
import static org.junit.Assert.fail;
import java.io.IOException;
-
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
-
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.junit.Test;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.Properties;
-
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
-
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.junit.Test;
import org.onap.policy.common.endpoints.report.HealthCheckReport;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.Properties;
-
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
-
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.junit.Test;
import org.onap.policy.common.utils.network.NetworkUtil;
import com.openpojo.validation.rule.impl.SetterMustExistRule;
import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
-
import org.junit.Test;
import org.onap.policy.common.utils.test.ToStringTester;
package org.onap.policy.distribution.main.testclasses;
import java.util.Collection;
-
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.distribution.reception.decoding.PolicyDecoder;
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
import lombok.Getter;
import lombok.Setter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.reception.parameters.PolicyDecoderConfigurationParameterGroup;
import java.util.ArrayList;
import java.util.Collection;
-
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.PolicyForwardingException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
import lombok.Getter;
import lombok.Setter;
-
import org.onap.policy.common.parameters.annotations.Min;
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import lombok.Getter;
import lombok.Setter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
package org.onap.policy.distribution.model;
import java.util.Date;
-
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
-
import org.apache.commons.lang3.NotImplementedException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
import com.openpojo.validation.ValidatorBuilder;
import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
-
import org.junit.Test;
/**
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
-
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.PolicyForwardingException;
import lombok.Getter;
import lombok.Setter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.main.parameters.PolicyForwarderConfigurationParameterGroup;
package org.onap.policy.distribution.forwarding.lifecycle.api;
import lombok.Getter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.main.parameters.PolicyForwarderConfigurationParameterGroup;
package org.onap.policy.distribution.forwarding.lifecycle.api;
import lombok.Getter;
-
import org.onap.policy.common.parameters.annotations.Min;
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import java.util.ArrayList;
import java.util.Collection;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
package org.onap.policy.distribution.forwarding.testclasses;
import java.io.File;
-
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
package org.onap.policy.distribution.forwarding.testclasses;
import java.util.Collection;
-
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.distribution.reception.decoding.PolicyDecoder;
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
package org.onap.policy.distribution.forwarding.testclasses;
import io.swagger.annotations.ApiParam;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.policy.models.pap.concepts.PdpDeployPolicies;
import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.toscaparser.api.CapabilityAssignment;
package org.onap.policy.distribution.reception.decoding.hpa;
import com.google.gson.annotations.SerializedName;
-
import java.util.ArrayList;
import java.util.List;
final File csarFile = new File(csar.getCsarPath());
sdcCsarHelper = factory.getSdcCsarHelper(csarFile.getAbsolutePath());
} catch (final Exception exp) {
- throw new PolicyDecodingException( "Failed passing the csar file", exp);
+ throw new PolicyDecodingException("Failed passing the csar file", exp);
}
return sdcCsarHelper;
}
package org.onap.policy.distribution.reception.decoding.hpa;
import lombok.Getter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.reception.parameters.PolicyDecoderConfigurationParameterGroup;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
package org.onap.policy.distribution.reception.decoding.policy.file;
import lombok.Getter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.reception.parameters.PolicyDecoderConfigurationParameterGroup;
package org.onap.policy.distribution.reception.handling.file;
import java.io.IOException;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.zip.ZipFile;
-
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.model.Csar;
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
package org.onap.policy.distribution.reception.handling.file;
import java.io.File;
-
import lombok.Getter;
import lombok.Setter;
-
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.common.parameters.annotations.NotBlank;
package org.onap.policy.distribution.reception.handling.sdc;
import java.util.List;
-
import lombok.Getter;
-
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
package org.onap.policy.distribution.reception.decoding.hpa;
import java.io.File;
-
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.concurrent.atomic.AtomicInteger;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.io.FileReader;
import java.io.IOException;
-
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.util.Arrays;
import java.util.Collection;
-
import org.onap.policy.distribution.model.Csar;
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.distribution.reception.decoding.PolicyDecoder;
import java.util.ArrayList;
import java.util.Collection;
-
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.PolicyForwardingException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
-
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ValidationStatus;
* 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=========================================================
*/
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class ArtifactDownloadExceptionTest {
* 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=========================================================
*/
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class ArtifactInstallerExceptionTest {
* 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=========================================================
*/
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class PssdControllerExceptionTest {
* 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=========================================================
*/
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
-
import org.junit.Test;
public class PssdParametersExceptionTest {
package org.onap.policy.distribution.reception.decoding;
import java.util.Collection;
-
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
import java.util.ArrayList;
import java.util.Collection;
-
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.PolicyForwardingException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
-
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.parameters.PolicyForwarderParameters;
import java.util.Map;
import java.util.Map.Entry;
-
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
import org.onap.policy.common.parameters.ValidationStatus;
*
* @param name the name to set.
*/
+ @Override
public void setName(final String name) {
this.name = name;
}
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
-
import java.lang.reflect.Type;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
-
import java.lang.reflect.Type;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-
import org.junit.Test;
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.forwarding.PolicyForwarder;
package org.onap.policy.distribution.reception.handling;
import java.util.Collection;
-
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.distribution.reception.decoding.PolicyDecoder;
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
import java.util.ArrayList;
import java.util.Collection;
-
import org.onap.policy.distribution.forwarding.PolicyForwarder;
import org.onap.policy.distribution.forwarding.PolicyForwardingException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;