Skip to content

Commit

Permalink
More services should not be configurable
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 Dec 11, 2020
1 parent 2bd3f0f commit bde0c21
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

import org.eclipse.kapua.service.KapuaEntityService;
import org.eclipse.kapua.service.KapuaNamedEntityService;
import org.eclipse.kapua.service.config.KapuaConfigurableService;

public interface CollisionEntityService extends KapuaEntityService<CollisionEntity, CollisionEntityCreator>,
KapuaNamedEntityService<CollisionEntity>,
KapuaConfigurableService {
KapuaNamedEntityService<CollisionEntity> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
package org.eclipse.kapua.commons.model.misc;

import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.configuration.AbstractKapuaConfigurableService;
import org.eclipse.kapua.commons.jpa.EntityManagerContainer;
import org.eclipse.kapua.model.config.metatype.KapuaTocd;
import org.eclipse.kapua.commons.service.internal.AbstractKapuaService;
import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.model.query.KapuaListResult;
import org.eclipse.kapua.model.query.KapuaQuery;

import java.util.Map;

public class CollisionServiceImpl extends AbstractKapuaConfigurableService implements CollisionEntityService {
public class CollisionServiceImpl extends AbstractKapuaService implements CollisionEntityService {

public CollisionServiceImpl() {
super(CollisionServiceImpl.class.getName(), CollisionEntityDomains.COLLISION_ENTITY_DOMAIN, CollisionEntityManagerFactory.getInstance());
super(CollisionEntityManagerFactory.getInstance(), null);
}

public CollisionEntity insert(String testField) throws KapuaException {
Expand Down Expand Up @@ -81,22 +78,4 @@ public CollisionEntity findByName(String name) throws KapuaException {
return null;
}

@Override
public KapuaTocd getConfigMetadata(KapuaId scopeId) throws KapuaException {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, Object> getConfigValues(KapuaId scopeId) throws KapuaException {
// TODO Auto-generated method stub
return null;
}

@Override
public void setConfigValues(KapuaId scopeId, KapuaId parentId, Map<String, Object> values) throws KapuaException {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.eclipse.kapua.model.query.KapuaQuery;
import org.eclipse.kapua.service.KapuaEntityService;
import org.eclipse.kapua.service.KapuaUpdatableEntityService;
import org.eclipse.kapua.service.config.KapuaConfigurableService;

/**
* {@link QueuedJobExecutionService} exposes APIs to manage {@link QueuedJobExecution} objects.<br>
Expand All @@ -25,8 +24,7 @@
* @since 1.1.0
*/
public interface QueuedJobExecutionService extends KapuaEntityService<QueuedJobExecution, QueuedJobExecutionCreator>,
KapuaUpdatableEntityService<QueuedJobExecution>,
KapuaConfigurableService {
KapuaUpdatableEntityService<QueuedJobExecution> {

/**
* Returns the {@link QueuedJobExecutionListResult} with elements matching the provided query.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@

import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.configuration.AbstractKapuaConfigurableResourceLimitedService;
import org.eclipse.kapua.commons.service.internal.AbstractKapuaService;
import org.eclipse.kapua.commons.util.ArgumentValidator;
import org.eclipse.kapua.job.engine.jbatch.JobEngineEntityManagerFactory;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecution;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecutionCreator;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecutionFactory;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecutionListResult;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecutionQuery;
import org.eclipse.kapua.job.engine.queue.QueuedJobExecutionService;
import org.eclipse.kapua.locator.KapuaLocator;
import org.eclipse.kapua.locator.KapuaProvider;
Expand All @@ -31,23 +29,20 @@
import org.eclipse.kapua.service.authorization.permission.PermissionFactory;
import org.eclipse.kapua.service.job.JobDomains;
import org.eclipse.kapua.service.job.execution.JobExecution;
import org.eclipse.kapua.service.job.execution.JobExecutionService;

/**
* {@link QueuedJobExecutionService} implementation
*/
@KapuaProvider
public class QueuedJobExecutionServiceImpl
extends AbstractKapuaConfigurableResourceLimitedService<QueuedJobExecution, QueuedJobExecutionCreator, QueuedJobExecutionService, QueuedJobExecutionListResult, QueuedJobExecutionQuery, QueuedJobExecutionFactory>
implements QueuedJobExecutionService {
public class QueuedJobExecutionServiceImpl extends AbstractKapuaService implements QueuedJobExecutionService {

private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();

private static final AuthorizationService AUTHORIZATION_SERVICE = LOCATOR.getService(AuthorizationService.class);
private static final PermissionFactory PERMISSION_FACTORY = LOCATOR.getFactory(PermissionFactory.class);

public QueuedJobExecutionServiceImpl() {
super(JobExecutionService.class.getName(), JobDomains.JOB_DOMAIN, JobEngineEntityManagerFactory.getInstance(), QueuedJobExecutionService.class, QueuedJobExecutionFactory.class);
super(JobEngineEntityManagerFactory.getInstance(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Scenario: Regular step creation
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand All @@ -55,10 +51,6 @@ Scenario: Step with a null scope ID
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand All @@ -83,10 +75,6 @@ Scenario: Change an existing step name
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand All @@ -109,10 +97,6 @@ Scenario: Count steps in the database
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand Down Expand Up @@ -142,10 +126,6 @@ Scenario: Delete an existing step
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand All @@ -168,10 +148,6 @@ Scenario: Delete a non-existing step
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job step service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular step definition with the name "TestDefinition" and the following properties
| name | type |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Scenario: Regular target creation
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job target item
Then No exception was thrown
Expand All @@ -44,10 +40,6 @@ Scenario: Target with a null scope ID
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given A null scope
Given I expect the exception "KapuaIllegalNullArgumentException" with the text "scopeId"
When I create a job with the name "TestJob"
Expand All @@ -61,10 +53,6 @@ Scenario: Delete a job target
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job target item
When I delete the last job target in the database
Expand All @@ -79,10 +67,6 @@ Scenario: Delete a job target twice
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job target item
When I delete the last job target in the database
Expand All @@ -98,10 +82,6 @@ Scenario: Create and count multiple job targets
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job target item
And A regular job target item
Expand All @@ -118,10 +98,6 @@ Scenario: Query for the targets of a specific job
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob1"
And A regular job target item
And A regular job target item
Expand Down Expand Up @@ -149,10 +125,6 @@ Scenario: Update a job target TargetId
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob1"
And A regular job target item
When I update the job target target id
Expand All @@ -167,10 +139,6 @@ Scenario: Update a job target step index
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob1"
And A regular job target item
When I update the job target step number to 3
Expand All @@ -184,10 +152,6 @@ Scenario: Update a job target status
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job target service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob1"
And A regular job target item
When I update the job target step status to "PROCESS_OK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaEntityUniquenessException;
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.configuration.AbstractKapuaConfigurableResourceLimitedService;
import org.eclipse.kapua.commons.model.query.predicate.AndPredicateImpl;
import org.eclipse.kapua.commons.model.query.predicate.AttributePredicateImpl;
import org.eclipse.kapua.commons.service.internal.AbstractKapuaService;
import org.eclipse.kapua.commons.util.ArgumentValidator;
import org.eclipse.kapua.locator.KapuaLocator;
import org.eclipse.kapua.locator.KapuaProvider;
Expand All @@ -28,7 +28,6 @@
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperation;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationAttributes;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationCreator;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationFactory;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationListResult;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationQuery;
import org.eclipse.kapua.service.device.management.job.JobDeviceManagementOperationService;
Expand All @@ -45,7 +44,7 @@
* @since 1.1.0
*/
@KapuaProvider
public class JobDeviceManagementOperationServiceImpl extends AbstractKapuaConfigurableResourceLimitedService<JobDeviceManagementOperation, JobDeviceManagementOperationCreator, JobDeviceManagementOperationService, JobDeviceManagementOperationListResult, JobDeviceManagementOperationQuery, JobDeviceManagementOperationFactory>
public class JobDeviceManagementOperationServiceImpl extends AbstractKapuaService
implements JobDeviceManagementOperationService {

private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();
Expand All @@ -54,7 +53,7 @@ public class JobDeviceManagementOperationServiceImpl extends AbstractKapuaConfig
private static final PermissionFactory PERMISSION_FACTORY = LOCATOR.getFactory(PermissionFactory.class);

public JobDeviceManagementOperationServiceImpl() {
super(JobDeviceManagementOperationService.class.getName(), JobDomains.JOB_DOMAIN, JobDeviceManagementOperationEntityManagerFactory.getInstance(), JobDeviceManagementOperationService.class, JobDeviceManagementOperationFactory.class);
super(JobDeviceManagementOperationEntityManagerFactory.getInstance(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaEntityUniquenessException;
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.configuration.AbstractKapuaConfigurableResourceLimitedService;
import org.eclipse.kapua.commons.jpa.EntityManager;
import org.eclipse.kapua.commons.security.KapuaSecurityUtils;
import org.eclipse.kapua.commons.service.internal.AbstractKapuaService;
import org.eclipse.kapua.commons.util.ArgumentValidator;
import org.eclipse.kapua.commons.util.CommonsValidationRegex;
import org.eclipse.kapua.locator.KapuaLocator;
Expand Down Expand Up @@ -51,7 +51,7 @@
*/
@KapuaProvider
public class EndpointInfoServiceImpl
extends AbstractKapuaConfigurableResourceLimitedService<EndpointInfo, EndpointInfoCreator, EndpointInfoService, EndpointInfoListResult, EndpointInfoQuery, EndpointInfoFactory>
extends AbstractKapuaService
implements EndpointInfoService {

private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();
Expand All @@ -69,7 +69,7 @@ public class EndpointInfoServiceImpl
private static final String ENDPOINT_INFO_DNS = "endpointInfo.dns";

public EndpointInfoServiceImpl() {
super(EndpointInfoService.class.getName(), EndpointInfoDomains.ENDPOINT_INFO_DOMAIN, EndpointEntityManagerFactory.getInstance(), EndpointInfoService.class, EndpointInfoFactory.class);
super(EndpointEntityManagerFactory.getInstance(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.eclipse.kapua.model.query.KapuaQuery;
import org.eclipse.kapua.service.KapuaEntityService;
import org.eclipse.kapua.service.KapuaUpdatableEntityService;
import org.eclipse.kapua.service.config.KapuaConfigurableService;

/**
* {@link JobStepService} exposes APIs to manage JobStep objects.<br>
Expand All @@ -25,8 +24,7 @@
* @since 1.0
*/
public interface JobStepService extends KapuaEntityService<JobStep, JobStepCreator>,
KapuaUpdatableEntityService<JobStep>,
KapuaConfigurableService {
KapuaUpdatableEntityService<JobStep> {

/**
* Returns the {@link JobStepListResult} with elements matching the provided query.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.eclipse.kapua.model.query.KapuaQuery;
import org.eclipse.kapua.service.KapuaEntityService;
import org.eclipse.kapua.service.KapuaUpdatableEntityService;
import org.eclipse.kapua.service.config.KapuaConfigurableService;

/**
* {@link JobStepDefinitionService} exposes APIs to manage JobStepDefinition objects.<br>
Expand All @@ -25,8 +24,7 @@
* @since 1.0
*/
public interface JobStepDefinitionService extends KapuaEntityService<JobStepDefinition, JobStepDefinitionCreator>,
KapuaUpdatableEntityService<JobStepDefinition>,
KapuaConfigurableService {
KapuaUpdatableEntityService<JobStepDefinition> {

/**
* Returns the {@link JobStepDefinitionListResult} with elements matching the provided query.
Expand Down
Loading

0 comments on commit bde0c21

Please sign in to comment.