Class BasicAuthCache

  • All Implemented Interfaces:
    AuthCache

    @Contract(threading=SAFE)
    public class BasicAuthCache
    extends java.lang.Object
    implements AuthCache
    Default implementation of AuthCache. This implements expects AuthScheme to be Serializable in order to be cacheable.

    Instances of this class are thread safe as of version 4.4.

    Since:
    4.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.commons.logging.Log log  
      private java.util.Map<org.apache.http.HttpHost,​byte[]> map  
      private SchemePortResolver schemePortResolver  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      AuthScheme get​(org.apache.http.HttpHost host)  
      protected org.apache.http.HttpHost getKey​(org.apache.http.HttpHost host)  
      void put​(org.apache.http.HttpHost host, AuthScheme authScheme)  
      void remove​(org.apache.http.HttpHost host)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • log

        private final org.apache.commons.logging.Log log
      • map

        private final java.util.Map<org.apache.http.HttpHost,​byte[]> map
    • Constructor Detail

      • BasicAuthCache

        public BasicAuthCache​(SchemePortResolver schemePortResolver)
        Default constructor.
        Since:
        4.3
      • BasicAuthCache

        public BasicAuthCache()
    • Method Detail

      • getKey

        protected org.apache.http.HttpHost getKey​(org.apache.http.HttpHost host)
      • put

        public void put​(org.apache.http.HttpHost host,
                        AuthScheme authScheme)
        Specified by:
        put in interface AuthCache
      • remove

        public void remove​(org.apache.http.HttpHost host)
        Specified by:
        remove in interface AuthCache
      • clear

        public void clear()
        Specified by:
        clear in interface AuthCache
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object