Jian Li | ff8b9f9 | 2018-06-05 17:36:37 +0900 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.openstacktelemetry.api.config; |
| 17 | |
| 18 | import java.util.Map; |
| 19 | |
| 20 | /** |
| 21 | * Configuration API of InfluxDB for publishing openstack telemetry. |
| 22 | */ |
Jian Li | 69600e0 | 2018-12-24 13:21:18 +0900 | [diff] [blame^] | 23 | public interface InfluxDbTelemetryConfig extends TelemetryConfigProperties { |
Jian Li | ff8b9f9 | 2018-06-05 17:36:37 +0900 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Obtains InfluxDB server IP address. |
| 27 | * |
| 28 | * @return InfluxDB server IP address |
| 29 | */ |
| 30 | String address(); |
| 31 | |
| 32 | /** |
| 33 | * Obtains InfluxDB server port number. |
| 34 | * |
| 35 | * @return InfluxDB server port number |
| 36 | */ |
| 37 | int port(); |
| 38 | |
| 39 | /** |
| 40 | * Obtains InfluxDB username for accessing. |
| 41 | * |
| 42 | * @return InfluxDB username |
| 43 | */ |
| 44 | String username(); |
| 45 | |
| 46 | /** |
| 47 | * Obtains InfluxDB password for accessing. |
| 48 | * |
| 49 | * @return InfluxDB password |
| 50 | */ |
| 51 | String password(); |
| 52 | |
| 53 | /** |
| 54 | * Obtains InfluxDB database name. |
| 55 | * |
| 56 | * @return InfluxDB database name |
| 57 | */ |
| 58 | String database(); |
| 59 | |
| 60 | /** |
Boyoung Jeong | 4d1c9d1 | 2018-07-20 17:09:20 +0900 | [diff] [blame] | 61 | * Obtains InfluxDB measurement name. |
| 62 | * |
| 63 | * @return InfluxDB measurement name |
| 64 | */ |
| 65 | String measurement(); |
| 66 | |
| 67 | /** |
Jian Li | ff8b9f9 | 2018-06-05 17:36:37 +0900 | [diff] [blame] | 68 | * Obtains InfluxDB enable batch flag. |
| 69 | * |
| 70 | * @return InfluxDB enable batch flag |
| 71 | */ |
| 72 | boolean enableBatch(); |
| 73 | |
| 74 | /** |
| 75 | * Obtains InfluxDB config maps. |
| 76 | * |
| 77 | * @return InfluxDB config map |
| 78 | */ |
| 79 | Map<String, Object> configMap(); |
| 80 | |
| 81 | /** |
| 82 | * Builder class of InfluxDbTelemetryConfig. |
| 83 | */ |
Jian Li | 69600e0 | 2018-12-24 13:21:18 +0900 | [diff] [blame^] | 84 | interface Builder extends TelemetryConfigProperties.Builder { |
Jian Li | ff8b9f9 | 2018-06-05 17:36:37 +0900 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Sets InfluxDB server IP address. |
| 88 | * |
| 89 | * @param address InfluxDB server IP address |
| 90 | * @return builder instances |
| 91 | */ |
| 92 | Builder withAddress(String address); |
| 93 | |
| 94 | /** |
| 95 | * Sets InfluxDB server port number. |
| 96 | * |
| 97 | * @param port InfluxDB server port number |
| 98 | * @return builder instance |
| 99 | */ |
| 100 | Builder withPort(int port); |
| 101 | |
| 102 | /** |
| 103 | * Sets InfluxDB username. |
| 104 | * |
| 105 | * @param username InfluxDB username |
| 106 | * @return builder instance |
| 107 | */ |
| 108 | Builder withUsername(String username); |
| 109 | |
| 110 | /** |
| 111 | * Sets InfluxDB password. |
| 112 | * |
| 113 | * @param password InfluxDB password |
| 114 | * @return builder instance |
| 115 | */ |
| 116 | Builder withPassword(String password); |
| 117 | |
Jian Li | 69600e0 | 2018-12-24 13:21:18 +0900 | [diff] [blame^] | 118 | /** |
Boyoung Jeong | 4d1c9d1 | 2018-07-20 17:09:20 +0900 | [diff] [blame] | 119 | * Sets InfluxDB measurement. |
| 120 | * |
| 121 | * @param measurement InfluxDB measurement |
| 122 | * @return builder instance |
| 123 | */ |
| 124 | Builder withMeasurement(String measurement); |
| 125 | |
Jian Li | ff8b9f9 | 2018-06-05 17:36:37 +0900 | [diff] [blame] | 126 | /** |
| 127 | * Sets InfluxDB database. |
| 128 | * |
| 129 | * @param database InfluxDB database |
| 130 | * @return builder instance |
| 131 | */ |
| 132 | Builder withDatabase(String database); |
| 133 | |
| 134 | /** |
| 135 | * Sets InfluxDB enable batch flag. |
| 136 | * |
| 137 | * @param enableBatch enable batch flag |
| 138 | * @return builder instance |
| 139 | */ |
| 140 | Builder withEnableBatch(boolean enableBatch); |
| 141 | |
| 142 | /** |
| 143 | * Sets other InfluxDB configuration map. |
| 144 | * |
| 145 | * @param configMap InfluxDB configuration map |
| 146 | * @return builder instance |
| 147 | */ |
| 148 | Builder withConfigMap(Map<String, Object> configMap); |
| 149 | |
| 150 | /** |
| 151 | * Creates a InfluxDB telemetry config instance. |
| 152 | * |
| 153 | * @return InfluxDB telemetry config instance |
| 154 | */ |
| 155 | InfluxDbTelemetryConfig build(); |
| 156 | } |
Jian Li | 69600e0 | 2018-12-24 13:21:18 +0900 | [diff] [blame^] | 157 | } |