buffer.append(String.format(" Deployment \"%s\" is missing the following dependencies:\n", name));
DependencyInfo dependsInfo = ctx.getDependencyInfo();
Set<DependencyItem> depends = dependsInfo.getIDependOn(null);
for (DependencyItem item : depends)
{
ControllerState dependentState = item.getDependentState();
if (dependentState == null)
dependentState = ControllerState.INSTALLED;
ControllerState otherState = null;
ControllerContext other = null;
Object iDependOn = item.getIDependOn();
if (name.equals(iDependOn) == false)
{
if (iDependOn != null)
{
other = controller.getContext(iDependOn, null);
if (other != null)
otherState = other.getState();
}
boolean print = true;
if (otherState != null && otherState.equals(ControllerState.ERROR) == false)
{
ControllerStateModel states = controller.getStates();
if (states.isBeforeState(otherState, dependentState) == false)
print = false;
}
if (print)
{
buffer.append(String.format(" Dependency \"%s\" (should be in state \"%s\", but is actually %s)\n",
iDependOn,
dependentState.getStateString(),
iDependOn == null ?
String.format("unresolved (%s)",
item.toHumanReadableString()) :
other == null ?
"not found" :
String.format("in state \"%s\"", otherState.getStateString())));
}
}
}
}
}