Asterisk-Java

org.asteriskjava.manager.event
Class AbstractChannelStateEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.AbstractChannelEvent
              extended by org.asteriskjava.manager.event.AbstractChannelStateEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NewChannelEvent, NewStateEvent

public abstract class AbstractChannelStateEvent
extends AbstractChannelEvent

Abstract base class providing common properties for HangupEvent, NewChannelEvent and NewStateEvent.

Version:
$Id: AbstractChannelStateEvent.java 1026 2008-04-06 09:35:12Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected AbstractChannelStateEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.Integer getChannelState()
          Returns the new state of the channel.
 java.lang.String getChannelStateDesc()
          Returns the new state of the channel as a descriptive text.
 java.lang.String getState()
          Deprecated. as of 1.0.0, use getChannelStateDesc() instead or even better switch to numeric values as returned by getChannelState().
 void setChannelState(java.lang.Integer channelState)
          Sets the new state of the channel.
 void setChannelStateDesc(java.lang.String channelStateDesc)
          Sets the new state of the channel as a descriptive text.
 void setState(java.lang.String state)
          Sets the new state of the channel as a descriptive text.
 
Methods inherited from class org.asteriskjava.manager.event.AbstractChannelEvent
getCallerId, getCallerIdName, getCallerIdNum, getChannel, getUniqueId, setCallerId, setCallerIdName, setCallerIdNum, setChannel, setUniqueId
 
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent
appendPropertyIfNotNull, getDateReceived, getFile, getFunc, getLine, getPrivilege, getSequenceNumber, getServer, getTimestamp, setDateReceived, setFile, setFunc, setLine, setPrivilege, setSequenceNumber, setServer, setTimestamp, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractChannelStateEvent

protected AbstractChannelStateEvent(java.lang.Object source)
Method Detail

getChannelState

public java.lang.Integer getChannelState()
Returns the new state of the channel.

For Asterisk versions prior to 1.6 (that do not send the numeric value) it is derived from the descriptive text.

Returns:
the new state of the channel.
Since:
1.0.0

setChannelState

public void setChannelState(java.lang.Integer channelState)
Sets the new state of the channel.

Parameters:
channelState - the new state of the channel.
Since:
1.0.0

getChannelStateDesc

public java.lang.String getChannelStateDesc()
Returns the new state of the channel as a descriptive text.

The following states are used:


setChannelStateDesc

public void setChannelStateDesc(java.lang.String channelStateDesc)
Sets the new state of the channel as a descriptive text.

Parameters:
channelStateDesc - the new state of the channel as a descriptive text.
Since:
1.0.0

getState

public java.lang.String getState()
Deprecated. as of 1.0.0, use getChannelStateDesc() instead or even better switch to numeric values as returned by getChannelState().

Returns the new state of the channel as a descriptive text.

This is an alias for @getChannelStateDesc.

Returns:
the new state of the channel as a descriptive text.

setState

public void setState(java.lang.String state)
Sets the new state of the channel as a descriptive text.

The state property is used by Asterisk versions prior to 1.6.

Parameters:
state - the new state of the channel as a descriptive text.

Asterisk-Java

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