Skip to content

Commit

Permalink
💥 Creators are now concrete classes, without factories
Browse files Browse the repository at this point in the history
Signed-off-by: dseurotech <[email protected]>
  • Loading branch information
dseurotech committed Jan 17, 2025
1 parent 18153d2 commit 7d7c2cb
Show file tree
Hide file tree
Showing 255 changed files with 3,365 additions and 5,706 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private synchronized void refreshOrigins() {
final KapuaQuery accounts = new KapuaQuery((KapuaId) null);
AccountListResult accountListResult = KapuaSecurityUtils.doPrivileged(() -> accountService.query(accounts));
accountListResult.getItems().forEach(account -> {
EndpointInfoQuery endpointInfoQuery = endpointInfoFactory.newQuery(account.getId());
EndpointInfoQuery endpointInfoQuery = new EndpointInfoQuery(account.getId());
try {
EndpointInfoListResult endpointInfoListResult = KapuaSecurityUtils.doPrivileged(() -> endpointInfoService.query(endpointInfoQuery, EndpointInfo.ENDPOINT_TYPE_CORS));
endpointInfoListResult.getItems().forEach(endpointInfo -> newAllowedOrigins.put(endpointInfo.toStringURI(), account.getId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public abstract class AbstractKapuaConfigurableResourceLimitedService<
E extends KapuaEntity,
C extends KapuaEntityCreator<E>,
S extends KapuaEntityService<E, C>,
F extends KapuaEntityFactory<E, C>
F extends KapuaEntityFactory<E>
>
extends AbstractKapuaConfigurableService
implements KapuaEntityService<E, C> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,71 @@

import java.util.Properties;

import org.eclipse.kapua.KapuaException;
import javax.xml.bind.annotation.XmlElement;

import org.eclipse.kapua.model.KapuaEntityCreator;
import org.eclipse.kapua.model.KapuaUpdatableEntityCreator;
import org.eclipse.kapua.model.id.KapuaId;

/**
* Service configuration creator definition.
*
* @since 1.0
*/
public interface ServiceConfigCreator extends KapuaUpdatableEntityCreator<ServiceConfig> {
public class ServiceConfigCreator extends KapuaUpdatableEntityCreator<ServiceConfig> {

private static final long serialVersionUID = 7508550960304732465L;

@XmlElement(name = "pid")
private String pid;

@XmlElement(name = "configurations")
private Properties configurations;

public ServiceConfigCreator() {
}

public ServiceConfigCreator(KapuaId scopeId) {
super(scopeId);
}

public ServiceConfigCreator(KapuaEntityCreator<ServiceConfig> entityCreator) {
super(entityCreator);
}

/**
* Return service pid
*
* @return
*/
public String getPid();
public String getPid() {
return pid;
}

/**
* Set service pid
*
* @param pid
*/
public void setPid(String pid);
public void setPid(String pid) {
this.pid = pid;
}

/**
* Return service configurations
*
* @return
* @throws KapuaException
*/
public Properties getConfigurations() throws KapuaException;
public Properties getConfigurations() {
return this.configurations;
}

/**
* Set service configurations
*
* @param configurations
* @throws KapuaException
*/
public void setConfigurations(Properties configurations) throws KapuaException;
public void setConfigurations(Properties configurations) {
this.configurations = configurations;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import javax.xml.bind.annotation.XmlType;

import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.PropertiesUtils;
import org.eclipse.kapua.commons.model.AbstractKapuaUpdatableEntity;
import org.eclipse.kapua.commons.util.PropertiesUtils;
import org.eclipse.kapua.model.id.KapuaId;

@XmlRootElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.model.KapuaEntity;
import org.eclipse.kapua.model.KapuaEntityCreator;
import org.eclipse.kapua.model.KapuaEntityFactory;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.model.query.KapuaListResult;
Expand All @@ -25,10 +24,8 @@

public class UsedEntitiesCounterImpl<
E extends KapuaEntity,
C extends KapuaEntityCreator<E>,
L extends KapuaListResult<E>,
Q extends KapuaQuery,
F extends KapuaEntityFactory<E, C>
F extends KapuaEntityFactory<E>
> implements UsedEntitiesCounter {

private final F factory;
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7d7c2cb

Please sign in to comment.