Remoto - VFS: objectRegistry Class Reference
Remoto - VFS

#include "remoto!stdlib:js/include/objectRegistry.js"

Public Member Functions

 objectRegistry ()
 
 applyDiff (id, diff, user, except)
 
 applyMetadata (id, metadata)
 
 applyRead (id, data, metadata)
 
 applyReleaseLock (id, data)
 
 applyRequestError (command, id, reason)
 
 applyRequestLock (id, data)
 
 applyRequestSuccess (command, id, data, metadata)
 
 applySubscription (id, data, metadata)
 
 find (id, type)
 Find a registered object, optionally by type. More...
 
 isRegistered (id, object)
 
 metadataPath (id, o)
 Request metadata for a given path. More...
 
 pathList ()
 
 printRegistry ()
 Print the contents of the registry to the console. More...
 
 readPath (id, o)
 Request a read on a given path. More...
 
 readSinglePath (id, o, metadata)
 Request a read on a given path, and send metadata. More...
 
 registerObject (id, o, nosubscribe)
 Register an object in the registry, and call the pathAddedCallback. More...
 
 reset ()
 
 unregisterObject (id, o, silent, nounsubscribe, now)
 Unregister an object from the registry. More...
 

Detailed Description

DOCME

Constructor & Destructor Documentation

◆ objectRegistry()

DOCME

Member Function Documentation

◆ applyDiff()

applyDiff (   id,
  diff,
  user,
  except 
)
Parameters
id
diff
user
except
Returns

DOCME

◆ applyMetadata()

applyMetadata (   id,
  metadata 
)
Parameters
id
metadata
Returns

DOCME

◆ applyRead()

applyRead (   id,
  data,
  metadata 
)
Parameters
id
data
metadata
Returns

DOCME

◆ applyReleaseLock()

applyReleaseLock (   id,
  data 
)
Parameters
id
data
Returns

DOCME

◆ applyRequestError()

applyRequestError (   command,
  id,
  reason 
)
Parameters
command
id
reason
Returns

DOCME

◆ applyRequestLock()

applyRequestLock (   id,
  data 
)
Parameters
id
data
Returns

DOCME

◆ applyRequestSuccess()

applyRequestSuccess (   command,
  id,
  data,
  metadata 
)
Parameters
command
id
data
metadata
Returns

DOCME

◆ applySubscription()

applySubscription (   id,
  data,
  metadata 
)
Parameters
id
data
metadata
Returns

DOCME

◆ find()

find (   id,
  type 
)

Find a registered object, optionally by type.

Parameters
idThe id (or path) that the object is subscribed to
typeThe type of the object (for instanceof), or null
Returns
The first object found, or null

DOCME

◆ isRegistered()

isRegistered (   id,
  object 
)
Parameters
id
object
Returns

DOCME

◆ metadataPath()

metadataPath (   id,
  o 
)

Request metadata for a given path.

Parameters
idThe path or ID to query
oThe receiving object, which will need an applyMetadata() method on it.

This will issue a metadata request to the vfsClient and route the returned metadata to a receiving object's applyMetadata().

Multiple requests to the same path can be made, and all listening objects will receive the metadata in the order they were added to the queue.

◆ pathList()

pathList ( )
Returns

Return all subscribed paths

◆ printRegistry()

printRegistry ( )

Print the contents of the registry to the console.

This can be attached to a key command for debugging.

◆ readPath()

readPath (   id,
  o 
)

Request a read on a given path.

Parameters
idThe path or ID to query
oThe receiving object, which will need an applyRead() method on it.

This will issue a read request to the vfsClient and route the returned data to a receiving object's applyRead().

Multiple requests to the same path can be made, and all listening objects will receive the data in the order they were added to the queue.

◆ readSinglePath()

readSinglePath (   id,
  o,
  metadata 
)

Request a read on a given path, and send metadata.

Parameters
idThe path or ID to query
oThe receiving object, which will need an applyRead() method on it
metadataThe metadata sent to the read request

This will issue a read request with metadata to the vfsClient and route the returned data to a receiving object's applyRead().

The request is executed immediately and not aggregated. If multiple requests to the same path are be made while a request is outstanding, all pending objects will receive the resulting data from the first request and the subsequent requests will not be sent.

◆ registerObject()

registerObject (   id,
  o,
  nosubscribe 
)

Register an object in the registry, and call the pathAddedCallback.

Parameters
idThe id to register
oThe object to add to the id's registration list
nosubscribeBoolean if pathAdded should be called

Registering an item will call pathAddedCallback on the id provided. If using the vfsClient, this will trigger a subscribe request on the id, which will want to be a VFS path.

◆ reset()

reset ( )

DOCME

◆ unregisterObject()

unregisterObject (   id,
  o,
  silent,
  nounsubscribe,
  now 
)

Unregister an object from the registry.

Normally this also means unsubscribe from the VFS.

Parameters
idUsually the path of the registration
oThe object to unregister
silentDon't complain if the object was not registered.
nounsubscribeRemove the object from the registry, but don't let the VFS know.
nowSend the now flag to the callback, which means it will not wait to send the request.

DOCME


The documentation for this class was generated from the following file: