Search in sources :

Example 1 with PluginEntity

use of io.gravitee.rest.api.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());
    // TODO: check the purpose of this
    // entity.setPlugin(pluginEntity);
    }
    return entity;
}
Also used : PluginEntity(io.gravitee.rest.api.model.PluginEntity) FetcherEntity(io.gravitee.rest.api.model.FetcherEntity) Plugin(io.gravitee.plugin.core.api.Plugin) FetcherPlugin(io.gravitee.plugin.fetcher.FetcherPlugin)

Example 2 with PluginEntity

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

the class NotifierServiceImpl method convert.

private io.gravitee.rest.api.model.NotifierEntity convert(NotifierPlugin plugin, boolean withPlugin) {
    io.gravitee.rest.api.model.NotifierEntity entity = new io.gravitee.rest.api.model.NotifierEntity();
    entity.setId(plugin.id());
    entity.setDescription(plugin.manifest().description());
    entity.setName(plugin.manifest().name());
    entity.setVersion(plugin.manifest().version());
    if (withPlugin) {
        // Plugin information
        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.rest.api.model.PluginEntity) NotifierEntity(io.gravitee.rest.api.model.notification.NotifierEntity)

Example 3 with PluginEntity

use of io.gravitee.rest.api.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());
    entity.setCategory(policyPlugin.manifest().category());
    if (withPlugin) {
        // Plugin information
        PluginEntity pluginEntity = new PluginEntity();
        pluginEntity.setPlugin(policyPlugin.clazz());
        pluginEntity.setPath(policyPlugin.path().toString());
        pluginEntity.setType(((Plugin) policyPlugin).type().toLowerCase());
        pluginEntity.setDependencies(policyPlugin.dependencies());
        entity.setPlugin(pluginEntity);
        entity.setDevelopment(loadPolicy(policyPlugin));
    }
    return entity;
}
Also used : PluginEntity(io.gravitee.rest.api.model.PluginEntity) PolicyEntity(io.gravitee.rest.api.model.PolicyEntity) Plugin(io.gravitee.plugin.core.api.Plugin) PolicyPlugin(io.gravitee.plugin.policy.PolicyPlugin)

Aggregations

PluginEntity (io.gravitee.rest.api.model.PluginEntity)3 Plugin (io.gravitee.plugin.core.api.Plugin)2 FetcherPlugin (io.gravitee.plugin.fetcher.FetcherPlugin)1 PolicyPlugin (io.gravitee.plugin.policy.PolicyPlugin)1 FetcherEntity (io.gravitee.rest.api.model.FetcherEntity)1 PolicyEntity (io.gravitee.rest.api.model.PolicyEntity)1 NotifierEntity (io.gravitee.rest.api.model.notification.NotifierEntity)1