Skip to content

Instantly share code, notes, and snippets.

<spring:bean id="fakeCredentialAccessor" class="org.mule.example.SimpleCredentialsAccessor">
<spring:constructor-arg value="The Receiver &lt;the@receiver.com&gt;" />
</spring:bean>
public class SimpleCredentialsAccessor implements CredentialsAccessor {
private String credentials;
public SimpleCredentialsAccessor(String credentials) {
this.credentials = credentials;
}
@Override
public Object getCredentials(MuleEvent event) {
<pgp:security-manager>
<pgp:security-provider name="pgpSecurityProvider" keyManager-ref="pgpKeyManager" />
<pgp:keybased-encryption-strategy name="keyBasedEncryptionStrategy" keyManager-ref="pgpKeyManager" credentialsAccessor-ref="fakeCredentialAccessor" />
</pgp:security-manager>
<sub-flow name="encryptFlow">
<encrypt-transformer name="pgpEncrypt" strategy-ref="keyBasedEncryptionStrategy" />
<object-to-string-transformer />
<ftp:outbound-endpoint host="${ftp.host}"
port="${ftp.port}" user="${ftp.user}" password="${ftp.password}"
outputPattern="file_#[function:datestamp:MMddyyyy].txt"
connector-ref="ftpConnector">
</ftp:outbound-endpoint>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-pgp</artifactId>
<version>${mule.version}</version>
</dependency>
@marianogonzalez
marianogonzalez / gist:1933227
Created February 28, 2012 15:39
ssh namespace
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ssh="http://www.mulesoft.org/schema/mule/sshmultiplexedconnector"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ssh http://www.mulesoft.org/schema/mule/sshmultiplexedconnector/1.0/mule-sshmultiplexedconnector.xsd">
@marianogonzalez
marianogonzalez / sshconfig.xml
Created February 28, 2012 15:51
ssh config
<ssh:config host="ssh.mycompany.com" port="22" timeout="6000" callbackFlowName="callback" shellMode="true" />
<flow name="exampleFlow">
<ssh:send username="${ssh.user}" password="${ssh.pass}" content="cd test" breakLine="true" />
<ssh:send username="${ssh.user}" password="${ssh.pass}" content="cat helloWorld.txt" breakLine="true"/>
</flow>
@marianogonzalez
marianogonzalez / sshcallback.xml
Created February 28, 2012 16:36
callback example
<flow name="callback">
<logger message="sent to #[header:INBOUND:SSH_CALLBACK_USER], message says: #[payload]" />
</flow>
@marianogonzalez
marianogonzalez / sshrelease.xml
Created February 28, 2012 16:40
release connection
<flow name="release">
<ssh:release username="${ssh.user}"/>
</flow>