Class TunnelFilter.HeaderReplacer

  • Enclosing class:
    TunnelFilter

    private static class TunnelFilter.HeaderReplacer
    extends java.lang.Object
    Used to describe the replacement value for an old client preference and for a a series of specific agent (i.e. web client) attributes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> agentAttributes
      Agent attributes that must be checked.
      private java.lang.String headerNew
      New header value.
      private java.lang.String headerOld
      Old header value.
    • Constructor Summary

      Constructors 
      Constructor Description
      HeaderReplacer​(java.lang.String headerOld, java.lang.String headerNew, java.util.Map<java.lang.String,​java.lang.String> agentAttributes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> getAgentAttributes()  
      java.lang.String getHeaderNew()  
      java.lang.String getHeaderOld()  
      boolean matchesConditions​(java.util.Map<java.lang.String,​java.lang.String> agentAttributes, java.lang.String headerOld)
      Indicates if the current header replacer matches the request attributes.
      • Methods inherited from class java.lang.Object

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

      • agentAttributes

        private final java.util.Map<java.lang.String,​java.lang.String> agentAttributes
        Agent attributes that must be checked.
      • headerNew

        private final java.lang.String headerNew
        New header value.
      • headerOld

        private final java.lang.String headerOld
        Old header value.
    • Constructor Detail

      • HeaderReplacer

        HeaderReplacer​(java.lang.String headerOld,
                       java.lang.String headerNew,
                       java.util.Map<java.lang.String,​java.lang.String> agentAttributes)
    • Method Detail

      • getAgentAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getAgentAttributes()
      • getHeaderNew

        public java.lang.String getHeaderNew()
      • getHeaderOld

        public java.lang.String getHeaderOld()
      • matchesConditions

        public boolean matchesConditions​(java.util.Map<java.lang.String,​java.lang.String> agentAttributes,
                                         java.lang.String headerOld)
        Indicates if the current header replacer matches the request attributes.
        Parameters:
        agentAttributes - The user agent attributes to match.
        headerOld - The facultative value of the current's request header to match.
        Returns:
        true if the given request's attibutes match the current header replacer.