Class RunConfig


  • public class RunConfig
    extends java.lang.Object
    Helper class to configure verticles.
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RunConfig.RunConfigBuilder
      RunConfigBuilder class for simplyfied configuration of the run configuration.
    • Constructor Summary

      Constructors 
      Constructor Description
      RunConfig​(io.vertx.core.Vertx vertx, io.vertx.redis.RedisClient redisClient, java.lang.Class verticleClass, org.swisspush.gateleen.routing.Router router, org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler, org.swisspush.gateleen.queue.queuing.QueueBrowser queueBrowser, org.swisspush.gateleen.core.cors.CORSHandler corsHandler, org.swisspush.gateleen.scheduler.SchedulerResourceManager schedulerResourceManager, org.swisspush.gateleen.validation.ValidationResourceManager validationResourceManager, org.swisspush.gateleen.logging.LoggingResourceManager loggingResourceManager, org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager, org.swisspush.gateleen.queue.queuing.circuitbreaker.configuration.QueueCircuitBreakerConfigurationResourceManager queueCircuitBreakerConfigurationResourceManager, org.swisspush.gateleen.core.event.EventBusHandler eventBusHandler, org.swisspush.gateleen.validation.ValidationHandler validationHandler, org.swisspush.gateleen.hook.HookHandler hookHandler, org.swisspush.gateleen.user.UserProfileHandler userProfileHandler, org.swisspush.gateleen.user.RoleProfileHandler roleProfileHandler, org.swisspush.gateleen.expansion.ExpansionHandler expansionHandler, org.swisspush.gateleen.delta.DeltaHandler deltaHandler, org.swisspush.gateleen.security.authorization.Authorizer authorizer, org.swisspush.gateleen.core.resource.CopyResourceHandler copyResourceHandler, org.swisspush.gateleen.qos.QoSHandler qosHandler, org.swisspush.gateleen.core.property.PropertyHandler propertyHandler, org.swisspush.gateleen.expansion.ZipExtractHandler zipExtractHandler, org.swisspush.gateleen.delegate.DelegateHandler delegateHandler, org.swisspush.gateleen.merge.MergeHandler mergeHandler, org.swisspush.gateleen.kafka.KafkaHandler kafkaHandler, org.swisspush.gateleen.routing.CustomHttpResponseHandler customHttpResponseHandler, org.swisspush.gateleen.security.content.ContentTypeConstraintHandler contentTypeConstraintHandler)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static io.vertx.core.json.JsonObject buildMetricsConfig()
      Builds a standard metrics configuration.
      static io.vertx.core.json.JsonObject buildModRedisConfig​(java.lang.String redisHost, int redisPort)
      Builds a standard mod redis configuration.
      static java.util.Map<java.lang.String,​java.lang.Object> buildRedisProps​(java.lang.String redisHost, int redisPort)
      Builds redis properties configuration.
      static io.vertx.core.json.JsonObject buildRedisquesConfig()
      Builds a standard redisques configuration.
      io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> buildRoutingContextHandler()
      Builds a handler for RoutingContexts with a "default" behaviour.
      static io.vertx.core.json.JsonObject buildStorageConfig()
      Builds a standard storage configuration.
      static org.swisspush.gateleen.user.UserProfileConfiguration buildUserProfileConfiguration()
      Builds a standard UserProfileConfiguration.
      static void deployModules​(io.vertx.core.Vertx vertx, java.lang.Class verticleClass, java.util.Map<java.lang.String,​java.lang.Object> props, io.vertx.core.Handler<java.lang.Boolean> handler)
      Deploys the following modules in this order: org.swisspush.redisques.RedisQues org.swisspush.reststorage.RestStorageMod org.swisspush.metrics.MetricsModule
      static java.util.Map<java.lang.String,​java.lang.Object> subMap​(java.util.Map<java.lang.String,​java.lang.Object> map, java.lang.String prefix)  
      static RunConfig.RunConfigBuilder with()  
      • Methods inherited from class java.lang.Object

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

      • SERVER_TIMESTAMP_HEADER

        public static final java.lang.String SERVER_TIMESTAMP_HEADER
        See Also:
        Constant Field Values
      • SERVER_ARRIVAL_TIMESTAMP_HEADER

        public static final java.lang.String SERVER_ARRIVAL_TIMESTAMP_HEADER
        See Also:
        Constant Field Values
      • EVENTBUS_BRIDGE_PING_INTERVAL

        public static final long EVENTBUS_BRIDGE_PING_INTERVAL
        See Also:
        Constant Field Values
      • PROFILE_PROPERTIES_PROVIDED_BY_THE_PROXY

        public static final java.lang.String[] PROFILE_PROPERTIES_PROVIDED_BY_THE_PROXY
      • PROFILE_PROPERTIES_PROVIDED_BY_THE_CLIENT

        public static final java.lang.String[] PROFILE_PROPERTIES_PROVIDED_BY_THE_CLIENT
    • Constructor Detail

      • RunConfig

        public RunConfig​(io.vertx.core.Vertx vertx,
                         io.vertx.redis.RedisClient redisClient,
                         java.lang.Class verticleClass,
                         org.swisspush.gateleen.routing.Router router,
                         org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler,
                         org.swisspush.gateleen.queue.queuing.QueueBrowser queueBrowser,
                         org.swisspush.gateleen.core.cors.CORSHandler corsHandler,
                         org.swisspush.gateleen.scheduler.SchedulerResourceManager schedulerResourceManager,
                         org.swisspush.gateleen.validation.ValidationResourceManager validationResourceManager,
                         org.swisspush.gateleen.logging.LoggingResourceManager loggingResourceManager,
                         org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager,
                         org.swisspush.gateleen.queue.queuing.circuitbreaker.configuration.QueueCircuitBreakerConfigurationResourceManager queueCircuitBreakerConfigurationResourceManager,
                         org.swisspush.gateleen.core.event.EventBusHandler eventBusHandler,
                         org.swisspush.gateleen.validation.ValidationHandler validationHandler,
                         org.swisspush.gateleen.hook.HookHandler hookHandler,
                         org.swisspush.gateleen.user.UserProfileHandler userProfileHandler,
                         org.swisspush.gateleen.user.RoleProfileHandler roleProfileHandler,
                         org.swisspush.gateleen.expansion.ExpansionHandler expansionHandler,
                         org.swisspush.gateleen.delta.DeltaHandler deltaHandler,
                         org.swisspush.gateleen.security.authorization.Authorizer authorizer,
                         org.swisspush.gateleen.core.resource.CopyResourceHandler copyResourceHandler,
                         org.swisspush.gateleen.qos.QoSHandler qosHandler,
                         org.swisspush.gateleen.core.property.PropertyHandler propertyHandler,
                         org.swisspush.gateleen.expansion.ZipExtractHandler zipExtractHandler,
                         org.swisspush.gateleen.delegate.DelegateHandler delegateHandler,
                         org.swisspush.gateleen.merge.MergeHandler mergeHandler,
                         org.swisspush.gateleen.kafka.KafkaHandler kafkaHandler,
                         org.swisspush.gateleen.routing.CustomHttpResponseHandler customHttpResponseHandler,
                         org.swisspush.gateleen.security.content.ContentTypeConstraintHandler contentTypeConstraintHandler)
    • Method Detail

      • buildRedisProps

        public static java.util.Map<java.lang.String,​java.lang.Object> buildRedisProps​(java.lang.String redisHost,
                                                                                             int redisPort)
        Builds redis properties configuration.
      • buildModRedisConfig

        public static io.vertx.core.json.JsonObject buildModRedisConfig​(java.lang.String redisHost,
                                                                        int redisPort)
        Builds a standard mod redis configuration.
      • buildMetricsConfig

        public static io.vertx.core.json.JsonObject buildMetricsConfig()
        Builds a standard metrics configuration.
      • buildRedisquesConfig

        public static io.vertx.core.json.JsonObject buildRedisquesConfig()
        Builds a standard redisques configuration.
      • buildStorageConfig

        public static io.vertx.core.json.JsonObject buildStorageConfig()
        Builds a standard storage configuration.
      • buildUserProfileConfiguration

        public static org.swisspush.gateleen.user.UserProfileConfiguration buildUserProfileConfiguration()
        Builds a standard UserProfileConfiguration.
      • deployModules

        public static void deployModules​(io.vertx.core.Vertx vertx,
                                         java.lang.Class verticleClass,
                                         java.util.Map<java.lang.String,​java.lang.Object> props,
                                         io.vertx.core.Handler<java.lang.Boolean> handler)
        Deploys the following modules in this order:
        • org.swisspush.redisques.RedisQues
        • org.swisspush.reststorage.RestStorageMod
        • org.swisspush.metrics.MetricsModule

        The handler is called with Boolean.TRUE when all modules have been deployed successfully. When any of the modules could not be deployed correctly, the handler returns Boolean.FALSE.

        Parameters:
        vertx -
        verticleClass -
        props -
        handler -
      • buildRoutingContextHandler

        public io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> buildRoutingContextHandler()
        Builds a handler for RoutingContexts with a "default" behaviour.
      • subMap

        public static java.util.Map<java.lang.String,​java.lang.Object> subMap​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                                                                    java.lang.String prefix)