diff options
author | Dan Timoney <dt5972@att.com> | 2018-07-27 20:53:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-27 20:53:51 +0000 |
commit | 46c24a62f6931364075e9bd1cd33446dfdc9575b (patch) | |
tree | 8de852a617861bff9f8f1d1d80b0d2636e1e64b2 /pomba/network-discovery-api/src/main/java/org/onap | |
parent | 7a8f22568543677bd2ef98f5d69a8c557a9d038c (diff) | |
parent | 92c73de0f57aee2ada5f5c85b960c4c8ce7adf85 (diff) |
Merge "Initial code for network discovery microservice"
Diffstat (limited to 'pomba/network-discovery-api/src/main/java/org/onap')
5 files changed, 307 insertions, 0 deletions
diff --git a/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Attribute.java b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Attribute.java new file mode 100644 index 0000000..131b708 --- /dev/null +++ b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Attribute.java @@ -0,0 +1,53 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.sdnc.apps.pomba.networkdiscovery.datamodel; + +public class Attribute { + private String name; + private String value; + private DataQuality dataQuality; + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public DataQuality getDataQuality() { + return this.dataQuality; + } + + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + @Override + public String toString() { + return "Attribute [name=" + this.name + ", value=" + this.value + ", dataQuality=" + this.dataQuality + "]"; + } +} diff --git a/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/DataQuality.java b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/DataQuality.java new file mode 100644 index 0000000..3e7836a --- /dev/null +++ b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/DataQuality.java @@ -0,0 +1,65 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.sdnc.apps.pomba.networkdiscovery.datamodel; + +public class DataQuality { + public static enum Status { + ok, error + } + + private Status status; + private String errorText; + + + public Status getStatus() { + return this.status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public String getErrorText() { + return this.errorText; + } + + public void setErrorText(String errorText) { + this.errorText = errorText; + } + + + public static DataQuality ok() { + // as a non-mutable class, it is not safe to define a constant for this + DataQuality result = new DataQuality(); + result.setStatus(Status.ok); + return result; + } + + public static DataQuality error(String text) { + // as a non-mutable class, it is not safe to define a constant for this + DataQuality result = new DataQuality(); + result.setStatus(Status.error); + result.setErrorText(text); + return result; + } + + @Override + public String toString() { + return "DataQuality [status=" + this.status + ", errorText=" + this.errorText + "]"; + } +} diff --git a/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryNotification.java b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryNotification.java new file mode 100644 index 0000000..0508628 --- /dev/null +++ b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryNotification.java @@ -0,0 +1,41 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.sdnc.apps.pomba.networkdiscovery.datamodel; + +import java.util.List; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class NetworkDiscoveryNotification extends NetworkDiscoveryResponse { + private List<Resource> resources; + + public List<Resource> getResources() { + return this.resources; + } + + public void setResources(List<Resource> resources) { + this.resources = resources; + } + + @Override + public String toString() { + return "NetworkDiscoveryResponse [requestId=" + getRequestId() + ", code=" + getCode() + ", message=" + + getMessage() + ", ackFinalIndicator=" + getAckFinalIndicator() + ", resources=" + this.resources + + "]"; + } +} diff --git a/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryResponse.java b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryResponse.java new file mode 100644 index 0000000..136688a --- /dev/null +++ b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/NetworkDiscoveryResponse.java @@ -0,0 +1,74 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.sdnc.apps.pomba.networkdiscovery.datamodel; + +import java.util.List; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class NetworkDiscoveryResponse { + /** The originating request identifier */ + private String requestId; + /** Result code - 200 indicates success */ + private Integer code; + private String message; + + /** + * @return false if further asynchronous notifications will follow. + */ + private Boolean ackFinalIndicator; + + public String getRequestId() { + return this.requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public Integer getCode() { + return this.code; + } + + public void setCode(Integer responseCode) { + this.code = responseCode; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String responseMessage) { + this.message = responseMessage; + } + + public Boolean getAckFinalIndicator() { + return this.ackFinalIndicator; + } + + public void setAckFinalIndicator(Boolean ackFinalIndicator) { + this.ackFinalIndicator = ackFinalIndicator; + } + + @Override + public String toString() { + return "NetworkDiscoveryResponse [requestId=" + this.requestId + ", code=" + this.code + ", message=" + + this.message + ", ackFinalIndicator=" + this.ackFinalIndicator + + "]"; + } +} diff --git a/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Resource.java b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Resource.java new file mode 100644 index 0000000..a98d457 --- /dev/null +++ b/pomba/network-discovery-api/src/main/java/org/onap/sdnc/apps/pomba/networkdiscovery/datamodel/Resource.java @@ -0,0 +1,74 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.sdnc.apps.pomba.networkdiscovery.datamodel; + +import java.util.List; + +public class Resource { + private String id; + private String name; + private String type; + private DataQuality dataQuality; + private List<Attribute> attributeList; + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public List<Attribute> getAttributeList() { + return this.attributeList; + } + + public void setAttributeList(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + + public DataQuality getDataQuality() { + return this.dataQuality; + } + + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + @Override + public String toString() { + return "Resource [id=" + this.id + ", name=" + this.name + ", type=" + this.type + ", dataQuality=" + + this.dataQuality + ", attributeList=" + this.attributeList + "]"; + } +} |