add rest serve and distribution framework
[multicloud/framework.git] / artifactbroker / main / src / main / java / org / onap / policy / distribution / main / rest / StatisticsReport.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.distribution.main.rest;
22
23 /**
24  * Class to represent statistics report of distribution service.
25  *
26  * @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
27  */
28 public class StatisticsReport {
29
30     private int code;
31     private long totalDistributionCount;
32     private long distributionSuccessCount;
33     private long distributionFailureCount;
34     private long totalDownloadCount;
35     private long downloadSuccessCount;
36     private long downloadFailureCount;
37
38     /**
39      * Returns the code of this {@link StatisticsReport} instance.
40      *
41      * @return the code
42      */
43     public int getCode() {
44         return code;
45     }
46
47     /**
48      * Set code in this {@link StatisticsReport} instance.
49      *
50      * @param code the code to set
51      */
52     public void setCode(final int code) {
53         this.code = code;
54     }
55
56     /**
57      * Returns the totalDistributionCount of this {@link StatisticsReport} instance.
58      *
59      * @return the totalDistributionCount
60      */
61     public long getTotalDistributionCount() {
62         return totalDistributionCount;
63     }
64
65     /**
66      * Set totalDistributionCount in this {@link StatisticsReport} instance.
67      *
68      * @param totalDistributionCount the totalDistributionCount to set
69      */
70     public void setTotalDistributionCount(final long totalDistributionCount) {
71         this.totalDistributionCount = totalDistributionCount;
72     }
73
74     /**
75      * Returns the distributionSuccessCount of this {@link StatisticsReport} instance.
76      *
77      * @return the distributionSuccessCount
78      */
79     public long getDistributionSuccessCount() {
80         return distributionSuccessCount;
81     }
82
83     /**
84      * Set distributionSuccessCount in this {@link StatisticsReport} instance.
85      *
86      * @param distributionSuccessCount the distributionSuccessCount to set
87      */
88     public void setDistributionSuccessCount(final long distributionSuccessCount) {
89         this.distributionSuccessCount = distributionSuccessCount;
90     }
91
92     /**
93      * Returns the distributionFailureCount of this {@link StatisticsReport} instance.
94      *
95      * @return the distributionFailureCount
96      */
97     public long getDistributionFailureCount() {
98         return distributionFailureCount;
99     }
100
101     /**
102      * Set distributionFailureCount in this {@link StatisticsReport} instance.
103      *
104      * @param distributionFailureCount the distributionFailureCount to set
105      */
106     public void setDistributionFailureCount(final long distributionFailureCount) {
107         this.distributionFailureCount = distributionFailureCount;
108     }
109
110     /**
111      * Returns the totalDownloadCount of this {@link StatisticsReport} instance.
112      *
113      * @return the totalDownloadCount
114      */
115     public long getTotalDownloadCount() {
116         return totalDownloadCount;
117     }
118
119     /**
120      * Set totalDownloadCount in this {@link StatisticsReport} instance.
121      *
122      * @param totalDownloadCount the totalDownloadCount to set
123      */
124     public void setTotalDownloadCount(final long totalDownloadCount) {
125         this.totalDownloadCount = totalDownloadCount;
126     }
127
128     /**
129      * Returns the downloadSuccessCount of this {@link StatisticsReport} instance.
130      *
131      * @return the downloadSuccessCount
132      */
133     public long getDownloadSuccessCount() {
134         return downloadSuccessCount;
135     }
136
137     /**
138      * Set downloadSuccessCount in this {@link StatisticsReport} instance.
139      *
140      * @param downloadSuccessCount the downloadSuccessCount to set
141      */
142     public void setDownloadSuccessCount(final long downloadSuccessCount) {
143         this.downloadSuccessCount = downloadSuccessCount;
144     }
145
146     /**
147      * Returns the downloadFailureCount of this {@link StatisticsReport} instance.
148      *
149      * @return the downloadFailureCount
150      */
151     public long getDownloadFailureCount() {
152         return downloadFailureCount;
153     }
154
155     /**
156      * Set downloadFailureCount in this {@link StatisticsReport} instance.
157      *
158      * @param downloadFailureCount the downloadFailureCount to set
159      */
160     public void setDownloadFailureCount(final long downloadFailureCount) {
161         this.downloadFailureCount = downloadFailureCount;
162     }
163
164
165     /**
166      * {@inheritDoc}.
167      */
168     @Override
169     public String toString() {
170         final StringBuilder builder = new StringBuilder();
171         builder.append("StatisticsReport [code=");
172         builder.append(getCode());
173         builder.append(", totalDistributionCount=");
174         builder.append(getTotalDistributionCount());
175         builder.append(", distributionSuccessCount=");
176         builder.append(getDistributionSuccessCount());
177         builder.append(", distributionFailureCount=");
178         builder.append(getDistributionFailureCount());
179         builder.append(", totalDownloadCount=");
180         builder.append(getTotalDownloadCount());
181         builder.append(", downloadSuccessCount=");
182         builder.append(getDownloadSuccessCount());
183         builder.append(", downloadFailureCount=");
184         builder.append(getDownloadFailureCount());
185         builder.append("]");
186         return builder.toString();
187     }
188 }