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]
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean handle​(io.vertx.core.http.HttpServerRequest request)  
      io.vertx.core.Future<java.lang.Void> initialize()  
      boolean isInitialized()  
      void resourceChanged​(java.lang.String resourceUri, io.vertx.core.buffer.Buffer resource)  
      void resourceRemoved​(java.lang.String resourceUri)  
      • Methods inherited from class org.swisspush.gateleen.core.configuration.ConfigurationResourceConsumer

        configResourceUri, configurationResourceManager, schemaResourceName
      • Methods inherited from class java.lang.Object

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

      • ContentTypeConstraintHandler

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

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

      • isInitialized

        public boolean isInitialized()
      • initialize

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

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

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

        public void resourceRemoved​(java.lang.String resourceUri)