added schema validation tools
[aai/aai-common.git] / aai-schema-ingest / src / main / java / org / onap / aai / validation / SchemaErrorStrategy.java
1 /** 
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 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
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  *
20  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  */
22
23 package org.onap.aai.validation;
24
25 /**
26  * Controls response to finding problems in the schema files.
27  */
28 public interface SchemaErrorStrategy {
29         /**
30          * Gives if it is OK to proceed with whatever process
31          * invoked the validation (probably the installation of
32          * the A&AI instance).
33          * 
34          * @return boolean
35          */
36         public boolean isOK();
37         
38         /**
39          * Gets the error message(s) gathered in the course
40          * of validation. 
41          * 
42          * @return String error message or messages concatenated together
43          */
44         public String getErrorMsg();
45         
46         /**
47          * Invokes the ErrorStrategy to do whatever response to
48          * an issue in the schema having been found.
49          * 
50          * Options:
51          * -Throw an exception if the whole process should be 
52          *  immediately aborted
53          * -Set OK status to false, store the message and allow the
54          *  validation process to continue and find any other issues
55          * -Completely ignore that something is wrong
56          * etc.
57          * 
58          * @param String errorMsg - the error message from the validator module
59          */
60         public void notifyOnError(String errorMsg);
61 }