blob: 7b4589d5c321ce62eddda7a9c19252356cea5823 [file] [log] [blame]
Jian Liff8b9f92018-06-05 17:36:37 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.openstacktelemetry.api.config;
17
18import java.util.Map;
19
20/**
21 * Configuration API of gRPC for publishing openstack telemetry.
22 */
Jian Li69600e02018-12-24 13:21:18 +090023public interface GrpcTelemetryConfig extends TelemetryConfigProperties {
Jian Liff8b9f92018-06-05 17:36:37 +090024
25 /**
26 * Obtains gRPC server IP address.
27 *
28 * @return gRPC server IP address
29 */
30 String address();
31
32 /**
33 * Obtains gRPC server port number.
34 *
35 * @return gRPC server port number
36 */
37 int port();
38
39 /**
40 * Obtains usePlaintext gRPC config flag.
41 *
42 * @return usePlaintext gRPC config flag
43 */
44 boolean usePlaintext();
45
46 /**
47 * Obtains max inbound message size.
48 *
49 * @return max inbound message size
50 */
51 int maxInboundMsgSize();
52
53 /**
54 * Obtains kafka config maps.
55 *
56 * @return kafka config map
57 */
58 Map<String, Object> configMap();
59
60 /**
61 * Builder class of GrpcTelemetryConfig.
62 */
Jian Li69600e02018-12-24 13:21:18 +090063 interface Builder extends TelemetryConfigProperties.Builder {
Jian Liff8b9f92018-06-05 17:36:37 +090064
65 /**
66 * Sets gRPC server IP address.
67 *
68 * @param address gRPC server IP address
69 * @return builder instances
70 */
71 Builder withAddress(String address);
72
73 /**
74 * Sets gRPC server port number.
75 *
76 * @param port gRPC server port number
77 * @return builder instance
78 */
79 Builder withPort(int port);
80
81 /**
82 * Sets usePlaintext config flag.
83 *
84 * @param usePlaintext usePlaintext config flag
85 * @return builder instance
86 */
87 Builder withUsePlaintext(boolean usePlaintext);
88
89 /**
90 * Sets maximum inbound message size.
91 *
92 * @param maxInboundMsgSize maximum inbound message size
93 * @return builder instance
94 */
95 Builder withMaxInboundMsgSize(int maxInboundMsgSize);
96
97 /**
98 * Sets other gRPC configuration map.
99 *
100 * @param configMap gRPC configuration map
101 * @return builder instance
102 */
103 Builder withConfigMap(Map<String, Object> configMap);
104
105 /**
106 * Creates a gRPC telemetry config instance.
107 *
108 * @return gRPC telemetry config instance
109 */
110 GrpcTelemetryConfig build();
111 }
Jian Li69600e02018-12-24 13:21:18 +0900112}