|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.lrc.LRCInterestManager
public class LRCInterestManager
This class maintains the publication and subscription interests of a federate. NOTE: This class does *not* do any checking of validity regarding the given handles. In fact, it will take pub/sub interests even when there is not FOM! It is only a vessel for storing and querying such values.
TheLRCInterestManager
also provides a number of helper methods for use during the
validation of various actions. For example, the isOCPublished(int)
method can be used
to ensure that the federate publishes the specified object class handle before it attempts to
register an instance of it.
Nested Class Summary | |
---|---|
private class |
LRCInterestManager.RegionSubscription
This class represents a subscription interest with region data. |
Field Summary | |
---|---|
private Set<Integer> |
publishedIC
|
private Map<Integer,Set<Integer>> |
publishedOC
|
private Map<Integer,LRCInterestManager.RegionSubscription> |
subscribedIC
|
private Map<Integer,Map<Integer,Set<Integer>>> |
subscribedOC
|
Constructor Summary | |
---|---|
LRCInterestManager()
|
Method Summary | |
---|---|
void |
clear()
Remove all information and reset the manager to its initial state |
Set<Integer> |
getICRegions(int classHandle)
This will return all the regions associated with the subscription for the identified interaciton class handle. |
boolean |
isACPublished(int classHandle,
int attributeHandle)
Returns true if the federate is publishing the specified attribute handle of
the identified object class, false otherwise. |
boolean |
isICPublished(int classHandle)
|
boolean |
isICSubscribed(int classHandle)
|
boolean |
isOCPublished(int classHandle)
Returns true if the given class is currently published in some capacity. |
boolean |
isOCPublished(int classHandle,
Collection<Integer> attributes)
Returns true if the federate is publishing *ALL* of the specified attributes of
the given object class. |
boolean |
isOCSubscribed(int classHandle)
Returns true if the federate is subscribed to any attributes of the given
object class. |
void |
publishIC(int classHandle)
|
void |
publishOC(int classHandle,
Set<Integer> attributes)
Records a new publication for the given class handle and the associated attributes. |
void |
subscribeIC(int classHandle)
|
void |
subscribeIC(int classHandle,
int regionToken)
Add a subscription interest in the interaction class for the associated region. |
void |
subscribeOC(int classHandle,
Set<Integer> attributes)
Registers a new subscription for the federate regarding the given attributes for the given class handle. |
void |
subscribeOC(int classHandle,
Set<Integer> attributes,
int regionToken)
Registers a new subscription for the federate regarding the given attributes for the given class handle and associates that subscription with the given region. |
void |
unpublishIC(int classHandle)
|
void |
unpublishOC(int classHandle)
Removes any publication for the given class handle. |
void |
unpublishOC(int classHandle,
Set<Integer> attributes)
Removes the publication interest in the given attributes of the given class. |
void |
unsubscribeIC(int classHandle)
This method will remove all subscription interests in the given interaction class. |
void |
unsubscribeIC(int classHandle,
int regionToken)
This method will disassociate the identified region with the interaction subscription, but it will never remove the subscription entirely. |
void |
unsubscribeOC(int classHandle)
Removes any subscription for the given class handle. |
void |
unsubscribeOC(int classHandle,
int regionToken)
Same as unpublishOC(int) except that it only removes the subscription to any
attributes with the given region. |
void |
unsubscribeOC(int classHandle,
Set<Integer> attributes)
Removes the subscription interest in the given attributes of the given class. |
void |
unsubscribeOC(int classHandle,
Set<Integer> attributes,
int regionToken)
Removes the subscription interest in the given attributes of the given class for the given region. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map<Integer,Set<Integer>> publishedOC
private Map<Integer,Map<Integer,Set<Integer>>> subscribedOC
private Set<Integer> publishedIC
private Map<Integer,LRCInterestManager.RegionSubscription> subscribedIC
Constructor Detail |
---|
public LRCInterestManager()
Method Detail |
---|
public void clear()
public void publishOC(int classHandle, Set<Integer> attributes)
public void unpublishOC(int classHandle)
public void unpublishOC(int classHandle, Set<Integer> attributes)
public void subscribeOC(int classHandle, Set<Integer> attributes)
public void subscribeOC(int classHandle, Set<Integer> attributes, int regionToken)
public void unsubscribeOC(int classHandle)
public void unsubscribeOC(int classHandle, int regionToken)
unpublishOC(int)
except that it only removes the subscription to any
attributes with the given region. If the federate is only subscribed to attributes in
that region, then the subscription is removed entirely.
public void unsubscribeOC(int classHandle, Set<Integer> attributes)
public void unsubscribeOC(int classHandle, Set<Integer> attributes, int regionToken)
public boolean isOCPublished(int classHandle)
true
if the given class is currently published in some capacity.
public boolean isOCPublished(int classHandle, Collection<Integer> attributes)
true
if the federate is publishing *ALL* of the specified attributes of
the given object class. If one or more of the attributes are not being published,
false
is returned.
public boolean isACPublished(int classHandle, int attributeHandle)
true
if the federate is publishing the specified attribute handle of
the identified object class, false
otherwise.
public boolean isOCSubscribed(int classHandle)
true
if the federate is subscribed to any attributes of the given
object class.
public void publishIC(int classHandle)
public void unpublishIC(int classHandle)
public void subscribeIC(int classHandle)
public void subscribeIC(int classHandle, int regionToken)
public void unsubscribeIC(int classHandle)
unsubscribeIC(int, int)
, it will always remove the interest entirely.
public void unsubscribeIC(int classHandle, int regionToken)
public boolean isICPublished(int classHandle)
public boolean isICSubscribed(int classHandle)
public Set<Integer> getICRegions(int classHandle)
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |