public WebUserDataPermission(String urlPattern, String[] HTTPMethods, String transportType) { super(urlPattern); urlPatternSpec = new URLPatternSpec(urlPattern); httpMethodSpec = new HTTPMethodSpec(HTTPMethods, transportType == null? "NONE": transportType); }
public HTTPMethodSpec(String singleMethod, int transport) { int tmpMask = 0; for (int j = 0; j < HTTP_METHODS.length; j++) { if (HTTP_METHODS[j].equals(singleMethod)) { tmpMask = HTTP_MASKS[j]; break; } } if (tmpMask == 0) { checkToken(singleMethod); this.extensionMethods = new String[]{singleMethod}; } else { this.extensionMethods = NO_METHODS; } this.mask = tmpMask; this.isExcluded = false; this.transport = transport; }
public boolean implies(HTTPMethodSpec p) { if ((transport & p.transport) != p.transport) { return false; } if (isExcluded) { if (p.isExcluded) { return ((mask & p.mask) == mask) && contains(p.extensionMethods, extensionMethods); } else { return ((mask & p.mask) == 0x00) && isDisjoint(extensionMethods, p.extensionMethods); } } else { if (p.isExcluded) { return false; } else { return ((mask & p.mask) == p.mask) && contains(extensionMethods, p.extensionMethods); } } }
checkToken(HTTPMethods[i]); if (extensions == null) { extensions = new ArrayList<String>(HTTPMethods.length); add(extensions, HTTPMethods[i]);
public String toString() { return getActions(); }
public String getActions() { if (actions == null) { StringBuilder buffer; if (isAllHttpActions()) { if (hasTransportGuarantee()) { buffer = new StringBuilder(); } else { if (hasTransportGuarantee()) { if (transport == INTEGRAL) { buffer.append(":INTEGRAL");
public int hashCode() { if (cachedHashCode == 0) { cachedHashCode = urlPatternSpec.hashCode() ^ httpMethodSpec.hashCode(); } return cachedHashCode; }
public boolean equals(Object o) { if (o == null || !(o instanceof WebResourcePermission)) return false; WebResourcePermission other = (WebResourcePermission) o; return urlPatternSpec.equals(other.urlPatternSpec) && httpMethodSpec.equals(other.httpMethodSpec); }
public boolean implies(Permission permission) { if (permission == null || !(permission instanceof WebUserDataPermission)) return false; WebUserDataPermission other = (WebUserDataPermission) permission; return urlPatternSpec.implies(other.urlPatternSpec) && httpMethodSpec.implies(other.httpMethodSpec); }
checkToken(HTTPMethods[i]); if (extensions == null) { extensions = new ArrayList<String>(HTTPMethods.length); add(extensions, HTTPMethods[i]);
public String getActions() { return httpMethodSpec.getActions(); }
public String getActions() { if (actions == null) { StringBuilder buffer; if (isAllHttpActions()) { if (hasTransportGuarantee()) { buffer = new StringBuilder(); } else { if (hasTransportGuarantee()) { if (transport == INTEGRAL) { buffer.append(":INTEGRAL");
public int hashCode() { if (cachedHashCode == 0) { cachedHashCode = urlPatternSpec.hashCode() ^ httpMethodSpec.hashCode(); } return cachedHashCode; }
public boolean equals(Object o) { if (o == null || !(o instanceof WebUserDataPermission)) return false; WebUserDataPermission other = (WebUserDataPermission) o; return urlPatternSpec.equals(other.urlPatternSpec) && httpMethodSpec.equals(other.httpMethodSpec); }
public boolean implies(Permission permission) { if (permission == null || !(permission instanceof WebUserDataPermission)) return false; WebUserDataPermission other = (WebUserDataPermission) permission; return urlPatternSpec.implies(other.urlPatternSpec) && httpMethodSpec.implies(other.httpMethodSpec); }
public WebUserDataPermission(String name, String actions) { super(name); urlPatternSpec = new URLPatternSpec(name); httpMethodSpec = new HTTPMethodSpec(actions, true); }
checkToken(HTTPMethods[i]); if (extensions == null) { extensions = new ArrayList<String>(HTTPMethods.length); add(extensions, HTTPMethods[i]);
public String getActions() { return httpMethodSpec.getActions(); }
public boolean implies(HTTPMethodSpec p) { if ((transport & p.transport) != p.transport) { return false; } if (isExcluded) { if (p.isExcluded) { return ((mask & p.mask) == mask) && contains(p.extensionMethods, extensionMethods); } else { return ((mask & p.mask) == 0x00) && isDisjoint(extensionMethods, p.extensionMethods); } } else { if (p.isExcluded) { return false; } else { return ((mask & p.mask) == p.mask) && contains(extensionMethods, p.extensionMethods); } } }
public String getActions() { if (actions == null) { StringBuilder buffer; if (isAllHttpActions()) { if (hasTransportGuarantee()) { buffer = new StringBuilder(); } else { if (hasTransportGuarantee()) { if (transport == INTEGRAL) { buffer.append(":INTEGRAL");