Class Platform


  • public abstract class Platform
    extends java.lang.Object
    An platform abstraction layer singleton providing information about the underlying system.
    • Constructor Summary

      Constructors 
      Constructor Description
      Platform()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.util.concurrent.Executor callbackExecutor()
      Return an executor for this platform.
      static Platform get()  
      abstract java.lang.String name()
      How do you call this platform?
      abstract boolean needsCustomTLSSocketFactory()
      Does this platform need to overwrite the default TLS socket factory to provide TLS1.2
      abstract java.lang.String version()
      Which version of the platform is executing this app?
      • Methods inherited from class java.lang.Object

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

      • Platform

        public Platform()
    • Method Detail

      • get

        public static Platform get()
        Returns:
        the current platform.
      • callbackExecutor

        public abstract java.util.concurrent.Executor callbackExecutor()
        Return an executor for this platform.
        Returns:
        an executor for this platform.
      • name

        public abstract java.lang.String name()
        How do you call this platform?

        Valid values are "Windows", "Linux", "Mac OS" and "Android".

        Returns:
        a string identifying this platform by name.
      • version

        public abstract java.lang.String version()
        Which version of the platform is executing this app?
        Returns:
        "1.4", "4.4", "10.1" …
      • needsCustomTLSSocketFactory

        public abstract boolean needsCustomTLSSocketFactory()
        Does this platform need to overwrite the default TLS socket factory to provide TLS1.2

        The servers Contentful uses are enforcing usage of TLS 1.2. Some platforms (Android 4.x) are having TLS1.2 implemented but are not enabling it as a default. This check finds these situations and recommends overwriting the default TLSSocketFactory.

        This recommendation can be overruled by using CDAClient.Builder.setTls12Implementation(com.contentful.java.cda.Tls12Implementation).

        Returns:
        true if for this platform the custom TLSSocketFactory should be used.