public class Contextor extends RefTable
Modifier and Type | Method and Description |
---|---|
Trace |
appTrace()
Obtain the application trace object for this context server.
|
Item |
createGeoItem(String name,
boolean isPossibleContainer,
boolean isDeletable,
double lat,
double lon)
Return a newly minted geo-positioned Item (i.e., one created at runtime
rather than loaded from the object database).
|
Item |
createItem(String name,
boolean isPossibleContainer,
boolean isDeletable)
Return a newly minted Item (i.e., one created at runtime rather than
loaded from the object database).
|
void |
createObjectRecord(String ref,
String contRef,
BasicObject obj)
Create a new (offline) object and store its description in the object
database.
|
void |
findServiceLink(String serviceName,
ArgRunnable handler)
Find or make a connection to an external service.
|
String |
getMetadataContextName(String contextRef)
Obtain the name metadata for a context, as most recently reported by the
presence server.
|
String |
getMetadataUserName(String userRef)
Obtain the name metadata for a user, as most recently reported by the
presence server.
|
Object |
getStaticObject(String ref)
Lookup an object in the static object table.
|
ObjDB |
odb()
Return a reference to the attached object store.
|
void |
queryObjects(JSONObject template,
String collectionName,
int maxResults,
ArgRunnable handler)
Query the attached object store.
|
long |
randomLong()
Generate a high-quality random number.
|
Server |
server()
Obtain the server object for this Context Server.
|
String |
uniqueID(String root)
Generate a unique object ID.
|
public Trace appTrace()
public Item createItem(String name, boolean isPossibleContainer, boolean isDeletable)
name
- The name for the new item, or null if the name doesn't
matter.isPossibleContainer
- Flag that is true if the new item may itself
be used as a container.isDeletable
- Flag that is true if the new item may be deleted by
users.public Item createGeoItem(String name, boolean isPossibleContainer, boolean isDeletable, double lat, double lon)
name
- The name for the new item, or null if the name doesn't
matter.isPossibleContainer
- Flag that is true if the new item may itself
be used as a container.isDeletable
- Flag that is true if the new item may be deleted by
users.lat
- Position latitude, in decimal degrees.lon
- Position longitude, in decimal degrees.public void createObjectRecord(String ref, String contRef, BasicObject obj)
ref
- Reference string for the new object, or null to have one
generated automatically.contRef
- Reference string for the new object's container, or null
to not have it put into a container.obj
- The new object.public void findServiceLink(String serviceName, ArgRunnable handler)
serviceName
- Name of the service being sought.handler
- A runnable that will be invoked with the relevant
service link once the connection is located or created. The handler
will be passed a null if no connection was possible.public Object getStaticObject(String ref)
ref
- Reference string denoting the object of interest.public String getMetadataContextName(String contextRef)
contextRef
- The context for which the name metadata is sought.public String getMetadataUserName(String userRef)
userRef
- The user for whom metadata is sought.public ObjDB odb()
public void queryObjects(JSONObject template, String collectionName, int maxResults, ArgRunnable handler)
template
- Query template indicating the object(s) desired.collectionName
- Name of collection to query, or null to take the
configured default.maxResults
- Maximum number of result objects to return, or 0 to
indicate no fixed limit.handler
- Handler to be called with the results. The results will
be an array of the object(s) requested, or null if no objects could
be retrieved.
XXX Is this a POLA violation??public long randomLong()
public Server server()
Copyright © 2017. All rights reserved.