[Asterisk-java-cvs] CVS: asterisk-java/src/java/net/sf/asterisk/manager/action PingAction.java,1.3,1
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-08-07 16:43:38
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6755/src/java/net/sf/asterisk/manager/action Modified Files: PingAction.java ChangeMonitorAction.java RedirectAction.java SetCDRUserFieldAction.java QueueRemoveAction.java MonitorAction.java QueueAddAction.java ParkedCallsAction.java QueueStatusAction.java Log Message: Added convenience constructors to some more manager actions Index: PingAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/PingAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- PingAction.java 16 Jul 2005 13:19:33 -0000 1.3 +++ PingAction.java 7 Aug 2005 16:43:29 -0000 1.4 @@ -17,8 +17,8 @@ package net.sf.asterisk.manager.action; /** - * The PingAction will ellicit a 'Pong' response, it is used to keep the manager connection open and - * performs no operation. + * The PingAction will ellicit a 'Pong' response, it is used to keep the manager + * connection open and performs no operation. * * @author srt * @version $Id$ @@ -31,6 +31,14 @@ public class PingAction extends Abstract private static final long serialVersionUID = -2930397629192323391L; /** + * Creates a new PingAction. + */ + public PingAction() + { + + } + + /** * Returns the name of this action, i.e. "Ping". */ public String getAction() Index: ChangeMonitorAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/ChangeMonitorAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ChangeMonitorAction.java 7 Aug 2005 00:09:42 -0000 1.4 +++ ChangeMonitorAction.java 7 Aug 2005 16:43:29 -0000 1.5 @@ -42,10 +42,10 @@ public class ChangeMonitorAction extends } /** - * Creates a new ChangeMonitorAction that causes the given channel to be - * monitored and voice data to be written to the given files. + * Creates a new ChangeMonitorAction that causes monitoring data for the + * given channel to be written to the given file(s). * - * @param channel the name of the channel to monitor + * @param channel the name of the channel that is monitored * @param file the (base) name of the file(s) to which the voice data is * written * @since 0.2 @@ -65,7 +65,7 @@ public class ChangeMonitorAction extends } /** - * Returns the name of the channel to start monitoring. + * Returns the name of the monitored channel. */ public String getChannel() { @@ -73,7 +73,7 @@ public class ChangeMonitorAction extends } /** - * Sets the name of the channel to start monitoring.<br> + * Sets the name of the monitored channel.<br> * This property is mandatory. */ public void setChannel(String channel) Index: RedirectAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/RedirectAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- RedirectAction.java 16 Jul 2005 13:19:34 -0000 1.3 +++ RedirectAction.java 7 Aug 2005 16:43:29 -0000 1.4 @@ -17,6 +17,9 @@ package net.sf.asterisk.manager.action; /** + * Redirects a given channel (and an optional additional channel) to a new + * extension. + * * @author srt * @version $Id$ */ @@ -34,6 +37,54 @@ public class RedirectAction extends Abst private Integer priority; /** + * Creates a new empty RedirectAction. + */ + public RedirectAction() + { + + } + + /** + * Creates a new RedirectAction that redirects the given channel to the + * given context, extension, priority triple. + * + * @param channel the name of the channel to redirect + * @param context the destination context + * @param exten the destination extension + * @param priority the destination priority + * @since 0.2 + */ + public RedirectAction(String channel, String context, String exten, + Integer priority) + { + this.channel = channel; + this.context = context; + this.exten = exten; + this.priority = priority; + } + + /** + * Creates a new RedirectAction that redirects the given channels to the + * given context, extension, priority triple. + * + * @param channel the name of the first channel to redirect + * @param extraChannel the name of the second channel to redirect + * @param context the destination context + * @param exten the destination extension + * @param priority the destination priority + * @since 0.2 + */ + public RedirectAction(String channel, String extraChannel, String context, + String exten, Integer priority) + { + this.channel = channel; + this.extraChannel = extraChannel; + this.context = context; + this.exten = exten; + this.priority = priority; + } + + /** * Returns the name of this action, i.e. "Redirect". */ public String getAction() @@ -42,7 +93,9 @@ public class RedirectAction extends Abst } /** - * @return Returns the channel. + * Returns name of the channel to redirect. + * + * @return the name of the channel to redirect */ public String getChannel() { @@ -50,7 +103,9 @@ public class RedirectAction extends Abst } /** - * @param channel The channel to set. + * Sets the name of the channel to redirect. + * + * @param channel the name of the channel to redirect */ public void setChannel(String channel) { @@ -58,55 +113,69 @@ public class RedirectAction extends Abst } /** - * @return Returns the context. + * Returns the name of the additional channel to redirect. + * + * @return the name of the additional channel to redirect */ - public String getContext() + public String getExtraChannel() { - return context; + return extraChannel; } /** - * @param context The context to set. + * Sets the name of the additional channel to redirect. + * + * @param extraChannel the name of the additional channel to redirect */ - public void setContext(String context) + public void setExtraChannel(String extraChannel) { - this.context = context; + this.extraChannel = extraChannel; } /** - * @return Returns the exten. + * Returns the destination context. + * + * @return the destination context */ - public String getExten() + public String getContext() { - return exten; + return context; } /** - * @param exten The exten to set. + * Sets the destination context. + * + * @param context the destination context */ - public void setExten(String exten) + public void setContext(String context) { - this.exten = exten; + this.context = context; } /** - * @return Returns the extraChannel. + * Returns the destination extension. + * + * @return the destination extension */ - public String getExtraChannel() + public String getExten() { - return extraChannel; + return exten; } /** - * @param extraChannel The extraChannel to set. + * Sets the destination extension. + * + * @param exten the destination extension */ - public void setExtraChannel(String extraChannel) + public void setExten(String exten) { - this.extraChannel = extraChannel; + this.exten = exten; } /** - * @return Returns the priority. + * Returns the destination priority. + * + * @return the destination priority */ public Integer getPriority() { @@ -114,7 +183,9 @@ public class RedirectAction extends Abst } /** - * @param priority The priority to set. + * Sets the destination priority. + * + * @param priority the destination priority */ public void setPriority(Integer priority) { Index: SetCDRUserFieldAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/SetCDRUserFieldAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- SetCDRUserFieldAction.java 16 Jul 2005 13:19:33 -0000 1.3 +++ SetCDRUserFieldAction.java 7 Aug 2005 16:43:29 -0000 1.4 @@ -17,10 +17,12 @@ package net.sf.asterisk.manager.action; /** - * The SetCDRUserFieldAction causes the user field of the call detail record for the given channel - * to be changed.<br> - * Depending on the value of the append property the value is appended or overwritten.<br> - * The SetCDRUserFieldAction is implemented in <code>apps/app_setcdruserfield.c</code> + * The SetCDRUserFieldAction causes the user field of the call detail record for + * the given channel to be changed.<br> + * Depending on the value of the append property the value is appended or + * overwritten.<br> + * The SetCDRUserFieldAction is implemented in + * <code>apps/app_setcdruserfield.c</code> * * @author srt * @version $Id$ @@ -36,6 +38,46 @@ public class SetCDRUserFieldAction exten private Boolean append; /** + * Creates a new empty SetCDRUserFieldAction. + */ + public SetCDRUserFieldAction() + { + + } + + /** + * Creates a new SetCDRUserFieldAction that sets the user field of the call + * detail record for the given channel to the given value. + * + * @param channel the name of the channel + * @param userField the new value of the userfield + * @since 0.2 + */ + public SetCDRUserFieldAction(String channel, String userField) + { + this.channel = channel; + this.userField = userField; + } + + /** + * Creates a new SetCDRUserFieldAction that sets the user field of the call + * detail record for the given channel to the given value. + * + * @param channel the name of the channel + * @param userField the new value of the userfield + * @param append true to append the value to the cdr user field or false to + * overwrite + * @since 0.2 + */ + public SetCDRUserFieldAction(String channel, String userField, + Boolean append) + { + this.channel = channel; + this.userField = userField; + this.append = append; + } + + /** * Returns the name of the action, i.e. "SetCDRUserField". */ public String getAction() @@ -86,7 +128,8 @@ public class SetCDRUserFieldAction exten } /** - * Set to true to append the value to the cdr user field or false to overwrite. + * Set to true to append the value to the cdr user field or false to + * overwrite. */ public void setAppend(Boolean append) { Index: QueueRemoveAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/QueueRemoveAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- QueueRemoveAction.java 16 Jul 2005 13:19:33 -0000 1.4 +++ QueueRemoveAction.java 7 Aug 2005 16:43:29 -0000 1.5 @@ -37,6 +37,28 @@ public class QueueRemoveAction extends A private String iface; /** + * Creates a new empty QueueRemoveAction. + */ + public QueueRemoveAction() + { + + } + + /** + * Creates a new QueueRemoveAction that removes the member on the given + * interface from the given queue. + * + * @param queue the name of the queue the member will be removed from + * @param iface the interface of the member to remove + * @since 0.2 + */ + public QueueRemoveAction(String queue, String iface) + { + this.queue = queue; + this.iface = iface; + } + + /** * Returns the name of this action, i.e. "QueueRemove". * * @return the name of this action. Index: MonitorAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/MonitorAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- MonitorAction.java 16 Jul 2005 13:19:34 -0000 1.3 +++ MonitorAction.java 7 Aug 2005 16:43:29 -0000 1.4 @@ -35,6 +35,66 @@ public class MonitorAction extends Abstr private Boolean mix; /** + * Creates a new empty MonitorAction. + */ + public MonitorAction() + { + + } + + /** + * Creates a new MonitorAction that starts monitoring the given channel and + * writes voice data to the given file(s). + * + * @param channel the name of the channel to monitor + * @param file the (base) name of the file(s) to which the voice data is + * written + * @since 0.2 + */ + public MonitorAction(String channel, String file) + { + this.channel = channel; + this.file = file; + } + + /** + * Creates a new MonitorAction that starts monitoring the given channel and + * writes voice data to the given file(s). + * + * @param channel the name of the channel to monitor + * @param file the (base) name of the file(s) to which the voice data is + * written + * @param format the format to use for encoding the voice files + * @since 0.2 + */ + public MonitorAction(String channel, String file, String format) + { + this.channel = channel; + this.file = file; + this.format = format; + } + + /** + * Creates a new MonitorAction that starts monitoring the given channel and + * writes voice data to the given file(s). + * + * @param channel the name of the channel to monitor + * @param file the (base) name of the file(s) to which the voice data is + * written + * @param format the format to use for encoding the voice files + * @param mix true if the two voice files should be joined at the end of the + * call + * @since 0.2 + */ + public MonitorAction(String channel, String file, String format, Boolean mix) + { + this.channel = channel; + this.file = file; + this.format = format; + this.mix = mix; + } + + /** * Returns the name of this action, i.e. "Monitor". */ public String getAction() @@ -43,7 +103,7 @@ public class MonitorAction extends Abstr } /** - * Returns the name of the channel to start monitoring. + * Returns the name of the channel to monitor. */ public String getChannel() { @@ -51,7 +111,7 @@ public class MonitorAction extends Abstr } /** - * Sets the name of the channel to start monitoring.<br> + * Sets the name of the channel to monitor.<br> * This property is mandatory. */ public void setChannel(String channel) @@ -69,8 +129,8 @@ public class MonitorAction extends Abstr /** * Sets the (base) name of the file(s) to which the voice data is written.<br> - * If this property is not set it defaults to to the channel name as per CLI with the '/' - * replaced by '-'. + * If this property is not set it defaults to to the channel name as per CLI + * with the '/' replaced by '-'. */ public void setFile(String file) { @@ -95,7 +155,8 @@ public class MonitorAction extends Abstr } /** - * Returns true if the two voice files should be joined at the end of the call. + * Returns true if the two voice files should be joined at the end of the + * call. */ public Boolean getMix() { @@ -103,7 +164,8 @@ public class MonitorAction extends Abstr } /** - * Set to true if the two voice files should be joined at the end of the call. + * Set to true if the two voice files should be joined at the end of the + * call. */ public void setMix(Boolean mix) { Index: QueueAddAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/QueueAddAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- QueueAddAction.java 16 Jul 2005 13:19:34 -0000 1.3 +++ QueueAddAction.java 7 Aug 2005 16:43:29 -0000 1.4 @@ -34,6 +34,48 @@ public class QueueAddAction extends Abst private Integer penality; /** + * Creates a new empty QueueAddAction. + */ + public QueueAddAction() + { + + } + + /** + * Creates a new QueueAddAction that adds a new member on the given + * interface to the given queue. + * + * @param queue the name of the queue the new member will be added to + * @param iface Sets the interface to add. To add a specific channel just + * use the channel name, e.g. "SIP/1234". + * @since 0.2 + */ + public QueueAddAction(String queue, String iface) + { + this.queue = queue; + this.iface = iface; + } + + /** + * Creates a new QueueAddAction that adds a new member on the given + * interface to the given queue with the given penality. + * + * @param queue the name of the queue the new member will be added to + * @param iface Sets the interface to add. To add a specific channel just + * use the channel name, e.g. "SIP/1234". + * @param penality the penality for this member. The penality must be a + * positive integer or 0 for no penality. When calls are + * distributed members with higher penalties are considered last. + * @since 0.2 + */ + public QueueAddAction(String queue, String iface, Integer penality) + { + this.queue = queue; + this.iface = iface; + this.penality = penality; + } + + /** * Returns the name of this action, i.e. "QueueAdd". */ public String getAction() @@ -86,8 +128,10 @@ public class QueueAddAction extends Abst /** * Sets the penality for this member.<br> - * The penality must be a positive integer or 0 for no penality. If it is not set 0 is assumed.<br> - * When calls are distributed members with higher penalties are considered last. + * The penality must be a positive integer or 0 for no penality. If it is + * not set 0 is assumed.<br> + * When calls are distributed members with higher penalties are considered + * last. */ public void setPenality(Integer penality) { Index: ParkedCallsAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/ParkedCallsAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ParkedCallsAction.java 16 Jul 2005 14:25:48 -0000 1.4 +++ ParkedCallsAction.java 7 Aug 2005 16:43:29 -0000 1.5 @@ -20,16 +20,17 @@ import net.sf.asterisk.manager.event.Par /** * The ParkedCallsAction requests a list of all currently parked calls.<br> - * For each active channel a ParkedCallEvent is generated. After all parked calls have been reported - * a ParkedCallsCompleteEvent is generated. + * For each active channel a ParkedCallEvent is generated. After all parked + * calls have been reported a ParkedCallsCompleteEvent is generated. * * @see net.sf.asterisk.manager.event.ParkedCallEvent * @see net.sf.asterisk.manager.event.ParkedCallsCompleteEvent - * * @author srt * @version $Id$ */ -public class ParkedCallsAction extends AbstractManagerAction implements EventGeneratingAction +public class ParkedCallsAction extends AbstractManagerAction + implements + EventGeneratingAction { /** * Serializable version identifier @@ -37,6 +38,14 @@ public class ParkedCallsAction extends A private static final long serialVersionUID = 1859575016378824743L; /** + * Creates a new ParkedCallsAction. + */ + public ParkedCallsAction() + { + + } + + /** * Returns the name of this action, i.e. "ParkedCalls". */ public String getAction() Index: QueueStatusAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/QueueStatusAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- QueueStatusAction.java 16 Jul 2005 14:25:48 -0000 1.5 +++ QueueStatusAction.java 7 Aug 2005 16:43:29 -0000 1.6 @@ -19,25 +19,25 @@ package net.sf.asterisk.manager.action; import net.sf.asterisk.manager.event.QueueStatusCompleteEvent; /** - * The QueueStatusAction requests the state of all defined queues their members (agents) and entries - * (callers).<br> - * - * For each queue a QueueParamsEvent is generated, followed by a QueueMemberEvent for each member of - * that queue and a QueueEntryEvent for each entry in the queue.<br> - * - * Since Asterisk 1.2 a QueueStatusCompleteEvent is sent to denote the end of the generated dump.<br> - * + * The QueueStatusAction requests the state of all defined queues their members + * (agents) and entries (callers).<br> + * For each queue a QueueParamsEvent is generated, followed by a + * QueueMemberEvent for each member of that queue and a QueueEntryEvent for each + * entry in the queue.<br> + * Since Asterisk 1.2 a QueueStatusCompleteEvent is sent to denote the end of + * the generated dump.<br> * This action is implemented in <code>apps/app_queue.c</code> * * @see net.sf.asterisk.manager.event.QueueParamsEvent * @see net.sf.asterisk.manager.event.QueueMemberEvent * @see net.sf.asterisk.manager.event.QueueEntryEvent * @see net.sf.asterisk.manager.event.QueueStatusCompleteEvent - * * @author srt * @version $Id$ */ -public class QueueStatusAction extends AbstractManagerAction implements EventGeneratingAction +public class QueueStatusAction extends AbstractManagerAction + implements + EventGeneratingAction { /** * Serializable version identifier @@ -45,6 +45,14 @@ public class QueueStatusAction extends A private static final long serialVersionUID = -8599401015517232869L; /** + * Creates a new QueueStatusAction. + */ + public QueueStatusAction() + { + + } + + /** * Returns the name of this action, i.e. "QueueStatus". */ public String getAction() |