-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [CO-486] Add Domain SSL certificate info SOAP API Endpoint (#136)
* feat: [CO-486] add GetDomainCertRequest, GetDomainCertResponse, modify CertInfo * feat: [CO-486] add constants to CertMgrConstants, format request and response * feat: [CO-486] add setters in CertInfo * feat: [CO-486] code format * feat: [CO-486] changed domain name for domain id in GetDomainCertRequest
- Loading branch information
1 parent
584ae51
commit fb303c5
Showing
5 changed files
with
146 additions
and
16 deletions.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
soap/src/main/java/com/zimbra/soap/admin/message/GetDomainCertRequest.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,54 @@ | ||
package com.zimbra.soap.admin.message; | ||
|
||
import com.google.common.base.MoreObjects; | ||
import com.zimbra.common.soap.AdminConstants; | ||
import com.zimbra.common.soap.CertMgrConstants; | ||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/** | ||
* @zm-api-command-auth-required true | ||
* @zm-api-command-admin-auth-required true | ||
* @zm-api-command-description Get Domain Certificate <br> | ||
* Gets the certificate of a requested domain. | ||
*/ | ||
@XmlAccessorType(XmlAccessType.NONE) | ||
@XmlRootElement(name = CertMgrConstants.E_GET_DOMAIN_CERT_REQUEST) | ||
public class GetDomainCertRequest { | ||
|
||
/** | ||
* @zm-api-field-tag domain id | ||
* @zm-api-field-description a domain id whose cert is to be got | ||
*/ | ||
@XmlAttribute(name = AdminConstants.A_DOMAIN /* domain */, required = true) | ||
private String domain; | ||
|
||
/** no-argument constructor wanted by JAXB */ | ||
@SuppressWarnings("unused") | ||
private GetDomainCertRequest() { | ||
this(null); | ||
} | ||
|
||
public GetDomainCertRequest(String domain) { | ||
this.domain = domain; | ||
} | ||
|
||
public void setDomain(String domain) { | ||
this.domain = domain; | ||
} | ||
|
||
public String getDomain() { | ||
return domain; | ||
} | ||
|
||
public MoreObjects.ToStringHelper addToStringInfo(MoreObjects.ToStringHelper helper) { | ||
return helper.add("domain", domain); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return addToStringInfo(MoreObjects.toStringHelper(this)).toString(); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
soap/src/main/java/com/zimbra/soap/admin/message/GetDomainCertResponse.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,60 @@ | ||
package com.zimbra.soap.admin.message; | ||
|
||
import com.google.common.base.MoreObjects; | ||
import com.zimbra.common.soap.AdminConstants; | ||
import com.zimbra.common.soap.CertMgrConstants; | ||
import com.zimbra.soap.admin.type.CertInfo; | ||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlAccessorType(XmlAccessType.NONE) | ||
@XmlRootElement(name = CertMgrConstants.E_GET_DOMAIN_CERT_RESPONSE) | ||
@XmlType(propOrder = {}) | ||
public class GetDomainCertResponse { | ||
|
||
/** | ||
* @zm-api-field-description Certificate information | ||
*/ | ||
@XmlElement(name = CertMgrConstants.E_cert /* cert */, required = false) | ||
private CertInfo cert; | ||
|
||
/** | ||
* @zm-api-field-tag domain-name | ||
* @zm-api-field-description Domain name | ||
*/ | ||
@XmlAttribute(name = AdminConstants.A_DOMAIN /* domain */, required = false) | ||
private String domain; | ||
|
||
public GetDomainCertResponse() {} | ||
|
||
public void setCert(CertInfo cert) { | ||
this.cert = cert; | ||
} | ||
|
||
public void setDomain(String domain) { | ||
this.domain = domain; | ||
} | ||
|
||
public CertInfo getCert() { | ||
return cert; | ||
} | ||
|
||
public String getDomain() { | ||
return domain; | ||
} | ||
|
||
public MoreObjects.ToStringHelper addToStringInfo(MoreObjects.ToStringHelper helper) { | ||
return helper | ||
.add(AdminConstants.A_DOMAIN, domain) | ||
.add(CertMgrConstants.E_cert, cert); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return addToStringInfo(MoreObjects.toStringHelper(this)).toString(); | ||
} | ||
} |
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