ajout TP5

This commit is contained in:
Laureηt 2023-04-22 17:36:29 +02:00
parent 12949804d9
commit 03be149688
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI
54 changed files with 1421 additions and 0 deletions

10
TP5/imap/.classpath Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/imap/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>imap</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831303</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

81
TP5/imap/flows/imap.mflow Normal file
View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="imap">
<global-element name="IMAP" type="http://www.mulesoft.org/schema/mule/imaps/connector" entity-id="2fb5c575-aefe-4c1e-8e5b-7e9a2874fec1">
<properties>
<property name="name" value="IMAP"/>
<property name="backupFolder"/>
<property name="mailboxFolder"/>
<property name="moveToFolder"/>
<property name="dispatcherPoolFactory-ref"/>
<property name="dynamicNotification"/>
<property name="validateConnections" value="true"/>
<property name="backupEnabled"/>
<property name="deleteReadMessages"/>
<property name="checkFrequency" value="1000"/>
<property name="defaultProcessMessageAction"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/imaps/connector"/>
<property-collection name="@http://www.mulesoft.org/schema/mule/imaps/tls-client;0">
<property name="storePassword" value="*"/>
<property name="path" value="*"/>
</property-collection>
<property-collection name="@http://www.mulesoft.org/schema/mule/imaps/tls-trust-store;0">
<property name="storePassword" value="*"/>
<property name="path" value="*"/>
</property-collection>
</properties>
</global-element>
<flow SubFlow="false" name="imapFlow1">
<properties>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
</properties>
<lane hadOnlyOneElement="false" entity-id="8aef9b7a-06be-4eca-a87c-96ad5405a590">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="IMAP" type="http://www.mulesoft.org/schema/mule/imaps/endpoint" entity-id="bdc5f630-678f-48ee-be7f-c2d1b4b121d5">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="host" value="imap.gmail.com"/>
<property name="port" value="993"/>
<property name="user" value="tpdhlogin"/>
<property name="password" value="tpdhpasswd"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="connector-ref" value="IMAP"/>
<property name="ref"/>
<property name="transformer-refs"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/imaps/endpoint"/>
</properties>
</endpoint>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="817e0f6d-4987-4de1-941b-8f27f8826dcf">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="path" value="/tmp/out"/>
<property name="outputPattern"/>
<property name="moveToPattern"/>
<property name="moveToDirectory"/>
<property name="pollingFrequency"/>
<property name="fileAge"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="comparator"/>
<property name="reverseOrder"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
</properties>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>imap</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:imaps="http://www.mulesoft.org/schema/mule/imaps" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/imaps http://www.mulesoft.org/schema/mule/imaps/current/mule-imaps.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<imaps:connector name="IMAP" validateConnections="true" checkFrequency="1000" doc:name="IMAP">
<imaps:tls-client path="*" storePassword="*"/>
<imaps:tls-trust-store path="*" storePassword="*"/>
</imaps:connector>
<flow name="imapFlow1" doc:name="imapFlow1">
<imaps:inbound-endpoint host="imap.gmail.com" port="993" user="tpdhlogin" password="tpdhpasswd" responseTimeout="10000" connector-ref="IMAP" doc:name="IMAP"/>
<file:outbound-endpoint path="/tmp/out" responseTimeout="10000" doc:name="File"/>
</flow>
</mule>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:35:03 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:36:01 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=imap.xml

11
TP5/jdbc/.classpath Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="lib" path="/home/hagimont/shared/cours/enseeiht/cours/Intergiciels/tp/tp-esb/legacy/bd/hsqldb/lib/hsqldb.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/jdbc/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jdbc</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831305</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

BIN
TP5/jdbc/bin/person.class Normal file

Binary file not shown.

