@Beta
public class IntentData
extends java.lang.Object
| Modifier | Constructor and Description | 
|---|---|
protected  | 
IntentData()  | 
  | 
IntentData(IntentData intentData)
Deprecated. 
 
in 1.11.0 use  
copy(IntentData) instead | 
  | 
IntentData(IntentData original,
          java.util.List<Intent> installables)
Deprecated. 
 
in 1.11.0 use  
compiled(IntentData, List) instead | 
  | 
IntentData(Intent intent,
          IntentState state,
          IntentState request,
          Timestamp version,
          NodeId origin)
Deprecated. 
 
in 1.11.0 
 | 
  | 
IntentData(Intent intent,
          IntentState state,
          Timestamp version)
Deprecated. 
 
in 1.11.0 
 | 
  | 
IntentData(Intent intent,
          IntentState state,
          Timestamp version,
          NodeId origin)
Deprecated. 
 
in 1.11.0 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static IntentData | 
assign(IntentData data,
      Timestamp timestamp,
      NodeId node)
Creates updated IntentData after assigning task to a node. 
 | 
static IntentData | 
compiled(IntentData data,
        java.util.List<Intent> installables)
Creates updated IntentData with compilation result. 
 | 
static IntentData | 
copy(IntentData data)
Creates a copy of given IntentData. 
 | 
static IntentData | 
corrupt(IntentData data)
Creates a copy of IntentData in corrupt state,
 incrementing error count. 
 | 
boolean | 
equals(java.lang.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. 
 | 
java.util.List<Intent> | 
installables()
Returns the installables associated with this intent. 
 | 
Intent | 
intent()
Returns the intent this metadata references. 
 | 
int | 
internalStateVersion()  | 
static boolean | 
isUpdateAcceptable(IntentData currentData,
                  IntentData newData)
Determines whether an intent data update is allowed. 
 | 
Key | 
key()
Returns the intent key. 
 | 
static IntentData | 
nextState(IntentData data,
         IntentState nextState)
Create a copy of IntentData in next state. 
 | 
NodeId | 
origin()
Returns the origin node that created this intent. 
 | 
static IntentData | 
purge(Intent intent)
Creates IntentData for Intent purge request. 
 | 
IntentState | 
request()  | 
void | 
setErrorCount(int newCount)
Sets the error count for this intent. 
 | 
void | 
setState(IntentState newState)
Updates the state of the intent to the given new state. 
 | 
IntentState | 
state()
Returns the state of the intent. 
 | 
static IntentData | 
submit(Intent intent)
Creates IntentData for Intent submit request. 
 | 
java.lang.String | 
toString()  | 
Timestamp | 
version()
Returns the request version of the intent for this key. 
 | 
static IntentData | 
withdraw(Intent intent)
Creates IntentData for Intent withdraw request. 
 | 
@Deprecated public IntentData(Intent intent, IntentState state, Timestamp version)
intent - intent this metadata referencesstate - intent stateversion - version of the intent for this key@Deprecated public IntentData(Intent intent, IntentState state, Timestamp version, NodeId origin)
intent - intent this metadata referencesstate - intent stateversion - version of the intent for this keyorigin - ID of the node where the data was originally created@Deprecated public IntentData(Intent intent, IntentState state, IntentState request, Timestamp version, NodeId origin)
intent - intent this metadata referencesstate - intent staterequest - intent requestversion - version of the intent for this keyorigin - ID of the node where the data was originally created@Deprecated public IntentData(IntentData intentData)
copy(IntentData) insteadintentData - intent data to copy@Deprecated public IntentData(IntentData original, java.util.List<Intent> installables)
compiled(IntentData, List) insteadoriginal - original datainstallables - new installable intents to setprotected IntentData()
public static IntentData submit(Intent intent)
intent - to requestpublic static IntentData withdraw(Intent intent)
intent - to requestpublic static IntentData purge(Intent intent)
intent - to requestpublic static IntentData assign(IntentData data, Timestamp timestamp, NodeId node)
data - IntentData to update work assignmenttimestamp - to assign to current requestnode - node which was assigned to handle this request (local node id)public static IntentData copy(IntentData data)
data - intent data to copypublic static IntentData nextState(IntentData data, IntentState nextState)
data - intent data to copynextState - to transition topublic static IntentData corrupt(IntentData data)
data - intent data to copypublic static IntentData compiled(IntentData data, java.util.List<Intent> installables)
data - IntentData to updateinstallables - compilation resultpublic Intent intent()
public IntentState state()
public IntentState request()
public Key key()
public Timestamp version()
public int internalStateVersion()
public NodeId origin()
public void setState(IntentState newState)
newState - new state of the intentpublic void incrementErrorCount()
public void setErrorCount(int newCount)
newCount - new countpublic int errorCount()
public java.util.List<Intent> installables()
public static boolean isUpdateAcceptable(IntentData currentData, IntentData newData)
currentData - existing intent data in the storenewData - new intent data update proposalpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object