package com.fitbank.uci.server;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import com.fitbank.uci.common.UCIException;

/**
 * Clase que implementa el controlador Default
 *
 * @author    Fit-Bank
 */
public class Dummy extends Controlador {

    /**
     * Crea una nueva instancia de Dummy.
     *
     * @since    empty
     */
    public Dummy() {}

    /**
     * Método que Permite fijar los parámetros del controlador
     *
     * @param  pParameters  Valor de los parámetros del controlador
     * @since               empty
     * @throws  Exception   Error
     */
    public void setParameters(String pParameters) throws Exception {}

    /**
     * Método que indica si el controlador posee o no conexión
     *
     * @return             Entrega el valor del indicador
     * @since              empty
     * @throws  Exception  Error
     */
    public boolean isConnected() throws Exception {
        return false;
    }

    /**
     * Método que Permite obtener la descripción del Controlador
     *
     * @return             Entrega el valor de la descripción del controlador
     * @since              empty
     * @throws  Exception  Error
     */
    public String getDescription() throws Exception {
        return "Controlador en Blanco";
    }

    /**
     * Método que indica si el controlador está iniciado o no
     *
     * @return             Entrega el valor del indicador
     * @since              empty
     * @throws  Exception  Error
     */
    public boolean isStarted() throws Exception {
        return false;
    }

    /**
     * Método que Permite obtener el estatus del connector
     *
     * @return             Entrega el valor del estado
     * @since              empty
     * @throws  Exception  Error
     */
    public String getStatus() throws Exception {
        return "DOWN";
    }

    /**
     * Método que Permite desconectar el controlador
     *
     * @since                 empty
     * @throws  Exception     Error
     * @throws  UCIException  Error
     */
    public void disconnect() throws Exception {
        throw new UCIException("UCI-0011", "El Controlador (" + name + ") no se puede detener");
    }

    /**
     * Método que Permite recibir mensajes
     *
     * @return                Entrega el valor del mensaje recibido
     * @since                 empty
     * @throws  Exception     Error
     * @throws  UCIException  Error
     */
    public Serializable receiveMessage() throws Exception {
        throw new UCIException("UCI-0012", "El Controlador (" + name + ") no puede recibir mensajes");
    }

    /**
     * Método que Permite enviar mensajes
     *
     * @param  pMessage       Valor del mensaje
     * @param  pProperties    Valor de
     * @since                 empty
     * @throws  Exception     Error
     * @throws  UCIException  Error
     */
    public void sendMessage(Serializable pMessage, Properties pProperties)
        throws Exception {
        throw new UCIException("UCI-0011", "El Controlador (" + name + ") no puede enviar mensajes");
    }

    /**
     * Método que Permite detener el controlador
     *
     * @since                 empty
     * @throws  Exception     Error
     * @throws  UCIException  Error
     */
    public void shutdown() throws Exception {
        throw new UCIException("UCI-0026", "El Controlador (" + name + ") no se puede detener");
    }

    /**
     * Método que Permite iniciar el controlador
     *
     * @since                 empty
     * @throws  Exception     Error
     * @throws  UCIException  Error
     */
    public void startup() throws Exception {
        throw new UCIException("UCI-0027", "El Controlador (" + name + ") no se puede iniciar");
    }

    /**
     * Metodo que permite
     *
     * @param  pParameters    Valor de
     * @return                Entrega
     * @exception  Exception  Error
     * @since                 empty
     */
    @SuppressWarnings("unchecked")
    public String formatParameters(Map pParameters) throws Exception {
        return "";
    }

    /**
     * Metodo que permite
     *
     * @param  pParameters    Valor de
     * @return                Entrega
     * @exception  Exception  Error
     * @since                 empty
     */
    @SuppressWarnings("unchecked")
    public Map parseParametes(String pParameters) throws Exception {
        return new HashMap();
    }
}
