org.asteriskjava.manager.event.ReloadEvent Maven / Gradle / Ivy
Show all versions of asterisk-java Show documentation
/*
* Copyright 2004-2006 Stefan Reuter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.event;
/**
* A ReloadEvent is triggerd when the reload
console command is executed or the
* Asterisk server is started.
* It is implemented in manager.c
*
* @author srt
* @version $Id$
*/
public class ReloadEvent extends ManagerEvent
{
/**
* Serializable version identifier.
*/
private static final long serialVersionUID = 0L;
public static final String MODULE_MANAGER = "Manager";
public static final String MODULE_CDR = "CDR";
public static final String MODULE_DNS_MGR = "DNSmgr";
public static final String MODULE_RTP = "RTP";
public static final String MODULE_ENUM = "ENUM";
public static final String STATUS_ENABLED = "Enabled";
public static final String STATUS_DISABLED = "Disabled";
private String module;
private String status;
private String message;
public ReloadEvent(Object source)
{
super(source);
}
/**
* Returns the name of the module that has been reloaded.
* Available since Asterisk 1.6.
*
* @return the name of the module that has been reloaded.
* @since 1.0.0
*/
public String getModule()
{
return module;
}
/**
* Sets the name of the module that has been reloaded.
*
* @param module the name of the module that has been reloaded.
* @since 1.0.0
*/
public void setModule(String module)
{
this.module = module;
}
/**
* Returns the new status of the module.
* Available since Asterisk 1.6.
*
* @return "Enabled" if the module is endabled, "Disabled" if it is disabled.
* @since 1.0.0
* @see #STATUS_ENABLED
* @see #STATUS_DISABLED
* @see #isEnabled()
* @see #isDisabled()
*/
public String getStatus()
{
return status;
}
/**
* Sets the new status of the module.
*
* @param status "Enabled" if the module is endabled, "Disabled" if it is disabled.
* @since 1.0.0
*/
public void setStatus(String status)
{
this.status = status;
}
public String getMessage()
{
return message;
}
public void setMessage(String message)
{
this.message = message;
}
/**
* Returns whether the module is now enabled.
* Available since Asterisk 1.6.
*
* @return true
the module is now enabled, false
if it is disabled.
* For Asterisk versions up to 1.4 that do not support the "Status" property false
is returned.
* @see #getStatus()
* @since 1.0.0
*/
public boolean isEnabled()
{
return STATUS_ENABLED.equalsIgnoreCase(status);
}
/**
* Returns whether the module is now disabled.
* Available since Asterisk 1.6.
*
* @return true
the module is now disabled, false
if it is enabled.
* For Asterisk versions up to 1.4 that do not support the "Status" property false
is returned.
* @see #getStatus()
* @since 1.0.0
*/
public boolean isDisabled()
{
return STATUS_DISABLED.equalsIgnoreCase(status);
}
}