| 1 | package cz.vutbr.feec.session.rtprtcp; |
| 2 | |
| 3 | import cz.vutbr.feec.session.rtprtcp.internal.SessionType; |
| 4 | import org.apache.commons.lang.builder.ToStringBuilder; |
| 5 | |
| 6 | public class Config { |
| 7 | |
| 8 | /** The member scale. */ |
| 9 | private Integer memberScale = null; |
| 10 | /** The time scale. */ |
| 11 | private Integer timeScale = null; |
| 12 | /** The local ip address. */ |
| 13 | private String localIpAddress = null; |
| 14 | /** The CNAME. */ |
| 15 | private String CNAME = null; |
| 16 | /** The SSM source ip address. */ |
| 17 | private String SSMSourceIpAddress = null; |
| 18 | /** The SSM group ip address. */ |
| 19 | private String SSMGroupIpAddress = null; |
| 20 | /** The SSM port audio. */ |
| 21 | private Integer SSMPortAudio = null; |
| 22 | /** The feedback ip address. */ |
| 23 | private String feedbackIpAddress = null; |
| 24 | /** The feedback in port audio. */ |
| 25 | private Integer feedbackInPortAudio = null; |
| 26 | /** The feedback out port audio. */ |
| 27 | private Integer feedbackOutPortAudio = null; |
| 28 | private SessionType memberType = null; |
| 29 | /** The is SSM. */ |
| 30 | private Integer ifNumber = null; |
| 31 | /** The bandwidth audio. */ |
| 32 | protected Integer bandwidthAudio = null; |
| 33 | /** The bandwidth video. */ |
| 34 | protected Integer bandwidthVideo = null; |
| 35 | /** The payload type video. */ |
| 36 | protected int payloadTypeVideo = -1; |
| 37 | /** The payload type audio. */ |
| 38 | private int payloadTypeAudio = -1; |
| 39 | /** The SSM port video. */ |
| 40 | Integer SSMPortVideo = null; |
| 41 | /** The feedback in port video. */ |
| 42 | Integer feedbackInPortVideo = null; |
| 43 | /** The feedback out port video. */ |
| 44 | Integer feedbackOutPortVideo = null; |
| 45 | |
| 46 | public Config() { |
| 47 | super(); |
| 48 | } |
| 49 | |
| 50 | |
| 51 | /** |
| 52 | * Gets the SSM port video. |
| 53 | * |
| 54 | * @return the SSM port video |
| 55 | */ |
| 56 | public Integer getSSMPortVideo() { |
| 57 | return SSMPortVideo; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Sets the SSM port video. |
| 62 | * |
| 63 | * @param SSMPort |
| 64 | * the SSM port video |
| 65 | */ |
| 66 | public void setSSMPortVideo(Integer SSMPort) { |
| 67 | this.SSMPortVideo = SSMPort; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Gets the feedback in port video. |
| 72 | * |
| 73 | * @return the feedback in port video |
| 74 | */ |
| 75 | public Integer getFeedbackInPortVideo() { |
| 76 | return feedbackInPortVideo; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Sets the feedback in port video. |
| 81 | * |
| 82 | * @param feedbackPort |
| 83 | * the feedback in port video |
| 84 | */ |
| 85 | public void setFeedbackInPortVideo(Integer feedbackPort) { |
| 86 | this.feedbackInPortVideo = feedbackPort; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Gets the bandwidth video. |
| 91 | * |
| 92 | * @return the bandwidth video |
| 93 | */ |
| 94 | public Integer getBandwidthVideo() { |
| 95 | return bandwidthVideo; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Sets the bandwidth video. |
| 100 | * |
| 101 | * @param bandwidthVideo |
| 102 | * the bandwidth video |
| 103 | */ |
| 104 | public void setBandwidthVideo(Integer bandwidthVideo) { |
| 105 | this.bandwidthVideo = bandwidthVideo; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Gets the feedback out port video. |
| 110 | * |
| 111 | * @return the feedback out port video |
| 112 | */ |
| 113 | public Integer getFeedbackOutPortVideo() { |
| 114 | return feedbackOutPortVideo; |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Sets the feedback out port video. |
| 119 | * |
| 120 | * @param feedbackOutPortVideo |
| 121 | * the feedback out port video |
| 122 | */ |
| 123 | public void setFeedbackOutPortVideo(Integer feedbackOutPortVideo) { |
| 124 | this.feedbackOutPortVideo = feedbackOutPortVideo; |
| 125 | } |
| 126 | |
| 127 | public void setPayloadTypeVideo(int payloadType) { |
| 128 | this.payloadTypeVideo = payloadType; |
| 129 | } |
| 130 | |
| 131 | public int getPayloadTypeVideo() { |
| 132 | return payloadTypeVideo; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Validate. |
| 137 | * |
| 138 | * @return true if is configured as valid |
| 139 | */ |
| 140 | protected boolean validate() { |
| 141 | |
| 142 | return !(memberScale == null || timeScale == null || |
| 143 | |
| 144 | localIpAddress == null || CNAME == null || |
| 145 | |
| 146 | SSMSourceIpAddress == null || SSMGroupIpAddress == null |
| 147 | || SSMPortAudio == null || |
| 148 | |
| 149 | feedbackIpAddress == null || feedbackInPortAudio == null |
| 150 | || feedbackOutPortAudio == null || |
| 151 | |
| 152 | memberType == null || |
| 153 | |
| 154 | bandwidthAudio == null); |
| 155 | } |
| 156 | |
| 157 | /* |
| 158 | * (non-Javadoc) |
| 159 | * |
| 160 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getMemberScale() |
| 161 | */ |
| 162 | public int getMemberScale() { |
| 163 | return memberScale; |
| 164 | } |
| 165 | |
| 166 | /* |
| 167 | * (non-Javadoc) |
| 168 | * |
| 169 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setMemberScale(int) |
| 170 | */ |
| 171 | public void setMemberScale(int memberScale) { |
| 172 | this.memberScale = memberScale; |
| 173 | } |
| 174 | |
| 175 | /* |
| 176 | * (non-Javadoc) |
| 177 | * |
| 178 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getTimeScale() |
| 179 | */ |
| 180 | public int getTimeScale() { |
| 181 | return timeScale; |
| 182 | } |
| 183 | |
| 184 | /* |
| 185 | * (non-Javadoc) |
| 186 | * |
| 187 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setTimeScale(int) |
| 188 | */ |
| 189 | public void setTimeScale(int timeScale) { |
| 190 | this.timeScale = timeScale; |
| 191 | } |
| 192 | |
| 193 | /* |
| 194 | * (non-Javadoc) |
| 195 | * |
| 196 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getLocalIpAddress() |
| 197 | */ |
| 198 | public String getLocalIpAddress() { |
| 199 | return localIpAddress; |
| 200 | } |
| 201 | |
| 202 | /* |
| 203 | * (non-Javadoc) |
| 204 | * |
| 205 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setLocalIpAddress(java.lang.String) |
| 206 | */ |
| 207 | public void setLocalIpAddress(String localIpAddress) { |
| 208 | this.localIpAddress = localIpAddress; |
| 209 | } |
| 210 | |
| 211 | /* |
| 212 | * (non-Javadoc) |
| 213 | * |
| 214 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getCNAME() |
| 215 | */ |
| 216 | public String getCNAME() { |
| 217 | return CNAME; |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | * (non-Javadoc) |
| 222 | * |
| 223 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setCNAME(java.lang.String) |
| 224 | */ |
| 225 | public void setCNAME(String CNAME) { |
| 226 | this.CNAME = CNAME; |
| 227 | } |
| 228 | |
| 229 | /* |
| 230 | * (non-Javadoc) |
| 231 | * |
| 232 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getSSMSourceIpAddress() |
| 233 | */ |
| 234 | public String getSSMSourceIpAddress() { |
| 235 | return SSMSourceIpAddress; |
| 236 | } |
| 237 | |
| 238 | /* |
| 239 | * (non-Javadoc) |
| 240 | * |
| 241 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setSSMSourceIpAddress(java.lang.String) |
| 242 | */ |
| 243 | public void setSSMSourceIpAddress(String SSMUnicastIpAddress) { |
| 244 | this.SSMSourceIpAddress = SSMUnicastIpAddress; |
| 245 | } |
| 246 | |
| 247 | /* |
| 248 | * (non-Javadoc) |
| 249 | * |
| 250 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getSSMGroupIpAddress() |
| 251 | */ |
| 252 | public String getSSMGroupIpAddress() { |
| 253 | return SSMGroupIpAddress; |
| 254 | } |
| 255 | |
| 256 | /* |
| 257 | * (non-Javadoc) |
| 258 | * |
| 259 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setSSMGroupIpAddress(java.lang.String) |
| 260 | */ |
| 261 | public void setSSMGroupIpAddress(String SSMGroupIpAddress) { |
| 262 | this.SSMGroupIpAddress = SSMGroupIpAddress; |
| 263 | } |
| 264 | |
| 265 | /* |
| 266 | * (non-Javadoc) |
| 267 | * |
| 268 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getSSMPortAudio() |
| 269 | */ |
| 270 | public Integer getSSMPortAudio() { |
| 271 | return SSMPortAudio; |
| 272 | } |
| 273 | |
| 274 | /* |
| 275 | * (non-Javadoc) |
| 276 | * |
| 277 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setSSMPortAudio(java.lang.Integer) |
| 278 | */ |
| 279 | public void setSSMPortAudio(Integer SSMPort) { |
| 280 | this.SSMPortAudio = SSMPort; |
| 281 | } |
| 282 | |
| 283 | /* |
| 284 | * (non-Javadoc) |
| 285 | * |
| 286 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getFeedbackIpAddress() |
| 287 | */ |
| 288 | public String getFeedbackIpAddress() { |
| 289 | return feedbackIpAddress; |
| 290 | } |
| 291 | |
| 292 | /* |
| 293 | * (non-Javadoc) |
| 294 | * |
| 295 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setFeedbackIpAddress(java.lang.String) |
| 296 | */ |
| 297 | public void setFeedbackIpAddress(String feedbackIpAddress) { |
| 298 | this.feedbackIpAddress = feedbackIpAddress; |
| 299 | } |
| 300 | |
| 301 | /* |
| 302 | * (non-Javadoc) |
| 303 | * |
| 304 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getFeedbackInPortAudio() |
| 305 | */ |
| 306 | public Integer getFeedbackInPortAudio() { |
| 307 | return feedbackInPortAudio; |
| 308 | } |
| 309 | |
| 310 | /* |
| 311 | * (non-Javadoc) |
| 312 | * |
| 313 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setFeedbackInPortAudio(java.lang.Integer) |
| 314 | */ |
| 315 | public void setFeedbackInPortAudio(Integer feedbackPort) { |
| 316 | this.feedbackInPortAudio = feedbackPort; |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | * (non-Javadoc) |
| 321 | * |
| 322 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setMemberType(cz.vutbr.feec.session.rtprtcp.internal.SessionType) |
| 323 | */ |
| 324 | public void setMemberType(SessionType type) { |
| 325 | this.memberType = type; |
| 326 | } |
| 327 | |
| 328 | /* |
| 329 | * (non-Javadoc) |
| 330 | * |
| 331 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getBandwidthAudio() |
| 332 | */ |
| 333 | public Integer getBandwidthAudio() { |
| 334 | return bandwidthAudio; |
| 335 | } |
| 336 | |
| 337 | /* |
| 338 | * (non-Javadoc) |
| 339 | * |
| 340 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setBandwidthAudio(java.lang.Integer) |
| 341 | */ |
| 342 | public void setBandwidthAudio(Integer bandwidth) { |
| 343 | this.bandwidthAudio = bandwidth; |
| 344 | } |
| 345 | |
| 346 | /* |
| 347 | * (non-Javadoc) |
| 348 | * |
| 349 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getIfNumber() |
| 350 | */ |
| 351 | public Integer getIfNumber() { |
| 352 | return ifNumber; |
| 353 | } |
| 354 | |
| 355 | /* |
| 356 | * (non-Javadoc) |
| 357 | * |
| 358 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setIfNumber(java.lang.Integer) |
| 359 | */ |
| 360 | public void setIfNumber(Integer ifNumber) { |
| 361 | this.ifNumber = ifNumber; |
| 362 | } |
| 363 | |
| 364 | /* |
| 365 | * (non-Javadoc) |
| 366 | * |
| 367 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getFeedbackOutPortAudio() |
| 368 | */ |
| 369 | public Integer getFeedbackOutPortAudio() { |
| 370 | return feedbackOutPortAudio; |
| 371 | } |
| 372 | |
| 373 | /* |
| 374 | * (non-Javadoc) |
| 375 | * |
| 376 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setFeedbackOutPortAudio(java.lang.Integer) |
| 377 | */ |
| 378 | public void setFeedbackOutPortAudio(Integer feedbackOutPortAudio) { |
| 379 | this.feedbackOutPortAudio = feedbackOutPortAudio; |
| 380 | } |
| 381 | |
| 382 | /* |
| 383 | * (non-Javadoc) |
| 384 | * |
| 385 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#setPayloadTypeAudio(int) |
| 386 | */ |
| 387 | public void setPayloadTypeAudio(int payloadType) { |
| 388 | this.payloadTypeAudio = payloadType; |
| 389 | } |
| 390 | |
| 391 | /* |
| 392 | * (non-Javadoc) |
| 393 | * |
| 394 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getPayloadTypeAudio() |
| 395 | */ |
| 396 | public int getPayloadTypeAudio() { |
| 397 | return payloadTypeAudio; |
| 398 | } |
| 399 | |
| 400 | /* |
| 401 | * (non-Javadoc) |
| 402 | * |
| 403 | * @see cz.vutbr.feec.session.rtprtcp.IConfig#getMemberType() |
| 404 | */ |
| 405 | public SessionType getMemberType() { |
| 406 | return memberType; |
| 407 | } |
| 408 | |
| 409 | |
| 410 | /** |
| 411 | * @see java.lang.Object#toString() |
| 412 | */ |
| 413 | public String toString() { |
| 414 | return new ToStringBuilder(this).append("memberType", this.memberType) |
| 415 | .append("feedbackIpAddress", this.feedbackIpAddress).append( |
| 416 | "SSMPortVideo", this.SSMPortVideo).append("timeScale", |
| 417 | this.timeScale).append("CNAME", this.CNAME).append( |
| 418 | "bandwidthAudio", this.bandwidthAudio).append( |
| 419 | "memberScale", this.memberScale).append( |
| 420 | "feedbackOutPortAudio", this.feedbackOutPortAudio) |
| 421 | .append("SSMPortAudio", this.SSMPortAudio).append( |
| 422 | "feedbackOutPortVideo", this.feedbackOutPortVideo) |
| 423 | .append("ifNumber", this.ifNumber).append( |
| 424 | "feedbackInPortAudio", this.feedbackInPortAudio) |
| 425 | .append("SSMGroupIpAddress", this.SSMGroupIpAddress).append( |
| 426 | "payloadTypeVideo", this.payloadTypeVideo).append( |
| 427 | "SSMSourceIpAddress", this.SSMSourceIpAddress).append( |
| 428 | "payloadTypeAudio", this.payloadTypeAudio).append( |
| 429 | "feedbackInPortVideo", this.feedbackInPortVideo) |
| 430 | .append("bandwidthVideo", this.bandwidthVideo).append( |
| 431 | "localIpAddress", this.localIpAddress).toString(); |
| 432 | } |
| 433 | |
| 434 | } |