Skip to content

Commit

Permalink
ZCS-13344: Support for mailRecall soap API
Browse files Browse the repository at this point in the history
  • Loading branch information
manjeetbehera authored and shubhamCS03 committed Jul 11, 2024
1 parent 37f8bb7 commit 00a5d4d
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ public static ServiceException FAILURE(String message, Throwable cause) {
public static ServiceException LICENSE_ERROR(String message, Throwable cause) {
return new ServiceException("license error: "+message, LICENSE_ERROR, RECEIVERS_FAULT, cause);
}

public static ServiceException ERROR_MESSAGE(String str, Throwable cause){
return new ServiceException("error: " + str, null, SENDERS_FAULT, cause);
}

public static ServiceException ERROR_WHILE_PARSING_UPLOAD(String message, Throwable cause) {
return new ServiceException(
Expand Down
7 changes: 7 additions & 0 deletions common/src/java/com/zimbra/common/soap/AccountConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,13 @@ public class AccountConstants {
public static final String E_SKIN_FAVICON = "zimbraSkinFavicon";
public static final String E_HOSTNAME = "hostname";

// MailRecall Uses
public static final String E_MAIL_RECALL_REQUEST = "MailRecallRequest";
public static final String E_MAIL_RECALL_RESPONSE = "MailRecallResponse";
public static final QName MAIL_RECALL_REQUEST = QName.get(E_MAIL_RECALL_REQUEST, NAMESPACE);
public static final QName MAIL_RECALL_RESPONSE = QName.get(E_MAIL_RECALL_RESPONSE, NAMESPACE);
public static final String ITEM_ID = "itemId";

// 2FA attributes
public static final String E_TWO_FACTOR_AUTH_METHOD_ALLOWED = "zimbraTwoFactorAuthMethodAllowed";
public static final String E_TWO_FACTOR_AUTH_METHOD_ENABLED = "zimbraTwoFactorAuthMethodEnabled";
Expand Down
9 changes: 4 additions & 5 deletions soap/src/java/com/zimbra/soap/JaxbUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;

import com.zimbra.soap.admin.message.GenerateSecretKeyRequest;
import com.zimbra.soap.admin.message.GenerateSecretKeyResponse;
import org.dom4j.Document;
import org.dom4j.Namespace;
import org.dom4j.io.DocumentResult;
Expand Down Expand Up @@ -1175,8 +1173,9 @@ public final class JaxbUtil {
com.zimbra.soap.admin.message.EditS3BucketConfigRequest.class,
com.zimbra.soap.admin.message.EditS3BucketConfigResponse.class,
com.zimbra.soap.admin.message.GenerateSecretKeyRequest.class,
com.zimbra.soap.admin.message.GenerateSecretKeyResponse.class

com.zimbra.soap.admin.message.GenerateSecretKeyResponse.class,
com.zimbra.soap.account.message.MailRecallRequest.class,
com.zimbra.soap.account.message.MailRecallResponse.class
};

try {
Expand Down Expand Up @@ -1686,7 +1685,7 @@ public static ModifyItemNotification getModifiedItemSOAP(BaseItemInfo mod, int r
ImapMessageInfo messageInfo = new ImapMessageInfo(mod.getIdInMailbox(), mod.getImapUid(), mod.getMailItemType().toString(), mod.getFlagBitmask(), tags);
return new ModifyNotification.ModifyItemNotification(messageInfo, reason);
}

public static DeleteItemNotification getDeletedItemSOAP(int itemId, String type) throws ServiceException {
return new DeleteItemNotification(itemId, type);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2023 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program 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 General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/

package com.zimbra.soap.account.message;

import com.zimbra.common.soap.AccountConstants;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = AccountConstants.E_MAIL_RECALL_REQUEST)
public class MailRecallRequest {
@XmlAttribute(name = AccountConstants.ITEM_ID /* more */, required = true)
private int itemId;

public int getItemId() {
return itemId;
}

public void setItemId(int itemId) {
this.itemId = itemId;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2023 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program 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 General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/

package com.zimbra.soap.account.message;

import com.zimbra.common.soap.AccountConstants;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = AccountConstants.E_MAIL_RECALL_RESPONSE)
public class MailRecallResponse {
}

0 comments on commit 00a5d4d

Please sign in to comment.