diff --git a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningMultipleResponse.java b/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningMultipleResponse.java deleted file mode 100644 index 5e01b91b31b..00000000000 --- a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningMultipleResponse.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Eurotech - initial API and implementation - *******************************************************************************/ -package org.eclipse.kapua.commons.rest.model; - -import org.eclipse.kapua.model.id.KapuaId; - -import javax.xml.bind.annotation.XmlElementWrapper; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class IsJobRunningMultipleResponse { - - private List list = new ArrayList<>(); - - public IsJobRunningMultipleResponse() { - } - - public IsJobRunningMultipleResponse(Map map) { - map.forEach((key, value) -> list.add(new IsJobRunningResponse(key, value))); - } - - @XmlElementWrapper - public List getList() { - return list; - } - - public void setMap(List list) { - this.list = list; - } - -} diff --git a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningResponse.java b/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningResponse.java deleted file mode 100644 index 0d81f0fceee..00000000000 --- a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/IsJobRunningResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Eurotech - initial API and implementation - *******************************************************************************/ -package org.eclipse.kapua.commons.rest.model; - -import org.eclipse.kapua.model.id.KapuaId; -import org.eclipse.kapua.model.id.KapuaIdAdapter; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -public class IsJobRunningResponse { - - private KapuaId jobId; - private Boolean isRunning; - - public IsJobRunningResponse() { - } - - public IsJobRunningResponse(KapuaId jobId, Boolean isRunning) { - this.jobId = jobId; - this.isRunning = isRunning; - } - - @XmlJavaTypeAdapter(KapuaIdAdapter.class) - public KapuaId getJobId() { - return jobId; - } - - public void setJobId(KapuaId jobId) { - this.jobId = jobId; - } - - @XmlElement(name = "isRunning") - public Boolean isRunning() { - return isRunning; - } - - public void setRunning(Boolean isRunning) { - this.isRunning = isRunning; - } - -} diff --git a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/MultipleJobIdRequest.java b/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/MultipleJobIdRequest.java deleted file mode 100644 index a2c2a81da81..00000000000 --- a/commons-rest/model/src/main/java/org/eclipse/kapua/commons/rest/model/MultipleJobIdRequest.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Eurotech - initial API and implementation - *******************************************************************************/ -package org.eclipse.kapua.commons.rest.model; - -import org.eclipse.kapua.model.id.KapuaId; -import org.eclipse.kapua.model.id.KapuaIdAdapter; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import java.util.HashSet; -import java.util.Set; - -public class MultipleJobIdRequest { - - private Set jobIds = new HashSet<>(); - - @XmlElementWrapper(name = "jobIds") - @XmlElement(name = "jobId") - @XmlJavaTypeAdapter(KapuaIdAdapter.class) - public Set getJobIds() { - return jobIds; - } - - public void setJobIds(Set jobIds) { - this.jobIds = jobIds; - } - -} diff --git a/job-engine/app/core/src/main/java/org/eclipse/kapua/job/engine/app/core/jackson/ObjectMapperProvider.java b/job-engine/app/core/src/main/java/org/eclipse/kapua/job/engine/app/core/jackson/ObjectMapperProvider.java index ff768bc14a4..966c23bf481 100644 --- a/job-engine/app/core/src/main/java/org/eclipse/kapua/job/engine/app/core/jackson/ObjectMapperProvider.java +++ b/job-engine/app/core/src/main/java/org/eclipse/kapua/job/engine/app/core/jackson/ObjectMapperProvider.java @@ -13,8 +13,9 @@ package org.eclipse.kapua.job.engine.app.core.jackson; import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.kapua.commons.rest.model.IsJobRunningResponse; + import org.eclipse.kapua.job.engine.JobStartOptions; +import org.eclipse.kapua.job.engine.IsJobRunningResponse; import org.eclipse.kapua.job.engine.app.core.jackson.mixin.IsJobRunningResponseMixin; import org.eclipse.kapua.job.engine.app.core.jackson.mixin.JobStartOptionsMixin; import org.eclipse.kapua.job.engine.app.core.jackson.mixin.JobStepPropertyMixin; diff --git a/job-engine/app/resources/src/main/java/org/eclipse/kapua/job/engine/app/resources/JobEngineResource.java b/job-engine/app/resources/src/main/java/org/eclipse/kapua/job/engine/app/resources/JobEngineResource.java index bd1da06e560..848663b9261 100644 --- a/job-engine/app/resources/src/main/java/org/eclipse/kapua/job/engine/app/resources/JobEngineResource.java +++ b/job-engine/app/resources/src/main/java/org/eclipse/kapua/job/engine/app/resources/JobEngineResource.java @@ -12,15 +12,6 @@ *******************************************************************************/ package org.eclipse.kapua.job.engine.app.resources; -import org.eclipse.kapua.KapuaException; -import org.eclipse.kapua.commons.rest.model.IsJobRunningMultipleResponse; -import org.eclipse.kapua.commons.rest.model.IsJobRunningResponse; -import org.eclipse.kapua.commons.rest.model.MultipleJobIdRequest; -import org.eclipse.kapua.job.engine.JobEngineService; -import org.eclipse.kapua.job.engine.JobStartOptions; -import org.eclipse.kapua.model.id.KapuaId; -import org.glassfish.jersey.process.internal.RequestScoped; - import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -29,6 +20,15 @@ import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; +import org.eclipse.kapua.KapuaException; +import org.eclipse.kapua.job.engine.IsJobRunningMultipleResponse; +import org.eclipse.kapua.job.engine.IsJobRunningResponse; +import org.eclipse.kapua.job.engine.JobEngineService; +import org.eclipse.kapua.job.engine.JobStartOptions; +import org.eclipse.kapua.job.engine.MultipleJobIdRequest; +import org.eclipse.kapua.model.id.KapuaId; +import org.glassfish.jersey.process.internal.RequestScoped; + @SuppressWarnings("RestParamTypeInspection") @Path("/") @RequestScoped @@ -69,7 +69,7 @@ public void startJob(@PathParam("scopeId") KapuaId scopeId, @PathParam("jobId") @POST @Path("start-with-options/{scopeId}/{jobId}") - @Consumes({MediaType.APPLICATION_JSON}) + @Consumes({ MediaType.APPLICATION_JSON }) public void startJob(@PathParam("scopeId") KapuaId scopeId, @PathParam("jobId") KapuaId jobId, JobStartOptions jobStartOptions) throws KapuaException { jobEngineService.startJob(scopeId, jobId, jobStartOptions); } diff --git a/job-engine/app/web/pom.xml b/job-engine/app/web/pom.xml index fc5b8a31d4e..3dd9d1ee45c 100644 --- a/job-engine/app/web/pom.xml +++ b/job-engine/app/web/pom.xml @@ -44,22 +44,6 @@ org.eclipse.kapua kapua-device-call-kura - - - - - - - - - - - - - - - - org.eclipse.kapua kapua-device-management-all-job diff --git a/job-engine/client/src/main/java/org/eclipse/kapua/job/engine/client/JobEngineServiceClient.java b/job-engine/client/src/main/java/org/eclipse/kapua/job/engine/client/JobEngineServiceClient.java index 8b3f4f7ce20..4cdbba18626 100644 --- a/job-engine/client/src/main/java/org/eclipse/kapua/job/engine/client/JobEngineServiceClient.java +++ b/job-engine/client/src/main/java/org/eclipse/kapua/job/engine/client/JobEngineServiceClient.java @@ -36,9 +36,6 @@ import org.eclipse.kapua.KapuaErrorCodes; import org.eclipse.kapua.KapuaException; import org.eclipse.kapua.KapuaRuntimeException; -import org.eclipse.kapua.commons.rest.model.IsJobRunningMultipleResponse; -import org.eclipse.kapua.commons.rest.model.IsJobRunningResponse; -import org.eclipse.kapua.commons.rest.model.MultipleJobIdRequest; import org.eclipse.kapua.commons.rest.model.errors.CleanJobDataExceptionInfo; import org.eclipse.kapua.commons.rest.model.errors.EntityNotFoundExceptionInfo; import org.eclipse.kapua.commons.rest.model.errors.ExceptionInfo; @@ -52,8 +49,11 @@ import org.eclipse.kapua.commons.rest.model.errors.JobStartingExceptionInfo; import org.eclipse.kapua.commons.rest.model.errors.JobStoppingExceptionInfo; import org.eclipse.kapua.commons.util.xml.XmlUtil; +import org.eclipse.kapua.job.engine.IsJobRunningMultipleResponse; +import org.eclipse.kapua.job.engine.IsJobRunningResponse; import org.eclipse.kapua.job.engine.JobEngineService; import org.eclipse.kapua.job.engine.JobStartOptions; +import org.eclipse.kapua.job.engine.MultipleJobIdRequest; import org.eclipse.kapua.job.engine.client.filter.SessionInfoFilter; import org.eclipse.kapua.job.engine.client.settings.JobEngineClientSetting; import org.eclipse.kapua.job.engine.client.settings.JobEngineClientSettingKeys; diff --git a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/JobEngine.java b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/JobEngine.java index 937e60455f5..4ffee54fe08 100644 --- a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/JobEngine.java +++ b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/JobEngine.java @@ -26,11 +26,11 @@ import org.eclipse.kapua.app.api.core.model.EntityId; import org.eclipse.kapua.app.api.core.model.ScopeId; import org.eclipse.kapua.app.api.core.resources.AbstractKapuaResource; -import org.eclipse.kapua.commons.rest.model.IsJobRunningMultipleResponse; -import org.eclipse.kapua.commons.rest.model.IsJobRunningResponse; -import org.eclipse.kapua.commons.rest.model.MultipleJobIdRequest; +import org.eclipse.kapua.job.engine.IsJobRunningMultipleResponse; +import org.eclipse.kapua.job.engine.IsJobRunningResponse; import org.eclipse.kapua.job.engine.JobEngineService; import org.eclipse.kapua.job.engine.JobStartOptions; +import org.eclipse.kapua.job.engine.MultipleJobIdRequest; import org.eclipse.kapua.job.engine.exception.JobNotRunningException; @Path("{scopeId}/jobs") diff --git a/rest-api/web/src/main/java/org/eclipse/kapua/app/api/web/RestApiJAXBContextProvider.java b/rest-api/web/src/main/java/org/eclipse/kapua/app/api/web/RestApiJAXBContextProvider.java index 1e87eb97c20..4e46eb614fd 100644 --- a/rest-api/web/src/main/java/org/eclipse/kapua/app/api/web/RestApiJAXBContextProvider.java +++ b/rest-api/web/src/main/java/org/eclipse/kapua/app/api/web/RestApiJAXBContextProvider.java @@ -28,9 +28,6 @@ import org.eclipse.kapua.app.api.core.model.device.management.JsonGenericResponseMessage; import org.eclipse.kapua.app.api.core.model.message.JsonKapuaPayload; import org.eclipse.kapua.app.api.resources.v1.resources.model.device.management.keystore.DeviceKeystoreCertificateInfo; -import org.eclipse.kapua.commons.rest.model.IsJobRunningMultipleResponse; -import org.eclipse.kapua.commons.rest.model.IsJobRunningResponse; -import org.eclipse.kapua.commons.rest.model.MultipleJobIdRequest; import org.eclipse.kapua.commons.rest.model.errors.CleanJobDataExceptionInfo; import org.eclipse.kapua.commons.rest.model.errors.DeviceManagementRequestContentExceptionInfo; import org.eclipse.kapua.commons.rest.model.errors.DeviceManagementResponseCodeExceptionInfo; @@ -67,8 +64,11 @@ import org.eclipse.kapua.commons.service.event.store.api.EventStoreXmlRegistry; import org.eclipse.kapua.commons.util.xml.JAXBContextProvider; import org.eclipse.kapua.event.ServiceEvent; +import org.eclipse.kapua.job.engine.IsJobRunningMultipleResponse; +import org.eclipse.kapua.job.engine.IsJobRunningResponse; import org.eclipse.kapua.job.engine.JobEngineXmlRegistry; import org.eclipse.kapua.job.engine.JobStartOptions; +import org.eclipse.kapua.job.engine.MultipleJobIdRequest; import org.eclipse.kapua.message.device.data.KapuaDataChannel; import org.eclipse.kapua.message.device.data.KapuaDataMessage; import org.eclipse.kapua.message.device.data.KapuaDataPayload;