--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP Policy Models
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.base.keys;
+
+import lombok.NoArgsConstructor;
+import lombok.NonNull;
+import org.onap.policy.models.base.PfConceptKey;
+
+/**
+ * Identifies a policy type. Both the name and version must be non-null.
+ */
+@NonNull
+@NoArgsConstructor
+public class PolicyTypeIdent extends PfConceptKey {
+ private static final long serialVersionUID = 1L;
+
+ public PolicyTypeIdent(String name, String version) {
+ super(name, version);
+ }
+
+ public PolicyTypeIdent(PolicyTypeIdent source) {
+ super(source);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property. 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.models.base.keys;
+
+import com.openpojo.reflection.filters.FilterPackageInfo;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+import org.junit.Test;
+import org.onap.policy.common.utils.validation.ToStringTester;
+
+/**
+ * Class to perform unit testing of models.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public class TestModels {
+
+ @Test
+ public void testModels() {
+ final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester())
+ .with(new GetterTester()).build();
+ validator.validate(TestModels.class.getPackage().getName(), new FilterPackageInfo());
+ }
+}
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP Policy Models
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.base.keys;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.policy.models.base.keys.PolicyTypeIdent;
+import org.onap.policy.models.base.keys.TestModels;
+
+/**
+ * Test the other constructors, as {@link TestModels} tests the other methods.
+ */
+public class TestPolicyTypeIdent {
+ private static final String NAME = "my-name";
+ private static final String VERSION = "1.2.3";
+
+ @Test
+ public void testAllArgsConstructor() {
+ assertThatThrownBy(() -> new PolicyTypeIdent(null, VERSION)).isInstanceOf(NullPointerException.class);
+ assertThatThrownBy(() -> new PolicyTypeIdent(NAME, null)).isInstanceOf(NullPointerException.class);
+
+ PolicyTypeIdent orig = new PolicyTypeIdent(NAME, VERSION);
+ assertEquals(NAME, orig.getName());
+ assertEquals(VERSION, orig.getVersion());
+ }
+
+ @Test
+ public void testCopyConstructor() {
+ assertThatThrownBy(() -> new PolicyTypeIdent(null)).isInstanceOf(NullPointerException.class);
+
+ PolicyTypeIdent orig = new PolicyTypeIdent();
+
+ // verify with null values
+ assertEquals(orig.toString(), new PolicyTypeIdent(orig).toString());
+
+ // verify with all values
+ orig = new PolicyTypeIdent(NAME, VERSION);
+ assertEquals(orig.toString(), new PolicyTypeIdent(orig).toString());
+ }
+}
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
-import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfUtils;
+import org.onap.policy.models.base.keys.PolicyTypeIdent;
/**
* Class to represent a group of all PDP's of the same pdp type running for a particular
public class PdpSubGroup {
private String pdpType;
- private List<PfConceptKey> supportedPolicyTypes;
+ private List<PolicyTypeIdent> supportedPolicyTypes;
private List<Policy> policies;
private int currentInstanceCount;
private int desiredInstanceCount;
*/
public PdpSubGroup(@NonNull PdpSubGroup source) {
this.pdpType = source.pdpType;
- this.supportedPolicyTypes = PfUtils.mapList(source.supportedPolicyTypes, PfConceptKey::new);
+ this.supportedPolicyTypes = PfUtils.mapList(source.supportedPolicyTypes, PolicyTypeIdent::new);
this.policies = PfUtils.mapList(source.policies, Policy::new);
this.currentInstanceCount = source.currentInstanceCount;
this.desiredInstanceCount = source.desiredInstanceCount;
import java.util.Map;
import java.util.TreeMap;
import org.junit.Test;
-import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.base.keys.PolicyTypeIdent;
/**
* Test the copy constructor, as {@link TestModels} tests the other methods.
props.put("key-B", "value-B");
orig.setProperties(props);
- PfConceptKey supp1 = new PfConceptKey("supp-A", "1.2");
- PfConceptKey supp2 = new PfConceptKey("supp-B", "3.4");
+ PolicyTypeIdent supp1 = new PolicyTypeIdent("supp-A", "1.2");
+ PolicyTypeIdent supp2 = new PolicyTypeIdent("supp-B", "3.4");
orig.setSupportedPolicyTypes(Arrays.asList(supp1, supp2));
assertEquals(orig.toString(), new PdpSubGroup(orig).toString());
--- /dev/null
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Nordix Foundation.
+ Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ ================================================================================
+ 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=========================================================
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>models-pdp</artifactId>
+
+ <name>${project.artifactId}</name>
+ <description>The models for internal PDP API's.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+
+/**
+ * Class to represent the PDP_HEALTH_CHECK message that PAP will send to either PDPGroup/Subgroup or a PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpHealthCheck extends PdpMessage {
+
+ private String name;
+ private String pdpGroup;
+ private String pdpSubgroup;
+
+ /**
+ * Constructor for instantiating PdpHealthCheck class with message name.
+ *
+ */
+ public PdpHealthCheck() {
+ super(PdpMessageType.PDP_HEALTH_CHECK);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import java.util.UUID;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+
+/**
+ * Class to represent the base class for various messages that will ve exchanged between PAP and PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpMessage {
+
+ @Setter(AccessLevel.NONE)
+ private PdpMessageType messageName;
+
+ private String requestId = UUID.randomUUID().toString();
+
+ /**
+ * Time-stamp, in milliseconds, when the message was created. Defaults to the current
+ * time.
+ */
+ private long timestampMs = System.currentTimeMillis();
+
+ /**
+ * Constructor for instantiating PdpMessage class with message name.
+ *
+ * @param messageName the message name
+ */
+ public PdpMessage(final PdpMessageType messageName) {
+ this.messageName = messageName;
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.pdp.enums.PdpResponseStatus;
+
+/**
+ * Class to represent PDP response details.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpResponseDetails {
+
+ // The responseTo field should match the original request id in the request.
+ private String responseTo;
+ private PdpResponseStatus responseStatus;
+ private String responseMessage;
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+import org.onap.policy.models.pdp.enums.PdpState;
+
+/**
+ * Class to represent the PDP_STATE_CHANGE message that PAP will send to either PDPGroup/Subgroup or a PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpStateChange extends PdpMessage {
+
+ private String name;
+ private PdpState state;
+ private String pdpGroup;
+ private String pdpSubgroup;
+
+ /**
+ * Constructor for instantiating PdpStateChange class with message name.
+ *
+ */
+ public PdpStateChange() {
+ super(PdpMessageType.PDP_STATE_CHANGE);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * Class to represent statistics of a running PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpStatistics {
+
+ private long policyDownloadCount;
+ private long policyDownloadSuccessCount;
+ private long policyDownloadFailCount;
+ private long policyExecutedCount;
+ private long policyExecutedSuccessCount;
+ private long policyExecutedFailCount;
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.base.keys.PolicyTypeIdent;
+import org.onap.policy.models.pdp.enums.PdpHealthStatus;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+import org.onap.policy.models.pdp.enums.PdpState;
+import org.onap.policy.models.tosca.simple.concepts.ToscaPolicy;
+
+/**
+ * Class to represent the PDP_STATUS message that all the PDP's will send to PAP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpStatus extends PdpMessage {
+
+ private String name;
+ private String version;
+ private String pdpType;
+ private PdpState state;
+ private PdpHealthStatus healthy;
+ private String description;
+ private String pdpGroup;
+ private String pdpSubgroup;
+ private List<PolicyTypeIdent> supportedPolicyTypes;
+ private List<ToscaPolicy> policies;
+ private String instance;
+ private String deploymentInstanceInfo;
+ private String properties;
+ private PdpStatistics statistics;
+ private PdpResponseDetails response;
+
+ /**
+ * Constructor for instantiating PdpStatus class with message name.
+ *
+ */
+ public PdpStatus() {
+ super(PdpMessageType.PDP_STATUS);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.models.pdp.enums.PdpMessageType;
+import org.onap.policy.models.tosca.simple.concepts.ToscaPolicy;
+
+/**
+ * Class to represent the PDP_UPDATE message that PAP will send to a PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+@Getter
+@Setter
+@ToString
+public class PdpUpdate extends PdpMessage {
+
+ private String name;
+ private String pdpType;
+ private String description;
+ private String pdpGroup;
+ private String pdpSubgroup;
+ private List<ToscaPolicy> policies;
+
+ /**
+ * Constructor for instantiating PdpUpdate class with message name.
+ *
+ */
+ public PdpUpdate() {
+ super(PdpMessageType.PDP_UPDATE);
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.enums;
+
+/**
+ * Class to hold the possible values for health status of PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public enum PdpHealthStatus {
+
+ /**
+ * PDP is healthy and working fine.
+ */
+ HEALTHY,
+
+ /**
+ * PDP is not healthy.
+ */
+ NOT_HEALTHY,
+
+ /**
+ * PDP is currently under test state and performing tests.
+ */
+ TEST_IN_PROGRESS,
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.enums;
+
+/**
+ * Class to hold the possible values for the type of PDP messages.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public enum PdpMessageType {
+
+ /**
+ * Used by PDPs to report status to PAP.
+ */
+ PDP_STATUS,
+
+ /**
+ * Used by PAP to update the policies running on PDPs, triggers a PDP_STATUS message with the result of the
+ * PDP_UPDATE operation.
+ */
+ PDP_UPDATE,
+
+ /**
+ * Used by PAP to change the state of PDPs, triggers a PDP_STATUS message with the result of the PDP_STATE_CHANGE
+ * operation.
+ */
+ PDP_STATE_CHANGE,
+
+ /**
+ * Used by PAP to order a health check on PDPs, triggers a PDP_STATUS message with the result of the
+ * PDP_HEALTH_CHECK operation.
+ */
+ PDP_HEALTH_CHECK,
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.enums;
+
+/**
+ * Class to hold the possible values for PDP response status.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public enum PdpResponseStatus {
+
+ /**
+ * PDP operation was successful.
+ */
+ SUCCESS,
+
+ /**
+ * PDP operation failed.
+ */
+ FAIL,
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.enums;
+
+/**
+ * Class to hold the possible values for state of PDP.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public enum PdpState {
+
+ /**
+ * Policy execution is always rejected irrespective of PDP type.
+ */
+ PASSIVE,
+
+ /**
+ * Policy execution proceeds, but changes to domain state or context are not carried out. The PDP returns an
+ * indication that it is running in SAFE mode together with the action it would have performed if it was operating
+ * in ACTIVE mode.
+ */
+ SAFE,
+
+ /**
+ * Policy execution proceeds and changes to domain and state are carried out in a test environment. The PDP returns
+ * an indication that it is running in TEST mode together with the action it has performed on the test environment.
+ */
+ TEST,
+
+ /**
+ * Policy execution is executed in the live environment by the PDP.
+ */
+ ACTIVE,
+
+ /**
+ * Policy execution is terminated and not available.
+ */
+ TERMINATED
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * ================================================================================
+ * 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.models.pdp.concepts;
+
+import com.openpojo.reflection.filters.FilterPackageInfo;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+import org.junit.Test;
+import org.onap.policy.common.utils.validation.ToStringTester;
+
+/**
+ * Class to perform unit testing of models.
+ *
+ * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
+ */
+public class TestModels {
+
+ @Test
+ public void testPapModels() {
+ final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester())
+ .with(new GetterTester()).build();
+ validator.validate(TestModels.class.getPackage().getName(), new FilterPackageInfo());
+ }
+}
<module>models-dao</module>
<module>models-tosca</module>
<module>models-pap</module>
+ <module>models-pdp</module>
<module>models-errors</module>
<module>models-decisions</module>
<module>models-provider</module>