Search in sources :

Example 1 with PluginEntity

use of io.gravitee.management.model.PluginEntity in project gravitee-management-rest-api by gravitee-io.

the class FetcherServiceImpl method convert.

private FetcherEntity convert(FetcherPlugin fetcherPlugin, boolean withPlugin) {
    FetcherEntity entity = new FetcherEntity();
    entity.setId(fetcherPlugin.id());
    entity.setDescription(fetcherPlugin.manifest().description());
    entity.setName(fetcherPlugin.manifest().name());
    entity.setVersion(fetcherPlugin.manifest().version());
    if (withPlugin) {
        // Plugin information
        Plugin plugin = fetcherPlugin;
        PluginEntity pluginEntity = new PluginEntity();
        pluginEntity.setPlugin(plugin.clazz());
        pluginEntity.setPath(plugin.path().toString());
        pluginEntity.setType(plugin.type().toString().toLowerCase());
        pluginEntity.setDependencies(plugin.dependencies());
        entity.setPlugin(pluginEntity);
    }
    return entity;
}
Also used : PluginEntity(io.gravitee.management.model.PluginEntity) FetcherEntity(io.gravitee.management.model.FetcherEntity) FetcherPlugin(io.gravitee.plugin.fetcher.FetcherPlugin) Plugin(io.gravitee.plugin.core.api.Plugin)

Example 2 with PluginEntity

use of io.gravitee.management.model.PluginEntity in project gravitee-management-rest-api by gravitee-io.

the class PolicyServiceImpl method convert.

private PolicyEntity convert(PolicyPlugin policyPlugin, boolean withPlugin) {
    PolicyEntity entity = new PolicyEntity();
    entity.setId(policyPlugin.id());
    entity.setDescription(policyPlugin.manifest().description());
    entity.setName(policyPlugin.manifest().name());
    entity.setVersion(policyPlugin.manifest().version());
    if (withPlugin) {
        // Plugin information
        Plugin plugin = policyPlugin;
        PluginEntity pluginEntity = new PluginEntity();
        pluginEntity.setPlugin(plugin.clazz());
        pluginEntity.setPath(plugin.path().toString());
        pluginEntity.setType(plugin.type().toString().toLowerCase());
        pluginEntity.setDependencies(plugin.dependencies());
        entity.setPlugin(pluginEntity);
        // Policy development information
        PolicyDevelopmentEntity developmentEntity = new PolicyDevelopmentEntity();
        developmentEntity.setClassName(policyPlugin.policy().getName());
        /*
            if (policy.configuration() != null) {
                developmentEntity.setConfiguration(policyDefinition.configuration().getName());
            }

            if (policyDefinition.onRequestMethod() != null) {
                developmentEntity.setOnRequestMethod(policyDefinition.onRequestMethod().toGenericString());
            }

            if (policyDefinition.onResponseMethod() != null) {
                developmentEntity.setOnResponseMethod(policyDefinition.onResponseMethod().toGenericString());
            }
            */
        entity.setDevelopment(developmentEntity);
    }
    return entity;
}
Also used : PluginEntity(io.gravitee.management.model.PluginEntity) PolicyEntity(io.gravitee.management.model.PolicyEntity) PolicyDevelopmentEntity(io.gravitee.management.model.PolicyDevelopmentEntity) Plugin(io.gravitee.plugin.core.api.Plugin) PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Example 3 with PluginEntity

use of io.gravitee.management.model.PluginEntity in project gravitee-management-rest-api by gravitee-io.

the class ResourceServiceImpl method convert.

private ResourceEntity convert(ResourcePlugin resourcePlugin, boolean withPlugin) {
    ResourceEntity entity = new ResourceEntity();
    entity.setId(resourcePlugin.id());
    entity.setDescription(resourcePlugin.manifest().description());
    entity.setName(resourcePlugin.manifest().name());
    entity.setVersion(resourcePlugin.manifest().version());
    if (withPlugin) {
        // Plugin information
        Plugin plugin = resourcePlugin;
        PluginEntity pluginEntity = new PluginEntity();
        pluginEntity.setPlugin(plugin.clazz());
        pluginEntity.setPath(plugin.path().toString());
        pluginEntity.setType(plugin.type().toString().toLowerCase());
        pluginEntity.setDependencies(plugin.dependencies());
        entity.setPlugin(pluginEntity);
    }
    return entity;
}
Also used : PluginEntity(io.gravitee.management.model.PluginEntity) ResourceEntity(io.gravitee.management.model.ResourceEntity) ResourcePlugin(io.gravitee.plugin.resource.ResourcePlugin) Plugin(io.gravitee.plugin.core.api.Plugin)

Aggregations

PluginEntity (io.gravitee.management.model.PluginEntity)3 Plugin (io.gravitee.plugin.core.api.Plugin)3 FetcherEntity (io.gravitee.management.model.FetcherEntity)1 PolicyDevelopmentEntity (io.gravitee.management.model.PolicyDevelopmentEntity)1 PolicyEntity (io.gravitee.management.model.PolicyEntity)1 ResourceEntity (io.gravitee.management.model.ResourceEntity)1 FetcherPlugin (io.gravitee.plugin.fetcher.FetcherPlugin)1 PolicyPlugin (io.gravitee.plugin.policy.PolicyPlugin)1 ResourcePlugin (io.gravitee.plugin.resource.ResourcePlugin)1