aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/sa/searchdbabstraction/entity
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/aai/sa/searchdbabstraction/entity')
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java77
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java77
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java43
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java63
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java42
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java58
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java80
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java50
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java52
-rw-r--r--src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java52
10 files changed, 594 insertions, 0 deletions
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java
new file mode 100644
index 0000000..625a7b7
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationBucket.java
@@ -0,0 +1,77 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import edu.emory.mathcs.backport.java.util.Arrays;
+
+public class AggregationBucket {
+ private Object key;
+
+ @JsonProperty("formatted-key")
+ private String formattedKey;
+
+ private Number count;
+
+ @JsonProperty("sub-aggregations")
+ private AggregationResult[] subAggregationResult;
+
+ public Object getKey() {
+ return key;
+ }
+
+ public void setKey(Object key) {
+ this.key = key;
+ }
+
+ public String getFormattedKey() {
+ return formattedKey;
+ }
+
+ public void setFormattedKey(String formattedKey) {
+ this.formattedKey = formattedKey;
+ }
+
+ public Number getCount() {
+ return count;
+ }
+
+ public void setCount(Number count) {
+ this.count = count;
+ }
+
+ public AggregationResult[] getSubAggregationResult() {
+ return subAggregationResult;
+ }
+
+ public void setSubAggregationResult(AggregationResult[] subAggregationResult) {
+ this.subAggregationResult = subAggregationResult;
+ }
+
+ @Override
+ public String toString() {
+ return "AggregationBucket [key=" + key + ", formattedKey=" + formattedKey + ", count=" + count
+ + ", subAggregationResult=" + Arrays.toString(subAggregationResult) + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java
new file mode 100644
index 0000000..5b04009
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResult.java
@@ -0,0 +1,77 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import edu.emory.mathcs.backport.java.util.Arrays;
+
+public class AggregationResult {
+ private String name;
+
+ private Number count;
+
+ private AggregationBucket[] buckets;
+
+ @JsonProperty("nested-aggregations")
+ private AggregationResult[] nestedAggregations;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public AggregationBucket[] getBuckets() {
+ return buckets;
+ }
+
+ public void setBuckets(AggregationBucket[] buckets) {
+ this.buckets = buckets;
+ }
+
+ public AggregationResult[] getNestedAggregations() {
+ return nestedAggregations;
+ }
+
+ public void setNestedAggregations(AggregationResult[] nestedAggregations) {
+ this.nestedAggregations = nestedAggregations;
+ }
+
+ public Number getCount() {
+ return count;
+ }
+
+ public void setCount(Number count) {
+ this.count = count;
+ }
+
+ @Override
+ public String toString() {
+ return "AggregationResult [name=" + name + ", count=" + count + ", buckets="
+ + Arrays.toString(buckets) + ", nestedAggregations=" + Arrays.toString(nestedAggregations)
+ + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java
new file mode 100644
index 0000000..f26a0fd
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/AggregationResults.java
@@ -0,0 +1,43 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+import java.util.Arrays;
+
+public class AggregationResults {
+ private AggregationResult[] aggregations;
+
+ public AggregationResult[] getAggregations() {
+ return aggregations;
+ }
+
+ public void setAggregations(AggregationResult[] aggregations) {
+ this.aggregations = aggregations;
+ }
+
+ @Override
+ public String toString() {
+ return "AggregationResults [aggregations=" + Arrays.toString(aggregations) + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java
new file mode 100644
index 0000000..4a5d834
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/Document.java
@@ -0,0 +1,63 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+import org.json.simple.JSONObject;
+
+public class Document {
+ private String etag;
+ private String url;
+
+ private JSONObject content;
+
+ public String getEtag() {
+ return etag;
+ }
+
+ public void setEtag(String etag) {
+ this.etag = etag;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public JSONObject getContent() {
+ return content;
+ }
+
+ public void setContent(JSONObject content) {
+ this.content = content;
+ }
+
+ @Override
+ public String toString() {
+ return "Document [etag=" + etag + ", url=" + url + "]";
+ }
+
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java
new file mode 100644
index 0000000..5d14e75
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/DocumentOperationResult.java
@@ -0,0 +1,42 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+public class DocumentOperationResult extends OperationResult {
+ private Document document;
+
+ public Document getDocument() {
+ return document;
+ }
+
+ public void setDocument(Document document) {
+ this.document = document;
+ }
+
+ @Override
+ public String toString() {
+ return "DocumentOperationResult [document=" + document + "]";
+ }
+
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java
new file mode 100644
index 0000000..3a910a2
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/ErrorResult.java
@@ -0,0 +1,58 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+public class ErrorResult {
+
+ private String type;
+ private String reason;
+
+
+ public ErrorResult(String type, String reason) {
+ super();
+ this.type = type;
+ this.reason = reason;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getReason() {
+ return reason;
+ }
+
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
+
+ @Override
+ public String toString() {
+ return "ErrorResponse [type=" + type + ", reason=" + reason + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java
new file mode 100644
index 0000000..36d072f
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/OperationResult.java
@@ -0,0 +1,80 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+public class OperationResult {
+
+ private int resultCode;
+
+ private String failureCause;
+ private String resultVersion;
+ private String result;
+ private ErrorResult error;
+
+ public int getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(int resultCode) {
+ this.resultCode = resultCode;
+ }
+
+ public String getFailureCause() {
+ return failureCause;
+ }
+
+ public void setFailureCause(String failureCause) {
+ this.failureCause = failureCause;
+ }
+
+ public String getResultVersion() {
+ return resultVersion;
+ }
+
+ public void setResultVersion(String resultVersion) {
+ this.resultVersion = resultVersion;
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public ErrorResult getError() {
+ return error;
+ }
+
+ public void setError(ErrorResult error) {
+ this.error = error;
+ }
+
+ @Override
+ public String toString() {
+ return "OperationResult [resultCode=" + resultCode + ", failureCause=" + failureCause
+ + ", resultVersion=" + resultVersion + ", result=" + result + ", error=" + error + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java
new file mode 100644
index 0000000..9015d53
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHit.java
@@ -0,0 +1,50 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+public class SearchHit {
+ private String score;
+ Document document;
+
+ public String getScore() {
+ return score;
+ }
+
+ public void setScore(String score) {
+ this.score = score;
+ }
+
+ public Document getDocument() {
+ return document;
+ }
+
+ public void setDocument(Document document) {
+ this.document = document;
+ }
+
+ @Override
+ public String toString() {
+ return "SearchHit [score=" + score + ", document=" + document + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java
new file mode 100644
index 0000000..2c58377
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchHits.java
@@ -0,0 +1,52 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+import java.util.Arrays;
+
+public class SearchHits {
+ private String totalHits;
+ private SearchHit[] hits;
+
+ public String getTotalHits() {
+ return totalHits;
+ }
+
+ public void setTotalHits(String totalHits) {
+ this.totalHits = totalHits;
+ }
+
+ public SearchHit[] getHits() {
+ return hits;
+ }
+
+ public void setHits(SearchHit[] hits) {
+ this.hits = hits;
+ }
+
+ @Override
+ public String toString() {
+ return "SearchHits [totalHits=" + totalHits + ", hits=" + Arrays.toString(hits) + "]";
+ }
+
+}
diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java
new file mode 100644
index 0000000..540149e
--- /dev/null
+++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/entity/SearchOperationResult.java
@@ -0,0 +1,52 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017 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=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.aai.sa.searchdbabstraction.entity;
+
+public class SearchOperationResult extends OperationResult {
+
+ private SearchHits searchResult;
+ private AggregationResults aggregationResult;
+
+ public SearchHits getSearchResult() {
+ return searchResult;
+ }
+
+ public AggregationResults getAggregationResult() {
+ return aggregationResult;
+ }
+
+ public void setAggregationResult(AggregationResults aggregations) {
+ this.aggregationResult = aggregations;
+ }
+
+ public void setSearchResult(SearchHits hits) {
+ this.searchResult = hits;
+ }
+
+ @Override
+ public String toString() {
+ return "SearchOperationResult [searchResult=" + searchResult
+ + ", aggregationResult=" + aggregationResult;
+ }
+
+}