private void registerPurgeJobHandler(JobHandlerRegistry jobHandlerRegistry) { jobHandlerRegistry.addHandler( PurgeJob.INSTANCE, new Supplier<JobHandler<PurgeRequest, PurgeResult>>() { @Override public JobHandler<PurgeRequest, PurgeResult> get() { return getPurgeRequestPurgeResultJobHandler(); } }); }
public static boolean isNotOwner(JobHandler<?, ?> handler) { return handler.isNotOwner(); } }
public static <Q, R> JobIdentifier<Q, R> createNew(JobType<Q, R> jobType) { checkNotNull(jobType, "jobType"); return new JobIdentifier<>(toId(jobType.getName(), UUID.randomUUID()), jobType); }
@Override public String purgeTableAsync(String table, Audit audit) { checkNotNull(audit, "audit"); JobIdentifier<PurgeRequest, PurgeResult> jobId = _jobService.submitJob( new JobRequest<>(PurgeJob.INSTANCE, new PurgeRequest(table, audit))); return jobId.toString(); }
public static <Q, R> JobIdentifier<Q, R> fromString(String id, JobType<Q, R> jobType) { checkNotNull(id, "id"); checkNotNull(jobType, "jobType"); checkArgument(jobType.getName().equals(getJobTypeNameFromId(id)), "Inconsistent type"); return new JobIdentifier<>(id, jobType); }
private void startJobProcessing(PrintWriter printWriter) { if (_jobService.resume()) { printWriter.print("Job processing has been started"); } else { printWriter.print("Job processing remains started (no change)"); } } }
private void stopJobProcessing(PrintWriter printWriter) { if (_jobService.pause()) { printWriter.print("Job processing has been stopped"); } else { printWriter.print("Job processing remains stopped (no change)"); } }
@Override public String purgeTableAsync(String table, Audit audit) { checkNotNull(audit, "audit"); JobIdentifier<PurgeRequest, PurgeResult> jobId = _jobService.submitJob( new JobRequest<>(PurgeJob.INSTANCE, new PurgeRequest(table, audit))); return jobId.toString(); }
public static <Q, R> JobIdentifier<Q, R> fromString(String id, JobType<Q, R> jobType) { checkNotNull(id, "id"); checkNotNull(jobType, "jobType"); checkArgument(jobType.getName().equals(getJobTypeNameFromId(id)), "Inconsistent type"); return new JobIdentifier<>(id, jobType); }
public static <Q, R> JobIdentifier<Q, R> createNew(JobType<Q, R> jobType) { checkNotNull(jobType, "jobType"); return new JobIdentifier<>(toId(jobType.getName(), UUID.randomUUID()), jobType); }
private void registerPurgeJobHandler(JobHandlerRegistry jobHandlerRegistry) { jobHandlerRegistry.addHandler( PurgeJob.INSTANCE, new Supplier<JobHandler<PurgeRequest, PurgeResult>>() { @Override public JobHandler<PurgeRequest, PurgeResult> get() { return getPurgeRequestPurgeResultJobHandler(); } }); }
public static boolean isNotOwner(JobHandler<?, ?> handler) { return handler.isNotOwner(); } }
private void startJobProcessing(PrintWriter printWriter) { if (_jobService.resume()) { printWriter.print("Job processing has been started"); } else { printWriter.print("Job processing remains started (no change)"); } } }
private void stopJobProcessing(PrintWriter printWriter) { if (_jobService.pause()) { printWriter.print("Job processing has been stopped"); } else { printWriter.print("Job processing remains stopped (no change)"); } }
@Override public String replayAsyncSince(String ownerId, String subscription, Date since) { checkLegalSubscriptionName(subscription); checkSubscriptionOwner(ownerId, subscription); JobIdentifier<ReplaySubscriptionRequest, ReplaySubscriptionResult> jobId = _jobService.submitJob( new JobRequest<>(ReplaySubscriptionJob.INSTANCE, new ReplaySubscriptionRequest(ownerId, subscription, since))); return jobId.toString(); }
@Override public String moveAsync(String from, String to) { checkLegalQueueName(from); checkLegalQueueName(to); JobIdentifier<MoveQueueRequest, MoveQueueResult> jobId = _jobService.submitJob(new JobRequest<>(_moveQueueJobType, new MoveQueueRequest(from, to))); return jobId.toString(); }
@Override public String replayAsyncSince(String ownerId, String subscription, Date since) { checkLegalSubscriptionName(subscription); checkSubscriptionOwner(ownerId, subscription); JobIdentifier<ReplaySubscriptionRequest, ReplaySubscriptionResult> jobId = _jobService.submitJob( new JobRequest<>(ReplaySubscriptionJob.INSTANCE, new ReplaySubscriptionRequest(ownerId, subscription, since))); return jobId.toString(); }
@Override public String moveAsync(String from, String to) { checkLegalQueueName(from); checkLegalQueueName(to); JobIdentifier<MoveQueueRequest, MoveQueueResult> jobId = _jobService.submitJob(new JobRequest<>(_moveQueueJobType, new MoveQueueRequest(from, to))); return jobId.toString(); }
@Override public String moveAsync(String ownerId, String from, String to) { checkLegalSubscriptionName(from); checkLegalSubscriptionName(to); checkSubscriptionOwner(ownerId, from); checkSubscriptionOwner(ownerId, to); JobIdentifier<MoveSubscriptionRequest, MoveSubscriptionResult> jobId = _jobService.submitJob(new JobRequest<>( MoveSubscriptionJob.INSTANCE, new MoveSubscriptionRequest(ownerId, from, to))); return jobId.toString(); }
@Override public String moveAsync(String ownerId, String from, String to) { checkLegalSubscriptionName(from); checkLegalSubscriptionName(to); checkSubscriptionOwner(ownerId, from); checkSubscriptionOwner(ownerId, to); JobIdentifier<MoveSubscriptionRequest, MoveSubscriptionResult> jobId = _jobService.submitJob(new JobRequest<>( MoveSubscriptionJob.INSTANCE, new MoveSubscriptionRequest(ownerId, from, to))); return jobId.toString(); }