125
TP5/jdbc/flows/jdbc.mflow Normal file
View file

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="jdbc">
<global-element name="Bean" type="http://www.springframework.org/schema/beans/bean" entity-id="6ac5b5fa-944e-4966-baad-1dbd8dcbb751">
<properties>
<property name="id" value="dataSource"/>
<property name="name" value="dataSource"/>
<property name="class" value="org.enhydra.jdbc.standard.StandardDataSource"/>
<property name="parent"/>
<property name="scope"/>
<property name="children"/>
<property name="abstract"/>
<property name="lazy-init"/>
<property name="autowire"/>
<property name="depends-on"/>
<property name="autowire-candidate"/>
<property name="primary"/>
<property name="init-method"/>
<property name="destroy-method" value="shutdown"/>
<property name="factory-method"/>
<property name="factory-bean"/>
<property-collection name="@http://www.springframework.org/schema/beans/property;0">
<property name="name" value="driverName"/>
<property name="value" value="org.hsqldb.jdbcDriver"/>
</property-collection>
<property-collection name="@http://www.springframework.org/schema/beans/property;1">
<property name="name" value="url"/>
<property name="value" value="jdbc:hsqldb:hsql://localhost/xdb"/>
</property-collection>
<property-collection name="@http://www.springframework.org/schema/beans/property;2">
<property name="name" value="user"/>
<property name="value" value="sa"/>
</property-collection>
</properties>
</global-element>
<global-element name="Database (JDBC)" type="http://www.mulesoft.org/schema/mule/jdbc/connector" entity-id="e396de13-33cf-481e-9fae-b38537dbb900">
<properties>
<property name="d" value=""/>
<property name="resultSetHandler-ref" value=""/>
<property name="customReconnection" value="false"/>
<property name="dataSource-ref to Bean" value="dataSource"/>
<property name="standardReconnection" value="false"/>
<property name="pollingFrequency" value="0"/>
<property name="queryTimeout" value="-1"/>
<property name="validateConnections" value="true"/>
<property name="noReconnection" value="true"/>
<property name="dispatcherPoolFactory-ref" value=""/>
<property name="transactionPerMessage" value="false"/>
<property name="blocking" value="true"/>
<property name="name" value="Database__JDBC_"/>
<property name="dynamicNotification" value="false"/>
<property name="queryRunner-ref" value=""/>
<property-collection name="">
<property name="d" value=""/>
<property name="blocking" value="true"/>
<property name="customReconnection" value="false"/>
<property name="standardReconnection" value="false"/>
<property name="noReconnection" value="true"/>
</property-collection>
</properties>
<description></description>
</global-element>
<flow SubFlow="false" name="jdbcFlow1">
<properties>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
</properties>
<lane hadOnlyOneElement="false" entity-id="856acb42-474c-4785-b369-b708228a6f4d">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="230b0f92-c6bd-49a4-8212-7f7d9e0a5348">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="path" value="/tmp/in"/>
<property name="outputPattern"/>
<property name="moveToPattern"/>
<property name="moveToDirectory"/>
<property name="pollingFrequency"/>
<property name="fileAge"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="comparator"/>
<property name="reverseOrder"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
</properties>
</endpoint>
<pattern name="XML to Object" type="http://www.mulesoft.org/schema/mule/xml/xml-to-object-transformer" entity-id="e3f07f86-2eea-4e2b-a33e-68c0bbc6a434">
<properties>
<property name="returnClass"/>
<property name="ignoreBadInput"/>
<property name="encoding"/>
<property name="mimeType"/>
<property name="driverClass"/>
</properties>
</pattern>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="Database (JDBC)" type="http://www.mulesoft.org/schema/mule/jdbc/endpoint" entity-id="c4b3fc80-c025-418e-b441-538fa0e15119">
<properties>
<property name="ref" value=""/>
<property name="transformer-refs" value=""/>
<property name="address" value=""/>
<property name="queryTimeout" value="-1"/>
<property name="encoding" value=""/>
<property name="disableTransportTransformer" value="false"/>
<property name="mimeType" value=""/>
<property name="responseTimeout" value=""/>
<property name="queryKey" value="insertion"/>
<property name="exchange-pattern" value="one-way"/>
<property name="connector-ref" value="Database__JDBC_"/>
<property-collection name="@http://www.mulesoft.org/schema/mule/jdbc/query;1">
<property name="value" value="insert into accounts values (#[payload.nom], #[payload.prenom], #[payload.email]);"/>
<property name="key" value="insertion"/>
</property-collection>
</properties>
<description></description>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>jdbc</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<spring:beans>
<spring:bean id="dataSource" name="dataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="org.hsqldb.jdbcDriver"/>
<spring:property name="url" value="jdbc:hsqldb:hsql://localhost/xdb"/>
<spring:property name="user" value="sa"/>
</spring:bean>
</spring:beans>
<jdbc:connector name="Database__JDBC_" dataSource-ref="dataSource" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database (JDBC)"/>
<flow name="jdbcFlow1" doc:name="jdbcFlow1">
<file:inbound-endpoint path="/tmp/in" responseTimeout="10000" doc:name="File"/>
<mulexml:xml-to-object-transformer doc:name="XML to Object"/>
<jdbc:outbound-endpoint exchange-pattern="one-way" queryKey="insertion" queryTimeout="-1" connector-ref="Database__JDBC_" doc:name="Database (JDBC)">
<jdbc:query key="insertion" value="insert into accounts values (#[payload.nom], #[payload.prenom], #[payload.email]);"/>
</jdbc:outbound-endpoint>
</flow>
</mule>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:19:29 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:25:51 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=jdbc.xml

