--- /dev/null
+/*******************************************************************************
+ * Copyright � Igor Barma, Alexandre Desoubeaux, Christian Martel, Eric Brun, Mathieu Amblard, Gwenael Gevet, Pierre Guillot, 2012
+ * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Alexandre Lefevre, Marc Salvat 2014-2016
+ * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Marc Salvat, Marc Suarez, Harifetra Ramamonjy 2017
+ *
+ * This file is part of the work and learning management system Pentila Nero.
+ *
+ * Pentila Nero is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ * - the GNU Lesser General Public License as published by the
+ * Free Software Foundation, either version 3 of the license,
+ * or (at your option) any later version.
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE-PROJECT.txt in the directory of this software
+ * distribution.
+ *
+ * Pentila Nero is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and the CeCILL-C and the GNU Lesser General Public License along with
+ * Pentila Nero. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ ******************************************************************************/
+/**
+ * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.pentila.entSavoie.mail.mailbox;
+
+import com.pentila.entSavoie.internalMessaging.model.Account;
+import com.pentila.entSavoie.internalMessaging.model.Folder;
+import com.liferay.mail.model.MailFile;
+import com.pentila.entSavoie.internalMessaging.model.Message;
+import com.liferay.mail.model.MessagesDisplay;
+import com.liferay.portal.kernel.exception.PortalException;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.model.User;
+import com.pentila.entSavoie.mail.util.AttachmentHandler;
+
+import java.io.IOException;
+
+import java.util.List;
+
+import javax.mail.internet.InternetAddress;
+
+/**
+ * @author Scott Lee
+ */
+public interface Mailbox {
+
+ public Account addAccount(
+ String address, String personalName, String protocol,
+ String incomingHostName, int incomingPort, boolean incomingSecure,
+ String outgoingHostName, int outgoingPort, boolean outgoingSecure,
+ String login, String password, boolean savePassword,
+ String signature, boolean useSignature, String folderPrefix,
+ boolean defaultSender)
+ throws PortalException, SystemException;
+
+ public Folder addFolder(String displayName)
+ throws PortalException, SystemException;
+
+ public Folder addFolder(String displayName, String parentPath)
+ throws PortalException, SystemException;
+
+ public void deleteAccount() throws PortalException, SystemException;
+
+ public void deleteAttachment(long attachmentId)
+ throws PortalException, SystemException;
+
+ public void deleteFolder(long folderId)
+ throws PortalException, SystemException;
+
+ public void deleteMessages(long folderId, long[] messageIds)
+ throws PortalException, SystemException;
+
+ public Account getAccount();
+
+ public AttachmentHandler getAttachment(long attachmentId)
+ throws IOException, PortalException, SystemException;
+
+ public Message getMessage(
+ long folderId, String keywords, int messageNumber,
+ String orderByField, String orderByType)
+ throws PortalException, SystemException;
+
+ public MessagesDisplay getMessagesDisplay(
+ long folderId, String keywords, int pageNumber, int messagesPerPage,
+ String orderByField, String orderByType)
+ throws PortalException, SystemException;
+
+ public User getUser();
+
+ public boolean hasNewMessages(long folderId)
+ throws PortalException, SystemException;
+
+ public int countNewMessages(long folderId)
+ throws PortalException, SystemException;
+
+ public void moveMessages(long folderId, long[] messageIds)
+ throws PortalException, SystemException;
+
+ public InternetAddress[] parseAddresses(String addresses)
+ throws PortalException;
+
+ public void renameFolder(long folderId, String displayName)
+ throws PortalException, SystemException;
+
+ public Message saveDraft(
+ long accountId, long messageId, String to, String cc, String bcc,
+ String subject, String body, List<MailFile> mailFiles)
+ throws PortalException, SystemException;
+
+ public void sendMessage(long accountId, long messageId)
+ throws PortalException, SystemException;
+
+ public void setAccount(Account account);
+
+ public void setUser(User user);
+
+ public void synchronize() throws PortalException, SystemException;
+
+ public void synchronizeFolder(long folderId)
+ throws PortalException, SystemException;
+
+ public void synchronizeMessage(long messageId)
+ throws PortalException, SystemException;
+
+ public void synchronizePage(
+ long folderId, int pageNumber, int messagesPerPage)
+ throws PortalException, SystemException;
+
+ public Account updateAccount(
+ long accountId, String personalName, String password,
+ boolean savePassword, String signature, boolean useSignature,
+ String folderPrefix, boolean defaultSender)
+ throws PortalException, SystemException;
+
+ public void updateFlags(
+ long folderId, long[] messageIds, int flag, boolean value)
+ throws PortalException, SystemException;
+
+ public void updateFolders() throws PortalException, SystemException;
+
+ public void updateFolders(
+ long inboxFolderId, long draftFolderId, long sentFolderId,
+ long trashFolderId)
+ throws PortalException, SystemException;
+
+ public void validateAccount(
+ String incomingHostName, int incomingPort, boolean incomingSecure,
+ String outgoingHostName, int outgoingPort, boolean outgoingSecure,
+ String login, String password)
+ throws PortalException, SystemException;
+
+}