Skip to content

Instantly share code, notes, and snippets.

View nialdarbey's full-sized avatar

Nial Darbey nialdarbey

View GitHub Profile
@nialdarbey
nialdarbey / gist:4025413
Created November 6, 2012 15:28
invokeAirlineService
<sub-flow name="invokePatientService" doc:name="invokePatientService">
<cxf:proxy-client payload="body" enableMuleSoapHeaders="true" doc:name="Proxy client" />
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="${http.port}" path="PatientService" doc:name="PatientService" />
</sub-flow>
@nialdarbey
nialdarbey / gist:4025080
Created November 6, 2012 14:38
reservations xml
<flow name="admitPatientService" doc:name="admitPatientService">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="${http.port}" doc:name="AdmissionService" path="AdmissionService" />
<cxf:proxy-service doc:name="Proxy service" namespace="http://www.mule-health.com/SOA/service/admission/1.0" payload="body" port="AdmissionPort" service="AdmissionService" wsdlLocation="service/AdmissionService.wsdl" validationEnabled="true"/>
...
</flow>
@nialdarbey
nialdarbey / gist:4024559
Created November 6, 2012 12:57
content based routing operation
<set-variable doc:name="operation" value="#[xpath('fn:local-name(/*)')]" variableName="operation"/>
<choice doc:name="Choice">
<when expression="#[flowVars.operation == 'createEpisode']">
...
</when>
<otherwise>
...
</otherwise>
</choice>
@nialdarbey
nialdarbey / gist:3952232
Created October 25, 2012 12:08
archetype
mvn archetype:generate -DarchetypeGroupId=org.mule.tools.devkit -DarchetypeArtifactId=mule-devkit-archetype-generic -DarchetypeVersion=3.0.1 -DarchetypeRepository=http://repository.mulesoft.org/releases/ -DgroupId=org.mule.module.ldap -DartifactId=ldap-connector -Dversion=1.0 -DmuleVersion=3.3.1 -DmuleModuleName=LDAPConnector
@Disconnect
public void disconnect() throws LDAPException
{
...
@nialdarbey
nialdarbey / gist:3901315
Created October 16, 2012 19:11
@connectionid
@ConnectionIdentifier
public String connectionId()
{
@ValidateConnection
public boolean isConnected() throws LDAPException
{
@nialdarbey
nialdarbey / gist:3901089
Created October 16, 2012 18:29
ex config
<ldap:config name="Ldap" authDn="${ldap.userDn}" authPassword="${ldap.password}" authentication="simple" url="${ldap.url}" doc:name="LDAP" />
<flow name="search" doc:name="search">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="ldapSearch" doc:name="HTTP" />
<ldap:search config-ref="Ldap" doc:name="search" baseDn="ou=People,dc=muleforge,dc=org" filter="(objectclass=person)" scope="SUB_TREE" pageSize="500" maxResults="200">
<ldap:attributes>
<ldap:attribute>#[message.inboundProperties['http.query.params'].cn]</ldap:attribute>
</ldap:attributes>
</ldap:search>
<collection-splitter doc:name="Split Result Set"/>
<ldap:ldap-entry-to-ldif doc:name="to LDIF"/>
@nialdarbey
nialdarbey / gist:3900756
Created October 16, 2012 17:34
transformer
@Transformer(sourceTypes = {LDAPEntry.class})
public static String ldapEntryToLdif(LDAPEntry entry)
{
...
@nialdarbey
nialdarbey / gist:3900762
Created October 16, 2012 17:36
processor
@Processor
public void addFromMap(@Optional @FriendlyName("DN") String dn, @Optional @Default("#[payload:]") Map<String, Object> entry) throws Exception
{
...