Compare commits

...

1 Commits

Author SHA1 Message Date
Damian Ujma
58b304d5bb MNT-23864 Add unavailableTransformer status 2024-07-01 14:31:42 +02:00
3 changed files with 53 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* Copyright (C) 2005 - 2024 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.repo.web.scripts.solr;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.UnavailableTransformerException;
import org.alfresco.repo.content.transform.UnsupportedTransformationException;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.rendition2.SynchronousTransformClient;
@@ -200,6 +201,12 @@ public class NodeContentGet extends StreamContent
}
catch (Exception e)
{
if(e.getCause() instanceof UnavailableTransformerException)
{
res.setHeader(TRANSFORM_STATUS_HEADER, "unavailableTransformer");
res.setStatus(HttpStatus.SC_NO_CONTENT);
return;
}
transformException = e;
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -200,7 +200,7 @@ public class RemoteTransformerClient
// forces a wait before trying again.
connectionFailed();
logHttpClientTimeoutException(e, logger);
throw new AlfrescoRuntimeException(name + " failed to connect or to read the response", e);
throw new UnavailableTransformerException(name + " failed to connect or to read the response", e);
}
}
catch (IOException e)

View File

@@ -0,0 +1,43 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.content.transform;
import org.alfresco.error.AlfrescoRuntimeException;
public class UnavailableTransformerException extends AlfrescoRuntimeException
{
private static final long serialVersionUID = 6580643557731842995L;
public UnavailableTransformerException(String msgId)
{
super(msgId);
}
public UnavailableTransformerException(String msgId, Exception e)
{
super(msgId, e);
}
}