Open Kilda Java Documentation
PathVerificationServiceConfig.java
Go to the documentation of this file.
1 /* Copyright 2018 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.floodlight.pathverification;
17 
18 import com.sabre.oss.conf4j.annotation.Configuration;
19 import com.sabre.oss.conf4j.annotation.Default;
20 import com.sabre.oss.conf4j.annotation.Key;
21 
22 import java.util.Properties;
23 import javax.validation.constraints.Max;
24 import javax.validation.constraints.Min;
25 import javax.validation.constraints.NotBlank;
26 
27 @Configuration
29  @Key("isl_bandwidth_quotient")
30  @Default("1.0")
31  @Min(0)
32  @Max(1)
33  double getIslBandwidthQuotient();
34 
35  @Key("hmac256-secret")
36  @NotBlank
37  String getHmac256Secret();
38 
39  @Key("bootstrap-servers")
40  String getBootstrapServers();
41 
45  default Properties createKafkaProducerProperties() {
46  Properties properties = new Properties();
47  properties.put("bootstrap.servers", getBootstrapServers());
48  properties.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
49  properties.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
50 
51  return properties;
52  }
53 }