<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>

    <!-- Deployment Service Configuration -->  
    
    <!--  Payload transformers -->
     <bean id="deploymentTestTransformer" class="org.alfresco.deployment.test.TestDeploymentTransportTransformer">
     </bean>   
     
     <bean id="deploymentEncryptor" class="org.alfresco.deployment.transformers.SampleEncryptionTransformer">
        <property name="password">
         	<value>Alfresco</value>
        </property>
        <property name="cipherName">
         	<value>PBEWithMD5AndDES</value>
        </property>
     </bean>  
     
     <bean id="deploymentCompressor" class="org.alfresco.deployment.transformers.CompressionTransformer">
     </bean>  
     
     <!--  Transport adapters to communicate with remote File System Receivers -->     
     <!--  Communicate with an Deployment Server over RMI - Default method for Alfresco-->
     <bean id="rmiFSRAdapter" class="org.alfresco.repo.deploy.DeploymentReceiverTransportAdapterRMI">
     </bean>
     
     <!--  communicate with an Deployment Server over RMI with the content encrypted  -->
     <bean id="encryptedRMIFSRAdapter" class="org.alfresco.repo.deploy.DeploymentReceiverTransportAdapterRMI">
          <property name="transformers">
            <list>
            	<ref bean="deploymentEncryptor"></ref>
            </list>
        </property>
     </bean>
     
     <!--  communicate with an Deployment Server over RMI with the content compressed then encrypted  -->
     <bean id="compressEncryptedRMIFSRAdapter" class="org.alfresco.repo.deploy.DeploymentReceiverTransportAdapterRMI">
          <property name="transformers">
            <list>
            	<ref bean="deploymentEncryptor"></ref>
            	<ref bean="deploymentCompressor"></ref>
            </list>
        </property>
     </bean>
     
     <!--  how to communicate with an Deployment Server over Spring HTTP -->
     <bean id="springHttpFSRAdapter" class="org.alfresco.repo.deploy.DeploymentReceiverTransportAdapterSpringHTTP">
        <property name="urlPattern">
         	<value>http://{0}:{1}/ADSR/deployment</value>
        </property>
     </bean>
     

     <!--  Deployment Service -->
     <bean id="deploymentService" class="org.alfresco.repo.deploy.DeploymentServiceImpl" init-method="init">
        <property name="avmService">
            <ref bean="AVMService"/>
        </property>
        
        <property name="avmNodeService">
            <ref bean="avmNodeService"/>
        </property>
        
        <property name="transactionService">
            <ref bean="transactionService"/>
        </property>
        
        <property name="jobLockService">
        	<ref bean="jobLockService"/>
        </property>
        
        <!-- how many files to send in parallel -->
        <property name="numberOfSendingThreads">
            <value>${deployment.service.numberOfSendingThreads}</value>
        </property>
        
        <!-- Which adapters are provided to communicate with remote File System Receivers -->
        <property name="deploymentReceiverTransportAdapters">
            <map>
               <entry key="default">
               		<ref bean="rmiFSRAdapter"></ref>
               </entry>
               
           <!-- Uncomment to enable spring HTTP      
           	   <entry key="spring HTTP">
               		<ref bean="springHttpFSRAdapter"></ref>
               </entry>
           -->
        
           <!-- Uncomment to enable encrypted RMI 
           		<entry key="encrypted RMI">
               		<ref bean="encryptedRMIFSRAdapter"></ref>
               </entry>
            -->

			<!-- Uncomment to enable compressed and encrypted RMI
               <entry key="rmi compressed and encrypted">
               		<ref bean="compressEncryptedRMIFSRAdapter"></ref>
               </entry>
            -->
            </map>
        </property>
     </bean>

    
    <bean id="deploymentServiceReadTxnAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
        <property name="advice">
            <ref bean="retryingReadTxnAdvice"/>
        </property>
        <property name="mappedNames">
            <list>
                <value>getRemoteActionService</value>
            </list>
        </property>
    </bean>

    <bean id="deploymentServiceWriteTxnAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
        <property name="advice">
            <ref bean="retryingWriteTxnAdvice"/>
        </property>
        <property name="mappedNames">
            <list>
                <value>deployDifferenceFS</value>
                <value>deployDifference</value>
            </list>
        </property>
    </bean>

    <bean id="DeploymentService" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <list>
                <value>org.alfresco.service.cmr.avm.deploy.DeploymentService</value>
            </list>
        </property>
        <property name="targetName">
            <value>deploymentService</value>
        </property>
        <property name="interceptorNames">
            <list>
                <value>deploymentServiceWriteTxnAdvisor</value>
                <value>deploymentServiceReadTxnAdvisor</value>
                <value>checkTxnAdvisor</value>
            </list>
        </property>
    </bean>
</beans>
