Skip to content

Commit

Permalink
Fixed Certficate Xml Mappings
Browse files Browse the repository at this point in the history
Signed-off-by: coduz <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Dec 12, 2017
1 parent 7dd2dec commit babeba1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlInlineBinaryData;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
Expand All @@ -42,7 +44,9 @@
"privateKey",
"ca",
"caId",
"password"
"password",
"certificateUsages",
"keyUsageSettings"
}, factoryClass = CertificateXmlRegistry.class, factoryMethod = "newCertificate")
public interface Certificate extends KapuaNamedEntity {

Expand Down Expand Up @@ -91,9 +95,11 @@ default String getType() {

public void setStatus(CertificateStatus status);

@XmlInlineBinaryData
@XmlElement(name = "signature")
public byte[] getSignature();

public void setSignature(byte[] digest);
public void setSignature(byte[] signature);

public String getPrivateKey();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.eclipse.kapua.model.KapuaNamedEntityCreator;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.model.id.KapuaIdAdapter;
import org.eclipse.kapua.service.certificate.xml.CertificateXmlRegistry;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand All @@ -35,8 +36,9 @@
"status",
"privateKey",
"caId",
"password"
})
"password",
"certificateUsages"
}, factoryClass = CertificateXmlRegistry.class, factoryMethod = "newCreator")
public interface CertificateCreator extends KapuaNamedEntityCreator<Certificate> {

String getCertificate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
import org.eclipse.kapua.model.query.KapuaListResult;
import org.eclipse.kapua.service.certificate.xml.CertificateXmlRegistry;

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

@XmlRootElement(name = "certificates")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newListResult")
public interface CertificateListResult extends KapuaListResult<Certificate> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
*******************************************************************************/
package org.eclipse.kapua.service.certificate;

import org.eclipse.kapua.service.certificate.xml.CertificateXmlRegistry;

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

@XmlRootElement(name = "certificateUsage")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(
factoryClass = CertificateXmlRegistry.class, //
factoryMethod = "newCertificateUsage")
public interface CertificateUsage {

public String getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

import org.eclipse.kapua.locator.KapuaLocator;
import org.eclipse.kapua.service.certificate.Certificate;
import org.eclipse.kapua.service.certificate.CertificateCreator;
import org.eclipse.kapua.service.certificate.CertificateFactory;
import org.eclipse.kapua.service.certificate.CertificateListResult;
import org.eclipse.kapua.service.certificate.CertificateQuery;
import org.eclipse.kapua.service.certificate.CertificateUsage;

import javax.xml.bind.annotation.XmlRegistry;

Expand All @@ -29,11 +31,19 @@ public Certificate newCertificate() {
return FACTORY.newEntity(null);
}

public CertificateCreator newCreator() {
return FACTORY.newCreator(null);
}

public CertificateQuery newQuery() {
return FACTORY.newQuery(null);
}

public CertificateListResult newListResult() {
return FACTORY.newListResult();
}
}

public CertificateUsage newCertificateUsage() {
return FACTORY.newCertificateUsage(null);
}
}

0 comments on commit babeba1

Please sign in to comment.