Search in sources :

Example 1 with CORSFilter

use of org.apache.helix.rest.server.filters.CORSFilter in project helix by apache.

the class HelixRestServer method getResourceConfig.

private ResourceConfig getResourceConfig(HelixRestNamespace namespace, ServletType type) {
    ResourceConfig cfg = new ResourceConfig();
    cfg.packages(type.getServletPackageArray());
    cfg.property(ContextPropertyKeys.SERVER_CONTEXT.name(), new ServerContext(namespace.getMetadataStoreAddress()));
    if (type == ServletType.DEFAULT_SERVLET) {
        cfg.property(ContextPropertyKeys.ALL_NAMESPACES.name(), _helixNamespaces);
    } else {
        cfg.property(ContextPropertyKeys.METADATA.name(), namespace);
    }
    cfg.register(new CORSFilter());
    cfg.register(new AuditLogFilter(_auditLoggers));
    return cfg;
}
Also used : ResourceConfig(org.glassfish.jersey.server.ResourceConfig) CORSFilter(org.apache.helix.rest.server.filters.CORSFilter) AuditLogFilter(org.apache.helix.rest.server.filters.AuditLogFilter)

Aggregations

AuditLogFilter (org.apache.helix.rest.server.filters.AuditLogFilter)1 CORSFilter (org.apache.helix.rest.server.filters.CORSFilter)1 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)1