Class ProxyData


  • public class ProxyData
    extends java.lang.Object
    A DTO encapsulating the data needed to connect through a proxy server.
    Since:
    5.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.Proxy proxy  
      private char[] proxyPassword  
      private java.lang.String proxyUser  
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyData​(java.net.Proxy proxy)
      Creates a new ProxyData instance without user name or password.
      ProxyData​(java.net.Proxy proxy, java.lang.String proxyUser, char[] proxyPassword)
      Creates a new ProxyData instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearPassword()
      Clears the stored password, if any.
      char[] getPassword()
      Obtains a copy of the internally stored password.
      java.net.Proxy getProxy()
      Obtains the remote InetSocketAddress of the proxy to connect to.
      java.lang.String getUser()
      Obtains the user to log in at the proxy with.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • proxy

        @NonNull
        private final java.net.Proxy proxy
      • proxyUser

        private final java.lang.String proxyUser
      • proxyPassword

        private final char[] proxyPassword
    • Constructor Detail

      • ProxyData

        public ProxyData​(@NonNull
                         java.net.Proxy proxy)
        Creates a new ProxyData instance without user name or password.
        Parameters:
        proxy - to connect to; must not be Proxy.Type.DIRECT and must have an InetSocketAddress.
      • ProxyData

        public ProxyData​(@NonNull
                         java.net.Proxy proxy,
                         java.lang.String proxyUser,
                         char[] proxyPassword)
        Creates a new ProxyData instance.
        Parameters:
        proxy - to connect to; must not be Proxy.Type.DIRECT and must have an InetSocketAddress.
        proxyUser - to use for log-in to the proxy, may be null
        proxyPassword - to use for log-in to the proxy, may be null
    • Method Detail

      • getProxy

        @NonNull
        public java.net.Proxy getProxy()
        Obtains the remote InetSocketAddress of the proxy to connect to.
        Returns:
        the remote address of the proxy
      • getUser

        public java.lang.String getUser()
        Obtains the user to log in at the proxy with.
        Returns:
        the user name, or null if none
      • getPassword

        public char[] getPassword()
        Obtains a copy of the internally stored password.
        Returns:
        the password or null if none
      • clearPassword

        public void clearPassword()
        Clears the stored password, if any.