Class RemoteTransformerClient


  • public class RemoteTransformerClient
    extends java.lang.Object
    Client class that transfers content (from a ContentReader) to a remote transformation agent together with request parameters that will be used to transform the content. The transformed content is then returned and saved in a ContentWriter. In the event of an error an Exception is thrown.
    Since:
    6.0
    • Constructor Summary

      Constructors 
      Constructor Description
      RemoteTransformerClient​(java.lang.String name, java.lang.String baseUrl)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.alfresco.util.Pair<java.lang.Boolean,​java.lang.String> check​(org.alfresco.util.exec.RuntimeExec checkCommand)
      Helper method that returns the same result type as check(Log) given a local checkCommand.
      org.alfresco.util.Pair<java.lang.Boolean,​java.lang.String> check​(org.apache.commons.logging.Log logger)
      Indicates if a remote transform: a) ready probe has ever indicated success new Pair<>(true, <version string>), b) a ready probe has just failed new Pair<>(false, <error string>), or c) we are not performing a ready check as we have just done one new Pair<>(null, null).
      java.lang.String getBaseUrl()  
      boolean isAvailable()  
      void request​(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, java.lang.String sourceMimetype, java.lang.String sourceExtension, java.lang.String targetExtension, long timeoutMs, org.apache.commons.logging.Log logger, java.lang.String... args)  
      void setStartupRetryPeriodSeconds​(int startupRetryPeriodSeconds)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RemoteTransformerClient

        public RemoteTransformerClient​(java.lang.String name,
                                       java.lang.String baseUrl)
    • Method Detail

      • setStartupRetryPeriodSeconds

        public void setStartupRetryPeriodSeconds​(int startupRetryPeriodSeconds)
      • getBaseUrl

        public java.lang.String getBaseUrl()
      • request

        public void request​(org.alfresco.service.cmr.repository.ContentReader reader,
                            org.alfresco.service.cmr.repository.ContentWriter writer,
                            java.lang.String sourceMimetype,
                            java.lang.String sourceExtension,
                            java.lang.String targetExtension,
                            long timeoutMs,
                            org.apache.commons.logging.Log logger,
                            java.lang.String... args)
                     throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException
      • check

        public org.alfresco.util.Pair<java.lang.Boolean,​java.lang.String> check​(org.apache.commons.logging.Log logger)
        Indicates if a remote transform: a) ready probe has ever indicated success new Pair<>(true, <version string>), b) a ready probe has just failed new Pair<>(false, <error string>), or c) we are not performing a ready check as we have just done one new Pair<>(null, null).
      • check

        public static org.alfresco.util.Pair<java.lang.Boolean,​java.lang.String> check​(org.alfresco.util.exec.RuntimeExec checkCommand)
        Helper method that returns the same result type as check(Log) given a local checkCommand.
      • isAvailable

        public boolean isAvailable()