Merge branch 'master' into feature/ACS-1383_StorageClasses

# Conflicts:
#	data-model/src/main/java/org/alfresco/repo/content/ContentStore.java
#	repository/src/main/java/org/alfresco/repo/content/ContentServiceImpl.java
#	repository/src/main/java/org/alfresco/repo/content/caching/CachingContentStore.java
#	repository/src/main/java/org/alfresco/repo/content/replication/AggregatingContentStore.java
#	repository/src/main/java/org/alfresco/service/cmr/repository/ContentService.java
#	repository/src/main/resources/alfresco/public-services-security-context.xml
#	repository/src/test/java/org/alfresco/repo/content/replication/AggregatingContentStoreTest.java
#	repository/src/test/java/org/alfresco/repo/version/ContentServiceImplTest.java
This commit is contained in:
mpichura
2021-10-06 12:12:42 +02:00
190 changed files with 8339 additions and 4438 deletions

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>11.94-SNAPSHOT</version>
<version>14.7-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.ContentStreamListener;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.DirectAccessUrl;
/**
* Provides low-level retrieval of content
* {@link org.alfresco.service.cmr.repository.ContentReader readers} and
@@ -259,30 +260,58 @@ public interface ContentStore
public boolean delete(String contentUrl);
/**
* Gets a presigned URL to directly access a binary content. It is up to the actual store
* implementation if it can fulfil this request with an expiry time or not.
* Checks if the store supports the retrieving of direct access URLs.
*
* @param contentUrl A content store URL
* @param expiresAt An optional expiry date, so the direct access url would become invalid when the expiry date is reached
* @return A direct access URL object for a binary content
* @throws UnsupportedOperationException if the store is unable to provide the information
* @return {@code true} if direct access URLs retrieving is supported, {@code false} otherwise
*/
default DirectAccessUrl getDirectAccessUrl(String contentUrl, Date expiresAt)
default boolean isContentDirectUrlEnabled()
{
throw new UnsupportedOperationException(
"Retrieving direct access URLs is not supported by this content store.");
return false;
}
/**
* Checks if the store supports the retrieving of direct access URLs.
* Checks if the store supports the retrieving of a direct access URL for the given node.
*
* @return true if direct access URLs retrieving is supported, false otherwise
* @param contentUrl the {@code URL} of the content for which to request a direct access {@code URL}
* @return {@code true} if direct access URLs retrieving is supported for the node, {@code false} otherwise
*/
default boolean isDirectAccessSupported()
default boolean isContentDirectUrlEnabled(String contentUrl)
{
return false;
}
/**
* Gets a presigned URL to directly access the content. It is up to the actual store
* implementation if it can fulfil this request with an expiry time or not.
*
* @param contentUrl A content store {@code URL}
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
* @param fileName File name of the content
* @return A direct access {@code URL} object for the content
* @throws UnsupportedOperationException if the store is unable to provide the information
*/
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName)
{
return requestContentDirectUrl(contentUrl, attachment, fileName, null);
}
/**
* Gets a presigned URL to directly access the content. It is up to the actual store
* implementation if it can fulfil this request with an expiry time or not.
*
* @param contentUrl A content store {@code URL}
* @param attachment {@code true} if an attachment URL is requested, {@code false} for an embedded {@code URL}.
* @param fileName File name of the content
* @param validFor The time at which the direct access {@code URL} will expire.
* @return A direct access {@code URL} object for the content.
* @throws UnsupportedOperationException if the store is unable to provide the information
*/
default DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName, Long validFor)
{
throw new UnsupportedOperationException(
"Retrieving direct access URLs is not supported by this content store.");
}
/**
* Checks whether or not the current {@link ContentStore} supports the provided {@link Set} storage classes
*
@@ -292,8 +321,8 @@ public interface ContentStore
default boolean isStorageClassesSupported(StorageClassSet storageClassSet)
{
return storageClassSet == null ||
storageClassSet.isEmpty() ||
(1 == storageClassSet.size() && storageClassSet.equals(SCS_DEFAULT));
storageClassSet.isEmpty() ||
(1 == storageClassSet.size() && storageClassSet.equals(SCS_DEFAULT));
}
/**

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -27,6 +27,7 @@ package org.alfresco.service.cmr.repository;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import org.alfresco.api.AlfrescoPublicApi;
@@ -36,7 +37,8 @@ public class DirectAccessUrl implements Serializable
private static final long serialVersionUID = -881676208224414139L;
private String contentUrl;
private Date expiresAt;
private Date expiryTime;
private boolean attachment;
public String getContentUrl()
{
@@ -48,13 +50,38 @@ public class DirectAccessUrl implements Serializable
this.contentUrl = contentUrl;
}
public Date getExpiresAt()
public Date getExpiryTime()
{
return expiresAt;
return expiryTime;
}
public void setExpiresAt(Date expiresAt)
public void setExpiryTime(Date expiryTime)
{
this.expiresAt = expiresAt;
this.expiryTime = expiryTime;
}
public boolean isAttachment()
{
return attachment;
}
public void setAttachment(boolean attachment)
{
this.attachment = attachment;
}
@Override public boolean equals(Object obj)
{
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
DirectAccessUrl that = (DirectAccessUrl) obj;
return attachment == that.attachment && Objects.equals(contentUrl,
that.contentUrl) && Objects.equals(expiryTime, that.expiryTime);
}
@Override public int hashCode()
{
return Objects.hash(contentUrl, expiryTime, attachment);
}
}