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