Migrate to Java 8 Time API
[appc.git] / appc-dispatcher / appc-dispatcher-common / domain-model-lib / src / main / java / org / openecomp / appc / domainmodel / lcm / RuntimeContext.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                              reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.appc.domainmodel.lcm;
23
24 import java.time.Instant;
25 import java.util.Date;
26
27
28 public class RuntimeContext {
29
30     private RequestContext requestContext;
31     private ResponseContext responseContext;
32     private VNFContext vnfContext;
33
34     //TODO move fields timeStart abd isLockAcquired to a better place
35     private Instant timeStart;
36     private boolean isLockAcquired;
37     private String rpcName;
38
39     public String getRpcName() {
40         return rpcName;
41     }
42
43     public void setRpcName(String rpcName) {
44         this.rpcName = rpcName;
45     }
46
47     public Instant getTimeStart() {
48         return timeStart;
49     }
50
51     public boolean isLockAcquired() {
52         return isLockAcquired;
53     }
54
55     public void setIsLockAcquired(boolean isLockAcquired) {
56         this.isLockAcquired = isLockAcquired;
57     }
58
59     public void setTimeStart(Instant timeStart) {
60         this.timeStart = timeStart;
61     }
62
63     public RequestContext getRequestContext() {
64         return requestContext;
65     }
66
67     public void setRequestContext(RequestContext requestContext) {
68         this.requestContext = requestContext;
69     }
70
71     public ResponseContext getResponseContext() {
72         return responseContext;
73     }
74
75     public void setResponseContext(ResponseContext responseContext) {
76         this.responseContext = responseContext;
77     }
78
79     public VNFContext getVnfContext() {
80         return vnfContext;
81     }
82
83     public void setVnfContext(VNFContext vnfContext) {
84         this.vnfContext = vnfContext;
85     }
86
87     @Override
88     public String toString() {
89         return "RuntimeContext{" +
90                 "requestContext=" + requestContext +
91                 ", responseContext=" + responseContext +
92                 ", vnfContext=" + vnfContext +
93                 ", timeStart=" + timeStart +
94                 ", isLockAcquired=" + isLockAcquired +
95                 ", rpcName='" + rpcName + '\'' +
96                 '}';
97     }
98 }