Open Kilda Java Documentation
ProducerEndpoint.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.testing.service.traffexam.model;
17 
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import com.fasterxml.jackson.annotation.JsonProperty;
20 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
22 import lombok.Getter;
23 import lombok.Setter;
24 import lombok.experimental.Accessors;
25 
26 import java.util.UUID;
27 
28 @Accessors(chain = true)
29 @Getter
30 @Setter
31 public class ProducerEndpoint extends Endpoint {
32  @JsonDeserialize(using = BandwidthJsonDeserializer.class)
33  @JsonSerialize(using = BandwidthJsonSerializer.class)
34  private Bandwidth bandwidth = null;
35 
36  @JsonProperty("burst_pkt")
37  private int burstPkt = 0;
38 
39  @JsonDeserialize(using = TimeLimitJsonDeserializer.class)
40  @JsonSerialize(using = TimeLimitJsonSerializer.class)
41  private TimeLimit time = null;
42 
43  @JsonProperty("use_udp")
44  private boolean useUdp = false;
45 
46  @JsonProperty("remote_address")
47  private final EndpointAddress targetAddress;
48 
49  public ProducerEndpoint(EndpointAddress targetAddress) {
50  this(null, null, targetAddress);
51  }
52 
53  public ProducerEndpoint(UUID bindAddressId, EndpointAddress targetAddress) {
54  this(null, bindAddressId, targetAddress);
55  }
56 
57  @JsonCreator
59  @JsonProperty("idnr") UUID id,
60  @JsonProperty("bind_address") UUID bindAddressId,
61  @JsonProperty("remote_address") EndpointAddress targetAddress) {
62  super(id, bindAddressId);
63  this.targetAddress = targetAddress;
64  }
65 }
ProducerEndpoint( @JsonProperty("idnr") UUID id, @JsonProperty("bind_address") UUID bindAddressId, @JsonProperty("remote_address") EndpointAddress targetAddress)
ProducerEndpoint(UUID bindAddressId, EndpointAddress targetAddress)