matchProps.put("location", bundleLocation); boolean negate = (args.length == 2) ? "!".equals(args[1]) : false; return (negate ^ filter.match(matchProps)) ? Condition.TRUE : Condition.FALSE;
/** * Internal implies method. Used by the implies and the permission * collection implies methods. * * @param requested The requested AdaptPermission which has already be * validated as a proper argument. The requested AdaptPermission must * not have a filter expression. * @param effective The effective actions with which to start. * @return {@code true} if the specified permission is implied by this * object; {@code false} otherwise. */ boolean implies0(AdaptPermission requested, int effective) { /* check actions first - much faster */ effective |= action_mask; final int desired = requested.action_mask; if ((effective & desired) != desired) { return false; } /* Get filter */ Filter f = filter; if (f == null) { // it's "*" return true; } return f.matches(requested.getProperties()); }
/** * Tests this event's properties against the given filter using a case * sensitive match. * * @param filter The filter to test. * @return true If this event's properties match the filter, false * otherwise. */ public final boolean matches(Filter filter) { return filter.matchCase(new FilterProperties(topic, properties)); }
public String getFilter() { if (m_filter != null) { return m_filter.toString(); } return null; }
/** * Determines the equality of two {@code AdminPermission} objects. * * @param obj The object being compared for equality with this object. * @return {@code true} if {@code obj} is equivalent to this * {@code AdminPermission}; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AdminPermission)) { return false; } AdminPermission ap = (AdminPermission) obj; return (action_mask == ap.action_mask) && ((bundle == ap.bundle) || ((bundle != null) && bundle.equals(ap.bundle))) && (filter == null ? ap.filter == null : filter.equals(ap.filter)); }
public String[][] serialize() { String[][] result = new String[filters.length][2]; for (int i = 0; i < filters.length; i++) { result[i][0] = filters[i].toString(); result[i][1] = outputStrings[i]; } return result; } }
/** * Determines the equality of two {@code AdminPermission} objects. * * @param obj The object being compared for equality with this object. * @return {@code true} if {@code obj} is equivalent to this * {@code AdminPermission}; {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AdminPermission)) { return false; } AdminPermission ap = (AdminPermission) obj; return (action_mask == ap.action_mask) && ((bundle == ap.bundle) || ((bundle != null) && bundle.equals(ap.bundle))) && (filter == null ? ap.filter == null : filter.equals(ap.filter)); }
return false; if (!flt.match(props)) return false;
public String[][] serialize() { String[][] result = new String[filters.length][2]; for (int i = 0; i < filters.length; i++) { result[i][0] = filters[i].toString(); result[i][1] = outputStrings[i]; } return result; } }
/** * Internal implies method. Used by the implies and the permission * collection implies methods. * * @param requested The requested CoordinationPermission which has already * be validated as a proper argument. The requested * CoordinationPermission must not have a filter expression. * @param effective The effective actions with which to start. * @return {@code true} if the specified permission is implied by this * object; {@code false} otherwise. */ boolean implies0(CoordinationPermission requested, int effective) { /* check actions first - much faster */ effective |= action_mask; final int desired = requested.action_mask; if ((effective & desired) != desired) { return false; } /* Get filter */ Filter f = filter; if (f == null) { // it's "*" return true; } return f.matches(requested.getProperties()); }
/** * Internal implies method. Used by the implies and the permission * collection implies methods. * * @param requested The requested EndpointPermission which has already be * validated as a proper argument. The requested EndpointPermission * must not have a filter expression. * @param effective The effective actions with which to start. * @return {@code true} if the specified permission is implied by this * object; {@code false} otherwise. */ boolean implies0(EndpointPermission requested, int effective) { /* check actions first - much faster */ effective |= action_mask; final int desired = requested.action_mask; if ((effective & desired) != desired) { return false; } /* if we have no filter */ Filter f = filter; if (f == null) { // it's "*" return true; } return f.matchCase(requested.getProperties()); }
/** * Determines the equality of two {@code AdminPermission} objects. * * @param obj The object being compared for equality with this object. * @return {@code true} if {@code obj} is equivalent to this * {@code AdminPermission}; {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AdminPermission)) { return false; } AdminPermission ap = (AdminPermission) obj; return (action_mask == ap.action_mask) && ((bundle == ap.bundle) || ((bundle != null) && bundle.equals(ap.bundle))) && (filter == null ? ap.filter == null : filter.equals(ap.filter)); }
return false; if( !flt.match( props ) ) return false;
private String getFilterString(Filter baseFilter) { if (baseFilter != null) { return baseFilter.toString(); } else { return null; } }
return f.matches(requestedProperties);
/** * Tests the properties of this {@code EndpointDescription} against the * given filter using a case insensitive match. * * @param filter The filter to test. * @return {@code true} If the properties of this * {@code EndpointDescription} match the filter, {@code false} * otherwise. * @throws IllegalArgumentException If {@code filter} contains an invalid * filter string that cannot be parsed. */ public boolean matches(String filter) { Filter f; try { f = FrameworkUtil.createFilter(filter); } catch (InvalidSyntaxException e) { IllegalArgumentException iae = new IllegalArgumentException(e.getMessage()); iae.initCause(e); throw iae; } Dictionary<String, Object> d = new UnmodifiableDictionary<String, Object>(properties); /* * we can use matchCase here since properties already supports case * insensitive key lookup. */ return f.matchCase(d); }
/** * Determines the equality of two {@code AdminPermission} objects. * * @param obj The object being compared for equality with this object. * @return {@code true} if {@code obj} is equivalent to this * {@code AdminPermission}; {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AdminPermission)) { return false; } AdminPermission ap = (AdminPermission) obj; return (action_mask == ap.action_mask) && ((bundle == ap.bundle) || ((bundle != null) && bundle.equals(ap.bundle))) && (filter == null ? ap.filter == null : filter.equals(ap.filter)); }
public boolean match(Dictionary dictionary) { boolean result = delgate.match(dictionary); return result; }
private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (m_filter != null) { out.writeUTF(m_filter.toString()); } else { out.writeUTF(""); } }
return f.matches(requestedProperties);