2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.onap.aai.sparky.dal.sas.entity;
27 import java.util.ArrayList;
28 import java.util.List;
30 public class SearchAbstractionEntityBuilder {
33 public static HitEntity getHitSample1() {
35 HitEntity hitEntity = new HitEntity();
36 DocumentEntity doc = new DocumentEntity();
38 hitEntity.setDocument(doc);
39 hitEntity.setScore("17.073963");
41 doc.addContent("entityPrimaryKeyValue", "example-vnf-id-val-4394");
42 doc.addContent("entityType", "vpe");
43 doc.addContent("searchTags",
44 "example-vnf-id-val-4394;example-vnf-name-val-4394;example-vnf-name2-val-4394");
45 doc.addContent("link",
46 "https://aai-ext1.test.att.com:8443/aai/v9/network/vpes/vpe/example-vnf-id-val-4394");
47 doc.addContent("searchTagIDs", "0;1;2");
48 doc.addContent("lastmodTimestamp", "2017-04-18T17:20:48.072-0400");
51 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/e317a35256717f10e88d1b2c995efcdddfc911bf350c73e37e8afca6dfb11553");
59 public static HitEntity getHitSample2() {
61 HitEntity hitEntity = new HitEntity();
62 DocumentEntity doc = new DocumentEntity();
64 hitEntity.setDocument(doc);
65 hitEntity.setScore("17.073963");
67 doc.addContent("entityPrimaryKeyValue", "vpe-vnf-id-team4-11");
68 doc.addContent("entityType", "vpe");
69 doc.addContent("searchTags",
70 "vpe-vnf-id-team4-11;example-vnf-name-val-9512;example-vnf-name2-val-9512");
71 doc.addContent("link",
72 "https://aai-ext1.test.att.com:8443/aai/v9/network/vpes/vpe/vpe-vnf-id-team4-11");
73 doc.addContent("searchTagIDs", "0;1;2");
74 doc.addContent("lastmodTimestamp", "2017-04-18T17:20:48.175-0400");
77 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/80f6d1a252e047e50e0adbeb90ad30876bb5b63cf70c9dd53f3fe46aeb50c74b");
85 public static HitEntity getHitSample3() {
87 HitEntity hitEntity = new HitEntity();
88 DocumentEntity doc = new DocumentEntity();
90 hitEntity.setDocument(doc);
91 hitEntity.setScore("17.030035");
93 doc.addContent("entityPrimaryKeyValue", "example-vnf-id-val-6176");
94 doc.addContent("entityType", "generic-vnf");
95 doc.addContent("searchTags",
96 "example-vnf-id-val-6176;example-vnf-name-val-6176;example-vnf-name2-val-6176");
97 doc.addContent("link",
98 "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/example-vnf-id-val-6176");
99 doc.addContent("searchTagIDs", "0;1;2");
100 doc.addContent("lastmodTimestamp", "2017-04-18T17:29:39.889-0400");
103 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/8dfd1136f943296508fee11efcda35a0719aa490aa60e9abffecce0b220d8c94");
111 public static HitEntity getHitSample4() {
113 HitEntity hitEntity = new HitEntity();
114 DocumentEntity doc = new DocumentEntity();
116 hitEntity.setDocument(doc);
117 hitEntity.setScore("17.01174");
119 doc.addContent("entityPrimaryKeyValue", "vnf-id-team4-11");
120 doc.addContent("entityType", "newvce");
121 doc.addContent("searchTags",
122 "vnf-id-team4-11;example-vnf-name-val-5313;example-vnf-name2-val-5313");
123 doc.addContent("link",
124 "https://aai-ext1.test.att.com:8443/aai/v9/network/newvces/newvce/vnf-id-team4-11");
125 doc.addContent("searchTagIDs", "0;1;2");
126 doc.addContent("lastmodTimestamp", "2017-04-18T17:21:08.142-0400");
129 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/83dcab92d75b20eb94578039c8cec5e7b6b4717791e3c367d8af5069ce76dc90");
137 public static HitEntity getHitSample5() {
139 HitEntity hitEntity = new HitEntity();
140 DocumentEntity doc = new DocumentEntity();
142 hitEntity.setDocument(doc);
143 hitEntity.setScore("17.01174");
145 doc.addContent("entityPrimaryKeyValue", "example-vnf-id2-val-9501");
146 doc.addContent("entityType", "newvce");
147 doc.addContent("searchTags",
148 "example-vnf-id2-val-9501;example-vnf-name-val-9501;example-vnf-name2-val-9501");
149 doc.addContent("link",
150 "https://aai-ext1.test.att.com:8443/aai/v9/network/newvces/newvce/example-vnf-id2-val-9501");
151 doc.addContent("searchTagIDs", "0;1;2");
152 doc.addContent("lastmodTimestamp", "2017-04-18T17:21:23.323-0400");
155 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/461816ba8aa94d01f2c978999b843dbaf10e0509db58d1945d6f5999d6db8f5e");
163 public static HitEntity getHitSample6() {
165 HitEntity hitEntity = new HitEntity();
166 DocumentEntity doc = new DocumentEntity();
168 hitEntity.setDocument(doc);
169 hitEntity.setScore("17.01174");
171 doc.addContent("entityPrimaryKeyValue", "vnf-id-dm-auto-10");
172 doc.addContent("entityType", "vce");
173 doc.addContent("searchTags",
174 "vpe-id-dm-auto-10;vnf-id-dm-auto-10;vnf-name-dm-auto-10;vnf-name2-dm-auto-10");
175 doc.addContent("link",
176 "https://aai-ext1.test.att.com:8443/aai/v9/network/vces/vce/vnf-id-dm-auto-10");
177 doc.addContent("searchTagIDs", "0;1;2;3");
178 doc.addContent("lastmodTimestamp", "2017-04-18T17:24:57.209-0400");
181 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/1ead4512e65ee0eafb24e0156cc1abdf97368f08dfe065f02580aa09661bbcd8");
189 public static HitEntity getHitSample7() {
191 HitEntity hitEntity = new HitEntity();
192 DocumentEntity doc = new DocumentEntity();
194 hitEntity.setDocument(doc);
195 hitEntity.setScore("13.940832");
197 doc.addContent("entityPrimaryKeyValue", "e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7");
198 doc.addContent("entityType", "generic-vnf");
199 doc.addContent("searchTags", "e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7;VNF_Test_vNF_modules_01");
200 doc.addContent("link",
201 "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/e3e59c5b-ad48-44d0-b3e4-80eacdcee4c7");
202 doc.addContent("searchTagIDs", "0;1");
203 doc.addContent("lastmodTimestamp", "2017-04-18T17:26:34.603-0400");
206 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/1462582e8fd7786f72f26548e4247b72ab6cd101cca0bbb68a60dd3ad16500d0");
214 public static HitEntity getHitSample8() {
216 HitEntity hitEntity = new HitEntity();
217 DocumentEntity doc = new DocumentEntity();
219 hitEntity.setDocument(doc);
220 hitEntity.setScore("13.940832");
222 doc.addContent("entityPrimaryKeyValue", "fusion-jitsi-vnf-001");
223 doc.addContent("entityType", "generic-vnf");
224 doc.addContent("searchTags", "fusion-jitsi-vnf-001;fusion-jitsi-vnf");
225 doc.addContent("link",
226 "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/fusion-jitsi-vnf-001");
227 doc.addContent("searchTagIDs", "0;1");
228 doc.addContent("lastmodTimestamp", "2017-04-18T17:28:14.293-0400");
231 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/b79ddfec9a00184445174c91e7490a0d407f351983bba4ae53bfec0584f73ee3");
239 public static HitEntity getHitSample9() {
241 HitEntity hitEntity = new HitEntity();
242 DocumentEntity doc = new DocumentEntity();
244 hitEntity.setDocument(doc);
245 hitEntity.setScore("13.940832");
247 doc.addContent("entityPrimaryKeyValue", "vnfm0003v");
248 doc.addContent("entityType", "generic-vnf");
249 doc.addContent("searchTags", "vnfm0003v;vnfm0003v");
250 doc.addContent("link",
251 "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/vnfm0003v");
252 doc.addContent("searchTagIDs", "0;1");
253 doc.addContent("lastmodTimestamp", "2017-04-18T17:29:39.594-0400");
256 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/52ae232ea5506d6de8ef35c4f46a1ceafe35f3717ff578b83531bc7615870b12");
264 public static HitEntity getHitSample10() {
266 HitEntity hitEntity = new HitEntity();
267 DocumentEntity doc = new DocumentEntity();
269 hitEntity.setDocument(doc);
270 hitEntity.setScore("13.928098");
272 doc.addContent("entityPrimaryKeyValue", "amist456vnf");
273 doc.addContent("entityType", "generic-vnf");
274 doc.addContent("searchTags", "amist456vnf;amist456vnf");
275 doc.addContent("link",
276 "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/amist456vnf");
277 doc.addContent("searchTagIDs", "0;1");
278 doc.addContent("lastmodTimestamp", "2017-04-18T17:28:28.163-0400");
281 "services/search-data-service/v1/search/indexes/entitysearchindex-localhost-ist-apr18/documents/3424afea5963696380a0fdc78ee5320cf5fa9bc0459f1f9376db208d31196434");
291 public static SearchAbstractionResponse getSuccessfulEntitySearchResponse() {
293 SearchAbstractionResponse sasResponse = new SearchAbstractionResponse();
295 SearchResult searchResult = new SearchResult();
296 sasResponse.setSearchResult(searchResult);
298 searchResult.setTotalHits(3257);
300 List<HitEntity> hits = new ArrayList<HitEntity>();
302 hits.add(getHitSample1());
303 hits.add(getHitSample2());
304 hits.add(getHitSample3());
305 hits.add(getHitSample4());
306 hits.add(getHitSample5());
307 hits.add(getHitSample6());
308 hits.add(getHitSample7());
309 hits.add(getHitSample8());
310 hits.add(getHitSample9());
311 hits.add(getHitSample10());
313 searchResult.setHits(hits);