Skip to content

Commit

Permalink
Renamed Certificate to PrivateCertificate
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
  • Loading branch information
Claudio Mezzasalma authored and Coduz committed Jul 8, 2019
1 parent 1e5c8c6 commit 438ffa2
Show file tree
Hide file tree
Showing 23 changed files with 119 additions and 118 deletions.
4 changes: 2 additions & 2 deletions assembly/broker/configurations/locator.xml
Expand Up @@ -41,8 +41,8 @@
<api>org.eclipse.kapua.service.authorization.role.RolePermissionFactory</api>
<api>org.eclipse.kapua.service.authorization.role.RolePermissionService</api>

<api>org.eclipse.kapua.service.certificate.CertificateService</api>
<api>org.eclipse.kapua.service.certificate.CertificateFactory</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateService</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateFactory</api>

<api>org.eclipse.kapua.service.datastore.MessageStoreService</api>
<api>org.eclipse.kapua.service.datastore.ClientInfoRegistryService</api>
Expand Down
4 changes: 2 additions & 2 deletions broker-core/src/test/resources/locator.xml
Expand Up @@ -41,8 +41,8 @@
<api>org.eclipse.kapua.service.authorization.role.RolePermissionFactory</api>
<api>org.eclipse.kapua.service.authorization.role.RolePermissionService</api>

<api>org.eclipse.kapua.service.certificate.CertificateService</api>
<api>org.eclipse.kapua.service.certificate.CertificateFactory</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateService</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateFactory</api>

<!-- datastore -->
<api>org.eclipse.kapua.service.datastore.MessageStoreService</api>
Expand Down
4 changes: 2 additions & 2 deletions console/web/src/main/resources/locator.xml
Expand Up @@ -42,8 +42,8 @@
<api>org.eclipse.kapua.service.authorization.role.RolePermissionFactory</api>
<api>org.eclipse.kapua.service.authorization.role.RolePermissionService</api>

<api>org.eclipse.kapua.service.certificate.CertificateService</api>
<api>org.eclipse.kapua.service.certificate.CertificateFactory</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateService</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateFactory</api>

<api>org.eclipse.kapua.service.datastore.MessageStoreService</api>
<api>org.eclipse.kapua.service.datastore.ClientInfoRegistryService</api>
Expand Down
4 changes: 2 additions & 2 deletions qa/integration/src/test/resources/locator.xml
Expand Up @@ -44,8 +44,8 @@
<api>org.eclipse.kapua.service.authorization.role.RolePermissionFactory</api>
<api>org.eclipse.kapua.service.authorization.role.RolePermissionService</api>

<api>org.eclipse.kapua.service.certificate.CertificateService</api>
<api>org.eclipse.kapua.service.certificate.CertificateFactory</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateService</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateFactory</api>

<!-- datastore -->
<api>org.eclipse.kapua.service.datastore.MessageStoreService</api>
Expand Down
4 changes: 2 additions & 2 deletions rest-api/web/src/main/resources/locator.xml
Expand Up @@ -40,8 +40,8 @@
<api>org.eclipse.kapua.service.authorization.role.RolePermissionFactory</api>
<api>org.eclipse.kapua.service.authorization.role.RolePermissionService</api>

<api>org.eclipse.kapua.service.certificate.CertificateService</api>
<api>org.eclipse.kapua.service.certificate.CertificateFactory</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateService</api>
<api>org.eclipse.kapua.service.certificate.PrivateCertificateFactory</api>

<api>org.eclipse.kapua.service.datastore.model.StorableIdFactory</api>

Expand Down
Expand Up @@ -20,8 +20,8 @@
import java.util.Set;

/**
* {@link Certificate} domain.<br>
* Used to describe the {@link Certificate} {@link Domain} in the {@link CertificateService}.
* {@link PrivateCertificate} domain.<br>
* Used to describe the {@link PrivateCertificate} {@link Domain} in the {@link PrivateCertificateService} and {@link PrivateCertificateService}.
*
* @since 1.0.0
*/
Expand Down
Expand Up @@ -23,7 +23,7 @@
import java.util.Set;

