Asterisk-Java

org.asteriskjava.manager.response
Class CommandResponse

java.lang.Object
  extended by org.asteriskjava.manager.response.ManagerResponse
      extended by org.asteriskjava.manager.response.CommandResponse
All Implemented Interfaces:
java.io.Serializable

public class CommandResponse
extends ManagerResponse

Response that is received when sending a CommandAction.

Asterisk's handling of the command action is generelly quite hairy. It sends a "Response: Follows" line followed by the raw output of the command including empty lines. At the end of the command output a line containing "--END COMMAND--" is sent. The reader parses this response into a CommandResponse object to hide these details.

Version:
$Id: CommandResponse.java 1124 2008-08-18 03:25:01Z srt $
Author:
srt
See Also:
CommandAction, Serialized Form

Constructor Summary
CommandResponse()
           
 
Method Summary
 java.lang.String getPrivilege()
          Returns the AMI authorization class of this response.
 java.util.List<java.lang.String> getResult()
          Returns a List of strings representing the lines returned by the CLI command.
 void setPrivilege(java.lang.String privilege)
           
 void setResult(java.util.List<java.lang.String> result)
          Sets the result.
 
Methods inherited from class org.asteriskjava.manager.response.ManagerResponse
getActionId, getAttribute, getAttributes, getDateReceived, getEventList, getMessage, getResponse, getServer, getUniqueId, setActionId, setAttributes, setDateReceived, setEventList, setMessage, setResponse, setServer, setUniqueId, stringToInteger, stringToLong, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandResponse

public CommandResponse()
Method Detail

getPrivilege

public java.lang.String getPrivilege()
Returns the AMI authorization class of this response.

Returns:
always "Command"
Since:
1.0.0

setPrivilege

public void setPrivilege(java.lang.String privilege)

getResult

public java.util.List<java.lang.String> getResult()
Returns a List of strings representing the lines returned by the CLI command.

Returns:
a List of strings representing the lines returned by the CLI command.

setResult

public void setResult(java.util.List<java.lang.String> result)
Sets the result.


Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.