|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asterisk.manager.response.ManagerResponse
public class ManagerResponse
Represents a response received from the Asterisk server as the result of a
previously sent ManagerAction.
The response can be linked with the action that caused it by looking the
action id attribute that will match the action id of the corresponding
action.
ManagerAction
,
Serialized FormConstructor Summary | |
---|---|
ManagerResponse()
|
Method Summary | |
---|---|
java.lang.String |
getActionId()
Returns the action id received with this response referencing the action that generated this response. |
java.lang.String |
getAttribute(java.lang.String key)
Returns the value of the attribute with the given key. This is particulary important when a response contains special attributes that are dependent on the action that has been sent. An example of this is the response to the GetVarAction. |
java.util.Map |
getAttributes()
Returns a Map with all attributes of this response. The keys are all lower case! |
java.util.Date |
getDateReceived()
Returns the point in time this response was received from the asterisk server. |
java.lang.String |
getMessage()
Returns the message received with this response. |
java.lang.String |
getResponse()
Returns the value of the "Response:" line. |
java.lang.String |
getUniqueId()
Returns the unique id received with this response. |
void |
setActionId(java.lang.String actionId)
Sets the action id. |
void |
setAttributes(java.util.Map attributes)
Sets the Map with all attributes. |
void |
setDateReceived(java.util.Date dateReceived)
Sets the point in time this response was received from the asterisk server. |
void |
setMessage(java.lang.String message)
Sets the message. |
void |
setResponse(java.lang.String response)
Sets the response. |
void |
setUniqueId(java.lang.String uniqueId)
Sets the unique id received with this response. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ManagerResponse()
Method Detail |
---|
public java.util.Map getAttributes()
getAttribute(String)
public void setAttributes(java.util.Map attributes)
attributes
- Map with containing the attributes with all lower
case keys.public java.lang.String getAttribute(java.lang.String key)
GetVarAction action = new GetVarAction(); action.setChannel("SIP/1310-22c3"); action.setVariable("ALERT_INFO"); ManagerResponse response = connection.sendAction(action); String alertInfo = response.getAttribute("ALERT_INFO");As all attributes are internally stored in lower case the key is automatically converted to lower case before lookup.
key
- the key to lookup.
null
if there is no such attribute.public java.util.Date getDateReceived()
public void setDateReceived(java.util.Date dateReceived)
public java.lang.String getActionId()
public void setActionId(java.lang.String actionId)
public java.lang.String getMessage()
public void setMessage(java.lang.String message)
public java.lang.String getResponse()
public void setResponse(java.lang.String response)
public java.lang.String getUniqueId()
public void setUniqueId(java.lang.String uniqueId)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |