0490e2cf5f6b6d6660e54551cc76b9c7b5cd98eb
[appc.git] / appc-dispatcher / appc-dispatcher-common / domain-model-lib / src / main / java / org / onap / appc / domainmodel / lcm / RequestStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.domainmodel.lcm;
26
27 /**
28  * This is a Enumeration class which introduces various Request Status
29  */
30 public enum RequestStatus {
31     // Unknown request status
32     UNKNOWN(ExternalActionStatus.FAILED, "Status cannot be determined.",true),
33     // Request just entered in APPC boundaries
34     RECEIVED(ExternalActionStatus.IN_PROGRESS, "Request has been received.",false),
35     // APPC has accepted the request/transaction to process after applying various business rules/validation
36     ACCEPTED(ExternalActionStatus.IN_PROGRESS, "Request has been accepted and is in progress.",false),
37     // APPC decided to reject the request based on various applicable business rules/validation.
38     REJECTED(ExternalActionStatus.FAILED, "Request has been rejected.",true),
39     // APPC has processed the VNF management request without any errors
40     SUCCESSFUL(ExternalActionStatus.SUCCESSFUL, "Request has been successfully completed.",true),
41     // APPC encountered error during processing the VNF management request
42     FAILED(ExternalActionStatus.FAILED, "Request failed because of an error",true),
43     // APPC Timed out because of reason that is out of control of APPC.
44     TIMEOUT(ExternalActionStatus.FAILED, "Request failed because it timed out",true),
45     // APPC aborted the request
46     ABORTED(ExternalActionStatus.ABORTED, "Request was aborted",true),
47     // APPC cannot find any related request
48     NOT_FOUND(ExternalActionStatus.NOT_FOUND, "Request was not found",true);
49
50     private ExternalActionStatus externalActionStatus;
51     private String description;
52     boolean terminal;
53
54     RequestStatus(ExternalActionStatus externalActionStatus, String description, boolean terminal) {
55         this.externalActionStatus = externalActionStatus;
56         this.description = description;
57         this.terminal=terminal;
58     }
59
60     public ExternalActionStatus getExternalActionStatus() {
61         return externalActionStatus;
62     }
63
64     public String getExternalActionStatusName() {
65         return externalActionStatus.name();
66     }
67
68     public String getDescription() {
69         return description;
70     }
71     public boolean isTerminal() {
72         return terminal;
73     }
74 }