net.sf.asterisk.manager.impl
Class ActionBuilderImpl

java.lang.Object
  extended by net.sf.asterisk.manager.impl.ActionBuilderImpl
All Implemented Interfaces:
ActionBuilder

public class ActionBuilderImpl
extends java.lang.Object
implements ActionBuilder

Default implementation of the ActionBuilder interface.

Version:
$Id: ActionBuilderImpl.java,v 1.5 2005/11/08 15:25:18 srt Exp $
Author:
srt

Constructor Summary
ActionBuilderImpl()
          Creates a new ActionBuilder for Asterisk 1.0.
 
Method Summary
protected  void appendMap(java.lang.StringBuffer sb, java.lang.String key, java.util.Map values)
           
protected  void appendMap10(java.lang.StringBuffer sb, java.lang.String singularKey, java.util.Map values)
           
protected  void appendMap12(java.lang.StringBuffer sb, java.lang.String singularKey, java.util.Map values)
           
protected  void appendString(java.lang.StringBuffer sb, java.lang.String key, java.lang.String value)
           
 java.lang.String buildAction(ManagerAction action)
          Builds a String suitable to be sent to Asterisk based on the given action object.
Asterisk actions consist of an unordered set of key value pairs corresponding to the attributes of the ManagerActions.
 java.lang.String buildAction(ManagerAction action, java.lang.String internalActionId)
          Builds a String suitable to be sent to Asterisk based on the given action object.
Asterisk actions consist of an unordered set of key value pairs corresponding to the attributes of the ManagerActions.
 void setTargetVersion(AsteriskVersion targetVersion)
          Sets the version of the Asterisk server to built the action for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionBuilderImpl

public ActionBuilderImpl()
Creates a new ActionBuilder for Asterisk 1.0.

Method Detail

setTargetVersion

public void setTargetVersion(AsteriskVersion targetVersion)
Description copied from interface: ActionBuilder
Sets the version of the Asterisk server to built the action for.

Specified by:
setTargetVersion in interface ActionBuilder

buildAction

public java.lang.String buildAction(ManagerAction action)
Description copied from interface: ActionBuilder
Builds a String suitable to be sent to Asterisk based on the given action object.
Asterisk actions consist of an unordered set of key value pairs corresponding to the attributes of the ManagerActions. Key and value are separated by a colon (":"), key value pairs by a CR/NL ("\r\n"). An action is terminated by an empty line ("\r\n\r\n").

Specified by:
buildAction in interface ActionBuilder
Parameters:
action - the action to transform
Returns:
a String representing the given action in an asterisk compatible format

buildAction

public java.lang.String buildAction(ManagerAction action,
                                    java.lang.String internalActionId)
Description copied from interface: ActionBuilder
Builds a String suitable to be sent to Asterisk based on the given action object.
Asterisk actions consist of an unordered set of key value pairs corresponding to the attributes of the ManagerActions. Key and value are separated by a colon (":"), key value pairs by a CR/NL ("\r\n"). An action is terminated by an empty line ("\r\n\r\n").

Specified by:
buildAction in interface ActionBuilder
Parameters:
action - the action to transform
internalActionId - the internal action id to add
Returns:
a String representing the given action in an asterisk compatible format

appendMap

protected void appendMap(java.lang.StringBuffer sb,
                         java.lang.String key,
                         java.util.Map values)

appendMap10

protected void appendMap10(java.lang.StringBuffer sb,
                           java.lang.String singularKey,
                           java.util.Map values)

appendMap12

protected void appendMap12(java.lang.StringBuffer sb,
                           java.lang.String singularKey,
                           java.util.Map values)

appendString

protected void appendString(java.lang.StringBuffer sb,
                            java.lang.String key,
                            java.lang.String value)


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