Commit d2cacac7 authored by ducanh-le's avatar ducanh-le
Browse files

Add missing method for GTDServer

parent 1c40402a
......@@ -43,4 +43,7 @@ buildNumber.properties
.settings/
# MacOS
.java-version
\ No newline at end of file
.java-version
/diag-af257a0f53b386c36797ab8d7484cab4.png
/ISSUES.pdf
/README.pdf
package fr.alma.gtd.server.core;
import java.util.Date;
import java.util.List;
/**
* TODO: This should be the main interface:
* - the module gtd-server-main should implement it
......@@ -8,6 +11,107 @@ package fr.alma.gtd.server.core;
public interface GTDServer {
// TODO: Add all missing methods.
void createAccount(final String username, final String password, final String pseudo, final CallBack<String> callback);
void createContext(final IContext context, final String identification, final CallBack<IContext> callback);
void createIdea(final IIdea idea, final String identification, final CallBack<IIdea> callback);
void createProject(final IProject project, final String identification, final CallBack<IProject> callback);
void createTask(final ITask task, final String identification, final CallBack<ITask> callback);
void createTag(final ITag tag, final String identification, final CallBack<ITag> callback);
void disconnect(final String identification, final CallBack<String> callback);
void sendContext(final IContext context, final UpdateMode mode, final String identification, final CallBack<IContext> callback);
void sendIdea(final IIdea idea, final UpdateMode mode, final String identification, final CallBack<IIdea> callback);
void sendProject(final IProject project, final UpdateMode mode, final String identification, final CallBack<IProject> callback);
void sendTask(final ITask task, final UpdateMode mode, final String identification, final CallBack<ITask> callback);
void sendTag(final ITag tag, final UpdateMode mode, final String identification, final CallBack<ITag> callback);
void login(final String username, final String password, final CallBack<String> callback);
void editPassword(final String oldPassword, final String newPassword, final String identification, final CallBack<String> callback);
void editPseudo(final String pseudo, final String identification, final CallBack<String> callback);
void deleteAccount(final String username, final String password, final String identification, final CallBack<String> callback);
void deleteContext(final IContext context, final String identification, final CallBack<String> callback);
void deleteIdea(final IIdea idea, final String identification, final CallBack<String> callback);
void deleteProject(final IProject project, final String identification, final CallBack<String> callback);
void deleteTask(final ITask task, final String identification, final CallBack<String> callback);
void deleteTag(final ITag tag, final String identification, final CallBack<String> callback);
void downloadArchive(final String identification, final CallBack<List<IServerObject>> callback);
void downloadArchive(final Date date, final String identification, final CallBack<List<IServerObject>> callback);
void downloadCalendar(final String identification, final CallBack<List<ITask>> callback);
void downloadCalendar(final Date date, final String identification, final CallBack<List<ITask>> callback);
void downloadContext(final String identification, final CallBack<List<IContext>> callback);
void downloadIdeas(final String identification, final CallBack<List<IIdea>> callback);
void downloadInbox(final String identification, final CallBack<List<IIdea>> callback);
void downloadInbox(final Date date, final String identification, final CallBack<List<IIdea>> callback);
void downloadParticipants(final String identification, final CallBack<List<IParticipant>> callback);
void downloadTrashcan(final String identification, final CallBack<List<IServerObject>> callback);
void downloadTrashcan(final Date date, final String identification, final CallBack<List<IServerObject>> callback);
void downloadNextTasks(final String identification, final CallBack<List<ITask>> callback);
void downloadNextTasks(final Date date, final String identification, final CallBack<List<ITask>> callback);
void downloadNextTasksByContext(final IContext context, final String identification, final CallBack<List<ITask>> callback);
void downloadNextTasksByContext(final Date date, final IContext context, final String identification, final CallBack<List<ITask>> callback);
void downloadProjects(final String identification, final CallBack<List<IProject>> callback);
void downloadTaskByTag(final ITag tag, final String identification, final CallBack<List<ITask>> callback);
void downloadTaskByTag(final Date date, final ITag tag, final String identification, final CallBack<List<ITask>> callback);
void downloadTasks(final String identification, final CallBack<List<ITask>> callback);
void downloadTags(final String identification, final CallBack<List<ITag>> callback);
void downloadContexts(final String username, final String identification, final CallBack<List<IContext>> callback);
void downloadIdeas(final String username, final String identification, final CallBack<List<IIdea>> callback);
void downloadLog(final String identification, final CallBack<List<String>> callback);
void downloadLog(final Date date, final String identification, final CallBack<List<String>> callback);
void downloadLog(final String username, final String identification, final CallBack<List<String>> callback);
void downloadLogAdmin(final String identification, final CallBack<List<String>> callback);
void downloadProjects(final String username, final String identification, final CallBack<List<IProject>> callback);
void downloadTasks(final String username, final String identification, final CallBack<List<ITask>> callback);
void downloadTags(final String username, final String identification, final CallBack<List<ITag>> callback);
void start();
void stop();
}
package fr.alma.gtd.server.main;
import fr.alma.gtd.server.core.*;
import fr.alma.gtd.server.main.commande.Command;
import fr.alma.gtd.server.core.GTDServer;
import java.util.Date;
import java.util.List;
import java.util.concurrent.BlockingQueue;
// TODO: this class should implement all main methods.
......@@ -18,6 +20,256 @@ public class GTDServerWithReactor implements GTDServer {
private BlockingQueue<Command> arrivingCalls;
@Override
public void createAccount(String username, String password, String pseudo, CallBack<String> callback) {
}
@Override
public void createContext(IContext context, String identification, CallBack<IContext> callback) {
}
@Override
public void createIdea(IIdea idea, String identification, CallBack<IIdea> callback) {
}
@Override
public void createProject(IProject project, String identification, CallBack<IProject> callback) {
}
@Override
public void createTask(ITask task, String identification, CallBack<ITask> callback) {
}
@Override
public void createTag(ITag tag, String identification, CallBack<ITag> callback) {
}
@Override
public void disconnect(String identification, CallBack<String> callback) {
}
@Override
public void sendContext(IContext context, UpdateMode mode, String identification, CallBack<IContext> callback) {
}
@Override
public void sendIdea(IIdea idea, UpdateMode mode, String identification, CallBack<IIdea> callback) {
}
@Override
public void sendProject(IProject project, UpdateMode mode, String identification, CallBack<IProject> callback) {
}
@Override
public void sendTask(ITask task, UpdateMode mode, String identification, CallBack<ITask> callback) {
}
@Override
public void sendTag(ITag tag, UpdateMode mode, String identification, CallBack<ITag> callback) {
}
@Override
public void login(String username, String password, CallBack<String> callback) {
}
@Override
public void editPassword(String oldpPassword, String newPassword, String identification, CallBack<String> callback) {
}
@Override
public void editPseudo(String pseudo, String identification, CallBack<String> callback) {
}
@Override
public void deleteAccount(String username, String password, String identification, CallBack<String> callback) {
}
@Override
public void deleteContext(IContext context, String identification, CallBack<String> callback) {
}
@Override
public void deleteIdea(IIdea idea, String identification, CallBack<String> callback) {
}
@Override
public void deleteProject(IProject project, String identification, CallBack<String> callback) {
}
@Override
public void deleteTask(ITask task, String identification, CallBack<String> callback) {
}
@Override
public void deleteTag(ITag tag, String identification, CallBack<String> callback) {
}
@Override
public void downloadArchive(String identification, CallBack<List<IServerObject>> callback) {
}
@Override
public void downloadArchive(Date date, String identification, CallBack<List<IServerObject>> callback) {
}
@Override
public void downloadCalendar(String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadCalendar(Date date, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadContext(String identification, CallBack<List<IContext>> callback) {
}
@Override
public void downloadIdeas(String identification, CallBack<List<IIdea>> callback) {
}
@Override
public void downloadInbox(String identification, CallBack<List<IIdea>> callback) {
}
@Override
public void downloadInbox(Date date, String identification, CallBack<List<IIdea>> callback) {
}
@Override
public void downloadParticipants(String identification, CallBack<List<IParticipant>> callback) {
}
@Override
public void downloadTrashcan(String identification, CallBack<List<IServerObject>> callback) {
}
@Override
public void downloadTrashcan(Date date, String identification, CallBack<List<IServerObject>> callback) {
}
@Override
public void downloadNextTasks(String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadNextTasks(Date date, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadNextTasksByContext(IContext context, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadNextTasksByContext(Date date, IContext context, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadProjects(String identification, CallBack<List<IProject>> callback) {
}
@Override
public void downloadTaskByTag(ITag tag, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadTaskByTag(Date date, ITag tag, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadTasks(String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadTags(String identification, CallBack<List<ITag>> callback) {
}
@Override
public void downloadContexts(String username, String identification, CallBack<List<IContext>> callback) {
}
@Override
public void downloadIdeas(String username, String identification, CallBack<List<IIdea>> callback) {
}
@Override
public void downloadLog(String identification, CallBack<List<String>> callback) {
}
@Override
public void downloadLog(Date date, String identification, CallBack<List<String>> callback) {
}
@Override
public void downloadLog(String username, String identification, CallBack<List<String>> callback) {
}
@Override
public void downloadLogAdmin(String identification, CallBack<List<String>> callback) {
}
@Override
public void downloadProjects(String username, String identification, CallBack<List<IProject>> callback) {
}
@Override
public void downloadTasks(String username, String identification, CallBack<List<ITask>> callback) {
}
@Override
public void downloadTags(String username, String identification, CallBack<List<ITag>> callback) {
}
@Override
public void start() {
// TODO Start the thread that reads and processes the arriving calls
......
......@@ -42,7 +42,7 @@ public final class CommandDeleteTask implements Command {
* Constructor.
*
* @param i The user ID.
* @param t The task to remove.
* @param t The task to deleted.
* @param c The callback.
*/
public CommandDeleteTask(final String i, final ITask t, final CallBack<String> c) {
......
......@@ -45,7 +45,7 @@ public final class CommandFactory {
* @return The command to create an account.
*/
public Command getCommandCreateAccount(final String username, final String password, final String pseudo, final CallBack<String> callback) {
return new CommandCreateAccount(pseudo, pseudo, pseudo, callback);
return new CommandCreateAccount(username, password, pseudo, callback);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment