b9111bf9a9e0b6469782ed420f16198b14680c60
[oom/platform/cert-service.git] / trustStoreMerger / src / main / java / org / onap / oom / truststoremerger / api / ExitStatus.java
1 /*============LICENSE_START=======================================================
2  * oom-truststore-merger
3  * ================================================================================
4  * Copyright (C) 2020 Nokia. All rights reserved.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  * ============LICENSE_END=========================================================
18  */
19
20 package org.onap.oom.truststoremerger.api;
21
22 public enum ExitStatus {
23
24     SUCCESS(0, "Success"),
25     TRUSTSTORES_PATHS_PROVIDER_EXCEPTION(1, "Invalid paths in environment variables"),
26     MERGER_CONFIGURATION_EXCEPTION(2, "Invalid merger configuration"),
27     TRUSTSTORE_FILE_FACTORY_EXCEPTION(3, "Invalid truststore file-password pair"),
28     PASSWORD_READER_EXCEPTION(4, "Cannot read password from file"),
29     CREATE_BACKUP_EXCEPTION(5, "Cannot create backup file"),
30     KEYSTORE_INSTANCE_EXCEPTION(6, "Cannot initialize keystore instance"),
31     TRUSTSTORE_LOAD_FILE_EXCEPTION(7, "Cannot load truststore file"),
32     TRUSTSTORE_DATA_OPERATION_EXCEPTION(8, "Cannot operate on truststore data"),
33     MISSING_TRUSTSTORE_EXCEPTION(9, "Missing truststore certificates in provided file"),
34     ALIAS_CONFLICT_EXCEPTION(10, "Alias conflict detected"),
35     WRITE_TRUSTSTORE_FILE_EXCEPTION(11, "Cannot save truststore file");
36
37
38     private final int value;
39     private final String message;
40
41     ExitStatus(int value, String message) {
42         this.value = value;
43         this.message = message;
44     }
45
46     public int getExitCodeValue() {
47         return value;
48     }
49
50     public String getMessage() {
51         return message;
52     }
53 }