|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.avis.security.Keys
public class Keys
A key collection used to secure notifications. A key collection contains zero or more mappings from a key scheme to the keys registered for that scheme.
Once in use, key collections should be treated as immutable i.e. never be modified directly after construction.
See also section 7.4 of the client protocol spec.
Nested Class Summary | |
---|---|
static class |
Keys.Delta
Represents a delta (diff) between two key sets. |
Field Summary | |
---|---|
static Keys |
EMPTY_KEYS
An empty, immutable key collection. |
Constructor Summary | |
---|---|
Keys()
|
|
Keys(Keys keys)
|
Method Summary | |
---|---|
void |
add(DualKeyScheme scheme,
DualKeyScheme.Subset subset,
Key key)
Add a key for dual key scheme. |
void |
add(Keys keys)
Add all keys in a collection. |
void |
add(SingleKeyScheme scheme,
Key key)
Add a key for single key scheme. |
Keys |
addedTo(Keys keys)
Shortcut to efficiently generate a key collection that represents this key collection's union with another. |
static Keys |
decode(org.apache.mina.common.ByteBuffer in)
|
Keys |
delta(Keys toAdd,
Keys toRemove)
Create a new key collection with some keys added/removed. |
Keys.Delta |
deltaFrom(Keys keys)
Compute the changes between one key collection and another. |
void |
encode(org.apache.mina.common.ByteBuffer out)
|
boolean |
equals(Keys keys)
|
boolean |
equals(Object object)
|
int |
hashCode()
|
boolean |
isEmpty()
True if no keys are in the collection. |
boolean |
match(Keys producerKeys)
Test whether a given key collection matches this one for the purpose of notification delivery. |
void |
remove(DualKeyScheme scheme,
DualKeyScheme.Subset subset,
Key key)
Remove a key for dual key scheme. |
void |
remove(Keys keys)
Remove all keys in a collection. |
void |
remove(SingleKeyScheme scheme,
Key key)
Remove a key for single key scheme. |
int |
size()
Return the total number of keys in this key collection. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Keys EMPTY_KEYS
Constructor Detail |
---|
public Keys()
public Keys(Keys keys)
Method Detail |
---|
public boolean isEmpty()
public int size()
public Keys addedTo(Keys keys)
keys
- The keys to add.
public void add(SingleKeyScheme scheme, Key key)
scheme
- The key scheme.key
- The key to add.remove(SingleKeyScheme, Key)
public void remove(SingleKeyScheme scheme, Key key) throws IllegalArgumentException
scheme
- The key scheme.key
- The key to remove.
IllegalArgumentException
add(SingleKeyScheme, Key)
public void add(DualKeyScheme scheme, DualKeyScheme.Subset subset, Key key) throws IllegalArgumentException
scheme
- The key scheme.subset
- The key subset (PRODUCER or CONSUMER) to add the key to.key
- The key to add.
IllegalArgumentException
remove(DualKeyScheme, org.avis.security.DualKeyScheme.Subset, Key)
public void remove(DualKeyScheme scheme, DualKeyScheme.Subset subset, Key key)
scheme
- The key scheme.subset
- The key subset (PRODUCER or CONSUMER) to remove the
key from.key
- The key to remove.add(DualKeyScheme, org.avis.security.DualKeyScheme.Subset,
Key)
public void add(Keys keys)
keys
- The keys to add.remove(Keys)
public void remove(Keys keys)
keys
- The keys to remove.add(Keys)
public Keys delta(Keys toAdd, Keys toRemove)
toAdd
- Keys to add.toRemove
- Keys to remove
deltaFrom(Keys)
public Keys.Delta deltaFrom(Keys keys)
keys
- The target key collection.
delta(Keys, Keys)
public boolean match(Keys producerKeys)
producerKeys
- The producer keys to match against this
(consumer) key collection.
public void encode(org.apache.mina.common.ByteBuffer out)
public static Keys decode(org.apache.mina.common.ByteBuffer in) throws org.apache.mina.filter.codec.ProtocolCodecException
org.apache.mina.filter.codec.ProtocolCodecException
public boolean equals(Object object)
equals
in class Object
public boolean equals(Keys keys)
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |