|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectobixserver.watch.Watch
public class Watch
Watch implementation: it maintains information about watch such as watched list, changed list and provides an inteface for updating watched list and changed list
Changed list is updated at poll refresh (call originating outside of system) and via update calls from module (call originating in module).
It has a a pseudo unique id - unique in the context of all watches within the running program.
Field Summary | |
---|---|
private Map |
changedMap
Map of objects that are watched and changed. |
private boolean |
feed
Indicates if this watch is on a feed. |
private List |
feedList
List of Obj's associated with this feed. |
private String |
id
Watch id. |
private int |
lastPollListOffset
Offset to a feed at last poll. |
private long |
leaseTime
Watch lease time. |
private static Logger |
logger
|
private obix.Feed |
theFeed
If this is a feed watch, specified the associated feed. |
private boolean |
useTimestamp
Determines if timestamp should be used in wrapping Objs in feed |
private Map |
watchedMap
Map of objects that are watched. |
private static long |
watchIdCounter
Used to generate pseudo unique ids. |
Constructor Summary | |
---|---|
Watch()
Can be created only by WatchManager. |
Method Summary | |
---|---|
void |
addToFeed(obix.Obj obj)
For a feed, add obj to the feed. |
void |
addWatched(obix.Obj obj)
Add an obj to watched list. |
void |
clear()
|
(package private) void |
clearChanged()
Invoked after the client has performed pollRefresh and the information about updates needs to be cleared. |
private static String |
generateId()
Generates an id. |
List |
getChangedList()
Returns a set of changed objs. |
String |
getId()
|
long |
getLeasetime()
|
obix.Feed |
getTheFeed()
|
List |
getWatchedList()
Returns a set of watched objs. |
boolean |
isFeed()
|
void |
removeWatched(obix.Obj obj)
Remove an obj from watched list. |
void |
setFeed(boolean feed)
|
int |
size()
|
void |
update(List objList)
|
void |
update(obix.Obj obj)
Update watch for an updated object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger logger
private long leaseTime
private String id
private Map watchedMap
private Map changedMap
private obix.Feed theFeed
private List feedList
private boolean feed
private int lastPollListOffset
private boolean useTimestamp
private static long watchIdCounter
Constructor Detail |
---|
Watch()
Method Detail |
---|
private static String generateId()
public String getId()
public int size()
public void clear()
void clearChanged()
public void update(obix.Obj obj)
obj
- public void update(List objList)
public void addToFeed(obix.Obj obj)
obj
- public void addWatched(obix.Obj obj)
obj
- public void removeWatched(obix.Obj obj)
obj
- object to be removedpublic List getChangedList()
public List getWatchedList()
public long getLeasetime()
public boolean isFeed()
public void setFeed(boolean feed)
public obix.Feed getTheFeed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |