Class ContentTypeConstraintHandler

  • All Implemented Interfaces:
    org.swisspush.gateleen.core.configuration.ConfigurationResourceObserver

    public class ContentTypeConstraintHandler
    extends org.swisspush.gateleen.core.configuration.ConfigurationResourceConsumer
    Handler class for handling Content-Type constraints. The main responsibilities for this handler are:
    • Manage Content-Type constraint configuration resource
    • Grant requests having a Content-Type value matching the always allowed content-types (defaults)
    • Refuse requests not matching the default Content-Types or any configured Content-Type
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Constructor Detail

      • ContentTypeConstraintHandler

        public ContentTypeConstraintHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager,
                                            ContentTypeConstraintRepository repository,
                                            String configResourceUri,
                                            List<PatternHolder> alwaysAllowedContentTypes)
      • ContentTypeConstraintHandler

        public ContentTypeConstraintHandler​(org.swisspush.gateleen.core.configuration.ConfigurationResourceManager configurationResourceManager,
                                            ContentTypeConstraintRepository repository,
                                            String configResourceUri)
    • Method Detail

      • isInitialized

        public boolean isInitialized()
      • initialize

        public io.vertx.core.Future<Void> initialize()
      • handle

        public boolean handle​(io.vertx.core.http.HttpServerRequest request)
      • resourceChanged

        public void resourceChanged​(String resourceUri,
                                    io.vertx.core.buffer.Buffer resource)
      • resourceRemoved

        public void resourceRemoved​(String resourceUri)