<commit_before>package m1.configuration;

import m1.configuration.ServeurConfig;
import m1.configuration.ComposantsSimples.Client;
import m1.configuration.ComposantsSimples.Serveur;
import m1.configuration.connecteurs.RPC;
import m1.configuration.interfaces.InterfaceAPortConcret;
import m1.configuration.interfaces.port.PortEntreeConcret;
import m1.configuration.interfaces.port.PortSortieConcret;
import m2.configuration.Configuration;

import java.util.logging.Logger;
/**
 * 
 * @author <NAME>
 * @author <NAME> 
 * Classe representant la configuration principale, englobant tout les autres composants
 *
 */
public class Config extends Configuration {

	public Config(ObserveurDeTransit o) {
		super(o);

		/************************************************************************
		 * Elements propre a la configuration
		 *******************************************************************************************/
		this.id = "ConfigGenerale";
		ObserveurDeTransit observ = new ObserveurDeTransit(this);// observeur qui va
		                                                         // regarder tout
		                                                         // les ports de
		                                                         // sortie pour
		                                                         // lancer l'envoi
		                                                         // de donnees
		this.interfaceConfiguration = new InterfaceAPortConcret();
		this.getInterfaceConfiguration().getPorts().add(new PortEntreeConcret("EntreeConf"));
		this.getInterfaceConfiguration().getPorts().add(new PortSortieConcret("SortieConf", observ));

		/************************************************************************
		 * Composants de la configuration
		 ***********************************************************************************************/

		Client cli = new Client(observ);
		this.listeComposants.add(cli);

		Serveur serv = new Serveur(observ);
		this.listeComposants.add(serv);

		ServeurConfig confServ = new ServeurConfig(observ);// config serveur
		this.listeComposants.add(confServ);

		/************************************************************************
		 * Connecteurs de la configuration
		 **********************************************************************************************/

		RPC rpc = new RPC(observ);
		this.listeComposants.add(rpc);

		/************************************************************************
		 * Liaisons Attachements
		 ********************************************************************************************************/

		this.liaisons.put(cli.getSortie().getPoint("SortieClient"), rpc.getFrom().getPoint("EntreeRPCdeClient"));// Client->RPC
		this.liaisons.put(rpc.getTo().getPoint("SortieRPCdeClient"), cli.getEntree().getPoint("EntreeClient"));// RCP->Client
		this.liaisons.put(serv.getSortie().getPoint("SortieServeur"), rpc.getFrom().getPoint("EntreeRPCdeServeur"));// Serveur->RCP
		this.liaisons.put(rpc.getTo().getPoint("SortieRPCdeServeur"), serv.getEntree().getPoint("EntreeServeur"));// RCP->Serveur

		/************************************************************************
		 * Liaisons Bindings
		 ************************************************************************************************************/

		this.liaisons.put(this.getInterfaceConfiguration().getPoint("SortieConf"),
		    cli.getEntree().getPoint("EntreeClientBinding"));// Binding entree
		                                                     // Config -> entree
		                                                     // Client
		this.liaisons.put(serv.getSortie().getPoint("SortieServeurBinding"),
		    confServ.getInterfaceConfiguration().getPoint("EntreeConfServ"));// Binding
		                                                                     // Sortie
		                                                                     // de
		                                                                     // serv
		                                                                     // ->
		                                                                     // Entree
		                                                                     // de
		                                                                     // ConfServ
		this.liaisons.put(confServ.getInterfaceConfiguration().getPoint("SortieConfServ"),
		    serv.getEntree().getPoint("EntreeServeurBinding"));// Binding Sortie de
		                                                       // ConfServ -> Entree
		                                                       // de serv

		/*********************************************************************************************************************************************************************************/

		this.entrees.put(this.getInterfaceConfiguration().getPoint("EntreeConf"), this);
		this.entrees.put(cli.getEntree().getPoint("EntreeClientBinding"), cli);

		this.entrees.put(cli.getEntree().getPoint("EntreeClient"), cli);
		this.entrees.put(rpc.getFrom().getPoint("EntreeRPCdeClient"), rpc);
		this.entrees.put(rpc.getFrom().getPoint("EntreeRPCdeServeur"), rpc);
		this.entrees.put(serv.getEntree().getPoint("EntreeServeur"), serv);
		this.entrees.put(serv.getEntree().getPoint("EntreeServeurBinding"), serv);
		this.entrees.put(confServ.getInterfaceConfiguration().getPoint("EntreeConfServ"), confServ);

	}

	/* (non-Javadoc)
	 * @see m2.configuration.Configuration#lancer(java.lang.String)
	 */
	public void lancer(String p) {
		switch (p) {
		case "EntreeConf":
			String command = this.getInterfaceConfiguration().getPoint(p).getVal();
			LOGGER.info("Lien Binding : la commande '" + command + "' doit etre transferée vers le client");
			this.getInterfaceConfiguration().getPoint("SortieConf").setVal(command);
			break;

		case "SortieConf":
			break;

		default:
			LOGGER.severe("lancer not implemented for Serveur");
			break;
		}
	}

	public static void main(String[] args) {
		Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);// permet
		                                                            // gestion des
		                                                            // affichages
		                                                            // consoles
		Config conf = new Config(null);
		conf.getInterfaceConfiguration().getPoint("EntreeConf").setVal("Connexion:blabla");
		String sepa = System.getProperty("line.separator") + "        ***";
		conf.lancer("EntreeConf");
		LOGGER.info(sepa + sepa + sepa + sepa);
		conf.getInterfaceConfiguration().getPoint("EntreeConf").setVal("Query:Select * from table where name = 'Bob'");
		conf.lancer("EntreeConf");
	}
}<commit_msg>ajout structure de m0<commit_after>package m1.configuration;

