f3e500665155136619ae30c281bfc70853952415
[msb/java-sdk.git] / src / main / java / org / onap / msb / sdk / httpclient / conf / HttpClientConf.java
1 /*******************************************************************************
2  * Copyright 2017 ZTE, Inc. and others.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. 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 distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  ******************************************************************************/
14 /**
15  * 
16  */
17 package org.onap.msb.sdk.httpclient.conf;
18
19 import com.fasterxml.jackson.annotation.JsonProperty;
20
21 /**
22  * @author 10071214
23  *
24  */
25 public class HttpClientConf {
26
27   @JsonProperty
28   private long readTimeout = 180 * 1000;
29
30   @JsonProperty
31   private long connectTimeout = 20 * 1000;
32
33   @JsonProperty
34   private long writeTimeout = 10 * 1000;
35
36
37   public long getReadTimeout() {
38     return readTimeout;
39   }
40
41   public long getConnectTimeout() {
42     return connectTimeout;
43   }
44
45   public long getWriteTimeout() {
46     return writeTimeout;
47   }
48
49   public void setReadTimeout(long readTimeout) {
50     this.readTimeout = readTimeout;
51   }
52
53   public void setConnectTimeout(long connectTimeout) {
54     this.connectTimeout = connectTimeout;
55   }
56
57   public void setWriteTimeout(long writeTimeout) {
58     this.writeTimeout = writeTimeout;
59   }
60
61   @Override
62   public int hashCode() {
63     final int prime = 31;
64     int result = 1;
65     result = prime * result + (int) (connectTimeout ^ (connectTimeout >>> 32));
66     result = prime * result + (int) (readTimeout ^ (readTimeout >>> 32));
67     result = prime * result + (int) (writeTimeout ^ (writeTimeout >>> 32));
68     return result;
69   }
70
71   @Override
72   public boolean equals(Object obj) {
73     if (this == obj)
74       return true;
75     if (obj == null)
76       return false;
77     if (getClass() != obj.getClass())
78       return false;
79     HttpClientConf other = (HttpClientConf) obj;
80     if (connectTimeout != other.connectTimeout)
81       return false;
82     if (readTimeout != other.readTimeout)
83       return false;
84     if (writeTimeout != other.writeTimeout)
85       return false;
86     return true;
87   }
88
89
90
91 }