/**
* {@link CertificateGenerator} encapsulates all the information needed to generate a new Certificate in the system.
* {@link CertificateGenerator} encapsulates all the information needed to generate a new PrivateCertificate in the system.
*
* @since 1.0
*/
Expand Down
Expand Up @@ -23,7 +23,7 @@
@XmlRootElement(name = "query")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newQuery")
public interface CertificateQuery extends KapuaQuery<Certificate> {
public interface CertificateQuery extends KapuaQuery<PrivateCertificate> {

@XmlElement(name = "includeInherited")
Boolean getIncludeInherited();
Expand Down
Expand Up @@ -37,10 +37,10 @@
*/
@XmlRootElement(name = "certificate")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newCertificate")
public interface Certificate extends KapuaNamedEntity {
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newPrivateCertificate")
public interface PrivateCertificate extends KapuaNamedEntity {

String TYPE = "certificate";
String TYPE = "privateCertificate";

@Override
default String getType() {
Expand Down
Expand Up @@ -27,14 +27,14 @@
import java.util.Set;

/**
* {@link CertificateCreator} {@link org.eclipse.kapua.model.KapuaEntityCreator} definition
* PrivateCertificateCreator encapsulates all the information needed to create a new PrivateCertificate in the system.
*
* @since 1.0.0
*/
@XmlRootElement(name = "certificateCreator")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newCreator")
public interface CertificateCreator extends KapuaNamedEntityCreator<Certificate> {
public interface PrivateCertificateCreator extends KapuaNamedEntityCreator<PrivateCertificate> {

@XmlElement(name = "certificate")
String getCertificate();
Expand Down
Expand Up @@ -14,12 +14,12 @@
import org.eclipse.kapua.model.KapuaEntityFactory;

/**
* {@link CertificateFactory} definition.
* {@link PrivateCertificateFactory} definition.
*
* @see org.eclipse.kapua.model.KapuaEntityFactory
* @since 1.0.0
*/
public interface CertificateFactory extends KapuaEntityFactory<Certificate, CertificateCreator, CertificateQuery, CertificateListResult> {
public interface PrivateCertificateFactory extends KapuaEntityFactory<PrivateCertificate, PrivateCertificateCreator, CertificateQuery, PrivateCertificateListResult> {

/**
* Instantiates a new {@link CertificateUsage}.
Expand Down
Expand Up @@ -22,6 +22,6 @@
@XmlRootElement(name = "certificates")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(factoryClass = CertificateXmlRegistry.class, factoryMethod = "newListResult")
public interface CertificateListResult extends KapuaListResult<Certificate> {
public interface PrivateCertificateListResult extends KapuaListResult<PrivateCertificate> {

}
Expand Up @@ -21,29 +21,29 @@

import java.util.List;

public interface CertificateService extends KapuaEntityService<Certificate, CertificateCreator>,
KapuaNamedEntityService<Certificate>,
KapuaUpdatableEntityService<Certificate>,
public interface PrivateCertificateService extends KapuaEntityService<PrivateCertificate, PrivateCertificateCreator>,
KapuaNamedEntityService<PrivateCertificate>,
KapuaUpdatableEntityService<PrivateCertificate>,
KapuaConfigurableService {

CertificateDomain CERTIFICATE_DOMAIN = new CertificateDomain();

@Override
Certificate create(CertificateCreator var1) throws KapuaException;
PrivateCertificate create(PrivateCertificateCreator var1) throws KapuaException;

@Override
Certificate update(Certificate var1) throws KapuaException;
PrivateCertificate update(PrivateCertificate var1) throws KapuaException;

@Override
Certificate find(KapuaId var1, KapuaId var2) throws KapuaException;
PrivateCertificate find(KapuaId var1, KapuaId var2) throws KapuaException;

@Override
Certificate findByName(String var1) throws KapuaException;
PrivateCertificate findByName(String var1) throws KapuaException;

@Override
CertificateListResult query(KapuaQuery<Certificate> query) throws KapuaException;
PrivateCertificateListResult query(KapuaQuery<PrivateCertificate> query) throws KapuaException;

Certificate generate(CertificateGenerator generator) throws KapuaException;
PrivateCertificate generate(CertificateGenerator generator) throws KapuaException;

List<Certificate> findAncestorsCertificates(KapuaId scopeId, CertificateUsage usage) throws KapuaException;
List<PrivateCertificate> findAncestorsCertificates(KapuaId scopeId, CertificateUsage usage) throws KapuaException;
}
Expand Up @@ -12,10 +12,10 @@
package org.eclipse.kapua.service.certificate.xml;

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.PrivateCertificate;
import org.eclipse.kapua.service.certificate.PrivateCertificateCreator;
import org.eclipse.kapua.service.certificate.PrivateCertificateFactory;
import org.eclipse.kapua.service.certificate.PrivateCertificateListResult;
import org.eclipse.kapua.service.certificate.CertificateQuery;
import org.eclipse.kapua.service.certificate.CertificateUsage;
import org.eclipse.kapua.service.certificate.CertificateGenerator;
Expand All @@ -26,21 +26,21 @@
public class CertificateXmlRegistry {

private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();
private static final CertificateFactory FACTORY = LOCATOR.getFactory(CertificateFactory.class);
private static final PrivateCertificateFactory FACTORY = LOCATOR.getFactory(PrivateCertificateFactory.class);

public Certificate newCertificate() {
public PrivateCertificate newCertificate() {
return FACTORY.newEntity(null);
}

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

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

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

Expand Down
Expand Up @@ -13,10 +13,10 @@

import org.eclipse.kapua.commons.model.query.AbstractKapuaQuery;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.certificate.Certificate;
import org.eclipse.kapua.service.certificate.PrivateCertificate;
import org.eclipse.kapua.service.certificate.CertificateQuery;

public class CertificateQueryImpl extends AbstractKapuaQuery<Certificate> implements CertificateQuery {
public class CertificateQueryImpl extends AbstractKapuaQuery<PrivateCertificate> implements CertificateQuery {

private Boolean includeInherited = Boolean.FALSE;

Expand Down
Expand Up @@ -14,31 +14,31 @@
import org.eclipse.kapua.KapuaEntityCloneException;
import org.eclipse.kapua.locator.KapuaProvider;
import org.eclipse.kapua.model.id.KapuaId;
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.PrivateCertificate;
import org.eclipse.kapua.service.certificate.PrivateCertificateCreator;
import org.eclipse.kapua.service.certificate.PrivateCertificateFactory;
import org.eclipse.kapua.service.certificate.CertificateGenerator;
import org.eclipse.kapua.service.certificate.CertificateListResult;
import org.eclipse.kapua.service.certificate.PrivateCertificateListResult;
import org.eclipse.kapua.service.certificate.CertificateQuery;
import org.eclipse.kapua.service.certificate.CertificateUsage;
import org.eclipse.kapua.service.certificate.KeyUsage;
import org.eclipse.kapua.service.certificate.KeyUsageSetting;

/**
* {@link CertificateFactory} implementation.
* {@link PrivateCertificateFactory} implementation.
*
* @since 1.0.0
*/
@KapuaProvider
public class CertificateFactoryImpl implements CertificateFactory {
public class PrivateCertificateFactoryImpl implements PrivateCertificateFactory {

@Override
public Certificate newEntity(KapuaId scopeId) {
return new CertificateImpl(scopeId);
public PrivateCertificate newEntity(KapuaId scopeId) {
return new PrivateCertificateImpl(scopeId);
}

@Override
public CertificateCreator newCreator(KapuaId scopeId) {
public PrivateCertificateCreator newCreator(KapuaId scopeId) {
throw new UnsupportedOperationException();
}

Expand All @@ -48,8 +48,8 @@ public CertificateQuery newQuery(KapuaId scopeId) {
}

@Override
public CertificateListResult newListResult() {
return new CertificateListResultImpl();
public PrivateCertificateListResult newListResult() {
return new PrivateCertificateListResultImpl();
}

@Override
Expand All @@ -74,11 +74,11 @@ public CertificateGenerator newCertificateGenerator() {
}

@Override
public Certificate clone(Certificate certificate) {
public PrivateCertificate clone(PrivateCertificate certificate) {
try {
return new CertificateImpl(certificate);
return new PrivateCertificateImpl(certificate);
} catch (Exception e) {
throw new KapuaEntityCloneException(e, Certificate.TYPE, certificate);
throw new KapuaEntityCloneException(e, PrivateCertificate.TYPE, certificate);
}
}
}
Expand Up @@ -14,7 +14,7 @@
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.model.AbstractKapuaNamedEntity;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.certificate.Certificate;
import org.eclipse.kapua.service.certificate.PrivateCertificate;
import org.eclipse.kapua.service.certificate.CertificateStatus;
import org.eclipse.kapua.service.certificate.CertificateUsage;
import org.eclipse.kapua.service.certificate.KeyUsageSetting;
Expand All @@ -24,24 +24,24 @@
import java.util.Set;

/**
* {@link Certificate} implementation
* {@link PrivateCertificate} implementation
*
* @since 1.0.0
*/
public class CertificateImpl extends AbstractKapuaNamedEntity implements Certificate {
public class PrivateCertificateImpl extends AbstractKapuaNamedEntity implements PrivateCertificate {

private String certificate;
private String privateKey;
private String password;
private Set<KeyUsageSettingImpl> keyUsageSettings;
private Set<CertificateUsageImpl> certificateUsages;

public CertificateImpl(KapuaId scopeId) {
public PrivateCertificateImpl(KapuaId scopeId) {
super(scopeId);
}


public CertificateImpl(Certificate certificate) throws KapuaException {
public PrivateCertificateImpl(PrivateCertificate certificate) throws KapuaException {
throw new UnsupportedOperationException();
}

Expand Down
Expand Up @@ -12,15 +12,15 @@
package org.eclipse.kapua.service.certificate.internal;

import org.eclipse.kapua.commons.model.query.KapuaListResultImpl;
import org.eclipse.kapua.service.certificate.Certificate;
import org.eclipse.kapua.service.certificate.CertificateListResult;
import org.eclipse.kapua.service.certificate.PrivateCertificate;
import org.eclipse.kapua.service.certificate.PrivateCertificateListResult;

/**
* User result list definition.
*
* @since 1.0
*/

public class CertificateListResultImpl extends KapuaListResultImpl<Certificate> implements CertificateListResult {
public class PrivateCertificateListResultImpl extends KapuaListResultImpl<PrivateCertificate> implements PrivateCertificateListResult {

}

0 comments on commit 438ffa2

Please sign in to comment.