/** * Activate Inactive Execution Plan Configurations * * @param tenantId the tenant id of the tenant which triggered this call * @param resolvedDependencyId the id of the dependency that was resolved which resulted in * triggering this method call */ public void activateInactiveExecutionPlanConfigurations( ExecutionPlanConfigurationFile.Status status, String resolvedDependencyId, int tenantId) throws ExecutionPlanConfigurationException { List<ExecutionPlanConfigurationFile> reloadFileList = new ArrayList<ExecutionPlanConfigurationFile>(); if (tenantSpecificExecutionPlanFiles != null && tenantSpecificExecutionPlanFiles.size() > 0) { List<ExecutionPlanConfigurationFile> executionPlanConfigurationFiles = tenantSpecificExecutionPlanFiles.get(tenantId); if (executionPlanConfigurationFiles != null) { for (ExecutionPlanConfigurationFile executionPlanConfigurationFile : executionPlanConfigurationFiles) { if ((executionPlanConfigurationFile.getStatus().equals(status)) && resolvedDependencyId.equalsIgnoreCase( executionPlanConfigurationFile.getDependency())) { reloadFileList.add(executionPlanConfigurationFile); } } } } for (ExecutionPlanConfigurationFile executionPlanConfigurationFile : reloadFileList) { try { EventProcessorConfigurationFilesystemInvoker.reload( executionPlanConfigurationFile.getFileName(), executionPlanConfigurationFile.getAxisConfiguration()); } catch (Exception e) { log.error( "Exception occurred while trying to deploy the Execution Plan configuration file : " + new File(executionPlanConfigurationFile.getFileName()).getName()); } } }
@Override public String getExecutionPlanStatusAsString(String filename) { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); List<ExecutionPlanConfigurationFile> executionPlanConfigurationFileList = tenantSpecificExecutionPlanFiles.get(tenantId); if (executionPlanConfigurationFileList != null) { for (ExecutionPlanConfigurationFile executionPlanConfigurationFile : executionPlanConfigurationFileList) { if (filename != null && filename.equals(executionPlanConfigurationFile.getFileName())) { String statusMsg = executionPlanConfigurationFile.getDeploymentStatusMessage(); if (executionPlanConfigurationFile.getDependency() != null) { statusMsg = statusMsg + " [Dependency: " + executionPlanConfigurationFile.getDependency() + "]"; } return statusMsg; } } } return EventProcessorConstants.NO_DEPENDENCY_INFO_MSG; }