org.mashupbots.socko.rest

RestConfig

case class RestConfig(apiVersion: String, rootApiUrl: String, swaggerVersion: String = "1.1", swaggerApiGroupingPathSegment: Int = 1, requestTimeoutSeconds: Int = 60, sockoEventCacheTimeoutSeconds: Int = 5, maxWorkerCount: Int = 100, maxWorkerRescheduleMilliSeconds: Int = 500, reportRuntimeException: ReportRuntimeException.Value = ReportRuntimeException.Never) extends Extension with Product with Serializable

Configuration for REST handler

This can also be loaded from an externalized AKKA configuration file. For example:

rest-config {
# The version of your API. Required.
api-version="1.0"

# Root path to your API with the scheme, domain and port. Required.
# This is the path as seen by the end user and not from on the local server.
root-api-url=http://yourdomain.com/api

# Swagger definition version. Defaults to `1.1` if setting is omitted.
swagger-version="1.1"

# Path segments to group your APIs into Swagger resources. For exmaple, `/pet` is one resource
# while `/user` is another. Default is `1` which refers to the first relative path segment.
swagger-api-grouping-path-segment=1

# Number of seconds before a request is timed out.
# Defaults to `60` seconds if setting is omitted.
request-timeout-seconds=60

# Number of seconds before a SockoEvent is removed from the cache and cannot be accessed by
# your actor. Defaults to `5` if setting is omitted.
socko-event-cache-timeout-seconds=5

# Maximum number of workers per RestHandler
# Defaults to 100 if setting is omitted.
max-worker-count=100

# Reschedule a message for processing again using this delay when max worker count has been reached.
# Defaults to 500 if setting is omitted
max-worker-reschedule-milliseconds=500

# Determines if the message from runtime exceptions caught during handing of a REST request is returned
# to the caller in addition to the HTTP status code. Values are: `Never`, `BadRequestsOnly`,
# `InternalServerErrorOnly or `All`.
# Defaults to `Never` if setting is omitted
report-runtime-exception=Never
}

can be loaded as follows:

object MyRestHandlerConfig extends ExtensionId[RestConfig] with ExtensionIdProvider {
  override def lookup = MyRestHandlerConfig
  override def createExtension(system: ExtendedActorSystem) =
    new RestConfig(system.settings.config, "rest-config")
}

val myRestConfig = MyRestHandlerConfig(actorSystem)
apiVersion

the version of your API

rootApiUrl

Root path to your API with the scheme, domain and port. For example, http://yourdomain.com/api. This is the path as seen by the end user and not from on the local server.

swaggerVersion

Swagger definition version

swaggerApiGroupingPathSegment

Path segments to group APIs by. Default is 1 which refers to the first relative path segment.

For example, the following will be grouped under the /pets because the the share pets in the 1st path segment.

/pets
/pets/{petId}
/pets/findById
requestTimeoutSeconds

Number of seconds before a request is timed out. Make sure that your processor actor responds within this number of seconds or throws an exception. Defaults to 60 seconds.

sockoEventCacheTimeoutSeconds

Number of seconds before a org.mashupbots.socko.events.SockoEvent is removed from the cache and cannot be accessed by the REST processor. Once the REST processor has access to the org.mashupbots.socko.events.SockoEvent, its expiry from the cache does not affect usability. The cache is just used as a means to pass the event. Defaults to 5 seconds.

maxWorkerCount

Maximum number of workers per org.mashupbots.socko.rest.RestHandler.

maxWorkerRescheduleMilliSeconds

Reschedule a message for processing again using this delay when max worker count has been reached.

reportRuntimeException

Determines if the message from runtime exceptions caught during handing of a REST request is returned to the caller in addition to the HTTP status code.

Two types of exceptions are raised: 400 Bad Requests and 500 Internal Server Error. If turned on, the message will be return in the response and the content type set to text/plain; charset=UTF-8.

