Skip to content
Snippets Groups Projects
Commit 0b75f999 authored by srosse's avatar srosse
Browse files

OO-68: reorder the checks in the Quartz Job

parent f37707a3
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ import org.springframework.scheduling.quartz.QuartzJobBean; ...@@ -34,6 +34,7 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
import de.bps.course.nodes.VCCourseNode; import de.bps.course.nodes.VCCourseNode;
import de.bps.course.nodes.vc.MeetingDate; import de.bps.course.nodes.vc.MeetingDate;
import de.bps.course.nodes.vc.provider.VCProvider;
import de.bps.course.nodes.vc.provider.VCProviderFactory; import de.bps.course.nodes.vc.provider.VCProviderFactory;
/** /**
...@@ -57,19 +58,20 @@ public class AdobeConnectCleanupJob extends QuartzJobBean { ...@@ -57,19 +58,20 @@ public class AdobeConnectCleanupJob extends QuartzJobBean {
@Override @Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException { protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
AdobeConnectProvider adobe = null; if(!VCProviderFactory.existsProvider(providerId)) {
return;//same as dummy job
boolean success = VCProviderFactory.existsProvider(providerId);
if(!success) return;//same as dummy job
try {
adobe = (AdobeConnectProvider) VCProviderFactory.createProvider(providerId);
} catch(ClassCastException e) {
throw new JobExecutionException("Invalid configuration: defined a virtual classroom cleanup job and provider implementation doesn't fit");
} }
success = adobe.isProviderAvailable() && adobe.isEnabled(); VCProvider provider = VCProviderFactory.createProvider(providerId);
if(!success) { if(!provider.isEnabled()) {
return;
}
if(!(provider instanceof AdobeConnectProvider)) {
logger.error("Invalid configuration: defined a virtual classroom cleanup job and provider implementation doesn't fit");
return;
}
AdobeConnectProvider adobe = (AdobeConnectProvider)provider;
if(!adobe.isProviderAvailable()) {
logger.debug("Tried to cleanup Adobe Connect meetings but it's actually not available"); logger.debug("Tried to cleanup Adobe Connect meetings but it's actually not available");
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment