2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.onap.aai.sa.searchdbabstraction.elasticsearch.dao;
26 import org.onap.aai.sa.rest.BulkRequest;
27 import org.onap.aai.sa.searchdbabstraction.elasticsearch.exception.DocumentStoreOperationException;
28 import org.onap.aai.sa.searchdbabstraction.entity.DocumentOperationResult;
29 import org.onap.aai.sa.searchdbabstraction.entity.OperationResult;
30 import org.onap.aai.sa.searchdbabstraction.entity.SearchOperationResult;
31 import org.onap.aai.sa.rest.DocumentSchema;
34 public interface DocumentStoreInterface {
36 public OperationResult createIndex(String index, DocumentSchema documentSchema);
38 public OperationResult deleteIndex(String indexName) throws DocumentStoreOperationException;
40 public DocumentOperationResult createDocument(String indexName,
41 DocumentStoreDataEntity document,
42 boolean allowImplicitIndexCreation) throws DocumentStoreOperationException;
44 public DocumentOperationResult updateDocument(String indexName,
45 DocumentStoreDataEntity document,
46 boolean allowImplicitIndexCreation) throws DocumentStoreOperationException;
48 public DocumentOperationResult deleteDocument(String indexName, DocumentStoreDataEntity document)
49 throws DocumentStoreOperationException;
51 public DocumentOperationResult getDocument(String indexName, DocumentStoreDataEntity document)
52 throws DocumentStoreOperationException;
54 public SearchOperationResult search(String indexName, String queryText)
55 throws DocumentStoreOperationException;
57 public SearchOperationResult searchWithPayload(String indexName, String query)
58 throws DocumentStoreOperationException;
62 * Forwards a set of operations to the document store as a single, bulk
65 * @param anIndex - The index to apply the operations to.
66 * @param operations - A java object containing the set of operations to
68 * @return - An operation result.
69 * @throws DocumentStoreOperationException
71 public OperationResult performBulkOperations(BulkRequest[] request)
72 throws DocumentStoreOperationException;