Asterisk-Java

org.asteriskjava.manager.event
Class ChannelReloadEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.ChannelReloadEvent
All Implemented Interfaces:
java.io.Serializable

public class ChannelReloadEvent
extends ManagerEvent

A ChannelReloadEvent is when a channel driver is reloaded, either on startup or by request.

For example, channels/chan_sip.c triggers the channel reload event when the SIP configuration is reloaded from sip.conf because the 'sip reload' command was issued at the Manager interface, the CLI, or for another reason.

Available since Asterisk 1.4.

It is implemented in channels/chan_sip.c

Author:
martins
See Also:
Serialized Form

Field Summary
static java.lang.String REASON_CLI_RELOAD
          The channel module has been reloaded from the command line.
static java.lang.String REASON_LOAD
          The channel module has been loaded for the first time.
static java.lang.String REASON_MANAGER_RELOAD
          The channel module has been reloaded due to a manager action.
static java.lang.String REASON_RELOAD
          The channel module has been reloaded.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ChannelReloadEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.String getChannel()
          Deprecated. use getChannelType() instead.
 java.lang.String getChannelType()
          Returns the type of channel that was reloaded.
 java.lang.Integer getPeerCount()
          Returns the number of peers defined during the configuration of this channel (e.g.
 java.lang.Integer getRegistryCount()
           
 java.lang.String getReloadReason()
          Returns the reason that this channel was reloaded as received from Asterisk, for example "CLIRELOAD (Channel module reload by CLI command)".
 java.lang.String getReloadReasonCode()
          Returns the reason that this channel was reloaded.
 java.lang.String getReloadReasonDescription()
          Returns the reason that this channel was reloaded as a human readable descriptive string, for example "Channel module reload by CLI command".
 java.lang.Integer getUserCount()
           
 void setChannel(java.lang.String channel)
           
 void setChannelType(java.lang.String channelType)
           
 void setPeerCount(java.lang.Integer peerCount)
           
 void setRegistryCount(java.lang.Integer registryCount)
           
 void setReloadReason(java.lang.String reloadReason)
          Sets the reason that this channel was reloaded, for example "CLIRELOAD (Channel module reload by CLI command)".
 void setUserCount(java.lang.Integer userCount)
           
 
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
 

Field Detail

REASON_LOAD

public static final java.lang.String REASON_LOAD
The channel module has been loaded for the first time.

See Also:
Constant Field Values

REASON_RELOAD

public static final java.lang.String REASON_RELOAD
The channel module has been reloaded.

See Also:
Constant Field Values

REASON_CLI_RELOAD

public static final java.lang.String REASON_CLI_RELOAD
The channel module has been reloaded from the command line.

See Also:
Constant Field Values

REASON_MANAGER_RELOAD

public static final java.lang.String REASON_MANAGER_RELOAD
The channel module has been reloaded due to a manager action.

See Also:
Constant Field Values
Constructor Detail

ChannelReloadEvent

public ChannelReloadEvent(java.lang.Object source)
Parameters:
source -
Method Detail

getChannelType

public java.lang.String getChannelType()
Returns the type of channel that was reloaded. For channels/chan_sip.c, this would be "SIP".

Returns:
the type of channel that was reloaded (e.g. SIP)
Since:
1.0.0

setChannelType

public void setChannelType(java.lang.String channelType)

getChannel

public java.lang.String getChannel()
Deprecated. use getChannelType() instead.

Returns the channel that was reloaded. For channels/chan_sip.c, this would be "SIP"

Returns:
the type of channel that was reloaded (e.g. SIP)

setChannel

public void setChannel(java.lang.String channel)

getPeerCount

public java.lang.Integer getPeerCount()
Returns the number of peers defined during the configuration of this channel (e.g. sip peer definitions).

Returns:
the number of peers defined during the configuration of this channel (e.g. sip peer definitions)

setPeerCount

public void setPeerCount(java.lang.Integer peerCount)
Parameters:
peerCount - the number of peers defined during the configuration of this channel (e.g. sip peer definitions)

getRegistryCount

public java.lang.Integer getRegistryCount()
Returns:
the number of registrations with other channels (e.g. registrations with other sip proxies)

setRegistryCount

public void setRegistryCount(java.lang.Integer registryCount)
Parameters:
registryCount - the number of registrations with other channels (e.g. registrations with other sip proxies)

getReloadReason

public java.lang.String getReloadReason()
Returns the reason that this channel was reloaded as received from Asterisk, for example "CLIRELOAD (Channel module reload by CLI command)".

Usually you don't want to use this method directly.

Returns:
the reason for the reload as received from Asterisk.
See Also:
getReloadReasonCode(), getReloadReasonDescription()

setReloadReason

public void setReloadReason(java.lang.String reloadReason)
Sets the reason that this channel was reloaded, for example "CLIRELOAD (Channel module reload by CLI command)".

Parameters:
reloadReason - the reason that this channel was reloaded

getReloadReasonCode

public java.lang.String getReloadReasonCode()
Returns the reason that this channel was reloaded.

Only the code part of the reason is returned. This is one of

Returns:
the code of the reason for the reload
See Also:
REASON_CLI_RELOAD, REASON_LOAD, REASON_RELOAD, REASON_MANAGER_RELOAD

getReloadReasonDescription

public java.lang.String getReloadReasonDescription()
Returns the reason that this channel was reloaded as a human readable descriptive string, for example "Channel module reload by CLI command".

Returns:
the descriptive version of the reason for the reload.

getUserCount

public java.lang.Integer getUserCount()
Returns:
the number of users defined during the configuration of this channel (e.g. sip user definitions)

setUserCount

public void setUserCount(java.lang.Integer userCount)
Parameters:
userCount - the number of users defined during the configuration of this channel (e.g. sip user definitions)

Asterisk-Java

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