2 * ============LICENSE_START=======================================================
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 ati
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.openecomp.sa.searchdbabstraction.elasticsearch.dao;
28 import org.openecomp.sa.rest.BulkRequest;
29 import org.openecomp.sa.rest.DocumentSchema;
30 import org.openecomp.sa.searchdbabstraction.elasticsearch.exception.DocumentStoreOperationException;
31 import org.openecomp.sa.searchdbabstraction.entity.DocumentOperationResult;
32 import org.openecomp.sa.searchdbabstraction.entity.OperationResult;
33 import org.openecomp.sa.searchdbabstraction.entity.SearchOperationResult;
36 public interface DocumentStoreInterface {
38 public OperationResult createIndex(String index, DocumentSchema documentSchema);
40 public OperationResult deleteIndex(String indexName) throws DocumentStoreOperationException;
42 public DocumentOperationResult createDocument(String indexName,
43 DocumentStoreDataEntity document,
44 boolean allowImplicitIndexCreation) throws DocumentStoreOperationException;
46 public DocumentOperationResult updateDocument(String indexName,
47 DocumentStoreDataEntity document,
48 boolean allowImplicitIndexCreation) throws DocumentStoreOperationException;
50 public DocumentOperationResult deleteDocument(String indexName, DocumentStoreDataEntity document)
51 throws DocumentStoreOperationException;
53 public DocumentOperationResult getDocument(String indexName, DocumentStoreDataEntity document)
54 throws DocumentStoreOperationException;
56 public SearchOperationResult search(String indexName, String queryText)
57 throws DocumentStoreOperationException;
59 public SearchOperationResult searchWithPayload(String indexName, String query)
60 throws DocumentStoreOperationException;
64 * Forwards a set of operations to the document store as a single, bulk
67 * @param anIndex - The index to apply the operations to.
68 * @param operations - A java object containing the set of operations to
70 * @return - An operation result.
71 * @throws DocumentStoreOperationException
73 public OperationResult performBulkOperations(BulkRequest[] request)
74 throws DocumentStoreOperationException;