/* $ID: $
 * Created on 14.08.2003
 */
package de.skyrix.zsp.logic.httpserver.modules;

import java.util.Properties;

import de.skyrix.zsp.logic.httpserver.MethodModule;
import de.skyrix.zsp.logic.httpserver.Response;

/**Module to hande OPTIONS queries.
 * 
 * @author Burkhard Sell
 */
public class OptionsModule extends MethodModule {

	/**Returns "OPTIONS"
	 *  
	 * @see de.skyrix.zsp.logic.httpserver.MethodModule#getMethodName()
	 */
	public String getMethodName() {
		return "OPTIONS";
	}

	/**Processing the query.
	 * 
	 * @see de.skyrix.zsp.logic.httpserver.MethodModule#processQuery(java.lang.String, java.util.Properties, java.util.Properties, java.lang.String)
	 * @return the response object;
	 */
	public Response processQuery(
		String uri,
		Properties header,
		Properties parms,
		String body) {

		Response response = prepareResponse("200 OK", "text/xml", (String) null);
		response.addHeader(
			"allow",
			"GET, HEAD, POST, OPTIONS, MKCOL, DELETE, PUT, PROPFIND, SEARCH, LOCK, UNLOCK, COPY, MOVE");

		return response;
	}
}
