6c267e67bcc7d65df1674bf1e71f0541212f93bb
[aai/model-loader.git] / src / main / java / org / onap / aai / modelloader / notification / DistributionStatusMsg.java
1 /**\r
2  * ============LICENSE_START=======================================================\r
3  * org.onap.aai\r
4  * ================================================================================\r
5  * Copyright © 2017 AT&T Intellectual Property.\r
6  * Copyright © 2017 Amdocs\r
7  * All rights reserved.\r
8  * ================================================================================\r
9  * Licensed under the Apache License, Version 2.0 (the "License");\r
10  * you may not use this file except in compliance with the License.\r
11  * You may obtain a copy of the License at\r
12  *\r
13  *     http://www.apache.org/licenses/LICENSE-2.0\r
14  *\r
15  * Unless required by applicable law or agreed to in writing, software\r
16  * distributed under the License is distributed on an "AS IS" BASIS,\r
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
18  * See the License for the specific language governing permissions and\r
19  * limitations under the License.\r
20  * ============LICENSE_END=========================================================\r
21  *\r
22  * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
23  */\r
24 package org.onap.aai.modelloader.notification;\r
25 \r
26 import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;\r
27 import org.openecomp.sdc.utils.DistributionStatusEnum;\r
28 \r
29 public class DistributionStatusMsg implements IDistributionStatusMessage {\r
30   private DistributionStatusEnum status;\r
31   private String distributionId;\r
32   private String consumerId;\r
33   private String artifactUrl;\r
34 \r
35   /**\r
36    * Creates a new DistributionStatusMsg instance.\r
37    * \r
38    * @param status         - The distribution status to be reported.\r
39    * @param distributionId - The identifier of the distribution who's status is being rported on.\r
40    * @param consumerId     - Identifier of the consumer associated with the distribution.\r
41    * @param artifactUrl    - Resource identifier for the artifact.\r
42    */\r
43   public DistributionStatusMsg(DistributionStatusEnum status, \r
44                                String distributionId,\r
45                                String consumerId, \r
46                                String artifactUrl) {\r
47     this.status = status;\r
48     this.distributionId = distributionId;\r
49     this.consumerId = consumerId;\r
50     this.artifactUrl = artifactUrl;\r
51   }\r
52 \r
53   @Override\r
54   public long getTimestamp() {\r
55     long currentTimeMillis = System.currentTimeMillis();\r
56     return currentTimeMillis;\r
57   }\r
58 \r
59   @Override\r
60   public DistributionStatusEnum getStatus() {\r
61     return status;\r
62   }\r
63 \r
64   @Override\r
65   public String getDistributionID() {\r
66     return distributionId;\r
67   }\r
68 \r
69   @Override\r
70   public String getConsumerID() {\r
71     return consumerId;\r
72   }\r
73   \r
74   @Override\r
75   public String getArtifactURL() {\r
76     return artifactUrl;\r
77   }\r
78 }\r