public class

Automation

extends AirshipComponent
java.lang.Object
   ↳ com.urbanairship.AirshipComponent
     ↳ com.urbanairship.automation.Automation

Class Overview

This class is the primary interface to the Urban Airship On Device Automation API. If accessed outside of the main process, the class methods will no-op.

Summary

Constants
long SCHEDULES_LIMIT Automation schedules limit.
Public Methods
void cancel(String id)
Cancels a schedule for a given schedule ID.
void cancel(List<String> ids)
Cancels schedules for a given list of schedule IDs.
void cancelAll()
Cancels all schedules.
void cancelAllAsync()
Cancels all schedules asynchronously.
void cancelAsync(List<String> ids)
Cancels schedules for a given list of schedule IDs asynchronously.
void cancelAsync(String id)
Cancels a schedule for a given schedule ID asynchronously.
void cancelGroup(String group)
Cancels a group of schedules.
void cancelGroupAsync(String group)
Cancels a group of schedules asynchronously.
ActionSchedule getSchedule(String id)
Gets a schedule for a given schedule ID.
void getScheduleAsync(String id, ResultCallback<ActionSchedule> callback)
Gets a schedule for a given schedule ID asynchronously.
List<ActionSchedule> getSchedules(String group)
Gets all schedules for a given group.
List<ActionSchedule> getSchedules()
Gets all schedules.
void getSchedulesAsync(String group, ResultCallback<List<ActionSchedule>> callback)
Gets all schedules for a given group asynchronously.
void getSchedulesAsync(ResultCallback<List<ActionSchedule>> callback)
Gets all schedules asynchronously.
List<ActionSchedule> schedule(List<ActionScheduleInfo> scheduleInfos)
Schedules a list of ActionScheduleInfo instances.
ActionSchedule schedule(ActionScheduleInfo scheduleInfo)
Schedules an ActionScheduleInfo instance.
void scheduleAsync(List<ActionScheduleInfo> scheduleInfos, ResultCallback<List<ActionSchedule>> callback)
Schedules a list of ActionScheduleInfo instances asynchronously.
void scheduleAsync(ActionScheduleInfo scheduleInfo, ResultCallback<ActionSchedule> callback)
Schedules an ActionScheduleInfo instance asynchronously.
Protected Methods
void init()
Initialize the manager.
void tearDown()
Tear down the manager.
[Expand]
Inherited Methods
From class com.urbanairship.AirshipComponent
From class java.lang.Object

Constants

public static final long SCHEDULES_LIMIT

Automation schedules limit.

Constant Value: 1000 (0x00000000000003e8)

Public Methods

public void cancel (String id)

Cancels a schedule for a given schedule ID.

Parameters
id The schedule ID.

public void cancel (List<String> ids)

Cancels schedules for a given list of schedule IDs.

Parameters
ids The list of schedule IDs.

public void cancelAll ()

Cancels all schedules.

public void cancelAllAsync ()

Cancels all schedules asynchronously.

public void cancelAsync (List<String> ids)

Cancels schedules for a given list of schedule IDs asynchronously.

Parameters
ids The list of schedule IDs.

public void cancelAsync (String id)

Cancels a schedule for a given schedule ID asynchronously.

Parameters
id The schedule ID.

public void cancelGroup (String group)

Cancels a group of schedules.

Parameters
group The schedule group.

public void cancelGroupAsync (String group)

Cancels a group of schedules asynchronously.

Parameters
group The schedule group.

public ActionSchedule getSchedule (String id)

Gets a schedule for a given schedule ID.

Parameters
id The schedule ID.
Returns

public void getScheduleAsync (String id, ResultCallback<ActionSchedule> callback)

Gets a schedule for a given schedule ID asynchronously.

Parameters
id The schedule ID.
callback An PendingResult.ResultCallback implementation. The value returned to onResult(Object) may be null if the schedule does not exist or the get was attempted off of the main process.

public List<ActionSchedule> getSchedules (String group)

Gets all schedules for a given group.

Parameters
group The group.
Returns

public List<ActionSchedule> getSchedules ()

Gets all schedules.

Returns

public void getSchedulesAsync (String group, ResultCallback<List<ActionSchedule>> callback)

Gets all schedules for a given group asynchronously.

Parameters
group The group.
callback An PendingResult.ResultCallback implementation. The value returned to onResult(Object) may be emptyList() if no schedules exist or the get was attempted off of the main process.

public void getSchedulesAsync (ResultCallback<List<ActionSchedule>> callback)

Gets all schedules asynchronously.

Parameters
callback An PendingResult.ResultCallback implementation. The value returned to onResult(Object) may be emptyList() if no schedules exist or the get was attempted off of the main process.

public List<ActionSchedule> schedule (List<ActionScheduleInfo> scheduleInfos)

Schedules a list of ActionScheduleInfo instances.

Parameters
scheduleInfos The list of ActionScheduleInfo instances.
Returns

public ActionSchedule schedule (ActionScheduleInfo scheduleInfo)

Schedules an ActionScheduleInfo instance.

Parameters
scheduleInfo The ActionScheduleInfo instance.
Returns

public void scheduleAsync (List<ActionScheduleInfo> scheduleInfos, ResultCallback<List<ActionSchedule>> callback)

Schedules a list of ActionScheduleInfo instances asynchronously.

Parameters
scheduleInfos The list of ActionScheduleInfo instances.
callback An PendingResult.ResultCallback implementation. The value returned to onResult(Object) may be emptyList() if the scheduling failed, the schedule count is greater than or equal to SCHEDULES_LIMIT, or the scheduling was attempted off of the main process.

public void scheduleAsync (ActionScheduleInfo scheduleInfo, ResultCallback<ActionSchedule> callback)

Schedules an ActionScheduleInfo instance asynchronously.

Parameters
scheduleInfo The ActionScheduleInfo instance.
callback An PendingResult.ResultCallback implementation. The value returned to onResult(Object) may be null if the scheduling failed, the schedule count is greater than or equal to SCHEDULES_LIMIT, or the scheduling was attempted off of the main process.

Protected Methods

protected void init ()

Initialize the manager. Called in UAirship during takeoff.

protected void tearDown ()

Tear down the manager. Called in UAirship during land.