View Javadoc

1   /*
2    * Copyright 2012 smartics, Kronseder & Reiner GmbH
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 de.smartics.ci.comm;
17  
18  /**
19   * The information needed to connect to a proxy.
20   */
21  public class ProxyInformation
22  {
23    // ********************************* Fields *********************************
24  
25    // --- constants ------------------------------------------------------------
26  
27    // --- members --------------------------------------------------------------
28  
29    /**
30     * The host name of the proxy.
31     */
32    private final String host;
33  
34    /**
35     * The port the proxy is listening.
36     */
37    private final int port;
38  
39    /**
40     * The credentials to use to connect to the proxy.
41     */
42    private ProxyCredentials credentials;
43  
44    // ****************************** Initializer *******************************
45  
46    // ****************************** Constructors ******************************
47  
48    /**
49     * Constructor.
50     *
51     * @param host the host name of the proxy.
52     * @param port the port the proxy is listening.
53     */
54    public ProxyInformation(final String host, final int port)
55    {
56      this.host = host;
57      this.port = port;
58    }
59  
60    // ****************************** Inner Classes *****************************
61  
62    // ********************************* Methods ********************************
63  
64    // --- init -----------------------------------------------------------------
65  
66    // --- get&set --------------------------------------------------------------
67  
68    /**
69     * Sets the credentials to use to connect to the proxy.
70     *
71     * @param proxyCredentials the credentials to use to connect to the proxy.
72     */
73    public void setCredentials(final ProxyCredentials proxyCredentials)
74    {
75      this.credentials = proxyCredentials;
76    }
77  
78    /**
79     * Returns the host name of the proxy.
80     *
81     * @return the host name of the proxy.
82     */
83    public String getHost()
84    {
85      return this.host;
86    }
87  
88    /**
89     * Returns the port the proxy is listening.
90     *
91     * @return the port the proxy is listening.
92     */
93    public int getPort()
94    {
95      return this.port;
96    }
97  
98    /**
99     * Returns the credentials to use to connect to the proxy.
100    *
101    * @return the credentials to use to connect to the proxy.
102    */
103   public ProxyCredentials getCredentials()
104   {
105     return this.credentials;
106   }
107 
108   // --- business -------------------------------------------------------------
109 
110   // --- object basics --------------------------------------------------------
111 
112 }