abstract const class obix::ObixMod
sys::Obj web::WebMod obix::ObixMod
ObixMod is an abstract base class that implements the standard plumbing for adding oBIX server side support. Standardized URIs handled by the base class:
{modBase}/xsl debug style sheet
{modBase}/about about object
{modBase}/batch batch operation
{modBase}/watchService watch service
{modBase}/watch/{id} watch
All other URIs to the mod are automatically handled by the following callbacks:
- about
-
virtual ObixObj about()Get represenation of the About object. Subclasses should override this to customize their about. See
maketo customize vendor and product fields. - lobby
-
virtual ObixObj lobby()Get represenation of the Lobby object. Subclasses can override this to customize their lobby.
- make
-
new make(Str:Obj about := [Str:Obj][:])Construct with the given map for
obix:Aboutparameters:- serverName: defaults to
Env.cur.host - vendorName: defaults to "Fantom"
- vendorUrl: defaults to "https://fantom.org/"
- productName: defaults to "Fantom"
- productVersion: defaults to version of obix pod
- productUrl: defaults to "https://fantom.org/"
- serverName: defaults to
- onInvoke
-
abstract ObixObj onInvoke(Uri uri, ObixObj arg)Invoke the operation for the given URI and return the result. The URI is relative to the ObixMod base - see
WebReq.modRelThrow UnresolvedErr if URI doesn't map to a valid operation. - onRead
-
abstract ObixObj onRead(Uri uri)Return the ObixObj representation of the given URI for the application. The URI is relative to the ObixMod base - see
WebReq.modRel. Throw UnresolvedErr if URI doesn't map to a valid object. The resulting object must have its href set to the proper absolute URI according to 5.2 of the oBIX specification. - onService
-
virtual override Void onService() - onWrite
-
abstract ObixObj onWrite(Uri uri, ObixObj val)Write the value for the given URI and return the new representation. The URI is relative to the ObixMod base - see
WebReq.modRel. Throw UnresolvedErr if URI doesn't map to a valid object. Throw ReadonlyErr if URI doesn't map to a writable object. - watch
-
abstract ObixModWatch? watch(Str id)Find an existing watch by its identifier or return null.
- watchOpen
-
abstract ObixModWatch watchOpen()Construct a new watch.
- watchService
-
virtual ObixObj watchService()Get represenation of the WatchService object. Subclasses can override this to customize their watch service.