Asterisk-Java

org.asteriskjava.manager.action
Class AbstractManagerAction

java.lang.Object
  extended by org.asteriskjava.manager.action.AbstractManagerAction
All Implemented Interfaces:
java.io.Serializable, ManagerAction
Direct Known Subclasses:
AbsoluteTimeoutAction, AbstractMeetMeMuteAction, AgentCallbackLoginAction, AgentLogoffAction, AgentsAction, AgiAction, AtxferAction, BridgeAction, ChallengeAction, ChangeMonitorAction, CommandAction, CoreSettingsAction, CoreStatusAction, DbDelAction, DbDelTreeAction, DbGetAction, DbPutAction, EventsAction, ExtensionStateAction, GetConfigAction, GetVarAction, HangupAction, IaxPeerListAction, JabberSendAction, ListCommandsAction, LoginAction, LogoffAction, MailboxCountAction, MailboxStatusAction, ModuleCheckAction, ModuleLoadAction, MonitorAction, OriginateAction, ParkAction, ParkedCallsAction, PauseMonitorAction, PingAction, PlayDtmfAction, QueueAddAction, QueueLogAction, QueuePauseAction, QueuePenaltyAction, QueueRemoveAction, QueueResetAction, QueueStatusAction, QueueSummaryAction, RedirectAction, SendTextAction, SetCdrUserFieldAction, SetVarAction, ShowDialplanAction, SipNotifyAction, SipPeersAction, SipShowPeerAction, SipShowRegistryAction, StatusAction, StopMonitorAction, UnpauseMonitorAction, UpdateConfigAction, UserEventAction, VoicemailUsersListAction, ZapDialOffhookAction, ZapDndOffAction, ZapDndOnAction, ZapHangupAction, ZapRestartAction, ZapShowChannelsAction, ZapTransferAction

public abstract class AbstractManagerAction
extends java.lang.Object
implements ManagerAction

This class implements the ManagerAction interface and can serve as base class for your concrete Action implementations.

Since:
0.2
Version:
$Id: AbstractManagerAction.java 1140 2008-08-18 18:49:36Z srt $
Author:
srt
See Also:
Serialized Form

Constructor Summary
AbstractManagerAction()
           
 
Method Summary
abstract  java.lang.String getAction()
          Returns the name of the action for example "Hangup".
 java.lang.String getActionId()
          Returns the action id.
 void setActionId(java.lang.String actionId)
          Sets the action id.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractManagerAction

public AbstractManagerAction()
Method Detail

getAction

public abstract java.lang.String getAction()
Description copied from interface: ManagerAction
Returns the name of the action for example "Hangup".

Specified by:
getAction in interface ManagerAction

getActionId

public java.lang.String getActionId()
Description copied from interface: ManagerAction
Returns the action id.

Specified by:
getActionId in interface ManagerAction
Returns:
the user provied action id.

setActionId

public void setActionId(java.lang.String actionId)
Description copied from interface: ManagerAction
Sets the action id.

If the action id is set and sent to the asterisk server any response returned by the Asterisk server will include the same id. This way the action id can be used to track actions and their corresponding responses and response events.

Note that Asterisk-Java uses its own internal action id to match actions with the corresponding responses and events. Though the internal action is never exposed to the application code. So if you want to handle reponses or response events on your own your application must set a unique action id using this method otherwise the action id of the reponse and response event objects passed to your application will be null.

Specified by:
setActionId in interface ManagerAction
Parameters:
actionId - the user provided action id to set.
See Also:
ManagerResponse.getActionId(), ResponseEvent.getActionId()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Asterisk-Java

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