Linear Supertypes
Serializable, Serializable, Product, Equals, Extension, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RestConfig
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Extension
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RestConfig(config: Config, prefix: String)

    Read configuration from AKKA's application.conf

  2. new RestConfig(apiVersion: String, rootApiUrl: String, swaggerVersion: String = "1.1", swaggerApiGroupingPathSegment: Int = 1, requestTimeoutSeconds: Int = 60, sockoEventCacheTimeoutSeconds: Int = 5, maxWorkerCount: Int = 100, maxWorkerRescheduleMilliSeconds: Int = 500, reportRuntimeException: ReportRuntimeException.Value = ReportRuntimeException.Never)

    apiVersion

    the version of your API

    rootApiUrl

    Root path to your API with the scheme, domain and port. For example, http://yourdomain.com/api. This is the path as seen by the end user and not from on the local server.

    swaggerVersion

    Swagger definition version

    swaggerApiGroupingPathSegment

    Path segments to group APIs by. Default is 1 which refers to the first relative path segment.

    For example, the following will be grouped under the /pets because the the share pets in the 1st path segment.

    /pets
    /pets/{petId}
    /pets/findById
    requestTimeoutSeconds

    Number of seconds before a request is timed out. Make sure that your processor actor responds within this number of seconds or throws an exception. Defaults to 60 seconds.

    sockoEventCacheTimeoutSeconds

    Number of seconds before a org.mashupbots.socko.events.SockoEvent is removed from the cache and cannot be accessed by the REST processor. Once the REST processor has access to the org.mashupbots.socko.events.SockoEvent, its expiry from the cache does not affect usability. The cache is just used as a means to pass the event. Defaults to 5 seconds.

    maxWorkerCount

    Maximum number of workers per org.mashupbots.socko.rest.RestHandler.

    maxWorkerRescheduleMilliSeconds

    Reschedule a message for processing again using this delay when max worker count has been reached.

    reportRuntimeException

    Determines if the message from runtime exceptions caught during handing of a REST request is returned to the caller in addition to the HTTP status code.

    Two types of exceptions are raised: 400 Bad Requests and 500 Internal Server Error. If turned on, the message will be return in the response and the content type set to text/plain; charset=UTF-8.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val apiVersion: String

    the version of your API

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

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

    Definition Classes
    Any
  13. val maxWorkerCount: Int

    Maximum number of workers per org.mashupbots.socko.rest.RestHandler.

  14. val maxWorkerRescheduleMilliSeconds: Int

    Reschedule a message for processing again using this delay when max worker count has been reached.

  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  18. val reportOn400BadRequests: Boolean

  19. val reportOn500InternalServerError: Boolean

  20. val reportRuntimeException: ReportRuntimeException.Value

    Determines if the message from runtime exceptions caught during handing of a REST request is returned to the caller in addition to the HTTP status code.

    Determines if the message from runtime exceptions caught during handing of a REST request is returned to the caller in addition to the HTTP status code.

    Two types of exceptions are raised: 400 Bad Requests and 500 Internal Server Error. If turned on, the message will be return in the response and the content type set to text/plain; charset=UTF-8.

  21. val requestTimeoutSeconds: Int

    Number of seconds before a request is timed out.

    Number of seconds before a request is timed out. Make sure that your processor actor responds within this number of seconds or throws an exception. Defaults to 60 seconds.

  22. val rootApiURI: URI

  23. val rootApiUrl: String

    Root path to your API with the scheme, domain and port.

    Root path to your API with the scheme, domain and port. For example, http://yourdomain.com/api. This is the path as seen by the end user and not from on the local server.

  24. val rootPath: String

  25. val schemeDomainPort: String

  26. val sockoEventCacheTimeoutMilliSeconds: Int

  27. val sockoEventCacheTimeoutSeconds: Int

    Number of seconds before a org.mashupbots.socko.events.SockoEvent is removed from the cache and cannot be accessed by the REST processor.

    Number of seconds before a org.mashupbots.socko.events.SockoEvent is removed from the cache and cannot be accessed by the REST processor. Once the REST processor has access to the org.mashupbots.socko.events.SockoEvent, its expiry from the cache does not affect usability. The cache is just used as a means to pass the event. Defaults to 5 seconds.

  28. val swaggerApiGroupingPathSegment: Int

    Path segments to group APIs by.

    Path segments to group APIs by. Default is 1 which refers to the first relative path segment.

    For example, the following will be grouped under the /pets because the the share pets in the 1st path segment.

    /pets
    /pets/{petId}
    /pets/findById
  29. val swaggerVersion: String

    Swagger definition version

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Ungrouped