View file

@ -0,0 +1,48 @@
import java.io.Serializable;
public class person implements Serializable {
private static final long serialVersionUID = -1;
private String nom;
private String prenom;
private String login;
private String password;
private String email;
public person() {}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}

11
TP5/jms/.classpath Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="lib" path="/home/hagimont/install/apache-activemq-5.14.0/activemq-all-5.14.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/jms/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jms</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831307</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

128
TP5/jms/flows/jms.mflow Normal file
View file

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="jms">
<global-element name="Active MQ" type="http://www.mulesoft.org/schema/mule/jms/activemq-xa-connector" entity-id="3ec62879-c72b-4107-a847-75bec94339fc">
<properties>
<property name="customReconnection" value="false"/>
<property name="standardReconnection" value="false"/>
<property name="jndiProviderUrl" value=""/>
<property name="embeddedMode" value="false"/>
<property name="redeliveryHandlerFactory-ref" value=""/>
<property name="maxRedelivery" value="-1"/>
<property name="connectionFactory-ref" value=""/>
<property name="durable" value="false"/>
<property name="password" value="admin"/>
<property name="noReconnection" value="true"/>
<property name="username" value="admin"/>
<property name="name" value="Active_MQ"/>
<property name="dynamicNotification" value="false"/>
<property name="noLocal" value="false"/>
<property name="eagerConsumer" value="false"/>
<property name="d" value=""/>
<property name="numberOfConsumers" value="1"/>
<property name="acknowledgementMode" value="AUTO_ACKNOWLEDGE"/>
<property name="jndiInitialFactory" value=""/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/jms/activemq-connector"/>
<property name="validateConnections" value="true"/>
<property name="disableTemporaryReplyToDestinations" value="false"/>
<property name="clientId" value=""/>
<property name="dispatcherPoolFactory-ref" value=""/>
<property name="blocking" value="true"/>
<property name="persistentDelivery" value="false"/>
<property name="forceJndiDestinations" value="false"/>
<property name="connectionFactoryJndiName" value=""/>
<property name="specification" value="1.1"/>
<property name="brokerURL" value="tcp://localhost:61616"/>
<property name="jndiDestinations" value="false"/>
<property name="honorQosHeaders" value="false"/>
<property name="cacheJmsSessions" value="false"/>
<property name="jndiProviderProperties-ref" value=""/>
<property-collection name="">
<property name="d" value=""/>
<property name="blocking" value="true"/>
<property name="customReconnection" value="false"/>
<property name="standardReconnection" value="false"/>
<property name="noReconnection" value="true"/>
</property-collection>
</properties>
<description></description>
</global-element>
<flow SubFlow="false" name="jmsFlow1" entity-id="3b19b434-0594-4266-a72b-ba6ce24ac228">
<lane hadOnlyOneElement="false" entity-id="a5c174d1-3e0b-48d8-9b33-42440d34e4a2">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="8bf9cd0c-8b55-4e7d-9b5a-d8b448ccb37b">
<properties>
<property name="reverseOrder" value="false"/>
<property name="moveToPattern" value=""/>
<property name="pollingFrequency" value="1000"/>
<property name="comparator" value=""/>
<property name="disableTransportTransformer" value="false"/>
<property name="exchange-pattern" value="one-way"/>
<property name="ref" value=""/>
<property name="transformer-refs" value=""/>
<property name="moveToDirectory" value=""/>
<property name="address" value=""/>
<property name="fileAge" value="500"/>
<property name="path" value="/tmp/in"/>
<property name="encoding" value=""/>
<property name="responseTimeout" value="10000"/>
<property name="mimeType" value=""/>
<property name="connector-ref" value=""/>
</properties>
<description></description>
</endpoint>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="JMS" type="http://www.mulesoft.org/schema/mule/jms/endpoint" entity-id="dd58b646-811f-4ae6-85b6-facd2f84cd9c">
<properties>
<property name="ref" value=""/>
<property name="queue" value="MyQueue"/>
<property name="transformer-refs" value=""/>
<property name="address" value=""/>
<property name="encoding" value=""/>
<property name="disableTransportTransformer" value="false"/>
<property name="disableTemporaryReplyToDestinations" value="false"/>
<property name="responseTimeout" value="10000"/>
<property name="mimeType" value=""/>
<property name="exchange-pattern" value="one-way"/>
<property name="connector-ref" value="Active_MQ"/>
</properties>
<description></description>
</endpoint>
</lane>
</flow>
<flow SubFlow="false" name="jmsFlow2" entity-id="7824036a-87ec-4c33-9345-304f20c75f41">
<lane hadOnlyOneElement="false" entity-id="173c516f-f064-47b2-a92a-4b751d5adb77">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="JMS" type="http://www.mulesoft.org/schema/mule/jms/endpoint" entity-id="7a8c44b4-71fa-4be9-8920-2c49ffbbb4fd">
<properties>
<property name="ref" value=""/>
<property name="queue" value="MyQueue"/>
<property name="transformer-refs" value=""/>
<property name="durableName" value=""/>
<property name="address" value=""/>
<property name="encoding" value=""/>
<property name="disableTransportTransformer" value="false"/>
<property name="disableTemporaryReplyToDestinations" value="false"/>
<property name="responseTimeout" value="10000"/>
<property name="mimeType" value=""/>
<property name="exchange-pattern" value="one-way"/>
<property name="connector-ref" value="Active_MQ"/>
</properties>
<description></description>
</endpoint>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="62fd10f1-c602-4397-bb97-206892cf4d87">
<properties>
<property name="ref" value=""/>
<property name="transformer-refs" value=""/>
<property name="address" value=""/>
<property name="encoding" value=""/>
<property name="path" value="/tmp/out"/>
<property name="disableTransportTransformer" value="false"/>
<property name="outputPattern" value=""/>
<property name="mimeType" value=""/>
<property name="responseTimeout" value="10000"/>
<property name="exchange-pattern" value="one-way"/>
<property name="connector-ref" value=""/>
</properties>
<description></description>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

