Packages

final class DatasyncManager extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DatasyncManager
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DatasyncManager(optSystem: Option[ActorSystem], optExecutor: Option[ExecutionContextExecutor], optMaterializer: Option[ActorMaterializer])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def createAppClient(app: String): DatasyncClient

    Obtains a DatasyncClient bound to an application (formerly known as 'namespace') on Flexible Datasync.

    Obtains a DatasyncClient bound to an application (formerly known as 'namespace') on Flexible Datasync. Example:

    // ---------------
    // SCALA
    // ---------------
    val manager = DatasyncManager()
    val client = manager.createAppClient("my-datasync-app")
    
    // ---------------
    // JAVA
    // ---------------
    final static DatasyncManager manager = DatasyncManager.create();
    final static DatasyncClient client = manager.createAppClient("my-datasync-app");
    app

    the name of an application.

    returns

    a DatasyncClient

  7. def createAppClient(app: String, token: String): Future[(DatasyncClient, Source[AuthMessage, SourceQueueWithComplete[Any]])]

    Scala API.

    Scala API. Asynchronously obtains an already authenticated DatasyncClient bound to an application (formerly known as 'namespace') on Flexible Datasync. The akka stream Source additionally returned allows authentication monitoring. Example:

    val manager = DatasyncManager()
    
    val token = "eyJhbGc ... _yz8dN9gssZV9kS8ONgr7s"
    
    val futureClient = manager.createAppClient("my-datasync-app", token).andThen {
    	case Success((dc, source)) =>
    		logger.info("CLIENT CREATION AND AUTHENTICATION SUCCESS")
    		source.toMat(Sink.foreach(am => logger.debug(s"Event received: $am")))(Keep.left)
    			.run()
    	case Failure(t) =>
    		logger.error(s"CLIENT CREATION AND AUTHENTICATION ERROR: ${t.getMessage}", t)
    }.map(_._1)
    
    // then use futureClient, a Future[DatasyncClient] to do useful things...

    This may return some log like the following:

    Event received: AuthRevokedMessage(expired_token, Auth token is expired.)
    app

    the name of an application.

    token

    the token used to authenticate on Datasync.

    returns

    a Future[(DatasyncClient, Source[AuthMessage, SourceQueueWithComplete[Any]])]

    Exceptions thrown

    AuthenticateException if authentication process failed

    AuthenticateTimeoutException if authentication process timed out (automatic re-connection may occur)

    DatasyncUnavailableException if Web Socket connection fails while trying to authenticate

    IllegalArgumentException if token is null or empty

  8. def createAppClientJ(app: String, token: String): CompletionStage[(DatasyncClient, Source[AuthMessage, SourceQueueWithComplete[Any]])]

    Java API.

    Java API. Asynchronously obtains an already authenticated DatasyncClient bound to an application (formerly known as 'namespace') on Flexible Datasync. The akka stream Source additionally returned allows authentication monitoring. Example:

    final static DatasyncManager manager = DatasyncManager.create();
    
    final static String token = "eyJhbGc ... _yz8dN9gssZV9kS8ONgr7s";
    
    CompletionStage<DatasyncClient> futureClient =
      manager.createAppClient("my-datasync-app", token).handleAsync((tuple, ex) -> {
    	  if (tuple != null) {
    		  System.out.printf("CLIENT CREATION AND AUTHENTICATION SUCCESS \n");
    		  tuple._2.runWith(
    			  Sink.foreach(am -> System.out.printf("Event received: %s \n", am)),
    				  manager.materializer());
    	  } else {
    		  System.out.printf("CLIENT CREATION AND AUTHENTICATION ERROR: %s \n", ex.getMessage());
    	  }
    	  return tuple._1;
      });
    
    // then use futureClient to do useful things...

    This may return some log like the following:

    Event received: AuthRevokedMessage(expired_token, Auth token is expired.)
    app

    the name of an application.

    token

    the token used to authenticate on Datasync.

    returns

    a CompletionStage<(DatasyncClient, Source<AuthMessage, SourceQueueWithComplete<Any>>)>

    Exceptions thrown

    AuthenticateException if authentication process failed

    AuthenticateTimeoutException if authentication process timed out (automatic re-connection may occur)

    IllegalArgumentException if token is null or empty

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. val executor: ExecutionContextExecutor

    Retrieves the Execution Context Executor this DatasyncManager relies on.

    Retrieves the Execution Context Executor this DatasyncManager relies on. This may be useful when Execution Context Executor is built by this DatasyncManager (i.e. you did not provide it) Example:

    // ---------------
    // SCALA
    // ---------------
    val manager = DatasyncManager()
    implicit val executor: ExecutionContextExecutor = manager.executor
    
    // ---------------
    // JAVA
    // ---------------
    final static DatasyncManager manager = DatasyncManager.create();
    final static ExecutionContextExecutor executor = manager.executor();
    returns

    an ExecutionContextExecutor

  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. val log: DiagnosticMarkerBusLoggingAdapter
  17. val materializer: ActorMaterializer

    Retrieves the Actor Materializer this DatasyncManager relies on.

    Retrieves the Actor Materializer this DatasyncManager relies on. This may be useful when Actor Materializer is built by this DatasyncManager (i.e. you did not provide it) Example:

    // ---------------
    // SCALA
    // ---------------
    val manager = DatasyncManager()
    implicit val materializer: ActorMaterializer = manager.materializer
    
    // ---------------
    // JAVA
    // ---------------
    final static DatasyncManager manager = DatasyncManager.create();
    final static ActorMaterializer materializer = manager.materializer();
    returns

    an ActorMaterializer

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. val system: ActorSystem

    Retrieves the Actor System this DatasyncManager relies on.

    Retrieves the Actor System this DatasyncManager relies on. This may be useful when Actor System is built by this DatasyncManager (i.e. you did not provide it) Example:

    // ---------------
    // SCALA
    // ---------------
    val manager = DatasyncManager()
    implicit val system: ActorSystem = manager.system
    
    // ---------------
    // JAVA
    // ---------------
    final static DatasyncManager manager = DatasyncManager.create();
    final static ActorSystem system = manager.system();
    returns

    an ActorSystem

  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped