2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.dao.neo4j;
23 public enum Neo4jOperationStatus {
25 OK, NOT_CONNECTED, NOT_AUTHORIZED, HTTP_PROTOCOL_ERROR, DB_NOT_AVAILABLE, DB_READ_ONLY, BAD_REQUEST, LEGACY_INDEX_ERROR, SCHEMA_ERROR, TRANSACTION_ERROR, EXECUTION_FAILED, ENTITY_ALREADY_EXIST,
27 WRONG_INPUT, GENERAL_ERROR, NOT_SUPPORTED, NOT_FOUND;
29 private String originError;
30 private String message;
31 private String helpErrorMsg;
33 private static final String NA = "NA";
35 Neo4jOperationStatus() {
41 public Neo4jOperationStatus setOriginError(String originError) {
42 this.originError = originError;
46 public Neo4jOperationStatus setMessage(String message) {
47 if (message != null && !message.isEmpty()) {
48 this.message = message;
53 public Neo4jOperationStatus setHelpErrorMsg(String helpErrorMsg) {
54 this.helpErrorMsg = helpErrorMsg;
58 public String getOriginError() {
62 public String getMessage() {
66 public String getHelpErrorMsg() {
70 public String printError() {
71 StringBuilder sb = new StringBuilder();
72 sb.append("[").append(toString()).append("-").append(originError).append("-").append(helpErrorMsg).append("-")
73 .append(message).append("]");