@Beta public class IntentData extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
IntentData() |
|
IntentData(IntentData intentData)
Copy constructor.
|
|
IntentData(Intent intent,
IntentState state,
Timestamp version)
Creates a new intent data object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
errorCount()
Returns the number of times that this intent has encountered an error
during installation or withdrawal.
|
int |
hashCode() |
void |
incrementErrorCount()
Increments the error count for this intent.
|
List<Intent> |
installables()
Returns the installables associated with this intent.
|
Intent |
intent()
Returns the intent this metadata references.
|
static boolean |
isUpdateAcceptable(IntentData currentData,
IntentData newData)
Determines whether an intent data update is allowed.
|
Key |
key()
Returns the intent key.
|
NodeId |
origin()
Returns the origin node that created this intent.
|
IntentState |
request() |
void |
setErrorCount(int newCount)
Sets the error count for this intent.
|
void |
setInstallables(List<Intent> installables)
Sets the intent installables to the given list of intents.
|
void |
setOrigin(NodeId origin)
Sets the origin, which is the node that created the intent.
|
void |
setState(IntentState newState)
Updates the state of the intent to the given new state.
|
void |
setVersion(Timestamp version)
Sets the version for this intent data.
|
IntentState |
state()
Returns the state of the intent.
|
String |
toString() |
Timestamp |
version()
Returns the version of the intent for this key.
|
public IntentData(Intent intent, IntentState state, Timestamp version)
intent - intent this metadata referencesstate - intent stateversion - version of the intent for this keypublic IntentData(IntentData intentData)
intentData - intent data to copyprotected IntentData()
public Intent intent()
public IntentState state()
public IntentState request()
public Key key()
public Timestamp version()
public void setOrigin(NodeId origin)
origin - origin instancepublic NodeId origin()
public void setState(IntentState newState)
newState - new state of the intentpublic void setVersion(Timestamp version)
The store should call this method only once when the IntentData is first passed into the pending map. Ideally, an IntentData is timestamped on the same thread that the called used to submit the intents.
version - the version/timestamp for this intent datapublic void incrementErrorCount()
public void setErrorCount(int newCount)
newCount - new countpublic int errorCount()
public void setInstallables(List<Intent> installables)
installables - list of installables for this intentpublic List<Intent> installables()
public static boolean isUpdateAcceptable(IntentData currentData, IntentData newData)
currentData - existing intent data in the storenewData - new intent data update proposalCopyright © 2015. All rights reserved.