Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Certficate Xml Mappings #1177

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}