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

See Also:
Constant Field Values

REASON_RELOAD

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

See Also:
Constant Field Values

REASON_CLI_RELOAD

public static final 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 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(Object source)
Parameters:
source -
Method Detail

getChannelType

public 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(String channelType)

getChannel

public 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(String channel)

getPeerCount

public 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(Integer peerCount)
Parameters:
peerCount - the number of peers defined during the configuration of this channel (e.g. sip peer definitions)

getRegistryCount

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

setRegistryCount

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

getReloadReason

public 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(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 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 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 Integer getUserCount()
Returns:
the number of users defined during the configuration of this channel (e.g. sip user definitions)

setUserCount

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

Asterisk-Java

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