Commit 089bcc75 authored by ducanh-le's avatar ducanh-le
Browse files

Adding methods and instantiated the MainRMIServer. Ref #21

parent 6dbd5056
......@@ -11,8 +11,6 @@ import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
// TODO: this class should implement all main methods.
/**
* Facade for the Main GTD Server Component.
* <p>
......@@ -180,9 +178,9 @@ public class GTDServerWithReactor implements GTDServer {
}
@Override
public void editPassword(String oldpPassword, String newPassword, String identification, CallBack<String> callback) throws Exception {
public void editPassword(String oldPassword, String newPassword, String identification, CallBack<String> callback) throws Exception {
if (acceptor.accept(identification)) {
final Command cmd = commandFactory.getCommandEditPassword(oldpPassword, newPassword, callback);
final Command cmd = commandFactory.getCommandEditPassword(oldPassword, newPassword, callback);
arrivingCalls.add(cmd);
} else {
throw new Exception(invalidIdentification);
......
package fr.alma.gtd.server.rmi;
import fr.alma.gtd.server.core.CallBack;
import fr.alma.gtd.server.core.GTDServer;
import fr.alma.gtd.server.core.IIdea;
import fr.alma.gtd.server.core.*;
import fr.alma.gtd.server.main.GTDServerWithReactor;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.List;
// TODO: This class should implement all the methods from `ServeurRMI`
public class MainRMIServer {
public class MainRMIServer implements ServeurRMI{
// TODO: find a way to instantiate this field
private static MainRMIServer instance = new MainRMIServer();
private GTDServer server;
public void creerIdee(final IIdea idee, final String identification, final CallBack<IIdea> callback) throws RemoteException {
// FIXME: This method (as all implemented methods) should delegate the behavior to the gtd-server-main.
private MainRMIServer() {
server = GTDServerWithReactor.getInstance();
}
@Override
public void createIdea(IIdea idee, String identification, CallBack<IIdea> callback) throws RemoteException {
}
@Override
public void sendIdea(IIdea idee, UpdateMode mode, String identification, CallBack<IIdea> callback) throws RemoteException {
}
@Override
public void deleteIdea(IIdea idee, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void createTask(ITask tache, String identification, CallBack<ITask> callback) throws RemoteException {
}
@Override
public void sendTask(ITask tache, UpdateMode mode, String identification, CallBack<ITask> callback) throws RemoteException {
}
@Override
public void deleteTask(ITask tache, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void createProject(IProject projet, String identification, CallBack<IProject> callback) throws RemoteException {
}
@Override
public void sendProject(IProject projet, UpdateMode mode, String identification, CallBack<IProject> callback) throws RemoteException {
}
@Override
public void deleteProject(IProject projet, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void createContext(IContext contexte, String identification, CallBack<IContext> callback) throws RemoteException {
}
@Override
public void sendContext(IContext contexte, UpdateMode mode, String identification, CallBack<IContext> callback) throws RemoteException {
}
@Override
public void deleteContext(IContext contexte, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void createTag(ITag tag, String identification, CallBack<ITag> callback) throws RemoteException {
}
@Override
public void sendTag(ITag tag, UpdateMode mode, String identification, CallBack<ITag> callback) throws RemoteException {
}
@Override
public void deleteTag(ITag tag, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void downloadInbox(String identification, CallBack<List<IIdea>> callback) throws RemoteException {
}
@Override
public void downloadInbox(Date date, String identification, CallBack<List<IIdea>> callback) throws RemoteException {
}
@Override
public void downloadTrashcan(String identification, CallBack<List<IServerObject>> callback) throws RemoteException {
}
@Override
public void downloadTrashcan(Date date, String identification, CallBack<List<IServerObject>> callback) throws RemoteException {
}
@Override
public void downloadArchive(String identification, CallBack<List<IServerObject>> callback) throws RemoteException {
}
@Override
public void downloadArchive(Date date, String identification, CallBack<List<IServerObject>> callback) throws RemoteException {
}
@Override
public void downloadNextTasks(String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadNextTasks(Date date, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadNextTasksByContext(IContext contexte, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadNextTasksByContext(Date date, IContext contexte, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadCalendar(String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadCalendar(Date date, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadTaskByTag(ITag tag, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadTaskByTag(Date date, ITag tag, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadTags(String identification, CallBack<List<ITag>> callback) throws RemoteException {
}
@Override
public void downloadContext(String identification, CallBack<List<IContext>> callback) throws RemoteException {
}
@Override
public void downloadParticipants(String identification, CallBack<List<IParticipant>> callback) throws RemoteException {
}
@Override
public void downloadTasks(String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadProjects(String identification, CallBack<List<IProject>> callback) throws RemoteException {
}
@Override
public void downloadIdeas(String identification, CallBack<List<IIdea>> callback) throws RemoteException {
}
@Override
public void createAccount(String username, String password, String pseudo, CallBack<String> callback) throws RemoteException {
}
@Override
public void deleteAccount(String username, String password, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void editPseudo(String pseudo, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void editPassword(String oldPassword, String newPassword, String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void login(String username, String password, CallBack<String> callback) throws RemoteException {
}
@Override
public void disconnect(String identification, CallBack<String> callback) throws RemoteException {
}
@Override
public void downloadLog(String identification, CallBack<List<String>> callback) throws RemoteException {
}
@Override
public void downloadLog(Date date, String identification, CallBack<List<String>> callback) throws RemoteException {
}
@Override
public void downloadLogAdmin(String identification, CallBack<List<String>> callback) throws RemoteException {
}
@Override
public void downloadIdeas(String username, String identification, CallBack<List<IIdea>> callback) throws RemoteException {
}
@Override
public void downloadTasks(String username, String identification, CallBack<List<ITask>> callback) throws RemoteException {
}
@Override
public void downloadProjects(String username, String identification, CallBack<List<IProject>> callback) throws RemoteException {
}
@Override
public void downloadTags(String username, String identification, CallBack<List<ITag>> callback) throws RemoteException {
}
@Override
public void downloadContexts(String username, String identification, CallBack<List<IContext>> callback) throws RemoteException {
}
@Override
public void downloadLog(String username, String identification, CallBack<List<String>> callback) throws RemoteException {
}
}
......@@ -538,13 +538,13 @@ public interface ServeurRMI extends Remote {
* La methode onFailure du callback sera appelee si le mot de passe
* est invalide, ou si le nouveau mot de passe ne respecte pas les
* criteres de validite d'un mot de passe.
* @param oldpPassword L'ancien mot de passe.
* @param oldPassword L'ancien mot de passe.
* @param newPassword Le nouveau mot de passe.
* @param identification Le jeton d'identification.
* @param callback Le callback.
* @throws RemoteException En cas de probleme avec RMI.
*/
void editPassword(final String oldpPassword, final String newPassword, final String identification, final CallBack<String> callback) throws RemoteException;
void editPassword(final String oldPassword, final String newPassword, final String identification, final CallBack<String> callback) throws RemoteException;
/**
* Permet de s'identifier sur le serveur.
......
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