public boolean addEntry(ACLEntry entry) { // don't add a null entry or an entry that already exists. if (entry == null || this.entries.get(entry.getIdentity()) != null) return false; this.entries.put(entry.getIdentity(), entry); return true; }
public boolean removeEntry(ACLEntry entry) { return (this.entries.remove(entry.getIdentity()) != null); }
/** * <p> * Builds an instance of <code>ACLImpl</code> for the specified resource, and initialize * it with the specified entries. * </p> * * @param resource a reference to the <code>Resource</code> associated with * the ACL being constructed. * @param entries a <code>Collection</code> containing the ACL's initial entries. */ public ACLImpl(Resource resource, Collection<ACLEntry> entries) { this.resource = resource; this.entries = new HashMap<Identity, ACLEntry>(); for (ACLEntry entry : entries) this.entries.put(entry.getIdentity(), entry); }