Class

eu.shiftforward.adstax.storage.rpc

UserProfileStorageRmqRpcClient

Related Doc: package rpc

Permalink

class UserProfileStorageRmqRpcClient extends RmqRpcJsonClient with UserProfileStorageClient

The RPC client to interact with the user profile storage. It implements a RabbitMQ RPC protocol for issuing get, put, delete and update requests and exposes a type-safe interface for those operations.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UserProfileStorageRmqRpcClient
  2. UserProfileStorageClient
  3. RmqRpcJsonClient
  4. RabbitMQUtilAsync
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UserProfileStorageRmqRpcClient(actorRefFactory: ActorRefFactory, rmqConfig: Config = ..., rpcClientConfig: Config = ...)(implicit ec: ExecutionContext)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object AmqpDeliveryJsObject

    Permalink

    Extracts a JsObject from an Amqp Delivery message.

    Extracts a JsObject from an Amqp Delivery message.

    Usage:

    amqpDelivery match {
      case AmqpDeliveryJsObject(json) => json.convertTo[Something]
      case Delivery(_, _, _, bodyInBytes) => // will only match if the message is not a valid json object
    }
    Definition Classes
    RabbitMQUtilAsync
  5. object AmqpDeliveryString

    Permalink

    Extracts a String from an Amqp Delivery message.

    Extracts a String from an Amqp Delivery message.

    Usage:

    amqpDelivery match {
      case AmqpDeliveryString(string) => println(string)
    }
    Definition Classes
    RabbitMQUtilAsync
  6. object AmqpPublishJsObject

    Permalink

    Converts a AmqpPublishJsObject that receives a JsObject, to an Amqp.Publish.

    Converts a AmqpPublishJsObject that receives a JsObject, to an Amqp.Publish.

    Definition Classes
    RabbitMQUtilAsync
  7. object AmqpPublishString

    Permalink

    Converts a AmqpPublishString that receives a String, to an Amqp.Publish.

    Converts a AmqpPublishString that receives a String, to an Amqp.Publish.

    Definition Classes
    RabbitMQUtilAsync
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. lazy val connectionOwner: ActorRef

    Permalink
    Definition Classes
    RabbitMQUtilAsync
  11. def createProducer(handlerActor: Option[ActorRef]): ActorRef

    Permalink

    Creates a producer.

    Creates a producer. When the broker has a connection to the channel, the handler actor will be notified that the producer is connected.

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    returns

    the actor ref of the producer

    Definition Classes
    RabbitMQUtilAsync
  12. def createRpcClient(handlerActor: Option[ActorRef] = None): Future[ActorRef]

    Permalink

    Create a rpc client

    Create a rpc client

    handlerActor

    the actor to handle the channel state; it can receive the messages

    returns

    the rpc client actor ref

    Definition Classes
    RabbitMQUtilAsync
  13. def createRpcServer(exchangeName: String, routingKey: String, queueName: Option[String] = None, handlerActor: Option[ActorRef] = None, timeout: Option[FiniteDuration] = None)(server: (Delivery) ⇒ Future[ProcessResult])(implicit ec: ExecutionContext): Future[String]

    Permalink

    Setup a RpcServer asynchronously.

    Setup a RpcServer asynchronously. When the broker has a connection to the channel, the exchange and queues are declared and then it will start to process incoming messages.

    The queue name can be None to create a One-To-Many (all servers/processors handle the request) or specified for a One-To-Any (only one server/processor will handle the request).

    exchangeName

    the exchange name

    routingKey

    the routing key

    queueName

    the queue name

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    timeout

    an optional message timeout to avoid filling up the queue with old, already ignored, responses

    server

    the function that processes an Delivery

    ec

    the implicit execution context

    returns

    the future with the queue name

    Definition Classes
    RabbitMQUtilAsync
  14. def createStashedProducer(): ActorRef

    Permalink

    Creates a producer which stashes messages until the producer is fully connected to the rmq.

    Creates a producer which stashes messages until the producer is fully connected to the rmq.

    returns

    the actor ref of the producer proxy.

    Definition Classes
    RabbitMQUtilAsync
  15. def declareExchange(exchangeName: String, exchangeType: String = "topic", handlerActor: Option[ActorRef] = None): Future[Unit]

    Permalink

    Declare an exchange asynchronously.

    Declare an exchange asynchronously. When the broker has a connection to the channel, the exchange will be declared.

    exchangeName

    the exchange name

    exchangeType

    the exchange type

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    returns

    the future that completes this exchange declaration

    Definition Classes
    RabbitMQUtilAsync
  16. def declareQueue(exchangeName: String, routingKey: String, queueName: Option[String] = None, handlerActor: Option[ActorRef] = None, clientFacing: Boolean = false): Future[String]

    Permalink

    Declare a queue asynchronously.

    Declare a queue asynchronously. When the broker has a connection to the channel, the queue will be declared.

    exchangeName

    the exchange name

    routingKey

    the routing key

    queueName

    the queue name, pass None to generate one randomly

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    clientFacing

    true if the queue will be read by an external client

    returns

    the future with the queue name

    Definition Classes
    RabbitMQUtilAsync
  17. def delete(userId: String, clientId: String): Future[Boolean]

    Permalink

    Deletes the user details.

    Deletes the user details.

    userId

    the ID of the user

    clientId

    the ID of the client

    returns

    a Future with true if the user delete was successful, false otherwise.

    Definition Classes
    UserProfileStorageRmqRpcClientUserProfileStorageClient
  18. implicit val deleteRoutingKey: DeleteTypeRoutingKey.type

    Permalink
  19. implicit val deleteTypeDescriptor: RmqRpcJsonClientTypeDescriptor[UserProfileDelete, DeleteResponse]

    Permalink
  20. def dispatch[Req, Resp](req: Req, routingKey: String)(f: (Delivery) ⇒ Resp)(implicit requestJsonWriter: JsonWriter[Req]): Future[Resp]

    Permalink

    Dispatches a request message from the client and returns a Future of a response

    Dispatches a request message from the client and returns a Future of a response

    req

    the request message

    f

    the callback handler for the response

    returns

    a Future of the return of the callback of the rpc response

    Definition Classes
    RmqRpcJsonClient
  21. def dispatchRequest[Req, Resp](request: Req)(implicit td: RmqRpcJsonClientTypeDescriptor[Req, Resp], trk: RmqRpcJsonTypeRoutingKey[Req], requestJsonWriter: JsonWriter[Req], responseJsonReader: JsonReader[Resp]): Future[Resp]

    Permalink

    Dispatches a request message with a Future of a concrete response type.

    Dispatches a request message with a Future of a concrete response type.

    Req

    the type of the request message with a JsonWriter

    Resp

    the response type that the callback returns

    request

    the request message

    td

    the evidence to support the serialization of a concrete type Resp

    requestJsonWriter

    the json writer for type Req

    responseJsonReader

    the json reader for type Resp

    returns

    a Future of the expected response message

    Definition Classes
    RmqRpcJsonClient
  22. implicit val ec: ExecutionContext

    Permalink
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def get(userId: String, clientId: String): Future[Option[UserAttributes]]

    Permalink

    Retrives the attributes of an user.

    Retrives the attributes of an user.

    userId

    the ID of the user

    clientId

    the ID of the client

    returns

    a Future with the user attributes wrapped in a Some if it exists, None otherwise.

    Definition Classes
    UserProfileStorageRmqRpcClientUserProfileStorageClient
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. implicit val getRoutingKey: GetTypeRoutingKey.type

    Permalink
  29. implicit val getTypeDescriptor: RmqRpcJsonClientTypeDescriptor[UserProfileGet, GetResponse]

    Permalink
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def rmqActorRefFactory: ActorRefFactory

    Permalink
  36. val rmqConfig: Config

    Permalink
  37. val rpcClientConfig: Config

    Permalink
  38. def setListeningConsumer(actor: ActorRef, exchangeName: String, routingKey: String, queueName: Option[String] = None, autodelete: Boolean = true, handlerActor: Option[ActorRef] = None, clientFacing: Boolean = false): Future[(ActorRef, String)]

    Permalink

    Bind a specific queue to a given actor asynchronously.

    Bind a specific queue to a given actor asynchronously. When the broker has a connection to the channel, the queue is declared and bound to the given actor.

    actor

    the actor which will listen to the queue

    exchangeName

    the exchange name

    routingKey

    the routing key

    queueName

    the queue name, pass None to generate one randomly

    autodelete

    if true, the queue will be destroyed when it is no longer used

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    clientFacing

    true if the queue will be read by an external client

    returns

    the future with the consumer actor and the queue name

    Definition Classes
    RabbitMQUtilAsync
  39. def setListeningQueue(actor: ActorRef, exchangeName: String, routingKey: String, queueName: Option[String] = None, autodelete: Boolean = true, handlerActor: Option[ActorRef] = None, clientFacing: Boolean = false): Future[String]

    Permalink

    Bind a specific queue to a given actor asynchronously.

    Bind a specific queue to a given actor asynchronously. When the broker has a connection to the channel, the queue is declared and bound to the given actor.

    actor

    the actor which will listen to the queue

    exchangeName

    the exchange name

    routingKey

    the routing key

    queueName

    the queue name, pass None to generate one randomly

    autodelete

    if true, the queue will be destroyed when it is no longer used

    handlerActor

    the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.

    clientFacing

    true if the queue will be read by an external client

    returns

    the future with the queue name

    Definition Classes
    RabbitMQUtilAsync
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. implicit val timeout: Timeout

    Permalink
    Definition Classes
    RmqRpcJsonClient
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. def update(userId: String, clientId: String, attributes: UserAttributes, mergeStrategy: AttributeMergingStrategy = JoinMergingStrategy): Future[Boolean]

    Permalink

    Updates the user details.

    Updates the user details.

    userId

    the ID of the user

    clientId

    the ID of the client

    attributes

    the attributes to update the user with

    mergeStrategy

    the strategy to use when merging the attributes

    returns

    a Future with true if the user update was successful, false otherwise.

    Definition Classes
    UserProfileStorageRmqRpcClientUserProfileStorageClient
  44. implicit val updateRoutingKey: UserProfileUpdateTypeRoutingKey.type

    Permalink
  45. implicit val updateTypeDescriptor: RmqRpcJsonClientTypeDescriptor[UserProfileUpdate, UpdateResponse]

    Permalink
  46. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from UserProfileStorageClient

Inherited from RmqRpcJsonClient

Inherited from RabbitMQUtilAsync

Inherited from AnyRef

Inherited from Any

Ungrouped