* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.rest;
return opResult;
}
+ @Override
+ public OperationResult createDynamicIndex(String index, String dynamicSchema) {
+ OperationResult opResult = new OperationResult();
+ opResult.setResultCode(200);
+ // Directly return the json as this flow should not edit the json in any way
+ opResult.setResult(dynamicSchema);
+ return opResult;
+ }
+
@Override
public OperationResult deleteIndex(String indexName) throws DocumentStoreOperationException {
if (opResult.getDocument() != null) {
opResult.getDocument().setEtag(null);
opResult.getDocument().setUrl(null);
+ opResult.setResultVersion("1");
}
opResult.setResultCode(200);
opResult.setResult(indexName + "@" + document.getId());
+ opResult.setResultVersion("1");
}
return opResult;
if (indexName.equals(DOES_NOT_EXIST_INDEX)) {
opResult.setResultCode(404);
+ // Adding it to make the tests pass.
+ opResult.setResultVersion ("1");
} else {
opResult.setResultCode(200);
+ // Adding it to make the tests pass.
+ opResult.setResultVersion ("1");
}
return opResult;
return opResult;
}
+ @Override
+ public SearchOperationResult suggestionQueryWithPayload(String indexName, String query)
+ throws DocumentStoreOperationException {
+ SearchOperationResult opResult = new SearchOperationResult();
+
+ if (indexName.equals(DOES_NOT_EXIST_INDEX)) {
+ opResult.setResultCode(404);
+ } else {
+ opResult.setResultCode(200);
+ opResult.setResult(indexName + "@" + query);
+ }
+
+ return opResult;
+ }
+
@Override
public OperationResult performBulkOperations(BulkRequest[] requests) throws DocumentStoreOperationException {