com.safelayer.rap.json.model.revocation.JsonRevocationInformation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pki-connector-restapi Show documentation
Show all versions of pki-connector-restapi Show documentation
The PKI Connector RESTAPI is a library that helps developing new PKI Connectors for TrustedX
The newest version!
package com.safelayer.rap.json.model.revocation;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.safelayer.rap.api.model.RevocationInformation;
import com.safelayer.rap.api.model.revocation.RevocationPutCertificatesRequest;
import com.safelayer.rap.api.model.revocation.RevocationPutCertificatesRequest.ToBeRevoked;
/**
* @version $Revision$
*/
public class JsonRevocationInformation implements RevocationInformation {
@JsonProperty("labels")
private Map> signIdentitiesLabels;
@JsonCreator
public JsonRevocationInformation() {
}
public JsonRevocationInformation(RevocationPutCertificatesRequest other) throws Exception {
signIdentitiesLabels = new HashMap>();
for (Entry entry : other.getToBeRevoked().entrySet()) {
ToBeRevoked toBeRevoked = entry.getValue();
Set otherSignIdentityLabels = toBeRevoked.getSignIdentityLabels();
if (otherSignIdentityLabels != null && otherSignIdentityLabels.size() > 0) {
Set cloneLabels = new HashSet();
cloneLabels.addAll(otherSignIdentityLabels);
signIdentitiesLabels.put(entry.getKey(), cloneLabels);
}
}
}
@Override
@JsonIgnore
public Map> getSignIdentitiesLabels() {
return signIdentitiesLabels;
}
}