-
- All Implemented Interfaces:
-
com.onesignal.common.events.IEventNotifier
public abstract class Operation extends Model
An Operation can be enqueued and executed on the IOperationRepo. Each concrete-class of an Operation has a unique name to identity the type of operation, and contains additional properties required to execute that specific operation. Execution of an operation is performed by an IOperationExecutor. IOperationExecutor identifies itself as being able to execute an Operation through IOperationExecutor.operations.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringnameprivate final StringapplyToRecordIdprivate final StringcreateComparisonKeyprivate final StringmodifyComparisonKeyprivate final GroupComparisonTypegroupComparisonTypeprivate final BooleancanStartExecuteprivate Stringidprivate final BooleanhasSubscribers
-
Method Summary
Modifier and Type Method Description final StringgetName()final UnitsetName(String name)abstract StringgetApplyToRecordId()This is a unique id that points to a record this operation will affect. abstract StringgetCreateComparisonKey()The key of this operation for when the starting operation has a groupComparisonType of GroupComparisonType.CREATE abstract StringgetModifyComparisonKey()The key of this operation for when the starting operation has a groupComparisonType of GroupComparisonType.ALTER abstract GroupComparisonTypegetGroupComparisonType()The comparison type to use when this operation is the starting operation, in terms of which operations can be grouped with it. abstract BooleangetCanStartExecute()Whether the operation can currently execute given it's current state. final StringgetId()final UnitsetId(String id)BooleangetHasSubscribers()UnittranslateIds(Map<String, String> map)Called when an operation has resolved a local ID to a backend ID (i.e. StringtoString()-
Methods inherited from class com.onesignal.core.internal.operations.Operation
hasProperty, initializeFromJson, initializeFromModel, setAnyProperty, setBigDecimalProperty, setBooleanProperty, setDoubleProperty, setEnumProperty, setFloatProperty, setIntProperty, setListProperty, setLongProperty, setMapModelProperty, setOptAnyProperty, setOptBigDecimalProperty, setOptBooleanProperty, setOptDoubleProperty, setOptEnumProperty, setOptFloatProperty, setOptIntProperty, setOptListProperty, setOptLongProperty, setOptMapModelProperty, setOptStringProperty, setStringProperty, subscribe, toJSON, unsubscribe -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Operation
Operation(String name)
-
-
Method Detail
-
getApplyToRecordId
abstract String getApplyToRecordId()
This is a unique id that points to a record this operation will affect. Example: If the operation is updating tags on a User this will be the onesignalId.
-
getCreateComparisonKey
abstract String getCreateComparisonKey()
The key of this operation for when the starting operation has a groupComparisonType of GroupComparisonType.CREATE
-
getModifyComparisonKey
abstract String getModifyComparisonKey()
The key of this operation for when the starting operation has a groupComparisonType of GroupComparisonType.ALTER
-
getGroupComparisonType
abstract GroupComparisonType getGroupComparisonType()
The comparison type to use when this operation is the starting operation, in terms of which operations can be grouped with it.
-
getCanStartExecute
abstract Boolean getCanStartExecute()
Whether the operation can currently execute given it's current state.
-
getHasSubscribers
Boolean getHasSubscribers()
-
translateIds
Unit translateIds(Map<String, String> map)
Called when an operation has resolved a local ID to a backend ID (i.e. successfully created a backend resource). Any IDs within the operation that could be local IDs should be translated at this time. Within the map the key is the local Id, the value is the remote Id.
-
-
-
-