/* 
 * Copyright 2014 by AVM GmbH <info@avm.de>
 *
 * This software contains free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License ("License") as 
 * published by the Free Software Foundation  (version 3 of the License). 
 * This software is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the copy of the 
 * License you received along with this software for more details.
 */

package de.avm.android.tr064.sax;

import de.avm.android.tr064.Tr064Capabilities;

/*
 * SAX-Handler for FRITZ!Box Hosts1 description
 */
public class SAXHostsScpdHandler extends SAXScpdHandler
{
	public boolean isCapabilitiyOfInterface(Tr064Capabilities cap)
	{
		return cap.has(Tr064Capabilities.Capability.HOST_ENTRIES);
	}
	
	/**
	 * Instantiates a new sAX FRITZ!Box UserInterface1 description handler.
	 */
	public SAXHostsScpdHandler()
	{
		initActionsArray(new String[]
		{
			"GetHostNumberOfEntries",
			"GetSpecificHostEntry",
			"GetGenericHostEntry",
			"X_AVM-DE_SetHostNameByMACAddress"
		});
	}

	@Override
	public Tr064Capabilities getCapabilities()
	{
		for(ActionInfo action : mActions)
			if (!action.mIsAvailable) return Tr064Capabilities.EMPTY;
		return new Tr064Capabilities(
				Tr064Capabilities.Capability.HOST_ENTRIES);
	}
}
