|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--context.arch.subscriber.Subscriber
This class implements a subscriber object, encapsulating the information needed to create a subscriber and send information to it.
Subscribers
Field Summary | |
static java.lang.String |
ADD_SUBSCRIBER
Tag to indicate message is for adding a subscriber |
static java.lang.String |
CALLBACK_NAME
Tag for callback (on widget side) |
static java.lang.String |
CALLBACK_TAG
Tag for callback tag (on subscriber side) |
static java.lang.String |
HOSTNAME
Tag for host machine of component |
static int |
MAX_ERRORS
Maximum number of consecutive communication errors to be tolerated |
static java.lang.String |
PORT
Tag for port number of component |
static java.lang.String |
REMOVE_SUBSCRIBER
Tag to indicate message is for removing a subscriber |
static java.lang.String |
SUBSCRIBER
Tag for a subscriber |
static java.lang.String |
SUBSCRIBER_ID
Tag for subscription id |
static java.lang.String |
SUBSCRIPTION_CALLBACK
Tag to indicate message is a subscription callback |
static java.lang.String |
SUBSCRIPTION_CALLBACK_REPLY
Tag to indicate message is the reply to a subscription callback message |
static java.lang.String |
SUBSCRIPTION_REPLY
Tag to indicate message is a subscription reply |
Constructor Summary | |
Subscriber(DataObject data)
Basic constructor that creates a subscriber object from a DataObject. |
|
Subscriber(java.lang.String id,
java.lang.String hostname,
int port,
java.lang.String callback,
java.lang.String tag,
Conditions conditions,
Attributes attributes)
Basic constructor that creates a subscriber object. |
|
Subscriber(java.lang.String id,
java.lang.String hostname,
java.lang.String port,
java.lang.String callback,
java.lang.String tag,
Conditions conditions,
Attributes attributes)
Basic constructor that creates a subscriber object. |
Method Summary | |
void |
addError()
Increment the error counter |
Attributes |
getAttributes()
Returns the subscription attributes to be returned |
java.lang.String |
getCallback()
Returns the subscriber callback that the subscriber registered |
Conditions |
getConditions()
Returns the subscription conditions, under which the subscriber will be notified |
int |
getErrors()
Returns the number of consecutive errors in trying to communicate with this subscriber |
java.lang.String |
getHostName()
Returns the name of the subscriber's host computer |
java.lang.String |
getId()
Returns the id of the subscriber |
int |
getPort()
Returns the port number to send info to |
java.lang.String |
getTag()
Returns the widget callback that the subscriber registered for |
void |
resetErrors()
Reset the error counter |
void |
setAttributes(Attributes attributes)
Sets the attributes to return to the subscriber |
void |
setCallback(java.lang.String callback)
Sets the subscriber callback that the subscriber wants to register for |
void |
setConditions(Conditions conditions)
Sets the subscription conditions, under which the subscriber will be notified |
void |
setHostName(java.lang.String hostname)
Sets the name of the subscriber's host computer |
void |
setId(java.lang.String id)
Sets the id of the subscriber |
void |
setPort(int port)
Sets the port number to send info to |
void |
setTag(java.lang.String tag)
Sets the widget callback that the subscriber wants to register for |
DataObject |
toDataObject()
This method converts the subscriber info to a DataObject |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String SUBSCRIBER
public static final java.lang.String HOSTNAME
public static final java.lang.String PORT
public static final java.lang.String SUBSCRIBER_ID
public static final java.lang.String SUBSCRIPTION_REPLY
public static final java.lang.String CALLBACK_TAG
public static final java.lang.String CALLBACK_NAME
public static final java.lang.String SUBSCRIPTION_CALLBACK
public static final java.lang.String ADD_SUBSCRIBER
public static final java.lang.String REMOVE_SUBSCRIBER
public static final java.lang.String SUBSCRIPTION_CALLBACK_REPLY
public static final int MAX_ERRORS
Constructor Detail |
public Subscriber(java.lang.String id, java.lang.String hostname, int port, java.lang.String callback, java.lang.String tag, Conditions conditions, Attributes attributes)
id
- ID of the subscriberhostname
- Name of the subscriber's host computerport
- Port number to send information tocallback
- Callback the subscriber will implementtag
- Widget callback the subscriber is subscribing toconditions
- Any subscription conditions to useattributes
- Attributes to return to subscriberpublic Subscriber(java.lang.String id, java.lang.String hostname, java.lang.String port, java.lang.String callback, java.lang.String tag, Conditions conditions, Attributes attributes)
id
- ID of the subscriberhostname
- Name of the subscriber's host computerport
- Port number to send information tocallback
- Callback the subscriber will implementtag
- Widget callback the subscriber is subscribing toconditions
- Any subscription conditions to useattributes
- Attributes to return to subscriberpublic Subscriber(DataObject data)
data
- DataObject containing the subscriber infoMethod Detail |
public DataObject toDataObject()
public java.lang.String getId()
public void setId(java.lang.String id)
id
- ID of the subscriberpublic java.lang.String getHostName()
public void setHostName(java.lang.String hostname)
hostname
- Name of the subscriber's host computerpublic int getPort()
public void setPort(int port)
port
- Port number to send information topublic java.lang.String getCallback()
public void setCallback(java.lang.String callback)
String
- Widget callback being registered forpublic java.lang.String getTag()
public void setTag(java.lang.String tag)
public void setConditions(Conditions conditions)
conditions
- Subscription conditions used for notificationpublic Conditions getConditions()
public void setAttributes(Attributes attributes)
attributes
- Attributes to return to the subscriberpublic Attributes getAttributes()
public void addError()
public void resetErrors()
public int getErrors()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |