abstract const class obix::ObixMod

sys::Obj
  web::WebMod
    obix::ObixMod

Source

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()

Source

Get represenation of the About object. Subclasses should override this to customize their about. See make to customize vendor and product fields.

lobby

virtual ObixObj lobby()

Source

Get represenation of the Lobby object. Subclasses can override this to customize their lobby.

make

new make(Str:Obj about := [Str:Obj][:])

Source

Construct with the given map for obix:About parameters:

  • 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/"
onInvoke

abstract ObixObj onInvoke(Uri uri, ObixObj arg)

Source

Invoke the operation for the given URI and return the result. The URI is relative to the ObixMod base - see WebReq.modRel Throw UnresolvedErr if URI doesn't map to a valid operation.

onRead

abstract ObixObj onRead(Uri uri)

Source

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()

Source

onWrite

abstract ObixObj onWrite(Uri uri, ObixObj val)

Source

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)

Source

Find an existing watch by its identifier or return null.

watchOpen

abstract ObixModWatch watchOpen()

Source

Construct a new watch.

watchService

virtual ObixObj watchService()

Source

Get represenation of the WatchService object. Subclasses can override this to customize their watch service.