diff options
Diffstat (limited to 'plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models')
4 files changed, 340 insertions, 0 deletions
diff --git a/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/CloudRegionKey.java b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/CloudRegionKey.java new file mode 100755 index 00000000..3c45c196 --- /dev/null +++ b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/CloudRegionKey.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.so.aaisimulator.models; + +import java.io.Serializable; +import org.springframework.util.ObjectUtils; + +/** + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class CloudRegionKey implements Serializable { + + private static final long serialVersionUID = 6175094050996035737L; + + private final String cloudOwner; + + private final String cloudRegionId; + + public CloudRegionKey(final String cloudOwner, final String cloudRegionId) { + this.cloudOwner = cloudOwner; + this.cloudRegionId = cloudRegionId; + } + + /** + * @return the cloudOwner + */ + public String getCloudOwner() { + return cloudOwner; + } + + /** + * @return the cloudRegionId + */ + public String getCloudRegionId() { + return cloudRegionId; + } + + public boolean isValid() { + return cloudOwner != null && !cloudOwner.isEmpty() && cloudRegionId != null && !cloudRegionId.isEmpty(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (ObjectUtils.nullSafeHashCode(cloudOwner)); + result = prime * result + (ObjectUtils.nullSafeHashCode(cloudRegionId)); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof CloudRegionKey) { + final CloudRegionKey other = (CloudRegionKey) obj; + return ObjectUtils.nullSafeEquals(cloudOwner, other.cloudOwner) + && ObjectUtils.nullSafeEquals(cloudRegionId, other.cloudRegionId); + } + return false; + } + + @Override + public String toString() { + return "CloudRegionKey [cloudOwner=" + cloudOwner + ", cloudRegionId=" + cloudRegionId + "]"; + } + +} diff --git a/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Format.java b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Format.java new file mode 100755 index 00000000..1c851fc3 --- /dev/null +++ b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Format.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.so.aaisimulator.models; + +/** + * @author waqas.ikram@ericsson.com + * + */ +public enum Format { + + COUNT("count"), RAW("raw"), PATHED("pathed"); + + private final String value; + + private Format(final String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Format forValue(final String value) { + for (final Format format : Format.values()) { + if (format.getValue().equals(value)) { + return format; + } + } + return RAW; + } + +} diff --git a/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/NodeServiceInstance.java b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/NodeServiceInstance.java new file mode 100755 index 00000000..4a645915 --- /dev/null +++ b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/NodeServiceInstance.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.so.aaisimulator.models; + +import java.io.Serializable; + +/** + * @author waqas.ikram@ericsson.com + * + */ +public class NodeServiceInstance implements Serializable { + + private static final long serialVersionUID = -3314166327618070948L; + + private String globalCustomerId; + private String serviceType; + private String serviceInstanceId; + private String resourceType; + private String resourceLink; + + public NodeServiceInstance() {} + + + public NodeServiceInstance(final String globalCustomerId, final String serviceType, final String serviceInstanceId, + final String resourceType, final String resourceLink) { + this.globalCustomerId = globalCustomerId; + this.serviceType = serviceType; + this.serviceInstanceId = serviceInstanceId; + this.resourceType = resourceType; + this.resourceLink = resourceLink; + } + + + /** + * @return the globalCustomerId + */ + public String getGlobalCustomerId() { + return globalCustomerId; + } + + + /** + * @param globalCustomerId the globalCustomerId to set + */ + public void setGlobalCustomerId(final String globalCustomerId) { + this.globalCustomerId = globalCustomerId; + } + + + /** + * @return the serviceType + */ + public String getServiceType() { + return serviceType; + } + + + /** + * @param serviceType the serviceType to set + */ + public void setServiceType(final String serviceType) { + this.serviceType = serviceType; + } + + + /** + * @return the serviceInstanceId + */ + public String getServiceInstanceId() { + return serviceInstanceId; + } + + + /** + * @param serviceInstanceId the serviceInstanceId to set + */ + public void setServiceInstanceId(final String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + + /** + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } + + + /** + * @param resourceType the resourceType to set + */ + public void setResourceType(final String resourceType) { + this.resourceType = resourceType; + } + + + /** + * @return the resourceLink + */ + public String getResourceLink() { + return resourceLink; + } + + + /** + * @param resourceLink the resourceLink to set + */ + public void setResourceLink(final String resourceLink) { + this.resourceLink = resourceLink; + } + + + @Override + public String toString() { + return "NodeServiceInstance [globalCustomerId=" + globalCustomerId + ", serviceType=" + serviceType + + ", serviceInstanceId=" + serviceInstanceId + ", resourceType=" + resourceType + ", resourceLink=" + + resourceLink + "]"; + } + + +} diff --git a/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Results.java b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Results.java new file mode 100755 index 00000000..8dc20242 --- /dev/null +++ b/plans/usecases/pnf-sw-upgrade/so/simulator/aai-simulator/src/main/java/org/onap/so/aaisimulator/models/Results.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.so.aaisimulator.models; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author waqas.ikram@ericsson.com + * + */ +public class Results implements Serializable { + + private static final long serialVersionUID = 3967660859271162759L; + + @JsonProperty("results") + private List<Map<String, Object>> values = new ArrayList<>(); + + public Results() {} + + public Results(final Map<String, Object> value) { + this.values.add(value); + } + + /** + * @return the values + */ + public List<Map<String, Object>> getValues() { + return values; + } + + /** + * @param values the values to set + */ + public void setValues(final List<Map<String, Object>> values) { + this.values = values; + } + + + @JsonIgnore + @Override + public String toString() { + return "Result [values=" + values + "]"; + } + +} |