use of alien4cloud.model.orchestrators.Orchestrator in project alien4cloud by alien4cloud.
the class OrchestratorFactoriesRegistry method usage.
@Override
public List<PluginUsage> usage(String pluginId) {
// query the list of orchestrators that uses the given plugin
GetMultipleDataResult<Orchestrator> dataResult = alienDAO.search(Orchestrator.class, null, MapUtil.newHashMap(new String[] { "pluginId" }, new String[][] { new String[] { pluginId } }), Integer.MAX_VALUE);
List<PluginUsage> usages = Lists.newArrayList();
for (Orchestrator orchestrator : dataResult.getData()) {
usages.add(new PluginUsage(orchestrator.getId(), orchestrator.getName(), Orchestrator.class.getSimpleName()));
}
return usages;
}
use of alien4cloud.model.orchestrators.Orchestrator in project alien4cloud by alien4cloud.
the class OrchestratorService method getArtifactSupport.
/**
* Get the artifact support information for a given orchestrator.
*
* @param orchestratorId The id of the orchestrator for which to get location support information.
* @return artifact support information.
*/
public ArtifactSupport getArtifactSupport(String orchestratorId) {
Orchestrator orchestrator = getOrFail(orchestratorId);
IOrchestratorPluginFactory orchestratorFactory = getPluginFactory(orchestrator);
return orchestratorFactory.getArtifactSupport();
}
use of alien4cloud.model.orchestrators.Orchestrator in project alien4cloud by alien4cloud.
the class OrchestratorStateService method unloadAllOrchestrators.
/**
* Unload all orchestrators from JVM memory, it's typically to refresh/reload code
*/
public void unloadAllOrchestrators() {
List<Orchestrator> enabledOrchestratorList = orchestratorService.getAllEnabledOrchestrators();
if (enabledOrchestratorList != null && !enabledOrchestratorList.isEmpty()) {
log.info("Unloading orchestrators");
for (final Orchestrator orchestrator : enabledOrchestratorList) {
// un-register the orchestrator.
IOrchestratorPlugin orchestratorInstance = orchestratorPluginService.unregister(orchestrator.getId());
if (orchestratorInstance != null) {
IOrchestratorPluginFactory orchestratorFactory = orchestratorService.getPluginFactory(orchestrator);
orchestratorFactory.destroy(orchestratorInstance);
}
}
log.info("{} Orchestrators Unloaded", enabledOrchestratorList.size());
}
}
use of alien4cloud.model.orchestrators.Orchestrator in project alien4cloud by alien4cloud.
the class LocationMatchingConfigurationService method getMatchingConfiguration.
/**
* Get the matching configuration for a given location.
*
* @param location The location for which to get the configuration.
* @return A map nodetype, matching configuration to be used for matching.
*/
public Map<String, MatchingConfiguration> getMatchingConfiguration(Location location) {
Orchestrator orchestrator = orchestratorService.getOrFail(location.getOrchestratorId());
IOrchestratorPlugin orchestratorInstance = (IOrchestratorPlugin) orchestratorPluginService.get(orchestrator.getId());
if (orchestratorInstance == null) {
return null;
}
ILocationConfiguratorPlugin configuratorPlugin = orchestratorInstance.getConfigurator(location.getInfrastructureType());
return configuratorPlugin.getMatchingConfigurations();
}
use of alien4cloud.model.orchestrators.Orchestrator in project alien4cloud by alien4cloud.
the class OrchestratorController method search.
@ApiOperation(value = "Search for orchestrators.")
@RequestMapping(method = RequestMethod.GET)
@PreAuthorize("isAuthenticated()")
public RestResponse<GetMultipleDataResult<Orchestrator>> search(@ApiParam(value = "Query text.") @RequestParam(required = false) String query, @ApiParam(value = "If true only connected orchestrators will be retrieved.") @RequestParam(required = false, defaultValue = "false") boolean connectedOnly, @ApiParam(value = "Query from the given index.") @RequestParam(required = false, defaultValue = "0") int from, @ApiParam(value = "Maximum number of results to retrieve.") @RequestParam(required = false, defaultValue = "20") int size) {
FilterBuilder authorizationFilter = AuthorizationUtil.getResourceAuthorizationFilters();
OrchestratorState filterStatus = connectedOnly ? OrchestratorState.CONNECTED : null;
GetMultipleDataResult<Orchestrator> result = orchestratorService.search(query, filterStatus, from, size, authorizationFilter);
return RestResponseBuilder.<GetMultipleDataResult<Orchestrator>>builder().data(result).build();
}
Aggregations