/*
   Copyright 2013 Nationale-Nederlanden

   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 nl.nn.adapterframework.http;

import nl.nn.adapterframework.configuration.ConfigurationException;
import nl.nn.adapterframework.core.HasPhysicalDestination;
import nl.nn.adapterframework.core.IPushingListener;
import nl.nn.adapterframework.receivers.ServiceDispatcher;

import org.apache.commons.lang.StringUtils;

/**
 * Implementation of a {@link nl.nn.adapterframework.core.IPushingListener IPushingListener} that enables a {@link nl.nn.adapterframework.receivers.GenericReceiver}
 * to receive messages from HTTP requests.
 * <p><b>Configuration:</b>
 * <table border="1">
 * <tr><th>attributes</th><th>description</th><th>default</th></tr>
 * <tr><td>className</td><td>nl.nn.adapterframework.http.WebServiceListener</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setName(String) name}</td><td>name of the listener as known to the adapter</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setServiceName(String) serviceName}</td><td>name of the service that is provided by the adapter of this listener</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setApplicationFaultsAsExceptions(boolean) applicationFaultsAsExceptions}</td><td>Controls the behavior when an application-fault occurrs: 
 *   <table>
 *     <tr><td><code>true</code></td><td>errors are returned as a HTTP internal server error (500)</td></tr>
 *     <tr><td><code>false</code></td><td>errors are returned in error message generated by the IBIS error message formatter</td></tr>
 *   </table>
 * </td><td>true</td></tr>
 * </table>
 * @author  Gerrit van Brakel 
 * @since   4.4.x (still experimental)
 */
public class HttpListener extends PushingListenerAdapter implements HasPhysicalDestination {

	private String serviceName;

	/**
	 * initialize listener and register <code>this</code> to the JNDI
	 */
	public void configure() throws ConfigurationException {
		super.configure();
		try {
			if (StringUtils.isEmpty(getServiceName())) {
				log.debug("registering listener ["+getName()+"] with ServiceDispatcher");
				ServiceDispatcher.getInstance().registerServiceClient(getName(), this);
			} else {
				log.debug("registering listener ["+getName()+"] with ServiceDispatcher by serviceName ["+getServiceName()+"]");
				ServiceDispatcher.getInstance().registerServiceClient(getServiceName(), this);
			}
		} catch (Exception e){
			throw new ConfigurationException(e);
		}
	}

	public String getPhysicalDestinationName() {
		return "serviceName: "+getServiceName();
	}


	public String getServiceName() {
		return serviceName;
	}
	public void setServiceName(String string) {
		serviceName = string;
	}

}

@@ -1305,18 +1305,12 @@
 ttp.
-WebService
+Http
 List

Fix classname in javadoc (WebServiceListener -> HttpListener)