[utilities COMMIT] /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuild...

noreply at shibboleth.net noreply at shibboleth.net
Tue Sep 30 03:32:41 EDT 2014


Author: rdw
Date: Tue Sep 30 03:32:41 2014
New Revision: 664

URL: http://svn.shibboleth.net/view/utilities?rev=664&view=rev
Log:
idp-475 add setting of the user agent.  And some annotations

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java?rev=664&r1=663&r2=664&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java Tue Sep 30 03:32:41 2014
@@ -21,6 +21,7 @@
 import java.net.UnknownHostException;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -157,22 +158,25 @@
     private boolean connectionStalecheck;
 
     /** Host name of the HTTP proxy server through which connections will be made. Default value: null. */
-    private String connectionProxyHost;
+    @Nullable private String connectionProxyHost;
+    
+    /** Apache UserAgent. */
+    @Nullable private String userAgent;
 
     /** Port number of the HTTP proxy server through which connections will be made. Default value: 8080. */
     private int connectionProxyPort;
 
     /** Username used to connect to the HTTP proxy server. Default value: null. */
-    private String connectionProxyUsername;
+    @Nullable private String connectionProxyUsername;
 
     /** Password used to connect to the HTTP proxy server. Default value: null. */
-    private String connectionProxyPassword;
+    @Nullable private String connectionProxyPassword;
 
     /** Whether to follow HTTP redirects. Default value: true */
     private boolean httpFollowRedirects;
 
     /** Character set used for HTTP entity content. Default value: UTF-8 */
-    private String httpContentCharSet;
+    @Nullable private String httpContentCharSet;
 
     /** The Apache HttpClientBuilder 4.3+ instance over which to layer this builder. */
     private org.apache.http.impl.client.HttpClientBuilder apacheBuilder;
@@ -208,6 +212,7 @@
         connectionProxyPassword = null;
         httpFollowRedirects = true;
         httpContentCharSet = "UTF-8";
+        userAgent = null;
     }
 
     /**
@@ -359,7 +364,7 @@
      * 
      * @return hostname of the default proxy used when making connection
      */
-    public String getConnectionProxyHost() {
+    @Nullable public String getConnectionProxyHost() {
         return connectionProxyHost;
     }
 
@@ -368,7 +373,7 @@
      * 
      * @param host hostname of the default proxy used when making connection
      */
-    public void setConnectionProxyHost(final String host) {
+    public void setConnectionProxyHost(@Nullable final String host) {
         connectionProxyHost = StringSupport.trimOrNull(host);
     }
 
@@ -397,7 +402,7 @@
      * 
      * @return username to use when authenticating to the proxy
      */
-    public String getConnectionProxyUsername() {
+    @Nullable public String getConnectionProxyUsername() {
         return connectionProxyUsername;
     }
 
@@ -406,7 +411,7 @@
      * 
      * @param usename username to use when authenticating to the proxy; may be null
      */
-    public void setConnectionProxyUsername(final String usename) {
+    public void setConnectionProxyUsername(@Nullable final String usename) {
         connectionProxyUsername = usename;
     }
 
@@ -415,7 +420,7 @@
      * 
      * @return password used when authenticating to the proxy
      */
-    public String getConnectionProxyPassword() {
+    @Nullable public String getConnectionProxyPassword() {
         return connectionProxyPassword;
     }
 
@@ -424,7 +429,7 @@
      * 
      * @param password password used when authenticating to the proxy; may be null
      */
-    public void setConnectionProxyPassword(final String password) {
+    public void setConnectionProxyPassword(@Nullable final String password) {
         connectionProxyPassword = password;
     }
 
@@ -451,7 +456,7 @@
      * 
      * @return character set used with the HTTP entity (body)
      */
-    public String getHttpContentCharSet() {
+    @Nullable public String getHttpContentCharSet() {
         return httpContentCharSet;
     }
 
@@ -460,8 +465,26 @@
      * 
      * @param charSet character set used with the HTTP entity (body)
      */
-    public void setHttpContentCharSet(final String charSet) {
+    public void setHttpContentCharSet(@Nullable final String charSet) {
         httpContentCharSet = charSet;
+    }
+
+    /**
+     * Gets user agent.
+     * 
+     * @return The user agent.
+     */
+    @Nullable public String getUserAgent() {

[... 40 lines stripped ...]


More information about the commits mailing list