08467f0bd8b95fdb45a218fa1b9458a9295d7e44
[policy/apex-pdp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  *  Modifications Copyright (C) 2019 Nordix Foundation.
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  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.apex.plugins.event.carrier.restrequestor;
23
24 import java.util.Properties;
25
26 /**
27  * This class holds a record of a REST request for the REST requestor plugin.
28  *
29  * @author Liam Fallon (liam.fallon@ericsson.com)
30  */
31 public class ApexRestRequest {
32     private long executionId;
33     private String eventName;
34     private Object event;
35     private Properties executionProperties;
36     private long timestamp;
37
38     /**
39      * Instantiates a new apex rest request.
40      *
41      * @param executionId the execution id
42      * @param eventName the event name
43      * @param event the event
44      */
45     public ApexRestRequest(final long executionId, final Properties executionProperties,
46             final String eventName, final Object event) {
47         this.executionId = executionId;
48         this.executionProperties = executionProperties;
49         this.eventName = eventName;
50         this.event = event;
51     }
52
53     /**
54      * Gets the execution id.
55      *
56      * @return the execution id
57      */
58     public long getExecutionId() {
59         return executionId;
60     }
61
62     /**
63      * Gets the event name.
64      *
65      * @return the event name
66      */
67     public String getEventName() {
68         return eventName;
69     }
70
71     /**
72      * Gets the event.
73      *
74      * @return the event
75      */
76     public Object getEvent() {
77         return event;
78     }
79
80     /**
81      * Gets the executionProperties.
82      *
83      * @return the executionProperties
84      */
85     public Properties getExecutionProperties() {
86         return executionProperties;
87     }
88
89     /**
90      * Gets the timestamp.
91      *
92      * @return the timestamp
93      */
94     public long getTimestamp() {
95         return timestamp;
96     }
97
98     /**
99      * Sets the timestamp.
100      *
101      * @param timestamp the new timestamp
102      */
103     public void setTimestamp(final long timestamp) {
104         this.timestamp = timestamp;
105     }
106
107     /**
108      * {@inheritDoc}.
109      */
110     @Override
111     public String toString() {
112         return "ApexRestRequest [executionId=" + executionId + ", eventName=" + eventName + ", event=" + event
113                 + ", timestamp=" + timestamp + "]";
114     }
115 }