5
TP5/jms/mule-project.xml Normal file
View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>jms</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<jms:activemq-connector name="Active_MQ" specification="1.1" username="admin" password="admin" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/>
<flow name="jmsFlow1" doc:name="jmsFlow1">
<file:inbound-endpoint path="/tmp/in" responseTimeout="10000" doc:name="File"/>
<jms:outbound-endpoint queue="MyQueue" connector-ref="Active_MQ" doc:name="JMS"/>
</flow>
<flow name="jmsFlow2" doc:name="jmsFlow2">
<jms:inbound-endpoint queue="MyQueue" connector-ref="Active_MQ" doc:name="JMS"/>
<file:outbound-endpoint path="/tmp/out" responseTimeout="10000" doc:name="File"/>
</flow>
</mule>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:38:01 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:38:40 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=jms.xml

10
TP5/smtp/.classpath Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/smtp/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>smtp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831315</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

118
TP5/smtp/flows/smtp.mflow Normal file
View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="smtp">
<global-element name="Gmail" type="http://www.mulesoft.org/schema/mule/smtp/gmail-connector" entity-id="68269c01-b4f4-458f-91d0-bbda0b913aaa">
<properties>
<property name="d" value=""/>
<property name="customReconnection" value="false"/>
<property name="standardReconnection" value="false"/>
<property name="subject" value=""/>
<property name="bccAddresses" value=""/>
<property name="validateConnections" value="true"/>
<property name="contentType" value=""/>
<property name="replyToAddresses" value=""/>
<property name="noReconnection" value="true"/>
<property name="ccAddresses" value=""/>
<property name="dispatcherPoolFactory-ref" value=""/>
<property name="blocking" value="true"/>
<property name="name" value="Gmail"/>
<property name="fromAddress" value=""/>
<property name="dynamicNotification" value="false"/>
<property-collection name="">
<property name="d" value=""/>
<property name="blocking" value="true"/>
<property name="customReconnection" value="false"/>
<property name="standardReconnection" value="false"/>
<property name="noReconnection" value="true"/>
</property-collection>
</properties>
<description></description>
</global-element>
<flow SubFlow="false" name="smtpFlow1">
<properties>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
</properties>
<lane hadOnlyOneElement="false" entity-id="fa819679-ee69-494f-881a-e4676d42359c">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="f022c346-9563-4ab2-896f-fdaca2a1b596">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="path" value="/tmp/in"/>
<property name="outputPattern"/>
<property name="moveToPattern"/>
<property name="moveToDirectory"/>
<property name="pollingFrequency"/>
<property name="fileAge"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="comparator"/>
<property name="reverseOrder"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
</properties>
</endpoint>
<pattern name="File to String" type="http://www.mulesoft.org/schema/mule/file/file-to-string-transformer" entity-id="1250eec5-b7c3-41ce-8107-1783fc9a98e6">
<properties>
<property name="returnClass"/>
<property name="ignoreBadInput"/>
<property name="encoding"/>
<property name="mimeType"/>
</properties>
</pattern>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="Gmail" type="http://www.mulesoft.org/schema/mule/smtps/endpoint" entity-id="1fa9670b-55c4-4176-8e54-da9c3c76440c">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="host" value="smtp.gmail.com"/>
<property name="port" value="587"/>
<property name="user" value="tpdhlogin"/>
<property name="password" value="tpdhpasswd"/>
<property name="to" value="hagimont@enseeiht.fr"/>
<property name="from" value="tpdhlogin@gmail.com"/>
<property name="subject" value="Hello from Mule"/>
<property name="cc"/>
<property name="bcc"/>
<property name="replyTo" value="tpdhlogin@gmail.com"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/smtp/endpoint"/>
<property name="host" value="smtp.gmail.com"/>
<property name="port" value="587"/>
<property name="user" value="tpdhlogin"/>
<property name="password" value="tpdhpasswd"/>
<property name="to" value="hagimont@enseeiht.fr"/>
<property name="from" value="tpdhlogin@gmail.com"/>
<property name="subject" value="Hello from Mule"/>
<property name="cc"/>
<property name="bcc"/>
<property name="replyTo" value="tpdhlogin@gmail.com"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
</properties>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>smtp</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:42:00 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:46:42 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=smtp.xml

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<smtp:gmail-connector name="Gmail" validateConnections="true" doc:name="Gmail"/>
<flow name="smtpFlow1" doc:name="smtpFlow1">
<file:inbound-endpoint path="/tmp/in" responseTimeout="10000" doc:name="File"/>
<file:file-to-string-transformer doc:name="File to String"/>
<smtp:outbound-endpoint host="smtp.gmail.com" port="587" user="tpdhlogin" password="tpdhpasswd" to="hagimont@enseeiht.fr" from="tpdhlogin@gmail.com" subject="Hello from Mule" replyTo="tpdhlogin@gmail.com" responseTimeout="10000" doc:name="Gmail"/>
</flow>
</mule>