import m1.configuration.ServeurConfig;
import m1.configuration.ComposantsSimples.Client;
import m1.configuration.ComposantsSimples.Serveur;
import m1.configuration.connecteurs.RPC;
import m1.configuration.interfaces.InterfaceAPortConcret;
import m1.configuration.interfaces.port.PortEntreeConcret;
import m1.configuration.interfaces.port.PortSortieConcret;
import m2.configuration.Configuration;

import java.util.logging.Logger;
/**
 * 
 * @author <NAME>
 * @author <NAME> 
 * Classe representant la configuration principale, englobant tout les autres composants
 *
 */
public class Config extends Configuration {

	public Config(ObserveurDeTransit o) {
		super(o);

		/************************************************************************
		 * Elements propre a la configuration
		 *******************************************************************************************/
		this.id = "ConfigGenerale";
		ObserveurDeTransit observ = new ObserveurDeTransit(this);// observeur qui va
		                                                         // regarder tout
		                                                         // les ports de
		                                                         // sortie pour
		                                                         // lancer l'envoi
		                                                         // de donnees
		this.interfaceConfiguration = new InterfaceAPortConcret();
		this.getInterfaceConfiguration().getPorts().add(new PortEntreeConcret("EntreeConf"));
		this.getInterfaceConfiguration().getPorts().add(new PortSortieConcret("SortieConf", observ));

		/************************************************************************
		 * Composants de la configuration
		 ***********************************************************************************************/

		Client cli = new Client(observ);
		this.listeComposants.add(cli);

		Serveur serv = new Serveur(observ);
		this.listeComposants.add(serv);

		ServeurConfig confServ = new ServeurConfig(observ);// config serveur
		this.listeComposants.add(confServ);

		/************************************************************************
		 * Connecteurs de la configuration
		 **********************************************************************************************/

		RPC rpc = new RPC(observ);
		this.listeComposants.add(rpc);

		/************************************************************************
		 * Liaisons Attachements
		 ********************************************************************************************************/

		this.liaisons.put(cli.getSortie().getPoint("SortieClient"), rpc.getFrom().getPoint("EntreeRPCdeClient"));// Client->RPC
		this.liaisons.put(rpc.getTo().getPoint("SortieRPCdeClient"), cli.getEntree().getPoint("EntreeClient"));// RCP->Client
		this.liaisons.put(serv.getSortie().getPoint("SortieServeur"), rpc.getFrom().getPoint("EntreeRPCdeServeur"));// Serveur->RCP
		this.liaisons.put(rpc.getTo().getPoint("SortieRPCdeServeur"), serv.getEntree().getPoint("EntreeServeur"));// RCP->Serveur

		/************************************************************************
		 * Liaisons Bindings
		 ************************************************************************************************************/

		this.liaisons.put(this.getInterfaceConfiguration().getPoint("SortieConf"),
		    cli.getEntree().getPoint("EntreeClientBinding"));// Binding entree
		                                                     // Config -> entree
		                                                     // Client
		this.liaisons.put(serv.getSortie().getPoint("SortieServeurBinding"),
		    confServ.getInterfaceConfiguration().getPoint("EntreeConfServ"));// Binding
		                                                                     // Sortie
		                                                                     // de
		                                                                     // serv
		                                                                     // ->
		                                                                     // Entree
		                                                                     // de
		                                                                     // ConfServ
		this.liaisons.put(confServ.getInterfaceConfiguration().getPoint("SortieConfServ"),
		    serv.getEntree().getPoint("EntreeServeurBinding"));// Binding Sortie de
		                                                       // ConfServ -> Entree
		                                                       // de serv

		/*********************************************************************************************************************************************************************************/

		this.entrees.put(this.getInterfaceConfiguration().getPoint("EntreeConf"), this);
		this.entrees.put(cli.getEntree().getPoint("EntreeClientBinding"), cli);

		this.entrees.put(cli.getEntree().getPoint("EntreeClient"), cli);
		this.entrees.put(rpc.getFrom().getPoint("EntreeRPCdeClient"), rpc);
		this.entrees.put(rpc.getFrom().getPoint("EntreeRPCdeServeur"), rpc);
		this.entrees.put(serv.getEntree().getPoint("EntreeServeur"), serv);
		this.entrees.put(serv.getEntree().getPoint("EntreeServeurBinding"), serv);
		this.entrees.put(confServ.getInterfaceConfiguration().getPoint("EntreeConfServ"), confServ);

	}

	/* (non-Javadoc)
	 * @see m2.configuration.Configuration#lancer(java.lang.String)
	 */
	public void lancer(String p) {
		switch (p) {
		case "EntreeConf":
			String command = this.getInterfaceConfiguration().getPoint(p).getVal();
			LOGGER.info("Lien Binding : la commande '" + command + "' doit etre transferée vers le client");
			this.getInterfaceConfiguration().getPoint("SortieConf").setVal(command);
			break;

		case "SortieConf":
			break;

		default:
			LOGGER.severe("lancer not implemented for Serveur");
			break;
		}
	}

}
{'fraction_non_alphanumeric': 0.2592621787797572, 'fraction_numerical': 0.001655368122339587, 'mean_word_length': 2.494078766180116, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 84, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7536051', 'n_tokens_mistral': 3166, 'n_tokens_neox': 2775, 'n_words': 436}