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;
}
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;
}
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;
}
Aggregations