/*
   Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it
   Institute of Information Science and Technologies 
   of the Italian National Research Council 


   See the NOTICE file distributed with this work for additional 
   information regarding copyright ownership

   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.bubblecloud.zigbee.api;

import org.bubblecloud.zigbee.network.ZigBeeEndpoint;

/**
 * This class represent the main interface for the extendable architecture of the
 * refinement driver. Each refinement driver from {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} to {@link Device}
 * has to implement this interface as OSGi Service and register it on OSGi platform.
 *
 * @author <a href="mailto:stefano.lenzi@isti.cnr.it">Stefano "Kismet" Lenzi</a>
 * @author <a href="mailto:francesco.furfari@isti.cnr.it">Francesco Furfari</a>
 * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $)
 * @since 0.4.0
 */
public interface DeviceFactory {

    //TODO Allow the creation of multi-device factory

    /**
     * @return return the {@link String} representing the Device Id that this driver can refine
     */
    public int getDeviceId();

    /**
     * @return return an array of {@link String} containing all the cluster interfaces<br>
     *         implemented by the refined device generated by this driver
     */
    public int[] getDeviceClusters();

    /**
     * @return return an array of {@link String} containing all the interfaces<br>
     *         implemented by the refined device generated by this driver
     */
    public String[] getRefinedInterfaces();


    /**
     * @param zbd the {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} to refine
     * @return the {@link DeviceBase} refined from {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} from this<br>
     *         refinement driver
     * @throws ZigBeeDeviceException
     */
    public DeviceBase getInstance(ZigBeeEndpoint zbd);

    /**
     */
    public int hasMatch(ZigBeeEndpoint device);

}
