urbanairship-core/src/main/java/com/urbanairship/automation/AutomationEngine.java
public PendingResult<List<T>> schedule(@NonNull final List<? extends ScheduleInfo> scheduleInfos) {
        final PendingResult<List<T>> pendingResult = new PendingResult<>();

        backgroundHandler.post(new Runnable() {
            @Override
            public void run() {
                cleanSchedules();

                if (dataManager.getScheduleCount() + scheduleInfos.size() > scheduleLimit) {
                    Logger.error("AutomationDataManager - Unable to insert schedule due to schedule exceeded limit.");
                    pendingResult.setResult(Collections.<T>emptyList());
                    return;
                }

                List<ScheduleEntry> entries = new ArrayList<>();
                for (ScheduleInfo info : scheduleInfos) {
                    String scheduleId = UUID.randomUUID().toString();
                    entries.add(new ScheduleEntry(scheduleId, info));
                }


                dataManager.saveSchedules(entries);
                subscribeStateObservables(entries);

                List<T> result = convertEntries(entries);
                Logger.verbose("AutomationEngine - Scheduled entries: " + result);
                pendingResult.setResult(convertEntries(entries));

            }
        });

        return pendingResult;
    }
/**
     * Schedules a list of action schedules.
     *
     * @param scheduleInfos A list of {@link ScheduleInfo}.
     * @return A pending result.
     */
Schedules a list of action schedules.
@param scheduleInfos A list of  ScheduleInfo.
@return A pending result.
Schedules a list of action schedules . @param scheduleInfos A list of ScheduleInfo . @return A pending result .
public PendingResult<List<T>> schedule(@NonNull final List<? extends ScheduleInfo> scheduleInfos) {
        final PendingResult<List<T>> pendingResult = new PendingResult<>();
        backgroundHandler.post(new Runnable() {
            @Override
            public void run() {
                cleanSchedules();
                if (dataManager.getScheduleCount() + scheduleInfos.size() > scheduleLimit) {
                    Logger.error("AutomationDataManager - Unable to insert schedule due to schedule exceeded limit.");
                    pendingResult.setResult(Collections.<T>emptyList());
                    return;
                }
                List<ScheduleEntry> entries = new ArrayList<>();
                for (ScheduleInfo info : scheduleInfos) {
                    String scheduleId = UUID.randomUUID().toString();
                    entries.add(new ScheduleEntry(scheduleId, info));
                }
                dataManager.saveSchedules(entries);
                subscribeStateObservables(entries);
                List<T> result = convertEntries(entries);
                Logger.verbose("AutomationEngine - Scheduled entries: " + result);
                pendingResult.setResult(convertEntries(entries));
            }
        });
        return pendingResult;
    }
public PendingResult < List < T > > schedule ( @ NonNull final List < ? extends ScheduleInfo > scheduleInfos ) { final PendingResult < List < T > > pendingResult = new PendingResult < > ( ) ; backgroundHandler . post ( new Runnable ( ) { @ Override public void run ( ) { cleanSchedules ( ) ; if ( dataManager . getScheduleCount ( ) + scheduleInfos . size ( ) > scheduleLimit ) { Logger . error ( "AutomationDataManager - Unable to insert schedule due to schedule exceeded limit." ) ; pendingResult . setResult ( Collections . < T > emptyList ( ) ) ; return ; } List < ScheduleEntry > entries = new ArrayList < > ( ) ; for ( ScheduleInfo info : scheduleInfos ) { String scheduleId = UUID . randomUUID ( ) . toString ( ) ; entries . add ( new ScheduleEntry ( scheduleId , info ) ) ; } dataManager . saveSchedules ( entries ) ; subscribeStateObservables ( entries ) ; List < T > result = convertEntries ( entries ) ; Logger . verbose ( "AutomationEngine - Scheduled entries: " + result ) ; pendingResult . setResult ( convertEntries ( entries ) ) ; } } ) ; return pendingResult ; }
Schedules a list of action schedules.
Schedules a list of action schedules .