|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectobixserver.core.engine.ObjBrokerImpl
public class ObjBrokerImpl
Implements ObjBroker interface as facade for Obj managment. It uses WatchManager to manage watches and feeds and InvocationManager to invoke processing for operations (POST requests). ObjCache is used for caching of Obj's and their mapping and lookup based on Obj hrefs (URIs).
Field Summary | |
---|---|
private AlarmManager |
alarmManager
Manages alarm lifecycle: creation, deletion and updates. |
private String |
baseUri
Base URL loaded from properties |
private InvocationManager |
invocationManager
Manages invocation of operations on Obj's |
private Map |
invocationTargetMap
A map of invocation targets registered with the obix server system. |
static Logger |
logger
|
private ObjCache |
objCache
Obix object cache. |
private boolean |
useRelativeHref
Use relative hrefs when generating canonical href. |
private WatchManager |
watchManager
Watch manager invoked for watch operations and updates from user modules. |
Constructor Summary | |
---|---|
ObjBrokerImpl(ObjCache obixObjCache)
Constructs an instance, initializing fields with parameters. |
Method Summary | |
---|---|
void |
addCondition(Condition condition)
Adds an alarm to the system. |
void |
addFeed(obix.Feed feed,
List feedSet)
Adds a set of Obj's to a feed. |
obix.Obj |
addObj(obix.Obj obj)
Adds object to object manager and to the service. |
void |
addObjTree(obix.Obj obj)
Adds object and children to object manager and service, recursively. |
void |
addProxy(String uri,
ObjProxy proxy)
Adds a proxy obj. |
void |
addToFeed(obix.Feed feedObj,
obix.Obj obj)
Adds obj to all feeds associated with given feed obj. |
void |
clearFeed(obix.Feed feed)
Clears a feed. |
private void |
generateHref(obix.Obj obj)
Generate href for obj. |
String |
getBaseUri()
Get base URI for this server. |
List |
getFeed(obix.Feed feed)
Returns the set of Obj's that belong to a feed. |
obix.Obj |
getObj(String uri)
Returns Obj for given URI in the Obj repository. |
obix.Obj |
invoke(obix.Obj obj,
String xml,
String method)
Invokes processing for operation Obj's (Op Obj's). |
void |
notifyStatusChange(List objList)
Notifies about status change via a list of changed Obj's. |
void |
notifyStatusChange(obix.Obj obj)
Notifies about status change. |
void |
notifyStatusChangeRecursive(obix.Obj obj)
Notifies about status change recursively for passed obj and its children. |
void |
removeCondition(Condition c)
|
void |
removeObjTree(obix.Obj obj)
Removes obj and its children from object repository. |
private void |
setCanonicalHref(obix.Obj obj)
Sets href in a canonical way,. |
void |
start()
Starts the service. |
void |
stop()
Stops the service. |
void |
updateObject(obix.Obj obj)
Updates obj and its children in the obj repository. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Logger logger
private boolean useRelativeHref
private ObjCache objCache
private WatchManager watchManager
private String baseUri
private InvocationManager invocationManager
private AlarmManager alarmManager
private Map invocationTargetMap
Constructor Detail |
---|
public ObjBrokerImpl(ObjCache obixObjCache)
obixObjCache
- Method Detail |
---|
public void start() throws ObixserverException
Service
start
in interface Service
ObixserverException
- if an error occurs during start invocation.public void stop() throws ObixserverException
Service
stop
in interface Service
ObixserverException
- if an error occurs during stop invocation.public void updateObject(obix.Obj obj)
updateObject
in interface ObjBroker
obj
- Obj or Obj tree with children
that should be updated in cache and proxy,public void notifyStatusChangeRecursive(obix.Obj obj)
notifyStatusChangeRecursive
in interface ObjBroker
obj
- obj whiose status has changed.public void notifyStatusChange(obix.Obj obj)
notifyStatusChange
in interface ObjBroker
obj
- obj whose status has changed.public void notifyStatusChange(List objList)
ObjBroker
notifyStatusChange
in interface ObjBroker
objList
- list of Obj's whose status has changedpublic obix.Obj addObj(obix.Obj obj)
addObj
in interface ObjBroker
obj
-
public void addObjTree(obix.Obj obj)
addObjTree
in interface ObjBroker
obj
- public obix.Obj invoke(obix.Obj obj, String xml, String method) throws ObixserverException, obix.xml.XException
ObjBroker
invoke
in interface ObjBroker
obj
- target obj of this invocation: obj that is being read/GET, write/PUT into,
or POSTed into.xml
- request payloadmethod
- REST method
obix.xml.XException
- if request of incorrect xml syntax
ObixserverException
- if error occured during processingpublic void removeObjTree(obix.Obj obj)
ObjBroker
removeObjTree
in interface ObjBroker
obj
- obj to removepublic void addFeed(obix.Feed feed, List feedSet)
ObjBroker
addFeed
in interface ObjBroker
public void addToFeed(obix.Feed feedObj, obix.Obj obj)
ObjBroker
addToFeed
in interface ObjBroker
public void clearFeed(obix.Feed feed)
ObjBroker
clearFeed
in interface ObjBroker
public List getFeed(obix.Feed feed)
ObjBroker
getFeed
in interface ObjBroker
public void addProxy(String uri, ObjProxy proxy)
ObjBroker
addProxy
in interface ObjBroker
public obix.Obj getObj(String uri)
ObjBroker
getObj
in interface ObjBroker
private void setCanonicalHref(obix.Obj obj)
obj
- private void generateHref(obix.Obj obj)
obj
- public void addCondition(Condition condition)
ObjBroker
addCondition
in interface ObjBroker
public void removeCondition(Condition c)
public String getBaseUri()
ObjBroker
getBaseUri
in interface ObjBroker
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |