Change nexus values to properties
[appc.git] / appc-metric / appc-metric-bundle / src / main / java / org / openecomp / appc / metricservice / policy / impl / ScheduledPolicyBuilderImpl.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.metricservice.policy.impl;
23
24 import org.openecomp.appc.metricservice.Publisher;
25 import org.openecomp.appc.metricservice.metric.Metric;
26 import org.openecomp.appc.metricservice.policy.PublishingPolicy;
27 import org.openecomp.appc.metricservice.policy.ScheduledPolicyBuilder;
28
29
30 public class ScheduledPolicyBuilderImpl implements ScheduledPolicyBuilder {
31
32     private long startTime;
33     private long period;
34     private Publisher[] publishers;
35     private Metric[] metrics;
36
37     @Override
38     public ScheduledPolicyBuilder withStartTime(long time) {
39        this.startTime=time;
40         return this;
41     }
42
43     @Override
44     public ScheduledPolicyBuilder withPeriod(long period) {
45         this.period=period;
46         return this;
47     }
48
49     @Override
50     public ScheduledPolicyBuilder withPublishers(Publisher[] publishers) {
51         this.publishers=publishers;
52         return this;
53     }
54
55     @Override
56     public ScheduledPolicyBuilder withMetrics(Metric[] metrics) {
57         this.metrics=metrics;
58         return this;
59     }
60
61     @Override
62     public PublishingPolicy build() {
63         return new ScheduledPublishingPolicyImpl(this.publishers,this.metrics);
64     }
65 }