}
break;
case State.DirHereFileThere:
State buff = bsd.getState(dst);
if (buff.equals(State.Orphan, Buffer)) {
actions.add(new Action(Add, getOpposite(state.getLocation()), BufferUpdate.Destination,
"There was a node in buff, but its orphan, so add"));
}
else if (buff.equals(State.DirHereFileThere, state.getLocation())) {
if (state.getLocation() == Source) {
actions.add(new Action(Nothing, None, BufferUpdate.None,
"dirherefilethere, but there is a dir instead of file, so its in sync"));
}
else {
actions.add(new Action(UnexpectedChangeError, Destination, BufferUpdate.None,
"dirherefilethere, but there is a file instead of dir, so unexpected change"));
// TODO ^ recompare here
}
}
else {
actions.add(new Action(DirHereFileThereError, state.getLocation(), BufferUpdate.None,
"cant update, dir here file there error occured"));
}
break;
case State.FileChange:
if (bsd.getState(dst).equals(State.NodeInSync, Both)) {
if (state.getLocation() == Source) {
actions.add(updateDestination);
}
else if (state.getLocation() == Destination) {
actions.add(unexpectedDestinationChanged);
actions.add(overwriteDestination);
}
}
else {
actions.add(unexpectedBothChanged);
actions.add(overwriteDestination);
}
break;
case State.NodeInSync:
// TODO this check is not neccessary, check rules whether to do or not
// if( bsd.getState( dst ).equals( State.NodeInSync, Both ) || bsd.getState( dst ).equals( State.NodeInSync,
// None ) )
{
actions.add(inSync);
actions.add(overwriteDestination);
actions.add(overwriteSource);
}
break;
default:
actions.add(new Action(NotDecidableError, None, BufferUpdate.None, "no rule found"));
break;
}
actions.add(ignore);