-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZCS-11861 SOAP API: Need soap API to get the list of Available StoreM…
…anagers for the volume
- Loading branch information
Showing
9 changed files
with
158 additions
and
9 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
soap/src/java/com/zimbra/soap/admin/message/GetAllStoreManagersRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2022 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.admin.message; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
import com.zimbra.common.soap.AdminConstants; | ||
|
||
/** | ||
* @zm-api-command-auth-required true | ||
* @zm-api-command-admin-auth-required true | ||
* @zm-api-command-description Get all store managers | ||
*/ | ||
@XmlRootElement(name=AdminConstants.E_GET_ALL_STORE_MANAGERS_REQUEST) | ||
public class GetAllStoreManagersRequest { | ||
|
||
public GetAllStoreManagersRequest() { | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
soap/src/java/com/zimbra/soap/admin/message/GetAllStoreManagersResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2022 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.admin.message; | ||
|
||
import com.google.common.collect.Lists; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
import com.zimbra.common.soap.AdminConstants; | ||
|
||
@XmlAccessorType(XmlAccessType.NONE) | ||
@XmlRootElement(name=AdminConstants.E_GET_ALL_STORE_MANAGERS_RESPONSE) | ||
public final class GetAllStoreManagersResponse { | ||
|
||
/** | ||
* @zm-api-field-description Information about volumes | ||
*/ | ||
@XmlElement(name=AdminConstants.E_STORE_MANAGER, required=true) | ||
private final Set<String> smList = new HashSet<String>(); | ||
|
||
|
||
public void setSMList(Set<String> list) { | ||
smList.clear(); | ||
if (list != null) { | ||
smList.addAll(list); | ||
} | ||
} | ||
|
||
public void addStoreManager(String smName) { | ||
smList.add(smName); | ||
} | ||
|
||
public Set<String> getSMList() { | ||
return smList; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
store/src/java/com/zimbra/cs/service/admin/GetAllStoreManagers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2022 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.cs.service.admin; | ||
|
||
import com.zimbra.common.service.ServiceException; | ||
import com.zimbra.common.soap.Element; | ||
import com.zimbra.cs.store.StoreManager; | ||
import com.zimbra.soap.admin.message.GetAllStoreManagersRequest; | ||
import com.zimbra.soap.admin.message.GetAllStoreManagersResponse; | ||
import com.zimbra.soap.JaxbUtil; | ||
import com.zimbra.soap.ZimbraSoapContext; | ||
import java.util.Map; | ||
|
||
public final class GetAllStoreManagers extends AdminDocumentHandler { | ||
|
||
@Override | ||
public Element handle(Element request, Map<String, Object> context) throws ServiceException { | ||
ZimbraSoapContext zsc = getZimbraSoapContext(context); | ||
GetAllStoreManagersRequest req = zsc.elementToJaxb(request); | ||
GetAllStoreManagersResponse resp = new GetAllStoreManagersResponse(); | ||
resp.setSMList(StoreManager.getSMList()); | ||
return zsc.jaxbToElement(resp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters