Interface SyncItemCronJob.Configurator

  • All Superinterfaces:
    SyncItemCronJob.Confgurator
    All Known Implementing Classes:
    SynchronizationServiceImpl.CockpitDummySyncConfigurator
    Enclosing class:
    SyncItemCronJob

    public static interface SyncItemCronJob.Configurator
    extends SyncItemCronJob.Confgurator
    The configurator interface which allows to execute own configuration logic when this cronjob is being executed.

    This is rather useful when configuration turns out to be time consuming and therefore cannot be performed synchronously with the application code.

     SyncItemJob j = ...
     SnycItemCronjob cj = j.newExecution();
     cj.setConfiguration(
        new Configurator()
        {
            public void configureCronjob( SyncItemCronJob cj, SyncItemCopyContext cc )
            {
                    // add some items to synchronize, change some settings etc.
            }
            public CompletionInfo getCompletionInfo()
            {
                    // return completion status if possible to show up in enclosing wizard
            }
        }
     );
     j.perform( cj, false );