@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (isConstant() ? 1231 : 1237); result = prime * result + (isAllowSessionCreation() ? 17 : 19); result = prime * result + (isDisabled() ? 23 : 29); result = prime * result + (isRequireSSL() ? 31 : 37); result = prime * result + (isMatchHTTPMethod() ? 41 : 49); result = prime * ((roleFilterName == null) ? 1 : roleFilterName.hashCode()); result = prime * result + ((httpMethods == null) ? 0 : httpMethods.hashCode()); result = prime * result + ((filterNames == null) ? 0 : filterNames.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((patterns == null) ? 0 : patterns.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RequestFilterChain other = (RequestFilterChain) obj; if (this.roleFilterName == null && other.roleFilterName != null) return false; if (this.roleFilterName != null && this.roleFilterName.equals(other.roleFilterName) == false) return false; if (this.isAllowSessionCreation() != other.isAllowSessionCreation()) return false; if (this.isDisabled() != other.isDisabled()) return false; if (this.isRequireSSL() != other.isRequireSSL()) return false; if (this.isMatchHTTPMethod() != other.isMatchHTTPMethod()) return false; if (filterNames == null) { if (other.filterNames != null) return false; } else if (!filterNames.equals(other.filterNames)) return false; if (httpMethods == null) { if (other.httpMethods != null) return false; } else if (!httpMethods.equals(other.httpMethods)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (patterns == null) { if (other.patterns != null) return false; } else if (!patterns.equals(other.patterns)) return false; return true; }
/** * Creates a {@link GeoServerRequestMatcher} object for the specified {@link RequestFilterChain} * * @param chain */ public GeoServerRequestMatcher matcherForChain(RequestFilterChain chain) { Set<HTTPMethod> methods = chain.getHttpMethods(); if (chain.isMatchHTTPMethod() == false) methods = null; List<String> tmp = chain.getPatterns(); if (tmp == null) return new GeoServerRequestMatcher(methods, (RequestMatcher[]) null); // resolve multiple patterns separated by a comma List<String> patterns = new ArrayList<String>(); for (String pattern : tmp) { String[] array = pattern.split(","); for (String singlePattern : array) patterns.add(singlePattern); } RequestMatcher[] matchers = new RequestMatcher[patterns.size()]; for (int i = 0; i < matchers.length; i++) { matchers[i] = new IncludeQueryStringAntPathRequestMatcher(patterns.get(i)); } return new GeoServerRequestMatcher(methods, matchers); }
writer.addAttribute("ssl", Boolean.toString(requestChain.isRequireSSL())); writer.addAttribute( "matchHTTPMethod", Boolean.toString(requestChain.isMatchHTTPMethod())); if (requestChain.getHttpMethods() != null && requestChain.getHttpMethods().size() > 0) {
public boolean isMatchHTTPMethod() { return chain.isMatchHTTPMethod(); } public void setMatchHTTPMethod(boolean matchHTTPMethod) {
public boolean isMatchHTTPMethod() { return chain.isMatchHTTPMethod(); }
public String getHttpMethodString() { if (chain.isMatchHTTPMethod()) return StringUtils.collectionToCommaDelimitedString(chain.getHttpMethods()); else return "*"; }
public String getHttpMethodString() { if (chain.isMatchHTTPMethod()) return StringUtils.collectionToCommaDelimitedString(chain.getHttpMethods()); else return "*"; }
cb.setEnabled(chain.isMatchHTTPMethod());
cb.setEnabled(chain.isMatchHTTPMethod());