Search in sources :

Example 6 with PolicyPlugin

use of io.gravitee.plugin.policy.PolicyPlugin in project gravitee-gateway by gravitee-io.

the class DynamicRoutingGatewayTest method register.

@Override
public void register(PolicyPluginManager policyPluginManager) {
    super.register(policyPluginManager);
    PolicyPlugin dynamicRoutingPolicy = PolicyBuilder.build("dynamic-routing", DynamicRoutingPolicy.class);
    policyPluginManager.register(dynamicRoutingPolicy);
}
Also used : PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Example 7 with PolicyPlugin

use of io.gravitee.plugin.policy.PolicyPlugin in project gravitee-gateway by gravitee-io.

the class OverrideMethodGatewayTest method register.

@Override
public void register(PolicyPluginManager policyPluginManager) {
    super.register(policyPluginManager);
    PolicyPlugin dynamicRoutingPolicy = PolicyBuilder.build("override-method", OverrideMethodPolicy.class);
    policyPluginManager.register(dynamicRoutingPolicy);
}
Also used : PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Example 8 with PolicyPlugin

use of io.gravitee.plugin.policy.PolicyPlugin in project gravitee-gateway by gravitee-io.

the class OverrideRequestContentGatewayTest method register.

@Override
public void register(PolicyPluginManager policyPluginManager) {
    super.register(policyPluginManager);
    PolicyPlugin rewriteRequestStreamPolicy = PolicyBuilder.build("override-request-content", OverrideRequestContentPolicy.class);
    policyPluginManager.register(rewriteRequestStreamPolicy);
}
Also used : PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Example 9 with PolicyPlugin

use of io.gravitee.plugin.policy.PolicyPlugin in project gravitee-gateway by gravitee-io.

the class OverrideResponseContentGatewayTest method register.

@Override
public void register(PolicyPluginManager policyPluginManager) {
    super.register(policyPluginManager);
    PolicyPlugin rewriteResponseStreamPolicy = PolicyBuilder.build("override-response-content", OverrideResponseContentPolicy.class);
    policyPluginManager.register(rewriteResponseStreamPolicy);
}
Also used : PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Example 10 with PolicyPlugin

use of io.gravitee.plugin.policy.PolicyPlugin in project gravitee-management-rest-api by gravitee-io.

the class PolicyServiceImpl method findAll.

@Override
public Set<PolicyEntity> findAll() {
    try {
        LOGGER.debug("List all policies");
        final Collection<PolicyPlugin> policyDefinitions = policyManager.findAll();
        return policyDefinitions.stream().map(policyDefinition -> convert(policyDefinition, false)).collect(Collectors.toSet());
    } catch (Exception ex) {
        LOGGER.error("An error occurs while trying to list all policies", ex);
        throw new TechnicalManagementException("An error occurs while trying to list all policies", ex);
    }
}
Also used : PolicyNotFoundException(io.gravitee.management.service.exceptions.PolicyNotFoundException) PolicyService(io.gravitee.management.service.PolicyService) Logger(org.slf4j.Logger) PolicyEntity(io.gravitee.management.model.PolicyEntity) PluginEntity(io.gravitee.management.model.PluginEntity) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) TechnicalManagementException(io.gravitee.management.service.exceptions.TechnicalManagementException) Autowired(org.springframework.beans.factory.annotation.Autowired) Set(java.util.Set) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) PolicyDevelopmentEntity(io.gravitee.management.model.PolicyDevelopmentEntity) Component(org.springframework.stereotype.Component) Plugin(io.gravitee.plugin.core.api.Plugin) PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin) PolicyPluginManager(io.gravitee.plugin.policy.PolicyPluginManager) PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin) PolicyNotFoundException(io.gravitee.management.service.exceptions.PolicyNotFoundException) TechnicalManagementException(io.gravitee.management.service.exceptions.TechnicalManagementException) IOException(java.io.IOException) TechnicalManagementException(io.gravitee.management.service.exceptions.TechnicalManagementException)

Aggregations

PolicyPlugin (io.gravitee.plugin.policy.PolicyPlugin)15 PluginEntity (io.gravitee.management.model.PluginEntity)2 PolicyDevelopmentEntity (io.gravitee.management.model.PolicyDevelopmentEntity)2 PolicyEntity (io.gravitee.management.model.PolicyEntity)2 PolicyNotFoundException (io.gravitee.management.service.exceptions.PolicyNotFoundException)2 Plugin (io.gravitee.plugin.core.api.Plugin)2 PolicyPluginManager (io.gravitee.plugin.policy.PolicyPluginManager)2 IOException (java.io.IOException)2 Policy (io.gravitee.definition.model.Policy)1 Reactable (io.gravitee.gateway.reactor.Reactable)1 ReactorHandler (io.gravitee.gateway.reactor.handler.ReactorHandler)1 ResourceLifecycleManager (io.gravitee.gateway.resource.ResourceLifecycleManager)1 PolicyService (io.gravitee.management.service.PolicyService)1 TechnicalManagementException (io.gravitee.management.service.exceptions.TechnicalManagementException)1 PluginClassLoader (io.gravitee.plugin.core.api.PluginClassLoader)1 PolicyClassLoaderFactory (io.gravitee.plugin.policy.PolicyClassLoaderFactory)1 PolicyMethodResolver (io.gravitee.plugin.policy.internal.PolicyMethodResolver)1 PolicyContext (io.gravitee.policy.api.PolicyContext)1 Resource (io.gravitee.resource.api.Resource)1 Collection (java.util.Collection)1