use of org.alfresco.filesys.repo.rules.commands.SoftRenameFileCommand in project alfresco-repository by Alfresco.
the class ScenarioRenameCreateShuffleInstance method evaluate.
/**
* Evaluate the next operation
* @param operation
*/
public Command evaluate(Operation operation) {
/**
* Anti-pattern : timeout
*/
Date now = new Date();
if (now.getTime() > startTime.getTime() + getTimeout()) {
if (logger.isDebugEnabled()) {
logger.debug("Instance timed out");
}
isComplete = true;
return null;
}
switch(state) {
case NONE:
if (operation instanceof RenameFileOperation) {
logger.debug("New scenario initialised");
RenameFileOperation r = (RenameFileOperation) operation;
this.from = r.getFrom();
this.to = r.getTo();
state = InternalState.INITIALISED;
SoftRenameFileCommand r1 = new SoftRenameFileCommand(from, to, r.getRootNodeRef(), r.getFromPath(), r.getToPath());
isComplete = true;
return r1;
}
break;
}
return null;
}
Aggregations