edu.berkeley.io.context.home
Class ObjectPresenceWidget

java.lang.Object
  extended bycontext.arch.BaseObject
      extended bycontext.arch.widget.Widget
          extended byedu.berkeley.io.context.home.ObjectPresenceWidget
All Implemented Interfaces:
CommunicationsHandler, MessageHandler

public class ObjectPresenceWidget
extends Widget

Author:
newbergr

Field Summary
static java.lang.String OBJECT_ID
           
static java.lang.String OBJECT_TYPE
           
static java.lang.String TYPE_PERSON
           
 
Fields inherited from class context.arch.widget.Widget
attributes, attributeTypes, callbacks, CLASS, constantAttributes, constantAttributesTypes, CurrentOffset, DEBUG, DEFAULT_PORT, PUT_DATA, PUT_DATA_REPLY, QUERY, QUERY_ATTRIBUTES, QUERY_ATTRIBUTES_REPLY, QUERY_CALLBACKS, QUERY_CALLBACKS_REPLY, QUERY_CONSTANT_ATTRIBUTES, QUERY_CONSTANT_ATTRIBUTES_REPLY, QUERY_REPLY, QUERY_SERVICES, QUERY_SERVICES_REPLY, QUERY_VERSION, QUERY_VERSION_REPLY, services, SPACER, storage, subscribers, TIMESTAMP, UPDATE, UPDATE_AND_QUERY, UPDATE_AND_QUERY_REPLY, VERSION, VERSION_NUMBER, WIDGET_TYPE
 
Fields inherited from class context.arch.BaseObject
BASEOBJECT_TYPE, communications, DISABLE_PORT, discoverer, EXIT_OK, gFrame, handlers, ID, parser, PING, PING_REPLY, QUERY_DESCRIPTION, QUERY_DESCRIPTION_REPLY, serviceHandlers
 
Constructor Summary
ObjectPresenceWidget(java.lang.String objectId, java.lang.String objectType, int port, boolean storageFlag)
           
 
Method Summary
protected  Attributes initAttributes()
          Sets the attributes for the widget
protected  Callbacks initCallbacks()
          Sets the callbacks for the widget
protected  Attributes initConstantAttributes()
          Sets the constant attributes for the widget
protected  Services initServices()
          Sets the services for the widget
protected  Attributes queryGenerator()
          This abstract method is called when the widget wants to get the latest generator info.
 void setLocation(java.lang.String newLocationName)
          Sets the content id for the device; presumably the device will then retrieve content to display based on the id.
 void update()
           
 
Methods inherited from class context.arch.widget.Widget
addSubscriber, canHandle, canHandle, executeService, getAttributeType, getCurrentTime, getNewOffset, getNewOffsetNoDelay, getSubscribersDescription, getType, getUserDescription, getWidgetDescription, handleIndependentReply, isAttribute, isCallback, notify, processCallbackReply, putData, queryAttributes, queryCallbacks, queryConstantAttributes, queryServices, queryWidget, removeSubscriber, retrieveData, runUserMethod, runWidgetMethod, sendToSubscribers, setAttribute, setAttributes, setCallbacks, setConstantAttributes, setId, setNonConstantAttributes, setServices, setSubscribers, store, store, updateWidgetInformation
 
Methods inherited from class context.arch.BaseObject
activateDisplay, askInterpreter, deactivateDisplay, debugprintln, decodeData, discovererQuery, discovererQuery, discovererRegistration, discovererRegistration, discovererSendSubscription, discovererSubscribe, discovererSubscriptionNotification, discovererUnregistration, discovererUpdate, encodeData, executeAsynchronousWidgetService, executeSynchronousWidgetService, findDiscoverer, findDiscoverer, findDiscoverer, getComponentDescription, getDescription, getHostAddress, getHostName, getId, getId, getLease, getListOfHandlers, getLocationAddress, getPort, getVersion, getVersion, getWidgetAttributes, getWidgetCallbacks, getWidgetConstantAttributes, getWidgetServices, independentUserRequest, leaseEndNotified, pingComponent, pingComponent, pollWidget, println, putDataInWidget, queryVersion, quit, retrieveDataFrom, retrieveDataFrom, returnPing, runComponentMethod, runMethod, serviceResult, setAllDebug, setDiscoverer, setDisplay, setDisplay, setDisplayName, setDisplayTitle, setLease, setLocationAddress, setVersion, subscribeTo, unsubscribeFrom, updateAndPollWidget, userCallback, userRequest, userRequest, userRequest, userRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_ID

public static final java.lang.String OBJECT_ID
See Also:
Constant Field Values

OBJECT_TYPE

public static final java.lang.String OBJECT_TYPE
See Also:
Constant Field Values

TYPE_PERSON

public static final java.lang.String TYPE_PERSON
See Also:
Constant Field Values
Constructor Detail

ObjectPresenceWidget

public ObjectPresenceWidget(java.lang.String objectId,
                            java.lang.String objectType,
                            int port,
                            boolean storageFlag)
Method Detail

setLocation

public void setLocation(java.lang.String newLocationName)
Sets the content id for the device; presumably the device will then retrieve content to display based on the id. triggers an UPDATE callback.


update

public void update()

initAttributes

protected Attributes initAttributes()
Description copied from class: Widget
Sets the attributes for the widget

Specified by:
initAttributes in class Widget

initCallbacks

protected Callbacks initCallbacks()
Description copied from class: Widget
Sets the callbacks for the widget

Specified by:
initCallbacks in class Widget

initConstantAttributes

protected Attributes initConstantAttributes()
Description copied from class: Widget
Sets the constant attributes for the widget

Specified by:
initConstantAttributes in class Widget

initServices

protected Services initServices()
Description copied from class: Widget
Sets the services for the widget

Specified by:
initServices in class Widget

queryGenerator

protected Attributes queryGenerator()
Description copied from class: Widget
This abstract method is called when the widget wants to get the latest generator info.

Specified by:
queryGenerator in class Widget
Returns:
AttributeNameValues containing the latest generator information