The s3-mb-contentstore-context.xml.sample file - The s3-mb-contentstore-context.xml.sample file - Alfresco - Alfresco Content Connector for AWS S3 - Alfresco/Alfresco-Content-Connector-for-AWS-S3/6.0/Alfresco-Content-Connector-for-AWS-S3/Alfresco-Content-Connector-for-AWS-S3/Configure/Using-multiple-buckets/The-s3-mb-contentstore-context.xml.sample-file - 6.0

Alfresco Content Connector for AWS S3

Platform
Alfresco
Product
Alfresco Content Connector for AWS S3
Release
6.0
ft:lastPublication
2026-05-06T14:41:07.251000
ft:locale
en-US
ArchiveStatus
Archived

The subsystem configuration file is split into the following sections to make it easier to extend:

  • Deleted content store
  • Common configuration
  • Stores
  • Store selector
  • Caching content store

Deleted content store

<bean id="deletedContentStore" class="org.alfresco.integrations.connector.DeletedS3ContentStore"
    depends-on="store1.s3Adapter">
    <property name="contentRoot" value="${dir.s3.contentstore.deleted}" />
    <property name="serviceAdapter" ref="store1.s3Adapter" />
    <property name="nodeService" ref="nodeService" />
    <property name="useContentRootInPath" value="${s3.useContentRootInPath}"/>
    <property name="objNameSuffix" value="${connector.s3.deleted.objectNameSuffix}" />
    <property name="objNamePrefix" value="${connector.s3.deleted.objectNamePrefix}" />
    <property name="storeProtocol" value="${connector.s3.storeProtocol}"/>
    <!-- if true put all files into tenant root folder ! -->
    <property name="flatRoot" value="${s3.flatRoot}" />
</bean>

Note

If you re-enable the soft deletion provided by the repository, all deleted files will go to /dir.s3.contentstore.deleted from the bucket of the first store (e.g. connector.s3.bucketName).

Common configuration

This configuration is shared by the two stores.

<!-- [Start] Common configuration - could be duplicated for each store if needed -->

<bean id="s3RetryPolicy" class="com.amazonaws.retry.RetryPolicy">
    <constructor-arg ref="s3RetryCondition"/>
    <constructor-arg>
        <util:constant static-field="com.amazonaws.retry.PredefinedRetryPolicies.DEFAULT_BACKOFF_STRATEGY"/>
    </constructor-arg>
    <constructor-arg value="${connector.s3.maxErrorRetries}"/>
    <constructor-arg value="false" />
</bean>

<!-- Client configuration options such as proxy settings, user agent string, max retry attempts, etc. -->
<bean id="s3ClientConfiguration" class="com.amazonaws.ClientConfiguration">
    <!-- Sets the retry policy upon failed requests. -->
    <property name="retryPolicy" ref="s3RetryPolicy"/>
    <!-- Sets whether throttled retries should be used -->
    <property name="useThrottleRetries" value="true"/>
    <property name="requestTimeout" value="${connector.s3.httpRequestTimeout}" />
</bean>

<!-- [End] Common configuration -->

For more information on how to change this, see Advanced customization for S3MultipleBuckets subsystem

Stores

<!-- [Start] Store 1 -->

<bean id="store1.s3Adapter" class="org.alfresco.integrations.connector.AmazonS3ServiceAdapter" init-method="init">
    <property name="accessKey" value="${connector.s3.accessKey}" />
    <property name="secretKey" value="${connector.s3.secretKey}" />
    <property name="bucketName" value="${connector.s3.bucketName}" />
    <property name="bucketRegion" value="${connector.s3.bucketRegion}" />
    <property name="encryption" value="${connector.s3.encryption}" />
    <property name="abortIncompleteMultipartUploadDays" value="${connector.s3.abortIncompleteMultipartUploadDays}" />
    <property name="autoLowerCaseBucketName" value="${s3.autoLowerCaseBucketName}" />
    <property name="awsKmsKeyId" value="${connector.s3.awsKmsKeyId}" />
    <property name="endpoint" value="${connector.s3.endpoint}" />
    <property name="clientConfiguration" ref="s3ClientConfiguration"/>

    <property name="tagName" value="${connector.s3.tagName}" />
    <property name="tagValue" value="${connector.s3.tagValue}" />
</bean>

<bean id="store1.s3ContentStore" class="org.alfresco.integrations.connector.TenantS3ContentStore" depends-on="store1.s3Adapter">
    <property name="useTenantDomainInPath" value="${s3.useTenantDomainInPath}" />
    <property name="contentRoot" value="${dir.s3.contentstore}" />
    <property name="serviceAdapter" ref="store1.s3Adapter"/>
    <property name="nodeService" ref="nodeService" />
    <property name="defaultRootDir" value="${dir.s3.contentstore}" />

    <!-- Force the contentStore to use the prefix, otherwise the files would end up in the root of bucket -->
    <property name="useContentRootInPath" value="${s3.useContentRootInPath}"/>
    <property name="objNameSuffix" value="${connector.s3.objectNameSuffix}" />
    <property name="objNamePrefix" value="${connector.s3.objectNamePrefix}" />
    <property name="storeProtocol" value="${connector.s3.storeProtocol}"/>
    <!-- if true put all files into tenant root folder ! -->
    <property name="flatRoot" value="${s3.flatRoot}" />
</bean>

<!-- [End] Store 1 -->

Store selector

<!-- [Start] Store Selector -->

<!-- Override the selector to add in the S3Connector stores -->
<bean id="storeSelectorContentStore" parent="storeSelectorContentStoreBase">
    <property name="defaultStoreName">
        <value>default</value>
    </property>
    <property name="storesByName">
        <map>
            <entry key="default">
                <ref bean="store1.s3ContentStore"/>
            </entry>
            <entry key="s3ContentStore2">
                <ref bean="store2.s3ContentStore"/>
            </entry>
        </map>
    </property>
</bean>

<!-- Overwrite the store constraint with a no op constraint for now-->
<bean id="storeSelectorContentStore.constraint" class="org.alfresco.repo.dictionary.constraint.NoOpConstraint" init-method="initialize" >
    <property name="shortName">
        <value>defaultStoreSelector</value>
    </property>
    <property name="registry">
        <ref bean="cm:constraintRegistry" />
    </property>
</bean>

<!-- [End] Store Selector -->

Caching content store

The caching content store is defined over the content store selector so that we have one cache for all stores and makes the sample easier to extend when adding more stores.

<bean id="cachingContentStore"
class="org.alfresco.repo.content.caching.CachingContentStore"
init-method="init">
<property name="backingStore" ref="storeSelectorContentStore"/>
<property name="cache" ref="contentCache"/>
<property name="cacheOnInbound" value="true"/>
<property name="quota" ref="standardQuotaManager"/>
</bean>

<bean id="contentStoresToClean" class="java.util.ArrayList" >
    <constructor-arg>
        <list>
            <ref bean="cachingContentStore"/>
        </list>
    </constructor-arg>
</bean>

s3-mb-contentstore.properties.sample

This provides the subsystem properties where the S3MultipleBuckets subsystem declares default values for all the properties it requires.

See the Alfresco Content Services documentation on Subsystem properties for more info.

Deleted content store support provided by the repository vs. managed by S3 capabilities

See S3 Connector deleted content store for more info.