Show AsynchronousPersister.java syntax highlighted
package persister;
import java.io.File;
import java.sql.Timestamp;
/**
* @author webers
*
* NOTICE: IDs of all PlanningObjects (StoryCards, Iterations, Backlog etc.)
* have to be globally UNIQUE as they are used to identify these objects
* in AgilePlanner.
*
*/
public interface AsynchronousPersister {
/****************************************************************************************
* CONNECTION *
****************************************************************************************/
/**
* returns if a connection already exists or not
*/
public boolean connected() throws ConnectionFailedException;
/**
* Connects to a project
* The implementation class decides if the project resides on the local machine or on a server
* Expected result: asynchronous callback PlannerDataChangeListener>createdProject
* @throws ConnectionFailedException
*/
public void connect() throws ConnectionFailedException;
/****************************************************************************************
* LOAD AND SAVE *
****************************************************************************************/
/**
* send a message to the persister to load a project with name projectName
* if the project does not yet exist, the persister needs to create it
* Expected result: asynchronous callback PlannerDataChangeListener>createdProject
*/
public void load(String projectName) throws NotConnectedException, CouldNotLoadProjectException;
/**
* send a message to the persister to load a project with name projectName
* only load iterations that end after start time and end before end time
* Expected result: asynchronous callback PlannerDataChangeListener>createdProject
*/
public void load(String projectName, Timestamp start, Timestamp end) throws NotConnectedException, CouldNotLoadProjectException;
// public boolean save()throws NotConnectedException;
// public boolean saveAs(String path)throws NotConnectedException;
// public void getProjectNames()throws NotConnectedException;
// public void upload(File path) throws NotConnectedException;
// public void writeToFile(String filename, String content);
// public String[] readFromFile(String localPath);
/**
* send a message to the persister get all project names in the default location
* Expected result: asynchronous callback PlannerDataChangeListener>gotProjectNames
*/
public void getProjectNames() throws NotConnectedException;
/**
* Expected result: asynchronous callback PlannerDataChangeListener>projectInXML
*/
public void getProjectAsXML() throws NotConnectedException;
/****************************************************************************************
* CREATE *
****************************************************************************************/
/**
* Expected result: asynchronous callback PlannerDataChangeListener>createdBacklog
*/
public void createBacklog(int width, int height, int locationX, int locationY) throws NotConnectedException, ForbiddenOperationException;
/**
* Expected result: asynchronous callback PlannerDataChangeListener>createdIteration
*/
public void createIteration(String name, String description, int width, int height, int locationX, int locationY,
float availableEffort, Timestamp startDate, Timestamp endDate) throws NotConnectedException;
/**
* Expected result: asynchronous callback PlannerDataChangeListener>createdStoryCard
*/
public void createStoryCard(String name, String description, int width, int height, int locationX, int locationY,
long parentid, float bestCaseEstimate, float mostlikelyEstimate, float worstCaseEstimate, float actualEffort, String str) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* DELETE *
****************************************************************************************/
/**
* BAcklog and all stories in it need to be deleted
* Expected result: asynchronous callback PlannerDataChangeListener>deletedBacklog
*/
public void deleteBacklog(long id) throws NotConnectedException, ForbiddenOperationException;
/**
* Iteration and included story cards need to be deleted
* Expected result: asynchronous callback PlannerDataChangeListener>deletedIteration
*/
public void deleteIteration(long id) throws NotConnectedException, IndexCardNotFoundException;
/**
* StoryCard needs to be deleted
* Expected result: asynchronous callback PlannerDataChangeListener>deletedStoryCard
*/
public void deleteStoryCard(long id) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* UNDELETE *
****************************************************************************************/
/**
* Backlog object and all its story cards are added to the persister
* Expected result: asynchronous callback PlannerDataChangeListener>undeletedBacklog
* @param backlog object with all included story cards
*/
// public void undeleteBacklog(Backlog backlog) throws NotConnectedException, ForbiddenOperationException;
/**
* Iteration object and all its story cards are added to the persister
* Expected result: asynchronous callback PlannerDataChangeListener>undeletedIteration
* @param iteration object with all included story cards
*/
public void undeleteIteration(Iteration iteration) throws NotConnectedException, IndexCardNotFoundException, ForbiddenOperationException;
/**
* Project object and all its iterations, backlogs, story cards are added to the persister
* Expected result: asynchronous callback PlannerDataChangeListener>undeletedProject
* @param project object with all included backlogs, iterations, story cards
*/
// public void undeleteProject(Project project) throws NotConnectedException, ForbiddenOperationException;
/**
* story card is added to the persister
* Expected result: asynchronous callback PlannerDataChangeListener>undeletedStoryCard
* @param story card object with all included story cards
*/
public void undeleteStoryCard(StoryCard sc) throws NotConnectedException, IndexCardNotFoundException, ForbiddenOperationException;
/****************************************************************************************
* UPDATE BACKLOG *
****************************************************************************************/
public void updateBacklog(Backlog b) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* UPDATE STORYCARD *
****************************************************************************************/
public void updateStoryCard(StoryCard sc) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* MOVE STORYCARD BETWEEN PARENTS *
****************************************************************************************/
public void moveStoryCardToNewParent(StoryCard sc, long newparentid, int locationX, int locationY)
throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* UPDATE ITERATION *
****************************************************************************************/
public void updateIteration(Iteration iteration) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* UPDATE PROJECT *
****************************************************************************************/
//public void updateProjectName(long id, String name) throws NotConnectedException, IndexCardNotFoundException;
/****************************************************************************************
* LISTENER *
****************************************************************************************/
public void addPlannerDataChangeListener(PlannerDataChangeListener listener);
public void removePlannerDataChangeListener(PlannerDataChangeListener listener);
}
See more files for this project here