|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.TaskHeap.UpdateManager.UpdateManagerNodeDecl
org.sandev.TaskHeap.UpdateManager.UpdateManagerNodeBase
org.sandev.TaskHeap.UpdateManager.UpdateManagerNode
public class UpdateManagerNode
Implementation of UpdateManagerNode.
| Field Summary | |
|---|---|
protected long |
startupTime
The timestamp when this node started. |
| Fields inherited from class org.sandev.TaskHeap.UpdateManager.UpdateManagerNodeDecl |
|---|
peerAuthUserLookupNode |
| Fields inherited from interface org.sandev.basics.nodecommon.Controllable |
|---|
OPERATION_FAIL, OPERATION_RESUME, OPERATION_SHUTDOWN, OPERATION_STARTUP, OPERATION_STR_FAIL, OPERATION_STR_RESUME, OPERATION_STR_SHUTDOWN, OPERATION_STR_STARTUP, OPERATION_STR_SUSPEND, OPERATION_STR_UNDEFINED, OPERATION_STRINGS, OPERATION_SUSPEND, OPERATION_UNDEFINED, SHUTDOWN_ERROR_RESTART_GLOBAL, SHUTDOWN_ERROR_RESTART_LOCAL, SHUTDOWN_ERROR_TERMINATE, SHUTDOWN_NORMAL, STATE_FAILED, STATE_FAILING, STATE_RESUMING, STATE_RUNNING, STATE_STARTING, STATE_STOPPED, STATE_STOPPING, STATE_STR_FAILED, STATE_STR_FAILING, STATE_STR_RESUMING, STATE_STR_RUNNING, STATE_STR_STARTING, STATE_STR_STOPPED, STATE_STR_STOPPING, STATE_STR_SUSPENDED, STATE_STR_SUSPENDING, STATE_STR_UNDEFINED, STATE_STRINGS, STATE_SUSPENDED, STATE_SUSPENDING, STATE_UNDEFINED |
| Constructor Summary | |
|---|---|
UpdateManagerNode()
|
|
| Method Summary | |
|---|---|
protected void |
addImpliedHeapAssociationUpdates(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.AggregateUpdate au,
org.sandev.basics.util.AuthUser authUser,
java.util.ArrayList al)
Add any HeapAssociation updates needed for the given update. |
protected void |
addImpliedPlanComponentUpdates(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.structs.SandUpdateMessage[] updates,
org.sandev.basics.util.AuthUser authUser,
java.util.ArrayList al)
Add any additional updates necessary to track the given plan component update. |
protected org.sandev.basics.sandmessages.AggregateUpdate |
addImpliedUpdates(org.sandev.basics.sandmessages.AggregateUpdate au)
Add any additional updates that are implied by the given updates to the given AggregateUpdate message. |
protected void |
addInitialHeapPlans(HeapAttributes heap,
org.sandev.basics.util.AuthUser authUser,
org.sandev.basics.sandmessages.AggregateUpdate au,
java.util.ArrayList al)
Add the initial top level plans for the given heap. |
org.sandev.basics.sandmessages.AggregateUpdate |
callAggregateUpdate(org.sandev.basics.sandmessages.AggregateUpdate au)
Override any synchronous outbound AggregateUpdate call to update our cached information along the way. |
protected void |
confirmChildReferences(PlanUpdate pu,
java.util.ArrayList al,
org.sandev.basics.sandmessages.AggregateUpdate au)
Make sure that any referenced instances have this Plan as the parent, and make sure no previously referenced instances still reference this Plan. |
protected static org.sandev.basics.structs.SandPersistMessage |
findFromUpdates(long id,
java.util.ArrayList al)
If there is an existing update in the list for the given ID, then return that instance. |
protected org.sandev.basics.structs.SandUpdateMessage |
findUpdate(long id,
org.sandev.basics.structs.SandUpdateMessage[] updates,
java.util.ArrayList al)
Look for an existing update of the specified instance and return the latest, or null if not found. |
protected boolean |
fixReference(Plan plan,
long childID,
boolean hasChild)
Given a plan that either hasChild or not, add the reference or remove it as needed. |
protected Account |
getAccountForUsername(java.lang.String username)
Given a username, return the associated Account or null if not found. |
java.lang.String |
getDeploymentPrefix()
Return the prefix for this deployment. |
org.sandev.basics.structs.SandPersistMessage |
getInstance(java.lang.String classname,
long id,
org.sandev.basics.util.AuthUser user)
Lookup the specified class instance. |
protected long |
getParentForInstance(org.sandev.basics.structs.SandInstanceMessage sim)
Return the parent uniqueID for the PlanComponent derived instance, or zero if there is no parent reference. |
protected long |
getParentForUpdate(org.sandev.basics.structs.SandUpdateMessage sum)
Return the parent uniqueID for the PlanComponent derived update, or zero if there is no parent reference. |
org.sandev.basics.util.AuthUser |
getUserForID(long id)
Convenience passthrough call to our configured AuthUserLookup. |
org.sandev.basics.util.AuthUser |
getUserFromLogin(java.lang.String username,
java.lang.String password)
Convenience passthrough call to our configured AuthUserLookup. |
protected org.sandev.basics.sandmessages.AggregateUpdate |
heapUpdate(org.sandev.basics.sandmessages.AggregateUpdate au)
Handle the specified updates to the overall TaskHeap. |
protected boolean |
isRecalcExempt(org.sandev.basics.structs.SandUpdateMessage sum)
Return true if this update is exempt from recalc processing, false otherwise. |
protected boolean |
isTopLevelPlan(org.sandev.basics.structs.SandPersistMessage spm)
Return true if the given SandPersistMessage is one of the top level plans, false otherwise. |
protected java.lang.String |
linkref(org.sandev.basics.structs.SandPersistMessage spm)
Given a persistent message, return a link to it on the main screen. |
protected org.sandev.basics.sandmessages.AggregateUpdate |
onReceive(org.sandev.basics.sandmessages.AggregateUpdate msg)
Process the updates, including any bookkeeping for updates to Plans or Tasks. |
protected org.sandev.basics.sandmessages.Stats |
onReceive(org.sandev.basics.sandmessages.StatsQuery msg)
Return our current stats |
protected void |
onStartup()
Init our stats. |
protected void |
recalcParents(long parentID,
long userID,
java.util.ArrayList al)
Recalc the specified Plan, and any containing Plans recursively upward, appending the resulting updates to the specified list. |
protected void |
recalcPlan(Plan plan,
long userID,
java.util.ArrayList al)
Recalc the given plan. |
protected org.sandev.basics.structs.SandUpdateMessage[] |
removeDuplicateRecalcs(org.sandev.basics.structs.SandUpdateMessage[] sums)
We only want one PlanUpdate added per action. |
protected void |
removeReferenceToChild(org.sandev.basics.structs.SandInstanceMessage child,
org.sandev.basics.util.AuthUser user,
java.util.ArrayList al)
Given some form of PlanComponent derived update message, append an update as necessary to remove it from its parent. |
protected boolean |
timeEstimateChanged(org.sandev.basics.structs.SandUpdateMessage sum)
Return true if the timeEstimate for the given update has changed. |
protected void |
updateParentRef(long childID,
long parentID,
long userID,
java.util.ArrayList al)
Given a child, append an update to change its parent reference. |
protected void |
verifyAccount(AccountUpdate update,
org.sandev.basics.sandmessages.ErrorInfoCollection eic)
Verify that this Account is ok to go. |
protected void |
verifyHeapAttributes(HeapAttributesUpdate hau,
org.sandev.basics.sandmessages.ErrorInfoCollection eic)
Verify that this HeapAttributesUpdate is ok to go. |
protected void |
verifyNoPlanOrphans(org.sandev.basics.structs.SandUpdateMessage sum)
Throw if this is a plan with children that would be orphaned should the plan be deleted. |
protected void |
verifyNotRelativeDateBase(org.sandev.basics.structs.SandUpdateMessage sum)
Throw if the given PlanComponentInterface is referenced by another to compute its due date. |
protected void |
verifyParentRef(long childID,
long parentID,
long userID,
java.util.ArrayList al,
org.sandev.basics.sandmessages.AggregateUpdate au)
Given a child make sure there is an update pending that sets its parent reference appropriately. |
protected void |
verifyPCIUpdate(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.ErrorInfoCollection eic,
org.sandev.basics.sandmessages.AggregateUpdate msg)
Verify that the given update of a PlanComponentInterface is ok. |
protected void |
verifyReferenceToChild(long parentID,
long childID,
boolean hasChild,
org.sandev.basics.structs.SandUpdateMessage[] updates,
org.sandev.basics.util.AuthUser user,
java.util.ArrayList al)
Verify that there is a PlanUpdate for the given parent that either adds the child reference, or removes it, based on whether it now hasChild or not. |
protected void |
verifyTaskPhaseValid(Task task,
org.sandev.basics.util.AuthUser user)
Verify that the TaskPhase associated with the given Task is valid according to its TaskType. |
protected void |
verifyUpdate(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.AggregateUpdate msg)
Check that the given update is ok. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long startupTime
| Constructor Detail |
|---|
public UpdateManagerNode()
| Method Detail |
|---|
public org.sandev.basics.util.AuthUser getUserForID(long id)
throws org.sandev.basics.structs.SandException
getUserForID in interface org.sandev.basics.util.AuthUserLookupgetUserForID in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
public org.sandev.basics.util.AuthUser getUserFromLogin(java.lang.String username,
java.lang.String password)
throws org.sandev.basics.structs.SandException
getUserFromLogin in interface org.sandev.basics.util.AuthUserLookupgetUserFromLogin in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
public org.sandev.basics.structs.SandPersistMessage getInstance(java.lang.String classname,
long id,
org.sandev.basics.util.AuthUser user)
throws org.sandev.basics.structs.SandException
getInstance in interface org.sandev.basics.util.IDLookupgetInstance in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
protected void onStartup()
throws org.sandev.basics.structs.SandException
onStartup in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
protected org.sandev.basics.sandmessages.Stats onReceive(org.sandev.basics.sandmessages.StatsQuery msg)
throws org.sandev.basics.structs.SandException
onReceive in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
protected org.sandev.basics.sandmessages.AggregateUpdate onReceive(org.sandev.basics.sandmessages.AggregateUpdate msg)
throws org.sandev.basics.structs.SandException
onReceive in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
public org.sandev.basics.sandmessages.AggregateUpdate callAggregateUpdate(org.sandev.basics.sandmessages.AggregateUpdate au)
throws org.sandev.basics.structs.SandException
callAggregateUpdate in class UpdateManagerNodeBaseorg.sandev.basics.structs.SandException
protected void verifyUpdate(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.AggregateUpdate msg)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyAccount(AccountUpdate update,
org.sandev.basics.sandmessages.ErrorInfoCollection eic)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected Account getAccountForUsername(java.lang.String username)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyHeapAttributes(HeapAttributesUpdate hau,
org.sandev.basics.sandmessages.ErrorInfoCollection eic)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyPCIUpdate(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.ErrorInfoCollection eic,
org.sandev.basics.sandmessages.AggregateUpdate msg)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandExceptionprotected boolean isTopLevelPlan(org.sandev.basics.structs.SandPersistMessage spm)
protected org.sandev.basics.sandmessages.AggregateUpdate addImpliedUpdates(org.sandev.basics.sandmessages.AggregateUpdate au)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void addImpliedHeapAssociationUpdates(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.sandmessages.AggregateUpdate au,
org.sandev.basics.util.AuthUser authUser,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void addInitialHeapPlans(HeapAttributes heap,
org.sandev.basics.util.AuthUser authUser,
org.sandev.basics.sandmessages.AggregateUpdate au,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void addImpliedPlanComponentUpdates(org.sandev.basics.structs.SandUpdateMessage sum,
org.sandev.basics.structs.SandUpdateMessage[] updates,
org.sandev.basics.util.AuthUser authUser,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyReferenceToChild(long parentID,
long childID,
boolean hasChild,
org.sandev.basics.structs.SandUpdateMessage[] updates,
org.sandev.basics.util.AuthUser user,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected org.sandev.basics.structs.SandUpdateMessage findUpdate(long id,
org.sandev.basics.structs.SandUpdateMessage[] updates,
java.util.ArrayList al)
protected boolean fixReference(Plan plan,
long childID,
boolean hasChild)
protected void verifyNoPlanOrphans(org.sandev.basics.structs.SandUpdateMessage sum)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyNotRelativeDateBase(org.sandev.basics.structs.SandUpdateMessage sum)
throws org.sandev.basics.structs.SandException
We check this using separate Plan and Task queries so the message actually contains the correct type of PlanComponent.
org.sandev.basics.structs.SandExceptionprotected java.lang.String linkref(org.sandev.basics.structs.SandPersistMessage spm)
protected org.sandev.basics.sandmessages.AggregateUpdate heapUpdate(org.sandev.basics.sandmessages.AggregateUpdate au)
throws org.sandev.basics.structs.SandException
Recalc is handled in the PlanCalculator via a PlanRecalc synchronous request. Multiple simultaneous requests are handled concurrently, subject only to transactional constraints on the underlying data updates.
Implementation notes:
org.sandev.basics.structs.SandExceptionprotected boolean isRecalcExempt(org.sandev.basics.structs.SandUpdateMessage sum)
protected org.sandev.basics.structs.SandUpdateMessage[] removeDuplicateRecalcs(org.sandev.basics.structs.SandUpdateMessage[] sums)
This works by removing any plan recalc updates that have a subsequent update later on in the array.
protected void confirmChildReferences(PlanUpdate pu,
java.util.ArrayList al,
org.sandev.basics.sandmessages.AggregateUpdate au)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void removeReferenceToChild(org.sandev.basics.structs.SandInstanceMessage child,
org.sandev.basics.util.AuthUser user,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
We recalculate the parent as part of this processing, to avoid requiring two separate update actions for the same parent Plan.
org.sandev.basics.structs.SandException
protected long getParentForUpdate(org.sandev.basics.structs.SandUpdateMessage sum)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected long getParentForInstance(org.sandev.basics.structs.SandInstanceMessage sim)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected boolean timeEstimateChanged(org.sandev.basics.structs.SandUpdateMessage sum)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyParentRef(long childID,
long parentID,
long userID,
java.util.ArrayList al,
org.sandev.basics.sandmessages.AggregateUpdate au)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void updateParentRef(long childID,
long parentID,
long userID,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void recalcParents(long parentID,
long userID,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void recalcPlan(Plan plan,
long userID,
java.util.ArrayList al)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyTaskPhaseValid(Task task,
org.sandev.basics.util.AuthUser user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandExceptionpublic java.lang.String getDeploymentPrefix()
getDeploymentPrefix in class UpdateManagerNodeBase
protected static org.sandev.basics.structs.SandPersistMessage findFromUpdates(long id,
java.util.ArrayList al)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||