204
TP5/tp-esb.html Normal file
View file

@ -0,0 +1,204 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=windows-1252">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 1.1.4 (Win32)">
<meta name="CREATED" content="20051025;2415301">
<meta name="CHANGEDBY" content="Daniel Hagimont">
<meta name="CHANGED" content="20051025;3523617">
</head>
<body dir="LTR" lang="fr-FR">
<p align="CENTER"><font style="font-size: 28pt" size="6"><b>TP ESB<br>
<i><small><small><small><small><br>
</small></small></small></small></i></b><i><small><small><small><small>Daniel
Hagimont</small></small></small></small></i><b><br>
</b></font></p>
<p><br>
</p>
<p><big><b>Sujet</b></big><br>
</p>
<p>Le but de ce TP est de travailler avec le framework Mule étudié
en cours, autour d'un scénario d'intégration d'applications.<br>
Dans ce scénario, nous voulons intégrer 4 applications :<br>
</p>
<p>- Saisie : une application permettant de saisir les données
personnelles d'une personne qui s'inscrit quelque part (par
exemple un étudiant à l'enseeiht)<br>
- Email : une application de gestion d'emails utilisée par un
administratif qui valide les inscriptions<br>
- BD : un serveur de base de données enregistrant les étudiants<br>
- Login : un système d'exploitation sur lequel on gère des comptes
utilisateurs (cette fonction est accessible par un Web Service) </p>
<p>Le but de d'implanter le scénario suivant d'intégration :<br>
- Saisie : les données d'une personne sont saisies et
l'application permet d'exporter les données en XML Ces données
doivent être ensuite transmises à l'administratif par email<br>
- Email : l'admistratif verifie la cohérence des données, puis
valide l'inscription en répondant à ce mail (à l'adresse spécifiée
dans ReplyTo).<br>
- Web : ces données doivent alors être intégrées dans la base de
données. Elles sont donc reçues par email (la réponse) et intégrée
dans la base de données.<br>
- Login : les mêmes données sont exploitées pour demander la
création d'un compte utilisateur sur une machine avec un web
service<br>
</p>
<p><br>
<b><big>Les applications à utiliser : legacy</big></b></p>
<p>- saisie : ce répertoire contient une petite application de
saisie (voir le readme)<br>
- bd : ce répertoire contient la base de données à lancer (hsqldb)<br>
- ws : ce répertoire contient le Web Service permettant de
demander la création d'un login, à déployer dans un Tomcat (voir
readme)<br>
- il faudra avoir une adresse email correspondant à celle utilisée
par l'administratif et une utilisée pour recevoir la réponse de
l'administratif<br>
<br>
</p>
<p><big><b>Environnement Logiciel</b></big></p>
JDK 1.7 : il vous faut utiliser cette version de Java pour utiliser
la version de Mule ci-dessous.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - source use-jdk7.bash permet
d'utiliser ce JDK1.7<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - utiliser JDK1.8 pour
les autres logiciels (activeMQ, HSQLDB)<br>
<p>Mule Studio 1.3.0 : cette version est open source<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez l'installation dans
votre répertoire nosave<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - décompressez la<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - lancer MuleStudio avec le
JDK1.7<br>
</p>
<p>legacy.tgz : contient les applications à intégrer<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - à copier chez vous<br>
</p>
<p>apache-activemq-5.12.1-bin.tar.gz : activeMQ<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - à copier chez vous </p>
<p>sujet-esb.tgz : les exemples de base utiles pour réaliser cette
intégration<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - à copier chez vous<br>
</p>
<p>Tout cela se trouve dans <big><b>/mnt/n7fs/ens/tp_dh/tp-esb</b></big><br>
</p>
<p><big><b><br>
Exemples</b></big><br>
</p>
Les exemples qui vous sont fournis sont situés dans le répertoire tp
:<br>
<p> - xml : un exemple de fichiers et de parsing xml<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - créez des répertoires
/tmp/in et /tmp/out<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - exécutez le flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez
legacy/saisie/example.xml dans /tmp/in<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - regarder dans /tmp/out<br>
</p>
<p> - jdbc : un exemple d'utilisation d'une BD<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - ajoutez le driver jdbc
(legacy/bd/hsqldb/lib/hsqldb.jar) dans votre projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - lancez la BD<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - ant
start (dans legacy/bd)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - créer la table dans la BD<br>
&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; - ant db<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; - regardez dans la BD<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - ant
console<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exécutez le flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez
legacy/saisie/example.xml dans /tmp/in<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - regardez à nouveau dans la
BD<br>
</p>
<p>- smtp : un exemple d'envoi d'email avec SMTP<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - modifiez l'adresse email
pour ne pas m'envoyer un email !<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exécutez le flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez
legacy/saisie/example.xml dans /tmp/in<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - regardez votre mailbox<br>
</p>
<p>- imap : un exemple de lecture d'email avec IMAP<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - utilisez une adresse gmail
(j'en ai une qui est tpdhlogin/tpdhpasswd, mais c'est mieux
d'avoir la votre)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exécutez le flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - envoyez un email à cette
adresse<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - regardez dans /tmp/out<br>
</p>
<p>- ws : un exemple d'appel à un web service<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - lancez tomcat et copiez de
WS dedans (legacy/ws/WS.war)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exécutez le flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez
legacy/saisie.example.xml dans /tmp/in<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - regardez dans
/tmp/accounts (simule l'ajout d'un compte utilisateur)<br>
</p>
<p> - jms : un exemple d'envoi de message JMS<br>
&nbsp;&nbsp;&nbsp; - pour tester<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - importez ou recréez le
projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - ajoutez le driver de
activemq (apache-activemq-5.12.1/activemq-all-5.12.1.jar) dans
votre projet<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - lancez activemq<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -
./activemp start dans&nbsp;apache-activemq-5.12.1/bin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exécutez le
flow<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; - copiez
legacy/saisie.example.xml dans /tmp/in<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; - regardez dans /tmp/out</p>
<p> <b><big>Etapes</big></b><br>
</p>
<p>- dessinez un schéma global de l'intégration<br>
- travaillez de façon incrémentale :<br>
&nbsp;&nbsp;&nbsp; - connectez Saisie et Email<br>
&nbsp;&nbsp;&nbsp; - connectez Email et la BD<br>
&nbsp;&nbsp;&nbsp; - intégrez Login<br>
<br>
</p>
<p><big><b>Attention: Bug dans MuleStudio !</b></big><br>
</p>
<p>Si vous utilisez un endpoint IMAP, lorsque vous sauvegardez votre
projet, il arrive que MuleStudio génère un XML buggé.<br>
A l'exécution, vous observez une exception :
org.xml.sax.SAXParseException<br>
Si vous allez voir le XML généré, vous verrez une ligne incomplète
: <br>
http://www.mulesoft.org/schema/mule/imap s "&gt;<br>
Enlevez là en vérifiant que le XML reste bien parenthèsé.<br>
<br>
</p>
<p><br>
</p>
</body>
</html>

5
TP5/use-jdk7.bash Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
export JAVA_HOME=/mnt/n7fs/ens/tp_dh/jdk1.7.0_79
export PATH=$JAVA_HOME/bin:$PATH

10
TP5/ws/.classpath Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/ws/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ws</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831317</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

BIN
TP5/ws/bin/Filter.class Normal file

Binary file not shown.

BIN
TP5/ws/bin/person.class Normal file

Binary file not shown.

73
TP5/ws/flows/ws.mflow Normal file
View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="ws">
<flow SubFlow="false" name="wsFlow1">
<properties>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
</properties>
<lane hadOnlyOneElement="false" entity-id="04ddac60-4ec3-44b7-90f8-ed38aea3c276">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="6bc06e8f-1d8f-4daa-9cf4-8272f97c9261">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="path" value="/tmp/in"/>
<property name="outputPattern"/>
<property name="moveToPattern"/>
<property name="moveToDirectory"/>
<property name="pollingFrequency"/>
<property name="fileAge"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="address"/>
<property name="responseTimeout" value="10000"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="comparator"/>
<property name="reverseOrder"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
</properties>
</endpoint>
<pattern name="XML to Object" type="http://www.mulesoft.org/schema/mule/xml/xml-to-object-transformer" entity-id="8e8e4f9a-59c3-4fb8-9fa3-d9ad07b09124">
<properties>
<property name="returnClass"/>
<property name="ignoreBadInput"/>
<property name="encoding"/>
<property name="mimeType"/>
<property name="driverClass"/>
</properties>
</pattern>
<pattern name="Java" type="http://www.mulesoft.org/schema/mule/core/component" entity-id="064c61aa-39c4-4913-accc-00ae7d541efa">
<properties>
<property name="ref" value=""/>
<property name="class" value="Filter"/>
<property-collection name="@http://www.mulesoft.org/schema/mule/core/refInterceptorStackType;453815627">
<property name="ref" value=""/>
</property-collection>
</properties>
<description></description>
</pattern>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="Generic" type="http://www.mulesoft.org/schema/mule/core/endpoint" entity-id="5e13e94b-8f90-4ee0-bdbf-0f625c8cb5f4">
<properties>
<property name="exchange-pattern" value="one-way"/>
<property name="exchange-pattern"/>
<property name="address" value="wsdl-cxf:http://localhost:8080/WS/services/AccountManager?wsdl&amp;method=createAccount"/>
<property name="businessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="responseTimeout"/>
<property name="encoding"/>
<property name="disableTransportTransformer"/>
<property name="mimeType"/>
<property name="connector-ref"/>
<property name="ref"/>
<property name="transformer-refs"/>
<property name="responseTransformer-refs"/>
</properties>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

5
TP5/ws/mule-project.xml Normal file
View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>ws</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:28:04 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:32:18 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=ws.xml

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<flow name="wsFlow1" doc:name="wsFlow1">
<file:inbound-endpoint path="/tmp/in" responseTimeout="10000" doc:name="File"/>
<mulexml:xml-to-object-transformer doc:name="XML to Object"/>
<component class="Filter" doc:name="Java"/>
<outbound-endpoint address="wsdl-cxf:http://localhost:8080/WS/services/AccountManager?wsdl&amp;method=createAccount" doc:name="Generic"/>
</flow>
</mule>

View file

@ -0,0 +1,16 @@
import org.mule.api.MuleEventContext;
import org.mule.api.lifecycle.Callable;
public class Filter implements Callable {
public Object onCall(MuleEventContext eventContext) throws Exception {
person p = (person)eventContext.getMessage().getPayload();
String param[] = new String[2];
param[0] = p.getLogin();
param[1] = p.getPassword();
return param;
}
}

View file

@ -0,0 +1,48 @@
import java.io.Serializable;
public class person implements Serializable {
private static final long serialVersionUID = -1;
private String nom;
private String prenom;
private String login;
private String password;
private String email;
public person() {}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}

10
TP5/xml/.classpath Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>

34
TP5/xml/.project Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>xml</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.mule.tooling.core.muleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.mule.tooling.core.muleNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1667496831319</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

BIN
TP5/xml/bin/Filter.class Normal file

Binary file not shown.

BIN
TP5/xml/bin/person.class Normal file

Binary file not shown.

75
TP5/xml/flows/xml.mflow Normal file
View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="xml">
<flow SubFlow="false" name="xmlFlow1">
<properties>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
</properties>
<lane hadOnlyOneElement="false" entity-id="9d7d683b-fe2b-4159-80fd-8f3d829d053d">
<endpoint direction="Inbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="4a97f8b0-49c0-4959-a7fb-48b9ae65f2a3">
<properties>
<property name="reverseOrder" value="false"/>
<property name="moveToPattern" value=""/>
<property name="pollingFrequency" value="1000"/>
<property name="comparator" value=""/>
<property name="disableTransportTransformer" value="false"/>
<property name="exchange-pattern" value="one-way"/>
<property name="ref" value=""/>
<property name="transformer-refs" value=""/>
<property name="moveToDirectory" value=""/>
<property name="address" value=""/>
<property name="fileAge" value="500"/>
<property name="path" value="/tmp/in"/>
<property name="encoding" value=""/>
<property name="responseTimeout" value="10000"/>
<property name="mimeType" value=""/>
<property name="connector-ref" value=""/>
</properties>
<description></description>
</endpoint>
<pattern name="XML to Object" type="http://www.mulesoft.org/schema/mule/xml/xml-to-object-transformer" entity-id="0fb56994-9f45-445b-909e-2c3584c1124e">
<properties>
<property name="returnClass"/>
<property name="ignoreBadInput"/>
<property name="encoding"/>
<property name="mimeType"/>
<property name="driverClass"/>
</properties>
</pattern>
<pattern name="Java" type="http://www.mulesoft.org/schema/mule/core/component" entity-id="0272cab9-8433-40d2-9956-02fe4a51e940">
<properties>
<property name="class" value="Filter"/>
</properties>
</pattern>
<pattern name="Object to XML" type="org.mule.tooling.ui.modules.core.pattern.objectToXmlTransformer" entity-id="7954a121-3734-4d44-8868-ee081b5ca085">
<properties>
<property name="returnClass"/>
<property name="ignoreBadInput"/>
<property name="encoding"/>
<property name="mimeType"/>
<property name="driverClass"/>
<property name="acceptMuleMessage"/>
</properties>
</pattern>
<endpoint direction="Outbound" message-exchange-pattern="OneWay" name="File" type="http://www.mulesoft.org/schema/mule/file/endpoint" entity-id="39d40ef3-7ecb-4edf-891c-934bd9acb929">
<properties>
<property name="ref" value=""/>
<property name="transformer-refs" value=""/>
<property name="address" value=""/>
<property name="encoding" value=""/>
<property name="path" value="/tmp/out"/>
<property name="disableTransportTransformer" value="false"/>
<property name="outputPattern" value=""/>
<property name="mimeType" value=""/>
<property name="responseTimeout" value="10000"/>
<property name="exchange-pattern" value="one-way"/>
<property name="connector-ref" value=""/>
</properties>
<description></description>
</endpoint>
</lane>
</flow>
<description></description>
</mule-configuration>

5
TP5/xml/mule-project.xml Normal file
View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-project xmlns="http://www.mulesoft.com/tooling/project" runtimeId="org.mule.servers.3.3.0.CE">
<name>xml</name>
<description></description>
</mule-project>

View file

@ -0,0 +1,2 @@
#** GENERATED CONTENT ** Mule Custom Properties file.
#Mon Jan 11 21:13:24 CET 2021

View file

@ -0,0 +1,5 @@
#Mon Jan 11 21:15:40 CET 2021
redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=xml.xml

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<flow name="xmlFlow1" doc:name="xmlFlow1">
<file:inbound-endpoint path="/tmp/in" responseTimeout="10000" doc:name="File"/>
<mulexml:xml-to-object-transformer doc:name="XML to Object"/>
<component class="Filter" doc:name="Java"/>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
<file:outbound-endpoint path="/tmp/out" responseTimeout="10000" doc:name="File"/>
</flow>
</mule>

View file

@ -0,0 +1,14 @@
import org.mule.api.MuleEventContext;
import org.mule.api.lifecycle.Callable;
public class Filter implements Callable {
public Object onCall(MuleEventContext eventContext) throws Exception {
person p = (person)eventContext.getMessage().getPayload();
p.setNom("hagimont");
eventContext.getMessage().setPayload(p);
return eventContext.getMessage();
}
}

View file

@ -0,0 +1,48 @@
import java.io.Serializable;
public class person implements Serializable {
private static final long serialVersionUID = -1;
private String nom;
private String prenom;
private String login;
private String password;
private String email;
public person() {}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}