Integrate aai-schema-ingest library into aai-core
[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-18 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
21 package org.onap.aai.validation;
22
23 /**
24  * Controls response to finding problems in the schema files.
25  */
26 public interface SchemaErrorStrategy {
27         /**
28          * Gives if it is OK to proceed with whatever process
29          * invoked the validation (probably the installation of
30          * the A&AI instance).
31          * 
32          * @return boolean
33          */
34         public boolean isOK();
35         
36         /**
37          * Gets the error message(s) gathered in the course
38          * of validation. 
39          * 
40          * @return String error message or messages concatenated together
41          */
42         public String getErrorMsg();
43         
44         /**
45          * Invokes the ErrorStrategy to do whatever response to
46          * an issue in the schema having been found.
47          * 
48          * Options:
49          * -Throw an exception if the whole process should be 
50          *  immediately aborted
51          * -Set OK status to false, store the message and allow the
52          *  validation process to continue and find any other issues
53          * -Completely ignore that something is wrong
54          * etc.
55          * 
56          * @param String errorMsg - the error message from the validator module
57          */
58         public void notifyOnError(String errorMsg);
59 }