Rename and split rest resources ddi, mgmt and system

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-04-20 17:33:03 +02:00
parent 8a22ea3df3
commit c3c405c986
169 changed files with 3081 additions and 1871 deletions

0
3rd-dependencies/listDeps.sh Executable file → Normal file
View File

View File

@@ -64,7 +64,12 @@
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-resource</artifactId>
<artifactId>hawkbit-mgmt-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-system-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@@ -11,7 +11,8 @@ package org.eclipse.hawkbit.app;
import org.eclipse.hawkbit.RepositoryApplicationConfiguration;
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi;
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi;
import org.eclipse.hawkbit.system.annotation.EnableSystemApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
@@ -24,8 +25,9 @@ import org.springframework.context.annotation.Import;
@SpringBootApplication
@Import({ RepositoryApplicationConfiguration.class })
@EnableHawkbitManagedSecurityConfiguration
@EnableRestResources
@EnableMgmtApi
@EnableDdiApi
@EnableSystemApi
public class Start {
/**

View File

@@ -57,7 +57,7 @@
<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-api</artifactId>
<artifactId>hawkbit-mgmt-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the DistributionSet resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsets")
public interface DistributionSetResourceClient extends DistributionSetRestApi {
public interface DistributionSetResourceClient extends MgmtDistributionSetRestApi {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetTagRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the DistributionSetTag resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettags")
public interface DistributionSetTagResourceClient extends DistributionSetTagRestApi {
public interface DistributionSetTagResourceClient extends MgmtDistributionSetTagRestApi {
}

View File

@@ -8,7 +8,7 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
@@ -16,6 +16,6 @@ import org.springframework.cloud.netflix.feign.FeignClient;
*
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettypes")
public interface DistributionSetTypeResourceClient extends DistributionSetTypeRestApi {
public interface DistributionSetTypeResourceClient extends MgmtDistributionSetTypeRestApi {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.RolloutRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRolloutRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the Rollout resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/rollouts")
public interface RolloutResourceClient extends RolloutRestApi {
public interface RolloutResourceClient extends MgmtRolloutRestApi {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleRestAPI;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the SoftwareModule resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremodules")
public interface SoftwareModuleResourceClient extends SoftwareModuleRestAPI {
public interface SoftwareModuleResourceClient extends MgmtSoftwareModuleRestAPI {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleTypeRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the oftwareModuleType resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremoduletypes")
public interface SoftwareModuleTypeResourceClient extends SoftwareModuleTypeRestApi {
public interface SoftwareModuleTypeResourceClient extends MgmtSoftwareModuleTypeRestApi {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.TargetRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the Target resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/targets")
public interface TargetResourceClient extends TargetRestApi {
public interface TargetResourceClient extends MgmtTargetRestApi {
}

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource;
import org.eclipse.hawkbit.rest.resource.api.TargetTagRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi;
import org.springframework.cloud.netflix.feign.FeignClient;
/**
* Client binding for the TargetTag resource of the management API.
*/
@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/targettags")
public interface TargetTagResourceClient extends TargetTagRestApi {
public interface TargetTagResourceClient extends MgmtTargetTagRestApi {
}

View File

@@ -11,20 +11,20 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
import com.google.common.collect.Lists;
/**
* Builder pattern for building {@link DistributionSetRequestBodyPost}.
* Builder pattern for building {@link MgmtDistributionSetRequestBodyPost}.
*/
public class DistributionSetBuilder {
private String name;
private String version;
private String type;
private final List<SoftwareModuleAssigmentRest> modules = new ArrayList<>();
private final List<MgmtSoftwareModuleAssigment> modules = new ArrayList<>();
/**
* @param name
@@ -37,7 +37,7 @@ public class DistributionSetBuilder {
}
public DistributionSetBuilder moduleByID(final Long id) {
final SoftwareModuleAssigmentRest softwareModuleAssigmentRest = new SoftwareModuleAssigmentRest();
final MgmtSoftwareModuleAssigment softwareModuleAssigmentRest = new MgmtSoftwareModuleAssigment();
softwareModuleAssigmentRest.setId(id);
modules.add(softwareModuleAssigmentRest);
return this;
@@ -65,27 +65,27 @@ public class DistributionSetBuilder {
/**
* Builds a list with a single entry of
* {@link DistributionSetRequestBodyPost} which can directly be used to post
* {@link MgmtDistributionSetRequestBodyPost} which can directly be used to post
* on the RESTful-API.
*
* @return a single entry list of {@link DistributionSetRequestBodyPost}
* @return a single entry list of {@link MgmtDistributionSetRequestBodyPost}
*/
public List<DistributionSetRequestBodyPost> build() {
public List<MgmtDistributionSetRequestBodyPost> build() {
return Lists.newArrayList(doBuild(name));
}
/**
* Builds a list of multiple {@link DistributionSetRequestBodyPost} to
* Builds a list of multiple {@link MgmtDistributionSetRequestBodyPost} to
* create multiple distribution sets at once. An increasing number will be
* added to the name of the distribution set. The version and type will
* remain the same.
*
* @param count
* the amount of distribution sets body which should be created
* @return a list of {@link DistributionSetRequestBodyPost}
* @return a list of {@link MgmtDistributionSetRequestBodyPost}
*/
public List<DistributionSetRequestBodyPost> buildAsList(final int count) {
final ArrayList<DistributionSetRequestBodyPost> bodyList = Lists.newArrayList();
public List<MgmtDistributionSetRequestBodyPost> buildAsList(final int count) {
final ArrayList<MgmtDistributionSetRequestBodyPost> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(name + index));
}
@@ -93,8 +93,8 @@ public class DistributionSetBuilder {
return bodyList;
}
private DistributionSetRequestBodyPost doBuild(final String prefixName) {
final DistributionSetRequestBodyPost body = new DistributionSetRequestBodyPost();
private MgmtDistributionSetRequestBodyPost doBuild(final String prefixName) {
final MgmtDistributionSetRequestBodyPost body = new MgmtDistributionSetRequestBodyPost();
body.setName(prefixName);
body.setVersion(version);
body.setType(type);

View File

@@ -11,22 +11,22 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeAssigmentRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment;
import com.google.common.collect.Lists;
/**
*
* Builder pattern for building {@link DistributionSetTypeRequestBodyPost}.
* Builder pattern for building {@link MgmtDistributionSetTypeRequestBodyPost}.
*
*/
public class DistributionSetTypeBuilder {
private String key;
private String name;
private final List<SoftwareModuleTypeAssigmentRest> mandatorymodules = Lists.newArrayList();
private final List<SoftwareModuleTypeAssigmentRest> optionalmodules = Lists.newArrayList();
private final List<MgmtSoftwareModuleTypeAssigment> mandatorymodules = Lists.newArrayList();
private final List<MgmtSoftwareModuleTypeAssigment> optionalmodules = Lists.newArrayList();
/**
* @param key
@@ -56,7 +56,7 @@ public class DistributionSetTypeBuilder {
*/
public DistributionSetTypeBuilder mandatorymodules(final Long... softwareModuleTypeIds) {
for (final Long id : softwareModuleTypeIds) {
final SoftwareModuleTypeAssigmentRest softwareModuleTypeAssigmentRest = new SoftwareModuleTypeAssigmentRest();
final MgmtSoftwareModuleTypeAssigment softwareModuleTypeAssigmentRest = new MgmtSoftwareModuleTypeAssigment();
softwareModuleTypeAssigmentRest.setId(id);
this.mandatorymodules.add(softwareModuleTypeAssigmentRest);
}
@@ -72,7 +72,7 @@ public class DistributionSetTypeBuilder {
*/
public DistributionSetTypeBuilder optionalmodules(final Long... softwareModuleTypeIds) {
for (final Long id : softwareModuleTypeIds) {
final SoftwareModuleTypeAssigmentRest softwareModuleTypeAssigmentRest = new SoftwareModuleTypeAssigmentRest();
final MgmtSoftwareModuleTypeAssigment softwareModuleTypeAssigmentRest = new MgmtSoftwareModuleTypeAssigment();
softwareModuleTypeAssigmentRest.setId(id);
this.optionalmodules.add(softwareModuleTypeAssigmentRest);
}
@@ -81,17 +81,17 @@ public class DistributionSetTypeBuilder {
/**
* Builds a list with a single entry of
* {@link DistributionSetTypeRequestBodyPost} which can directly be used in
* {@link MgmtDistributionSetTypeRequestBodyPost} which can directly be used in
* the RESTful-API.
*
* @return a single entry list of {@link DistributionSetTypeRequestBodyPost}
* @return a single entry list of {@link MgmtDistributionSetTypeRequestBodyPost}
*/
public List<DistributionSetTypeRequestBodyPost> build() {
public List<MgmtDistributionSetTypeRequestBodyPost> build() {
return Lists.newArrayList(doBuild(name, key));
}
/**
* Builds a list of multiple {@link DistributionSetTypeRequestBodyPost} to
* Builds a list of multiple {@link MgmtDistributionSetTypeRequestBodyPost} to
* create multiple distribution set types at once. An increasing number will
* be added to the name and key of the distribution set type. The optional
* and mandatory software module types will remain the same.
@@ -99,10 +99,10 @@ public class DistributionSetTypeBuilder {
* @param count
* the amount of distribution sets type body which should be
* created
* @return a list of {@link DistributionSetTypeRequestBodyPost}
* @return a list of {@link MgmtDistributionSetTypeRequestBodyPost}
*/
public List<DistributionSetTypeRequestBodyPost> buildAsList(final int count) {
final ArrayList<DistributionSetTypeRequestBodyPost> bodyList = Lists.newArrayList();
public List<MgmtDistributionSetTypeRequestBodyPost> buildAsList(final int count) {
final ArrayList<MgmtDistributionSetTypeRequestBodyPost> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(name + index, key + index));
}
@@ -110,8 +110,8 @@ public class DistributionSetTypeBuilder {
}
private DistributionSetTypeRequestBodyPost doBuild(final String prefixName, final String prefixKey) {
final DistributionSetTypeRequestBodyPost body = new DistributionSetTypeRequestBodyPost();
private MgmtDistributionSetTypeRequestBodyPost doBuild(final String prefixName, final String prefixKey) {
final MgmtDistributionSetTypeRequestBodyPost body = new MgmtDistributionSetTypeRequestBodyPost();
body.setKey(prefixKey);
body.setName(prefixName);
body.setMandatorymodules(mandatorymodules);

View File

@@ -8,13 +8,13 @@
*/
package org.eclipse.hawkbit.mgmt.client.resource.builder;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutCondition;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutCondition.Condition;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition.Condition;
/**
*
* Builder pattern for building {@link RolloutRestRequestBody}.
* Builder pattern for building {@link MgmtRolloutRestRequestBody}.
*
*/
public class RolloutBuilder {
@@ -95,18 +95,18 @@ public class RolloutBuilder {
*
* @return the rest request body for creating a rollout
*/
public RolloutRestRequestBody build() {
public MgmtRolloutRestRequestBody build() {
return doBuild();
}
private RolloutRestRequestBody doBuild() {
final RolloutRestRequestBody body = new RolloutRestRequestBody();
private MgmtRolloutRestRequestBody doBuild() {
final MgmtRolloutRestRequestBody body = new MgmtRolloutRestRequestBody();
body.setName(name);
body.setAmountGroups(groupSize);
body.setTargetFilterQuery(targetFilterQuery);
body.setDistributionSetId(distributionSetId);
body.setSuccessCondition(new RolloutCondition(Condition.THRESHOLD, successThreshold));
body.setErrorCondition(new RolloutCondition(Condition.THRESHOLD, errorThreshold));
body.setSuccessCondition(new MgmtRolloutCondition(Condition.THRESHOLD, successThreshold));
body.setErrorCondition(new MgmtRolloutCondition(Condition.THRESHOLD, errorThreshold));
return body;
}

View File

@@ -11,11 +11,11 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
/**
*
* Builder pattern for building {@link SoftwareModuleAssigmentRest}.
* Builder pattern for building {@link MgmtSoftwareModuleAssigment}.
*
*/
public class SoftwareModuleAssigmentBuilder {
@@ -37,15 +37,15 @@ public class SoftwareModuleAssigmentBuilder {
}
/**
* Builds a list with a single entry of {@link SoftwareModuleAssigmentRest}
* Builds a list with a single entry of {@link MgmtSoftwareModuleAssigment}
* which can directly be used in the RESTful-API.
*
* @return a single entry list of {@link SoftwareModuleAssigmentRest}
* @return a single entry list of {@link MgmtSoftwareModuleAssigment}
*/
public List<SoftwareModuleAssigmentRest> build() {
final List<SoftwareModuleAssigmentRest> softwareModuleAssigmentRestList = new ArrayList<>();
public List<MgmtSoftwareModuleAssigment> build() {
final List<MgmtSoftwareModuleAssigment> softwareModuleAssigmentRestList = new ArrayList<>();
for (final Long id : ids) {
final SoftwareModuleAssigmentRest softwareModuleAssigmentRest = new SoftwareModuleAssigmentRest();
final MgmtSoftwareModuleAssigment softwareModuleAssigmentRest = new MgmtSoftwareModuleAssigment();
softwareModuleAssigmentRest.setId(id);
softwareModuleAssigmentRestList.add(softwareModuleAssigmentRest);
}

View File

@@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost;
import com.google.common.collect.Lists;
/**
*
* Builder pattern for building {@link SoftwareModuleRequestBodyPost}.
* Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}.
*
*/
public class SoftwareModuleBuilder {
@@ -60,27 +60,27 @@ public class SoftwareModuleBuilder {
/**
* Builds a list with a single entry of
* {@link SoftwareModuleRequestBodyPost} which can directly be used in the
* {@link MgmtSoftwareModuleRequestBodyPost} which can directly be used in the
* RESTful-API.
*
* @return a single entry list of {@link SoftwareModuleRequestBodyPost}
* @return a single entry list of {@link MgmtSoftwareModuleRequestBodyPost}
*/
public List<SoftwareModuleRequestBodyPost> build() {
public List<MgmtSoftwareModuleRequestBodyPost> build() {
return Lists.newArrayList(doBuild(name));
}
/**
* Builds a list of multiple {@link SoftwareModuleRequestBodyPost} to create
* Builds a list of multiple {@link MgmtSoftwareModuleRequestBodyPost} to create
* multiple software module at once. An increasing number will be added to
* the name of the software module. The version and type will remain the
* same.
*
* @param count
* the amount of software module body which should be created
* @return a list of {@link DistributionSetTypeRequestBodyPost}
* @return a list of {@link MgmtDistributionSetTypeRequestBodyPost}
*/
public List<SoftwareModuleRequestBodyPost> buildAsList(final int count) {
final ArrayList<SoftwareModuleRequestBodyPost> bodyList = Lists.newArrayList();
public List<MgmtSoftwareModuleRequestBodyPost> buildAsList(final int count) {
final ArrayList<MgmtSoftwareModuleRequestBodyPost> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(name + index));
}
@@ -88,8 +88,8 @@ public class SoftwareModuleBuilder {
return bodyList;
}
private SoftwareModuleRequestBodyPost doBuild(final String prefixName) {
final SoftwareModuleRequestBodyPost body = new SoftwareModuleRequestBodyPost();
private MgmtSoftwareModuleRequestBodyPost doBuild(final String prefixName) {
final MgmtSoftwareModuleRequestBodyPost body = new MgmtSoftwareModuleRequestBodyPost();
body.setName(prefixName);
body.setVersion(version);
body.setType(type);

View File

@@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost;
import com.google.common.collect.Lists;
/**
*
* Builder pattern for building {@link SoftwareModuleRequestBodyPost}.
* Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}.
*
*/
public class SoftwareModuleTypeBuilder {
@@ -60,35 +60,35 @@ public class SoftwareModuleTypeBuilder {
/**
* Builds a list with a single entry of
* {@link SoftwareModuleTypeRequestBodyPost} which can directly be used in
* {@link MgmtSoftwareModuleTypeRequestBodyPost} which can directly be used in
* the RESTful-API.
*
* @return a single entry list of {@link SoftwareModuleTypeRequestBodyPost}
* @return a single entry list of {@link MgmtSoftwareModuleTypeRequestBodyPost}
*/
public List<SoftwareModuleTypeRequestBodyPost> build() {
public List<MgmtSoftwareModuleTypeRequestBodyPost> build() {
return Lists.newArrayList(doBuild(key, name));
}
/**
* Builds a list of multiple {@link SoftwareModuleTypeRequestBodyPost} to
* Builds a list of multiple {@link MgmtSoftwareModuleTypeRequestBodyPost} to
* create multiple software module types at once. An increasing number will
* be added to the name and key of the software module type.
*
* @param count
* the amount of software module type bodies which should be
* created
* @return a list of {@link SoftwareModuleTypeRequestBodyPost}
* @return a list of {@link MgmtSoftwareModuleTypeRequestBodyPost}
*/
public List<SoftwareModuleTypeRequestBodyPost> buildAsList(final int count) {
final ArrayList<SoftwareModuleTypeRequestBodyPost> bodyList = Lists.newArrayList();
public List<MgmtSoftwareModuleTypeRequestBodyPost> buildAsList(final int count) {
final ArrayList<MgmtSoftwareModuleTypeRequestBodyPost> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(key + index, name + index));
}
return bodyList;
}
private SoftwareModuleTypeRequestBodyPost doBuild(final String prefixKey, final String prefixName) {
final SoftwareModuleTypeRequestBodyPost body = new SoftwareModuleTypeRequestBodyPost();
private MgmtSoftwareModuleTypeRequestBodyPost doBuild(final String prefixKey, final String prefixName) {
final MgmtSoftwareModuleTypeRequestBodyPost body = new MgmtSoftwareModuleTypeRequestBodyPost();
body.setKey(prefixKey);
body.setName(prefixName);
body.setDescription(description);

View File

@@ -11,12 +11,12 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
import com.google.common.collect.Lists;
/**
* Builder pattern for building {@link TagRequestBodyPut}.
* Builder pattern for building {@link MgmtTagRequestBodyPut}.
*
*/
public class TagBuilder {
@@ -56,26 +56,26 @@ public class TagBuilder {
}
/**
* Builds a list with a single entry of {@link TagRequestBodyPut} which can
* Builds a list with a single entry of {@link MgmtTagRequestBodyPut} which can
* directly be used in the RESTful-API.
*
* @return a single entry list of {@link TagRequestBodyPut}
* @return a single entry list of {@link MgmtTagRequestBodyPut}
*/
public List<TagRequestBodyPut> build() {
public List<MgmtTagRequestBodyPut> build() {
return Lists.newArrayList(doBuild(name));
}
/**
* Builds a list of multiple {@link TagRequestBodyPut} to create multiple
* Builds a list of multiple {@link MgmtTagRequestBodyPut} to create multiple
* tags at once. An increasing number will be added to the name of the tag.
* The color and description will remain the same.
*
* @param count
* the amount of distribution sets body which should be created
* @return a list of {@link TagRequestBodyPut}
* @return a list of {@link MgmtTagRequestBodyPut}
*/
public List<TagRequestBodyPut> buildAsList(final int count) {
final ArrayList<TagRequestBodyPut> bodyList = Lists.newArrayList();
public List<MgmtTagRequestBodyPut> buildAsList(final int count) {
final ArrayList<MgmtTagRequestBodyPut> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(name + index));
}
@@ -83,8 +83,8 @@ public class TagBuilder {
return bodyList;
}
private TagRequestBodyPut doBuild(final String prefixName) {
final TagRequestBodyPut body = new TagRequestBodyPut();
private MgmtTagRequestBodyPut doBuild(final String prefixName) {
final MgmtTagRequestBodyPut body = new MgmtTagRequestBodyPut();
body.setName(prefixName);
body.setDescription(description);
body.setColour(color);

View File

@@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody;
import com.google.common.collect.Lists;
/**
*
* Builder pattern for building {@link TargetRequestBody}.
* Builder pattern for building {@link MgmtTargetRequestBody}.
*
*/
public class TargetBuilder {
@@ -58,35 +58,35 @@ public class TargetBuilder {
}
/**
* Builds a list with a single entry of {@link TargetRequestBody} which can
* Builds a list with a single entry of {@link MgmtTargetRequestBody} which can
* directly be used in the RESTful-API.
*
* @return a single entry list of {@link TargetRequestBody}
* @return a single entry list of {@link MgmtTargetRequestBody}
*/
public List<TargetRequestBody> build() {
public List<MgmtTargetRequestBody> build() {
return Lists.newArrayList(doBuild(controllerId));
}
/**
* Builds a list of multiple {@link TargetRequestBody} to create multiple
* Builds a list of multiple {@link MgmtTargetRequestBody} to create multiple
* targets at once. An increasing number will be added to the controllerId
* of the target. The name and description will remain.
*
* @param count
* the amount of software module type bodies which should be
* created
* @return a list of {@link SoftwareModuleTypeRequestBodyPost}
* @return a list of {@link MgmtSoftwareModuleTypeRequestBodyPost}
*/
public List<TargetRequestBody> buildAsList(final int count) {
final ArrayList<TargetRequestBody> bodyList = Lists.newArrayList();
public List<MgmtTargetRequestBody> buildAsList(final int count) {
final ArrayList<MgmtTargetRequestBody> bodyList = Lists.newArrayList();
for (int index = 0; index < count; index++) {
bodyList.add(doBuild(controllerId + index));
}
return bodyList;
}
private TargetRequestBody doBuild(final String prefixControllerId) {
final TargetRequestBody body = new TargetRequestBody();
private MgmtTargetRequestBody doBuild(final String prefixControllerId) {
final MgmtTargetRequestBody body = new MgmtTargetRequestBody();
body.setControllerId(prefixControllerId);
body.setName(name);
body.setDescription(description);

View File

@@ -23,10 +23,10 @@ import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleAssigmentB
import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleBuilder;
import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleTypeBuilder;
import org.eclipse.hawkbit.mgmt.client.resource.builder.TargetBuilder;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -67,7 +67,7 @@ public class CreateStartedRolloutExample {
public void run() {
// create three SoftwareModuleTypes
final List<SoftwareModuleTypeRest> createdSoftwareModuleTypes = softwareModuleTypeResource
final List<MgmtSoftwareModuleType> createdSoftwareModuleTypes = softwareModuleTypeResource
.createSoftwareModuleTypes(new SoftwareModuleTypeBuilder().key(SM_MODULE_TYPE).name(SM_MODULE_TYPE)
.maxAssignments(1).build())
.getBody();
@@ -78,12 +78,12 @@ public class CreateStartedRolloutExample {
.getBody();
// create one DistributionSet
final List<DistributionSetRest> distributionSetsRest = distributionSetResource.createDistributionSets(
final List<MgmtDistributionSet> distributionSetsRest = distributionSetResource.createDistributionSets(
new DistributionSetBuilder().name("rollout-example").version("1.0.0").type(DS_MODULE_TYPE).build())
.getBody();
// create three SoftwareModules
final List<SoftwareModuleRest> softwareModulesRest = softwareModuleResource
final List<MgmtSoftwareModule> softwareModulesRest = softwareModuleResource
.createSoftwareModules(
new SoftwareModuleBuilder().name("firmware").version("1.0.0").type(SM_MODULE_TYPE).build())
.getBody();
@@ -97,7 +97,7 @@ public class CreateStartedRolloutExample {
.description("Targets used for rollout example").buildAsList(10));
// create a Rollout
final RolloutResponseBody rolloutResponseBody = rolloutResource
final MgmtRolloutResponseBody rolloutResponseBody = rolloutResource
.create(new RolloutBuilder().name("MyRollout").groupSize(2).targetFilterQuery("name==00-FF-AA-0*")
.distributionSetId(distributionSetsRest.get(0).getDsId()).successThreshold("80")
.errorThreshold("50").build())

View File

@@ -19,9 +19,9 @@ import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetTypeBuild
import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleAssigmentBuilder;
import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleBuilder;
import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleTypeBuilder;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -70,7 +70,7 @@ public class GettingStartedDefaultScenario {
// create one SoftwareModuleTypes
LOGGER.info("Creating software module type {}", SM_MODULE_TYPE);
final List<SoftwareModuleTypeRest> createdSoftwareModuleTypes = softwareModuleTypeResource
final List<MgmtSoftwareModuleType> createdSoftwareModuleTypes = softwareModuleTypeResource
.createSoftwareModuleTypes(new SoftwareModuleTypeBuilder().key(SM_MODULE_TYPE).name(SM_MODULE_TYPE)
.maxAssignments(1).build())
.getBody();
@@ -86,17 +86,17 @@ public class GettingStartedDefaultScenario {
final String dsVersion3 = "2.1.0";
LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion1);
final List<DistributionSetRest> distributionSetsRest1 = distributionSetResource.createDistributionSets(
final List<MgmtDistributionSet> distributionSetsRest1 = distributionSetResource.createDistributionSets(
new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion1).type(DS_MODULE_TYPE).build())
.getBody();
LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion2);
final List<DistributionSetRest> distributionSetsRest2 = distributionSetResource.createDistributionSets(
final List<MgmtDistributionSet> distributionSetsRest2 = distributionSetResource.createDistributionSets(
new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion2).type(DS_MODULE_TYPE).build())
.getBody();
LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion3);
final List<DistributionSetRest> distributionSetsRest3 = distributionSetResource.createDistributionSets(
final List<MgmtDistributionSet> distributionSetsRest3 = distributionSetResource.createDistributionSets(
new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion3).type(DS_MODULE_TYPE).build())
.getBody();
@@ -106,15 +106,15 @@ public class GettingStartedDefaultScenario {
final String swVersion3 = "3";
LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion1);
final List<SoftwareModuleRest> softwareModulesRest1 = softwareModuleResource.createSoftwareModules(
final List<MgmtSoftwareModule> softwareModulesRest1 = softwareModuleResource.createSoftwareModules(
new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion1).type(SM_MODULE_TYPE).build())
.getBody();
LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion2);
final List<SoftwareModuleRest> softwareModulesRest2 = softwareModuleResource.createSoftwareModules(
final List<MgmtSoftwareModule> softwareModulesRest2 = softwareModuleResource.createSoftwareModules(
new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion2).type(SM_MODULE_TYPE).build())
.getBody();
LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion3);
final List<SoftwareModuleRest> softwareModulesRest3 = softwareModuleResource.createSoftwareModules(
final List<MgmtSoftwareModule> softwareModulesRest3 = softwareModuleResource.createSoftwareModules(
new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion3).type(SM_MODULE_TYPE).build())
.getBody();

View File

@@ -64,13 +64,19 @@
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-resource</artifactId>
<artifactId>hawkbit-ddi-resource</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-resource</artifactId>
<artifactId>hawkbit-system-resource</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-mgmt-resource</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>

View File

@@ -29,7 +29,6 @@ import org.eclipse.hawkbit.im.authentication.UserAuthenticationFilter;
import org.eclipse.hawkbit.repository.ControllerManagement;
import org.eclipse.hawkbit.repository.SystemManagement;
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.security.ControllerTenantAwareAuthenticationDetailsSource;
import org.eclipse.hawkbit.security.DdiSecurityProperties;
import org.eclipse.hawkbit.security.DosFilter;
@@ -41,6 +40,7 @@ import org.eclipse.hawkbit.security.HttpControllerPreAuthenticatedSecurityHeader
import org.eclipse.hawkbit.security.HttpDownloadAuthenticationFilter;
import org.eclipse.hawkbit.security.PreAuthTokenSourceTrustAuthenticationProvider;
import org.eclipse.hawkbit.security.SystemSecurityContext;
import org.eclipse.hawkbit.system.rest.api.SystemRestConstant;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -292,8 +292,9 @@ public class SecurityManagedConfiguration {
new AuthenticationSuccessTenantMetadataCreationFilter(tenantAware, systemManagement),
RequestHeaderAuthenticationFilter.class)
.authorizeRequests().anyRequest().authenticated()
.antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/admin/**")
.hasAnyAuthority(SpPermission.SYSTEM_ADMIN).antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/**")
.antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/admin/**")
.hasAnyAuthority(SpPermission.SYSTEM_ADMIN)
.antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/**")
.hasAnyAuthority(SpPermission.SYSTEM_DIAG);
}
}

View File

@@ -9,20 +9,19 @@
package org.eclipse.hawkbit.autoconfigure.web;
import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi;
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi;
import org.eclipse.hawkbit.system.annotation.EnableSystemApi;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
* Auto-Configuration for enabling the REST-Resources.
*
*
*
*/
@Configuration
@ConditionalOnClass({ EnableDdiApi.class, EnableRestResources.class })
@Import({ EnableDdiApi.class, EnableRestResources.class })
@ConditionalOnClass({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class })
@Import({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class })
public class ResourceControllerAutoConfiguration {
}

View File

@@ -1,4 +1,14 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
@@ -9,12 +19,19 @@
</parent>
<artifactId>hawkbit-ddi-api</artifactId>
<name>hawkBit :: DDI API</name>
<dependencies>
<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-api</artifactId>
<version>${project.version}</version>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -22,17 +39,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>

View File

@@ -10,13 +10,13 @@ package org.eclipse.hawkbit.ddi.json.model;
import javax.validation.constraints.NotNull;
import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactHash;
import org.springframework.hateoas.ResourceSupport;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Download information for all artifacts related to a specific {@link DdiChunk}.
* Download information for all artifacts related to a specific {@link DdiChunk}
* .
*/
public class DdiArtifact extends ResourceSupport {
@@ -25,16 +25,16 @@ public class DdiArtifact extends ResourceSupport {
private String filename;
@JsonProperty
private ArtifactHash hashes;
private DdiArtifactHash hashes;
@JsonProperty
private Long size;
public ArtifactHash getHashes() {
public DdiArtifactHash getHashes() {
return hashes;
}
public void setHashes(final ArtifactHash hashes) {
public void setHashes(final DdiArtifactHash hashes) {
this.hashes = hashes;
}

View File

@@ -0,0 +1,57 @@
/**
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.json.model;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Hashes for given Artifact.
*
*
*/
public class DdiArtifactHash {
@JsonProperty
private String sha1;
@JsonProperty
private String md5;
/**
* Default constructor.
*/
public DdiArtifactHash() {
}
/**
* Public constructor.
*
* @param sha1
* @param md5
*/
public DdiArtifactHash(final String sha1, final String md5) {
this.sha1 = sha1;
this.md5 = md5;
}
/**
* @return the sha1
*/
public String getSha1() {
return sha1;
}
/**
* @return the md5
*/
public String getMd5() {
return md5;
}
}

View File

@@ -1,4 +1,14 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
@@ -10,31 +20,26 @@
<artifactId>hawkbit-ddi-resource</artifactId>
<name>hawkBit :: DDI Resources</name>
<dependencies>
<dependency>
<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-resource</artifactId>
<artifactId> hawkbit-rest-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-resource</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import java.io.IOException;
import java.util.List;
@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.repository.model.Action.Status;
import org.eclipse.hawkbit.repository.model.ActionStatus;
import org.eclipse.hawkbit.repository.model.LocalArtifact;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper;
import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper;
import org.eclipse.hawkbit.security.HawkbitSecurityProperties;
import org.eclipse.hawkbit.util.IpUtil;
import org.slf4j.Logger;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
import org.eclipse.hawkbit.api.UrlProtocol;
import org.eclipse.hawkbit.ddi.json.model.DdiArtifact;
import org.eclipse.hawkbit.ddi.json.model.DdiArtifactHash;
import org.eclipse.hawkbit.ddi.json.model.DdiChunk;
import org.eclipse.hawkbit.ddi.json.model.DdiConfig;
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
@@ -30,7 +31,6 @@ import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.Action.Status;
import org.eclipse.hawkbit.repository.model.LocalArtifact;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactHash;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Link;
@@ -85,7 +85,7 @@ public final class DataConversionHelper {
final List<DdiArtifact> files = new ArrayList<>();
module.getLocalArtifacts().forEach(artifact -> {
final DdiArtifact file = new DdiArtifact();
file.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash()));
file.setHashes(new DdiArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash()));
file.setFilename(artifact.getFilename());
file.setSize(artifact.getSize());
final String linkHttp = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(),
@@ -104,7 +104,8 @@ public final class DataConversionHelper {
static DdiControllerBase fromTarget(final Target target, final List<Action> actions,
final String defaultControllerPollTime, final TenantAware tenantAware) {
final DdiControllerBase result = new DdiControllerBase(new DdiConfig(new DdiPolling(defaultControllerPollTime)));
final DdiControllerBase result = new DdiControllerBase(
new DdiConfig(new DdiPolling(defaultControllerPollTime)));
boolean addedUpdate = false;
boolean addedCancel = false;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import java.io.IOException;
import java.util.List;
@@ -40,7 +40,7 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper;
import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper;
import org.eclipse.hawkbit.security.HawkbitSecurityProperties;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.eclipse.hawkbit.util.IpUtil;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
@@ -60,10 +60,10 @@ import ru.yandex.qatools.allure.annotations.Stories;
@ActiveProfiles({ "im", "test" })
@Features("Component Tests - Direct Device Integration API")
@Stories("Artifact Download Resource")
public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
public class DdiArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB {
public ArtifactDownloadTest() {
LOG = LoggerFactory.getLogger(ArtifactDownloadTest.class);
public DdiArtifactDownloadTest() {
LOG = LoggerFactory.getLogger(DdiArtifactDownloadTest.class);
}
private volatile int downLoadProgress = 0;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.equalTo;
@@ -23,13 +23,11 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.AbstractIntegrationTest;
import org.eclipse.hawkbit.MockMvcResultPrinter;
import org.eclipse.hawkbit.TestDataUtil;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.Action.Status;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.rest.resource.JsonBuilder;
import org.junit.Test;
import org.springframework.hateoas.MediaTypes;
import org.springframework.http.MediaType;
@@ -45,7 +43,7 @@ import ru.yandex.qatools.allure.annotations.Stories;
@ActiveProfiles({ "im", "test" })
@Features("Component Tests - Direct Device Integration API")
@Stories("Cancel Action Resource")
public class CancelActionTest extends AbstractIntegrationTest {
public class DdiCancelActionTest extends AbstractIntegrationTest {
@Test
@Description("Test of the controller can continue a started update even after a cancel command if it so desires.")

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.equalTo;
@@ -22,9 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.hawkbit.AbstractIntegrationTest;
import org.eclipse.hawkbit.MockMvcResultPrinter;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.rest.resource.JsonBuilder;
import org.junit.Test;
import org.springframework.hateoas.MediaTypes;
import org.springframework.http.MediaType;
@@ -40,7 +38,7 @@ import ru.yandex.qatools.allure.annotations.Stories;
@ActiveProfiles({ "im", "test" })
@Features("Component Tests - Direct Device Integration API")
@Stories("Config Data Resource")
public class ConfigDataTest extends AbstractIntegrationTest {
public class DdiConfigDataTest extends AbstractIntegrationTest {
@Test
@Description("We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) "

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.equalTo;
@@ -26,7 +26,6 @@ import java.util.List;
import org.apache.commons.lang3.RandomUtils;
import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB;
import org.eclipse.hawkbit.MockMvcResultPrinter;
import org.eclipse.hawkbit.TestDataUtil;
import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.Action.ActionType;
@@ -36,7 +35,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.LocalArtifact;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.rest.resource.JsonBuilder;
import org.fest.assertions.core.Condition;
import org.junit.Test;
import org.springframework.data.domain.PageRequest;
@@ -57,7 +55,7 @@ import ru.yandex.qatools.allure.annotations.Stories;
@ActiveProfiles({ "im", "test" })
@Features("Component Tests - Direct Device Integration API")
@Stories("Deployment Action Resource")
public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
public class DdiDeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
@Test()
@Description("Ensures that artifacts are not found, when softare module does not exists.")

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ddi.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.equalTo;
@@ -23,7 +23,6 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB;
import org.eclipse.hawkbit.MockMvcResultPrinter;
import org.eclipse.hawkbit.TestDataUtil;
import org.eclipse.hawkbit.WithSpringAuthorityRule;
import org.eclipse.hawkbit.WithUser;
@@ -33,7 +32,6 @@ import org.eclipse.hawkbit.repository.model.Action;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.rest.resource.JsonBuilder;
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
import org.eclipse.hawkbit.util.IpUtil;
import org.junit.Test;
@@ -51,7 +49,7 @@ import ru.yandex.qatools.allure.annotations.Stories;
@ActiveProfiles({ "im", "test" })
@Features("Component Tests - Direct Device Integration API")
@Stories("Root Poll Resource")
public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
public class DdiRootControllerTest extends AbstractIntegrationTestWithMongoDB {
@Test
@Description("Ensures that targets cannot be created e.g. in plug'n play scenarios when tenant does not exists but can be created if the tenant exists.")

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource;
package org.eclipse.hawkbit.ddi.rest.resource;
import java.util.ArrayList;
import java.util.List;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit;
package org.eclipse.hawkbit.ddi.rest.resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

53
hawkbit-mgmt-api/pom.xml Normal file
View File

@@ -0,0 +1,53 @@
<!--
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
</parent>
<artifactId>hawkbit-mgmt-api</artifactId>
<name>hawkBit :: Mgmt REST API</name>
<dependencies>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-junit-adaptor</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import org.springframework.hateoas.ResourceSupport;
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* A json annotated rest model for BaseEntity to RESTful API representation.
*
*/
public abstract class BaseEntityRest extends ResourceSupport {
public abstract class MgmtBaseEntity extends ResourceSupport {
@JsonProperty
private String createdBy;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class IdRest {
public class MgmtId {
@JsonProperty
private Long id;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* A json annotated rest model for NamedEntity to RESTful API representation.
*
*/
public abstract class NamedEntityRest extends BaseEntityRest {
public abstract class MgmtNamedEntity extends MgmtBaseEntity {
@JsonProperty(required = true)
private String name;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class PollStatusRest {
public class MgmtPollStatus {
@JsonProperty
private Long lastRequestAt;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import java.util.List;

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.action;
package org.eclipse.hawkbit.mgmt.json.model.action;
import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ActionRest extends BaseEntityRest {
public class MgmtAction extends MgmtBaseEntity {
/**
* API definition for {@link UpdateAction}.

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.action;
package org.eclipse.hawkbit.mgmt.json.model.action;
import java.util.List;
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ActionStatusRest {
public class MgmtActionStatus {
/**
* Action is finished successfully for this target.

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.artifact;
package org.eclipse.hawkbit.mgmt.json.model.artifact;
import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -22,7 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ArtifactRest extends BaseEntityRest {
public class MgmtArtifact extends MgmtBaseEntity {
@JsonProperty(required = true)
private ArtifactType type;
@@ -30,7 +31,7 @@ public class ArtifactRest extends BaseEntityRest {
private Long artifactId;
@JsonProperty
private ArtifactHash hashes;
private MgmtArtifactHash hashes;
@JsonProperty
private String providedFilename;
@@ -51,7 +52,7 @@ public class ArtifactRest extends BaseEntityRest {
* the hashes to set
*/
@JsonIgnore
public void setHashes(final ArtifactHash hashes) {
public void setHashes(final MgmtArtifactHash hashes) {
this.hashes = hashes;
}
@@ -81,7 +82,7 @@ public class ArtifactRest extends BaseEntityRest {
/**
* @return the hashes
*/
public ArtifactHash getHashes() {
public MgmtArtifactHash getHashes() {
return hashes;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.artifact;
package org.eclipse.hawkbit.mgmt.json.model.artifact;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*
*
*/
public class ArtifactHash {
public class MgmtArtifactHash {
@JsonProperty
private String sha1;
@@ -26,7 +26,7 @@ public class ArtifactHash {
/**
* Default constructor.
*/
public ArtifactHash() {
public MgmtArtifactHash() {
}
/**
@@ -35,7 +35,7 @@ public class ArtifactHash {
* @param sha1
* @param md5
*/
public ArtifactHash(final String sha1, final String md5) {
public MgmtArtifactHash(final String sha1, final String md5) {
super();
this.sha1 = sha1;
this.md5 = md5;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import com.fasterxml.jackson.annotation.JsonValue;
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
*
*
*/
public enum ActionTypeRest {
public enum MgmtActionType {
/**
* The soft action type.
*/
@@ -35,7 +35,7 @@ public enum ActionTypeRest {
private final String name;
private ActionTypeRest(final String name) {
private MgmtActionType(final String name) {
this.name = name;
}

View File

@@ -6,13 +6,13 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistributionSetRest extends NamedEntityRest {
public class MgmtDistributionSet extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true)
private Long dsId;
@@ -39,7 +39,7 @@ public class DistributionSetRest extends NamedEntityRest {
private String version;
@JsonProperty
private List<SoftwareModuleRest> modules = new ArrayList<>();
private List<MgmtSoftwareModule> modules = new ArrayList<>();
@JsonProperty
private boolean requiredMigrationStep;
@@ -99,7 +99,7 @@ public class DistributionSetRest extends NamedEntityRest {
/**
* @return the modules
*/
public List<SoftwareModuleRest> getModules() {
public List<MgmtSoftwareModule> getModules() {
return modules;
}
@@ -107,7 +107,7 @@ public class DistributionSetRest extends NamedEntityRest {
* @param modules
* the modules to set
*/
public void setModules(final List<SoftwareModuleRest> modules) {
public void setModules(final List<MgmtSoftwareModule> modules) {
this.modules = modules;
}

View File

@@ -6,11 +6,11 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -23,22 +23,22 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPut {
public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetRequestBodyPut {
// deprecated format from the time where os, application and runtime where
// statically defined
@JsonProperty
private SoftwareModuleAssigmentRest os;
private MgmtSoftwareModuleAssigment os;
@JsonProperty
private SoftwareModuleAssigmentRest runtime;
private MgmtSoftwareModuleAssigment runtime;
@JsonProperty
private SoftwareModuleAssigmentRest application;
private MgmtSoftwareModuleAssigment application;
// deprecated format - END
@JsonProperty
private List<SoftwareModuleAssigmentRest> modules;
private List<MgmtSoftwareModuleAssigment> modules;
@JsonProperty
private boolean requiredMigrationStep;
@@ -49,7 +49,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
/**
* @return the os
*/
public SoftwareModuleAssigmentRest getOs() {
public MgmtSoftwareModuleAssigment getOs() {
return os;
}
@@ -59,7 +59,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setOs(final SoftwareModuleAssigmentRest os) {
public MgmtDistributionSetRequestBodyPost setOs(final MgmtSoftwareModuleAssigment os) {
this.os = os;
return this;
}
@@ -67,7 +67,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
/**
* @return the runtime
*/
public SoftwareModuleAssigmentRest getRuntime() {
public MgmtSoftwareModuleAssigment getRuntime() {
return runtime;
}
@@ -77,7 +77,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setRuntime(final SoftwareModuleAssigmentRest runtime) {
public MgmtDistributionSetRequestBodyPost setRuntime(final MgmtSoftwareModuleAssigment runtime) {
this.runtime = runtime;
return this;
@@ -86,7 +86,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
/**
* @return the application
*/
public SoftwareModuleAssigmentRest getApplication() {
public MgmtSoftwareModuleAssigment getApplication() {
return application;
}
@@ -96,7 +96,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setApplication(final SoftwareModuleAssigmentRest application) {
public MgmtDistributionSetRequestBodyPost setApplication(final MgmtSoftwareModuleAssigment application) {
this.application = application;
return this;
@@ -115,7 +115,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) {
public MgmtDistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) {
this.requiredMigrationStep = requiredMigrationStep;
return this;
@@ -124,7 +124,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
/**
* @return the modules
*/
public List<SoftwareModuleAssigmentRest> getModules() {
public List<MgmtSoftwareModuleAssigment> getModules() {
return modules;
}
@@ -134,7 +134,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setModules(final List<SoftwareModuleAssigmentRest> modules) {
public MgmtDistributionSetRequestBodyPost setModules(final List<MgmtSoftwareModuleAssigment> modules) {
this.modules = modules;
return this;
@@ -153,7 +153,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu
*
* @return updated body
*/
public DistributionSetRequestBodyPost setType(final String type) {
public MgmtDistributionSetRequestBodyPost setType(final String type) {
this.type = type;
return this;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistributionSetRequestBodyPut {
public class MgmtDistributionSetRequestBodyPut {
@JsonProperty
private String name;
@@ -43,7 +43,7 @@ public class DistributionSetRequestBodyPut {
*
* @return updated body
*/
public DistributionSetRequestBodyPut setName(final String name) {
public MgmtDistributionSetRequestBodyPut setName(final String name) {
this.name = name;
return this;
}
@@ -61,7 +61,7 @@ public class DistributionSetRequestBodyPut {
*
* @return updated body
*/
public DistributionSetRequestBodyPut setDescription(final String description) {
public MgmtDistributionSetRequestBodyPut setDescription(final String description) {
this.description = description;
return this;
@@ -80,7 +80,7 @@ public class DistributionSetRequestBodyPut {
*
* @return updated body
*/
public DistributionSetRequestBodyPut setVersion(final String version) {
public MgmtDistributionSetRequestBodyPut setVersion(final String version) {
this.version = version;
return this;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -16,14 +16,14 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class TargetAssignmentRequestBody {
public class MgmtTargetAssignmentRequestBody {
@JsonProperty
private String id;
private long forcetime;
private ActionTypeRest type;
private MgmtActionType type;
/**
* @return the id
@@ -43,7 +43,7 @@ public class TargetAssignmentRequestBody {
/**
* @return the type
*/
public ActionTypeRest getType() {
public MgmtActionType getType() {
return type;
}
@@ -51,7 +51,7 @@ public class TargetAssignmentRequestBody {
* @param type
* the type to set
*/
public void setType(final ActionTypeRest type) {
public void setType(final MgmtActionType type) {
this.type = type;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionset;
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TargetAssignmentResponseBody {
public class MgmtTargetAssignmentResponseBody {
private int assigned;
private int alreadyAssigned;

View File

@@ -6,11 +6,11 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
package org.eclipse.hawkbit.mgmt.json.model.distributionsettype;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeAssigmentRest;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for DistributionSetType POST.
*
*/
public class DistributionSetTypeRequestBodyPost {
public class MgmtDistributionSetTypeRequestBodyPost {
@JsonProperty(required = true)
private String name;
@@ -30,10 +30,10 @@ public class DistributionSetTypeRequestBodyPost {
private String key;
@JsonProperty
private List<SoftwareModuleTypeAssigmentRest> mandatorymodules;
private List<MgmtSoftwareModuleTypeAssigment> mandatorymodules;
@JsonProperty
private List<SoftwareModuleTypeAssigmentRest> optionalmodules;
private List<MgmtSoftwareModuleTypeAssigment> optionalmodules;
/**
* @return the name
@@ -48,7 +48,7 @@ public class DistributionSetTypeRequestBodyPost {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPost setName(final String name) {
public MgmtDistributionSetTypeRequestBodyPost setName(final String name) {
this.name = name;
return this;
}
@@ -66,7 +66,7 @@ public class DistributionSetTypeRequestBodyPost {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPost setDescription(final String description) {
public MgmtDistributionSetTypeRequestBodyPost setDescription(final String description) {
this.description = description;
return this;
}
@@ -84,7 +84,7 @@ public class DistributionSetTypeRequestBodyPost {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPost setKey(final String key) {
public MgmtDistributionSetTypeRequestBodyPost setKey(final String key) {
this.key = key;
return this;
}
@@ -92,7 +92,7 @@ public class DistributionSetTypeRequestBodyPost {
/**
* @return the mandatory modules
*/
public List<SoftwareModuleTypeAssigmentRest> getMandatorymodules() {
public List<MgmtSoftwareModuleTypeAssigment> getMandatorymodules() {
return mandatorymodules;
}
@@ -102,8 +102,8 @@ public class DistributionSetTypeRequestBodyPost {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPost setMandatorymodules(
final List<SoftwareModuleTypeAssigmentRest> mandatorymodules) {
public MgmtDistributionSetTypeRequestBodyPost setMandatorymodules(
final List<MgmtSoftwareModuleTypeAssigment> mandatorymodules) {
this.mandatorymodules = mandatorymodules;
return this;
}
@@ -111,7 +111,7 @@ public class DistributionSetTypeRequestBodyPost {
/**
* @return the optional modules
*/
public List<SoftwareModuleTypeAssigmentRest> getOptionalmodules() {
public List<MgmtSoftwareModuleTypeAssigment> getOptionalmodules() {
return optionalmodules;
}
@@ -121,8 +121,8 @@ public class DistributionSetTypeRequestBodyPost {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPost setOptionalmodules(
final List<SoftwareModuleTypeAssigmentRest> optionalmodules) {
public MgmtDistributionSetTypeRequestBodyPost setOptionalmodules(
final List<MgmtSoftwareModuleTypeAssigment> optionalmodules) {
this.optionalmodules = optionalmodules;
return this;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
package org.eclipse.hawkbit.mgmt.json.model.distributionsettype;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for DistributionSetType PUT, i.e. update.
*
*/
public class DistributionSetTypeRequestBodyPut {
public class MgmtDistributionSetTypeRequestBodyPut {
@JsonProperty
private String description;
@@ -32,7 +32,7 @@ public class DistributionSetTypeRequestBodyPut {
*
* @return updated body
*/
public DistributionSetTypeRequestBodyPut setDescription(final String description) {
public MgmtDistributionSetTypeRequestBodyPut setDescription(final String description) {
this.description = description;
return this;
}

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
package org.eclipse.hawkbit.mgmt.json.model.distributionsettype;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistributionSetTypeRest extends NamedEntityRest {
public class MgmtDistributionSetTypeRest extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true)
private Long moduleId;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rollout;
package org.eclipse.hawkbit.mgmt.json.model.rollout;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutCondition {
public class MgmtRolloutCondition {
private Condition condition = Condition.THRESHOLD;
private String expression = "100";
@@ -25,10 +25,11 @@ public class RolloutCondition {
/**
*
*/
public RolloutCondition() {
public MgmtRolloutCondition() {
// needed for jackson json creator.
}
public RolloutCondition(final Condition condition, final String expression) {
public MgmtRolloutCondition(final Condition condition, final String expression) {
this.condition = condition;
this.expression = expression;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rollout;
package org.eclipse.hawkbit.mgmt.json.model.rollout;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutErrorAction {
public class MgmtRolloutErrorAction {
private ErrorAction action = ErrorAction.PAUSE;
private String expression = null;

View File

@@ -6,12 +6,12 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rollout;
package org.eclipse.hawkbit.mgmt.json.model.rollout;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutResponseBody extends NamedEntityRest {
public class MgmtRolloutResponseBody extends MgmtNamedEntity {
private String targetFilterQuery;
private Long distributionSetId;

View File

@@ -6,10 +6,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rollout;
package org.eclipse.hawkbit.mgmt.json.model.rollout;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -21,26 +21,26 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutRestRequestBody extends NamedEntityRest {
public class MgmtRolloutRestRequestBody extends MgmtNamedEntity {
private String targetFilterQuery;
private long distributionSetId;
private int amountGroups = 1;
private RolloutCondition successCondition = new RolloutCondition();
private RolloutSuccessAction successAction = new RolloutSuccessAction();
private RolloutCondition errorCondition = null;
private RolloutErrorAction errorAction = null;
private MgmtRolloutCondition successCondition = new MgmtRolloutCondition();
private MgmtRolloutSuccessAction successAction = new MgmtRolloutSuccessAction();
private MgmtRolloutCondition errorCondition = null;
private MgmtRolloutErrorAction errorAction = null;
private Long forcetime;
private ActionTypeRest type;
private MgmtActionType type;
/**
* @return the finishCondition
*/
public RolloutCondition getSuccessCondition() {
public MgmtRolloutCondition getSuccessCondition() {
return successCondition;
}
@@ -48,14 +48,14 @@ public class RolloutRestRequestBody extends NamedEntityRest {
* @param successCondition
* the finishCondition to set
*/
public void setSuccessCondition(final RolloutCondition successCondition) {
public void setSuccessCondition(final MgmtRolloutCondition successCondition) {
this.successCondition = successCondition;
}
/**
* @return the successAction
*/
public RolloutSuccessAction getSuccessAction() {
public MgmtRolloutSuccessAction getSuccessAction() {
return successAction;
}
@@ -63,14 +63,14 @@ public class RolloutRestRequestBody extends NamedEntityRest {
* @param successAction
* the successAction to set
*/
public void setSuccessAction(final RolloutSuccessAction successAction) {
public void setSuccessAction(final MgmtRolloutSuccessAction successAction) {
this.successAction = successAction;
}
/**
* @return the errorCondition
*/
public RolloutCondition getErrorCondition() {
public MgmtRolloutCondition getErrorCondition() {
return errorCondition;
}
@@ -78,7 +78,7 @@ public class RolloutRestRequestBody extends NamedEntityRest {
* @param errorCondition
* the errorCondition to set
*/
public void setErrorCondition(final RolloutCondition errorCondition) {
public void setErrorCondition(final MgmtRolloutCondition errorCondition) {
this.errorCondition = errorCondition;
}
@@ -145,7 +145,7 @@ public class RolloutRestRequestBody extends NamedEntityRest {
/**
* @return the type
*/
public ActionTypeRest getType() {
public MgmtActionType getType() {
return type;
}
@@ -153,14 +153,14 @@ public class RolloutRestRequestBody extends NamedEntityRest {
* @param type
* the type to set
*/
public void setType(final ActionTypeRest type) {
public void setType(final MgmtActionType type) {
this.type = type;
}
/**
* @return the errorAction
*/
public RolloutErrorAction getErrorAction() {
public MgmtRolloutErrorAction getErrorAction() {
return errorAction;
}
@@ -168,7 +168,7 @@ public class RolloutRestRequestBody extends NamedEntityRest {
* @param errorAction
* the errorAction to set
*/
public void setErrorAction(final RolloutErrorAction errorAction) {
public void setErrorAction(final MgmtRolloutErrorAction errorAction) {
this.errorAction = errorAction;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rollout;
package org.eclipse.hawkbit.mgmt.json.model.rollout;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutSuccessAction {
public class MgmtRolloutSuccessAction {
private SuccessAction action = SuccessAction.NEXTGROUP;
private String expression = null;
@@ -25,10 +25,11 @@ public class RolloutSuccessAction {
/**
*
*/
public RolloutSuccessAction() {
public MgmtRolloutSuccessAction() {
// needed for json creator
}
public RolloutSuccessAction(final SuccessAction action, final String expression) {
public MgmtRolloutSuccessAction(final SuccessAction action, final String expression) {
this.action = action;
this.expression = expression;
}

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.rolloutgroup;
package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RolloutGroupResponseBody extends NamedEntityRest {
public class MgmtRolloutGroupResponseBody extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true)
private Long rolloutGroupId;

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SoftwareModuleRest extends NamedEntityRest {
public class MgmtSoftwareModule extends MgmtNamedEntity {
/**
* API definition for {@link SoftwareModule.Type#RUNTIME}.
*/

View File

@@ -6,20 +6,17 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import org.eclipse.hawkbit.rest.resource.model.IdRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* Request Body of SoftwareModule for assignment operations (ID only).
*
*
*
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SoftwareModuleAssigmentRest extends IdRest {
public class MgmtSoftwareModuleAssigment extends MgmtId {
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for SoftwareModule POST.
*
*/
public class SoftwareModuleRequestBodyPost {
public class MgmtSoftwareModuleRequestBodyPost {
@JsonProperty(required = true)
private String name;
@@ -44,7 +44,7 @@ public class SoftwareModuleRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPost setName(final String name) {
public MgmtSoftwareModuleRequestBodyPost setName(final String name) {
this.name = name;
return this;
}
@@ -62,7 +62,7 @@ public class SoftwareModuleRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPost setVersion(final String version) {
public MgmtSoftwareModuleRequestBodyPost setVersion(final String version) {
this.version = version;
return this;
}
@@ -80,7 +80,7 @@ public class SoftwareModuleRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPost setType(final String type) {
public MgmtSoftwareModuleRequestBodyPost setType(final String type) {
this.type = type;
return this;
}
@@ -98,7 +98,7 @@ public class SoftwareModuleRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPost setDescription(final String description) {
public MgmtSoftwareModuleRequestBodyPost setDescription(final String description) {
this.description = description;
return this;
}
@@ -116,7 +116,7 @@ public class SoftwareModuleRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPost setVendor(final String vendor) {
public MgmtSoftwareModuleRequestBodyPost setVendor(final String vendor) {
this.vendor = vendor;
return this;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
package org.eclipse.hawkbit.mgmt.json.model.softwaremodule;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for SoftwareModule PUT.
*
*/
public class SoftwareModuleRequestBodyPut {
public class MgmtSoftwareModuleRequestBodyPut {
@JsonProperty
private String description;
@@ -35,7 +35,7 @@ public class SoftwareModuleRequestBodyPut {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPut setDescription(final String description) {
public MgmtSoftwareModuleRequestBodyPut setDescription(final String description) {
this.description = description;
return this;
}
@@ -53,7 +53,7 @@ public class SoftwareModuleRequestBodyPut {
*
* @return updated body
*/
public SoftwareModuleRequestBodyPut setVendor(final String vendor) {
public MgmtSoftwareModuleRequestBodyPut setVendor(final String vendor) {
this.vendor = vendor;
return this;
}

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SoftwareModuleTypeRest extends NamedEntityRest {
public class MgmtSoftwareModuleType extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true)
private Long moduleId;

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import org.eclipse.hawkbit.rest.resource.model.IdRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -17,6 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SoftwareModuleTypeAssigmentRest extends IdRest {
public class MgmtSoftwareModuleTypeAssigment extends MgmtId {
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for SoftwareModuleType POST.
*
*/
public class SoftwareModuleTypeRequestBodyPost {
public class MgmtSoftwareModuleTypeRequestBodyPost {
@JsonProperty(required = true)
private String name;
@@ -41,7 +41,7 @@ public class SoftwareModuleTypeRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleTypeRequestBodyPost setName(final String name) {
public MgmtSoftwareModuleTypeRequestBodyPost setName(final String name) {
this.name = name;
return this;
}
@@ -59,7 +59,7 @@ public class SoftwareModuleTypeRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleTypeRequestBodyPost setDescription(final String description) {
public MgmtSoftwareModuleTypeRequestBodyPost setDescription(final String description) {
this.description = description;
return this;
}
@@ -76,7 +76,7 @@ public class SoftwareModuleTypeRequestBodyPost {
* the key to set
* @return updated body
*/
public SoftwareModuleTypeRequestBodyPost setKey(final String key) {
public MgmtSoftwareModuleTypeRequestBodyPost setKey(final String key) {
this.key = key;
return this;
}
@@ -94,7 +94,7 @@ public class SoftwareModuleTypeRequestBodyPost {
*
* @return updated body
*/
public SoftwareModuleTypeRequestBodyPost setMaxAssignments(final int maxAssignments) {
public MgmtSoftwareModuleTypeRequestBodyPost setMaxAssignments(final int maxAssignments) {
this.maxAssignments = maxAssignments;
return this;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request Body for SoftwareModuleType PUT.
*
*/
public class SoftwareModuleTypeRequestBodyPut {
public class MgmtSoftwareModuleTypeRequestBodyPut {
@JsonProperty
private String description;
@@ -32,7 +32,7 @@ public class SoftwareModuleTypeRequestBodyPut {
*
* @return updated body
*/
public SoftwareModuleTypeRequestBodyPut setDescription(final String description) {
public MgmtSoftwareModuleTypeRequestBodyPut setDescription(final String description) {
this.description = description;
return this;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class AssignedDistributionSetRequestBody {
public class MgmtAssignedDistributionSetRequestBody {
@JsonProperty(value = "id", required = true)
private Long distributionSetId;
@@ -28,7 +28,7 @@ public class AssignedDistributionSetRequestBody {
return distributionSetId;
}
public AssignedDistributionSetRequestBody setDistributionSetId(final Long distributionSetId) {
public MgmtAssignedDistributionSetRequestBody setDistributionSetId(final Long distributionSetId) {
this.distributionSetId = distributionSetId;
return this;
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class AssignedTargetRequestBody {
public class MgmtAssignedTargetRequestBody {
@JsonProperty(required = true)
private String controllerId;
@@ -28,7 +28,7 @@ public class AssignedTargetRequestBody {
return controllerId;
}
public AssignedTargetRequestBody setControllerId(final String controllerId) {
public MgmtAssignedTargetRequestBody setControllerId(final String controllerId) {
this.controllerId = controllerId;
return this;
}

View File

@@ -6,11 +6,11 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -24,27 +24,27 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DistributionSetTagAssigmentResultRest {
public class MgmtDistributionSetTagAssigmentResult {
@JsonProperty
private List<DistributionSetRest> assignedDistributionSets;
private List<MgmtDistributionSet> assignedDistributionSets;
@JsonProperty
private List<DistributionSetRest> unassignedDistributionSets;
private List<MgmtDistributionSet> unassignedDistributionSets;
public List<DistributionSetRest> getAssignedDistributionSets() {
public List<MgmtDistributionSet> getAssignedDistributionSets() {
return assignedDistributionSets;
}
public List<DistributionSetRest> getUnassignedDistributionSets() {
public List<MgmtDistributionSet> getUnassignedDistributionSets() {
return unassignedDistributionSets;
}
public void setAssignedDistributionSets(final List<DistributionSetRest> assignedDistributionSets) {
public void setAssignedDistributionSets(final List<MgmtDistributionSet> assignedDistributionSets) {
this.assignedDistributionSets = assignedDistributionSets;
}
public void setUnassignedDistributionSets(final List<DistributionSetRest> unassignedDistributionSets) {
public void setUnassignedDistributionSets(final List<MgmtDistributionSet> unassignedDistributionSets) {
this.unassignedDistributionSets = unassignedDistributionSets;
}

View File

@@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TagRest extends NamedEntityRest {
public class MgmtTag extends MgmtNamedEntity {
@JsonProperty(value = "id", required = true)
private Long tagId;

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TagRequestBodyPut {
public class MgmtTagRequestBodyPut {
@JsonProperty
private String colour;
@@ -34,7 +34,7 @@ public class TagRequestBodyPut {
return name;
}
public TagRequestBodyPut setName(final String name) {
public MgmtTagRequestBodyPut setName(final String name) {
this.name = name;
return this;
}
@@ -43,12 +43,12 @@ public class TagRequestBodyPut {
return description;
}
public TagRequestBodyPut setDescription(final String description) {
public MgmtTagRequestBodyPut setDescription(final String description) {
this.description = description;
return this;
}
public TagRequestBodyPut setColour(final String colour) {
public MgmtTagRequestBodyPut setColour(final String colour) {
this.colour = colour;
return this;
}

View File

@@ -6,11 +6,11 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model.tag;
package org.eclipse.hawkbit.mgmt.json.model.tag;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -24,27 +24,27 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TargetTagAssigmentResultRest {
public class MgmtTargetTagAssigmentResult {
@JsonProperty
private List<TargetRest> assignedTargets;
private List<MgmtTarget> assignedTargets;
@JsonProperty
private List<TargetRest> unassignedTargets;
private List<MgmtTarget> unassignedTargets;
public void setAssignedTargets(final List<TargetRest> assignedTargets) {
public void setAssignedTargets(final List<MgmtTarget> assignedTargets) {
this.assignedTargets = assignedTargets;
}
public List<TargetRest> getAssignedTargets() {
public List<MgmtTarget> getAssignedTargets() {
return assignedTargets;
}
public void setUnassignedTargets(final List<TargetRest> unassignedTargets) {
public void setUnassignedTargets(final List<MgmtTarget> unassignedTargets) {
this.unassignedTargets = unassignedTargets;
}
public List<TargetRest> getUnassignedTargets() {
public List<MgmtTarget> getUnassignedTargets() {
return unassignedTargets;
}

View File

@@ -1,23 +1,23 @@
/**
* Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved.
*/
package org.eclipse.hawkbit.rest.resource.model.target;
package org.eclipse.hawkbit.mgmt.json.model.target;
import org.eclipse.hawkbit.rest.resource.model.IdRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
/**
* Request Body of DistributionSet for assignment operations (ID only).
*
*/
public class DistributionSetAssigmentRest extends IdRest {
public class MgmtDistributionSetAssigment extends MgmtId {
private long forcetime;
private ActionTypeRest type;
private MgmtActionType type;
/**
* @return the type
*/
public ActionTypeRest getType() {
public MgmtActionType getType() {
return type;
}
@@ -25,7 +25,7 @@ public class DistributionSetAssigmentRest extends IdRest {
* @param type
* the type to set
*/
public void setType(final ActionTypeRest type) {
public void setType(final MgmtActionType type) {
this.type = type;
}

View File

@@ -1,12 +1,12 @@
/**
* Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved.
*/
package org.eclipse.hawkbit.rest.resource.model.target;
package org.eclipse.hawkbit.mgmt.json.model.target;
import java.net.URI;
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
import org.eclipse.hawkbit.rest.resource.model.PollStatusRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity;
import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TargetRest extends NamedEntityRest {
public class MgmtTarget extends MgmtNamedEntity {
@JsonProperty(required = true)
private String controllerId;
@@ -41,7 +41,7 @@ public class TargetRest extends NamedEntityRest {
private String address;
@JsonProperty
private PollStatusRest pollStatus;
private MgmtPollStatus pollStatus;
@JsonProperty
private String securityToken;
@@ -111,7 +111,7 @@ public class TargetRest extends NamedEntityRest {
/**
* @return the pollStatus
*/
public PollStatusRest getPollStatus() {
public MgmtPollStatus getPollStatus() {
return pollStatus;
}
@@ -120,7 +120,7 @@ public class TargetRest extends NamedEntityRest {
* the pollStatus to set
*/
@JsonIgnore
public void setPollStatus(final PollStatusRest pollStatus) {
public void setPollStatus(final MgmtPollStatus pollStatus) {
this.pollStatus = pollStatus;
}

View File

@@ -1,7 +1,7 @@
/**
* Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved.
*/
package org.eclipse.hawkbit.rest.resource.model.target;
package org.eclipse.hawkbit.mgmt.json.model.target;
import java.util.HashMap;
import java.util.Map;
@@ -10,6 +10,6 @@ import java.util.Map;
* {@link Map} with attributes of SP Target.
*
*/
public class TargetAttributes extends HashMap<String, String> {
public class MgmtTargetAttributes extends HashMap<String, String> {
}

View File

@@ -1,7 +1,7 @@
/**
* Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved.
*/
package org.eclipse.hawkbit.rest.resource.model.target;
package org.eclipse.hawkbit.mgmt.json.model.target;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Request body for target PUT/POST commands.
*
*/
public class TargetRequestBody {
public class MgmtTargetRequestBody {
@JsonProperty(required = true)
private String name;
@@ -43,7 +43,7 @@ public class TargetRequestBody {
* @param name
* the name to set
*/
public TargetRequestBody setName(final String name) {
public MgmtTargetRequestBody setName(final String name) {
this.name = name;
return this;
}
@@ -52,7 +52,7 @@ public class TargetRequestBody {
* @param description
* the description to set
*/
public TargetRequestBody setDescription(final String description) {
public MgmtTargetRequestBody setDescription(final String description) {
this.description = description;
return this;
}
@@ -61,7 +61,7 @@ public class TargetRequestBody {
* @param controllerId
* the controllerId to set
*/
public TargetRequestBody setControllerId(final String controllerId) {
public MgmtTargetRequestBody setControllerId(final String controllerId) {
this.controllerId = controllerId;
return this;
}

View File

@@ -7,21 +7,20 @@
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.MetadataRest;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentRequestBody;
import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.mgmt.json.model.MetadataRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPut;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -33,8 +32,8 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* REST Resource handling for DistributionSet CRUD operations.
*/
@RequestMapping(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)
public interface DistributionSetRestApi {
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)
public interface MgmtDistributionSetRestApi {
/**
* Handles the GET request of retrieving all DistributionSets .
@@ -56,11 +55,11 @@ public interface DistributionSetRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<DistributionSetRest>> getDistributionSets(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
public ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single DistributionSet .
@@ -75,7 +74,7 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<DistributionSetRest> getDistributionSet(
public ResponseEntity<MgmtDistributionSet> getDistributionSet(
@PathVariable("distributionSetId") final Long distributionSetId);
/**
@@ -91,8 +90,8 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE,
"application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<DistributionSetRest>> createDistributionSets(
@RequestBody final List<DistributionSetRequestBodyPost> sets);
public ResponseEntity<List<MgmtDistributionSet>> createDistributionSets(
@RequestBody final List<MgmtDistributionSetRequestBodyPost> sets);
/**
* Handles the DELETE request for a single DistributionSet .
@@ -118,9 +117,9 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<DistributionSetRest> updateDistributionSet(
public ResponseEntity<MgmtDistributionSet> updateDistributionSet(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestBody final DistributionSetRequestBodyPut toUpdate);
@RequestBody final MgmtDistributionSetRequestBodyPut toUpdate);
/**
* Handles the GET request of retrieving assigned targets to a specific
@@ -146,12 +145,12 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedTargets", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<TargetRest>> getAssignedTargets(
public ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving installed targets to a specific
@@ -177,12 +176,12 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/installedTargets", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<TargetRest>> getInstalledTargets(
public ResponseEntity<PagedList<MgmtTarget>> getInstalledTargets(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the POST request of assigning multiple targets to a single
@@ -200,9 +199,9 @@ public interface DistributionSetRestApi {
@RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/assignedTargets", consumes = {
"application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<TargetAssignmentResponseBody> createAssignedTarget(
public ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestBody final List<TargetAssignmentRequestBody> targetIds);
@RequestBody final List<MgmtTargetAssignmentRequestBody> targetIds);
/**
* Gets a paged list of meta data for a distribution set.
@@ -228,10 +227,10 @@ public interface DistributionSetRestApi {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<MetadataRest>> getMetadata(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Gets a single meta data value for a specific key of a distribution set.
@@ -311,7 +310,7 @@ public interface DistributionSetRestApi {
MediaType.APPLICATION_JSON_VALUE,
"application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId,
@RequestBody final List<SoftwareModuleAssigmentRest> softwareModuleIDs);
@RequestBody final List<MgmtSoftwareModuleAssigment> softwareModuleIDs);
/**
* Deletes the assignment of the software module form the distribution set.
@@ -355,9 +354,9 @@ public interface DistributionSetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedSM", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<SoftwareModuleRest>> getAssignedSoftwareModules(
public ResponseEntity<PagedList<MgmtSoftwareModule>> getAssignedSoftwareModules(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam);
}

View File

@@ -2,21 +2,20 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.tag.AssignedDistributionSetRequestBody;
import org.eclipse.hawkbit.rest.resource.model.tag.DistributionSetTagAssigmentResultRest;
import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.tag.TagRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedDistributionSetRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtDistributionSetTagAssigmentResult;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -29,8 +28,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* REST Resource handling for DistributionSetTag CRUD operations.
*
*/
@RequestMapping(RestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING)
public interface DistributionSetTagRestApi {
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING)
public interface MgmtDistributionSetTagRestApi {
/**
* Handles the GET request of retrieving all DistributionSet tags.
*
@@ -52,11 +51,11 @@ public interface DistributionSetTagRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<TagRest>> getDistributionSetTags(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtTag>> getDistributionSetTags(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single distribution set tag.
@@ -71,7 +70,7 @@ public interface DistributionSetTagRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionsetTagId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TagRest> getDistributionSetTag(
ResponseEntity<MgmtTag> getDistributionSetTag(
@PathVariable("distributionsetTagId") final Long distributionsetTagId);
/**
@@ -86,7 +85,7 @@ public interface DistributionSetTagRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<TagRest>> createDistributionSetTags(@RequestBody final List<TagRequestBodyPut> tags);
ResponseEntity<List<MgmtTag>> createDistributionSetTags(@RequestBody final List<MgmtTagRequestBodyPut> tags);
/**
*
@@ -104,9 +103,9 @@ public interface DistributionSetTagRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{distributionsetTagId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TagRest> updateDistributionSetTag(
ResponseEntity<MgmtTag> updateDistributionSetTag(
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
@RequestBody final TagRequestBodyPut restDSTagRest);
@RequestBody final MgmtTagRequestBodyPut restDSTagRest);
/**
* Handles the DELETE request for a single distribution set tag.
@@ -120,7 +119,7 @@ public interface DistributionSetTagRestApi {
*
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{distributionsetTagId}")
public ResponseEntity<Void> deleteDistributionSetTag(
ResponseEntity<Void> deleteDistributionSetTag(
@PathVariable("distributionsetTagId") final Long distributionsetTagId);
/**
@@ -135,8 +134,8 @@ public interface DistributionSetTagRestApi {
* in case the given {@code distributionsetTagId} doesn't
* exists.
*/
@RequestMapping(method = RequestMethod.GET, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
public ResponseEntity<List<DistributionSetRest>> getAssignedDistributionSets(
@RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
ResponseEntity<List<MgmtDistributionSet>> getAssignedDistributionSets(
@PathVariable("distributionsetTagId") final Long distributionsetTagId);
/**
@@ -154,11 +153,11 @@ public interface DistributionSetTagRestApi {
* in case the given {@code distributionsetTagId} doesn't
* exists.
*/
@RequestMapping(method = RequestMethod.POST, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING
+ "/toggleTagAssignment")
public ResponseEntity<DistributionSetTagAssigmentResultRest> toggleTagAssignment(
ResponseEntity<MgmtDistributionSetTagAssigmentResult> toggleTagAssignment(
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
@RequestBody final List<AssignedDistributionSetRequestBody> assignedDSRequestBodies);
@RequestBody final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
/**
* Handles the POST request to assign distribution sets to the given tag id.
@@ -173,10 +172,10 @@ public interface DistributionSetTagRestApi {
* in case the given {@code distributionsetTagId} doesn't
* exists.
*/
@RequestMapping(method = RequestMethod.POST, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
public ResponseEntity<List<DistributionSetRest>> assignDistributionSets(
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
ResponseEntity<List<MgmtDistributionSet>> assignDistributionSets(
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
@RequestBody final List<AssignedDistributionSetRequestBody> assignedDSRequestBodies);
@RequestBody final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
/**
* Handles the DELETE request to unassign all distribution set from the
@@ -189,8 +188,8 @@ public interface DistributionSetTagRestApi {
* in case the given {@code distributionsetTagId} doesn't
* exists.
*/
@RequestMapping(method = RequestMethod.DELETE, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
public ResponseEntity<Void> unassignDistributionSets(
@RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
ResponseEntity<Void> unassignDistributionSets(
@PathVariable("distributionsetTagId") final Long distributionsetTagId);
/**
@@ -206,9 +205,8 @@ public interface DistributionSetTagRestApi {
* in case the given {@code distributionsetTagId} doesn't
* exists.
*/
@RequestMapping(method = RequestMethod.DELETE, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING
@RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING
+ "/{distributionsetId}")
public ResponseEntity<Void> unassignDistributionSet(
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
ResponseEntity<Void> unassignDistributionSet(@PathVariable("distributionsetTagId") final Long distributionsetTagId,
@PathVariable("distributionsetId") final Long distributionsetId);
}

View File

@@ -2,21 +2,20 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.IdRest;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.MgmtId;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut;
import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* operations.
*
*/
@RequestMapping(RestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)
public interface DistributionSetTypeRestApi {
@RequestMapping(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)
public interface MgmtDistributionSetTypeRestApi {
/**
* Handles the GET request of retrieving all DistributionSetTypes.
@@ -55,11 +54,11 @@ public interface DistributionSetTypeRestApi {
* response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<DistributionSetTypeRest>> getDistributionSetTypes(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtDistributionSetTypeRest>> getDistributionSetTypes(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single DistributionSetType
@@ -74,7 +73,7 @@ public interface DistributionSetTypeRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<DistributionSetTypeRest> getDistributionSetType(
ResponseEntity<MgmtDistributionSetTypeRest> getDistributionSetType(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId);
/**
@@ -86,7 +85,7 @@ public interface DistributionSetTypeRestApi {
*
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}")
public ResponseEntity<Void> deleteDistributionSetType(
ResponseEntity<Void> deleteDistributionSetType(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId);
/**
@@ -100,9 +99,9 @@ public interface DistributionSetTypeRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetTypeId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<DistributionSetTypeRest> updateDistributionSetType(
ResponseEntity<MgmtDistributionSetTypeRest> updateDistributionSetType(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@RequestBody final DistributionSetTypeRequestBodyPut restDistributionSetType);
@RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType);
/**
* Handles the POST request of creating new DistributionSetTypes. The
@@ -117,8 +116,8 @@ public interface DistributionSetTypeRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<DistributionSetTypeRest>> createDistributionSetTypes(
@RequestBody final List<DistributionSetTypeRequestBodyPost> distributionSetTypes);
ResponseEntity<List<MgmtDistributionSetTypeRest>> createDistributionSetTypes(
@RequestBody final List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes);
/**
* Handles the GET request of retrieving the list of mandatory software
@@ -129,9 +128,9 @@ public interface DistributionSetTypeRestApi {
* @return Unpaged list of module types and OK in case of success.
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { "application/hal+json",
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<SoftwareModuleTypeRest>> getMandatoryModules(
ResponseEntity<List<MgmtSoftwareModuleType>> getMandatoryModules(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId);
/**
@@ -145,9 +144,9 @@ public interface DistributionSetTypeRestApi {
* @return Unpaged list of module types and OK in case of success.
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleTypeRest> getMandatoryModule(
ResponseEntity<MgmtSoftwareModuleType> getMandatoryModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
@@ -162,9 +161,9 @@ public interface DistributionSetTypeRestApi {
* @return Unpaged list of module types and OK in case of success.
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleTypeRest> getOptionalModule(
ResponseEntity<MgmtSoftwareModuleType> getOptionalModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
@@ -177,9 +176,9 @@ public interface DistributionSetTypeRestApi {
* @return Unpaged list of module types and OK in case of success.
*/
@RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { "application/hal+json",
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<SoftwareModuleTypeRest>> getOptionalModules(
ResponseEntity<List<MgmtSoftwareModuleType>> getOptionalModules(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId);
/**
@@ -194,10 +193,9 @@ public interface DistributionSetTypeRestApi {
* @return OK if the request was successful
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> removeMandatoryModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
ResponseEntity<Void> removeMandatoryModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
/**
@@ -212,10 +210,9 @@ public interface DistributionSetTypeRestApi {
* @return OK if the request was successful
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES
+ "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> removeOptionalModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
ResponseEntity<Void> removeOptionalModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
/**
@@ -230,11 +227,11 @@ public interface DistributionSetTypeRestApi {
* @return OK if the request was successful
*/
@RequestMapping(method = RequestMethod.POST, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { "application/hal+json",
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> addMandatoryModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final IdRest smtId);
ResponseEntity<Void> addMandatoryModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@RequestBody final MgmtId smtId);
/**
* Handles the POST request for adding an optional software module type to a
@@ -248,10 +245,10 @@ public interface DistributionSetTypeRestApi {
* @return OK if the request was successful
*/
@RequestMapping(method = RequestMethod.POST, value = "/{distributionSetTypeId}/"
+ RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { "application/hal+json",
+ MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> addOptionalModule(
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final IdRest smtId);
ResponseEntity<Void> addOptionalModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
@RequestBody final MgmtId smtId);
}

View File

@@ -0,0 +1,46 @@
/**
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.mgmt.rest.api;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
*
*/
@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
public interface MgmtDownloadArtifactRestApi {
/**
* Handles the GET request for downloading an artifact.
*
* @param softwareModuleId
* of the parent SoftwareModule
* @param artifactId
* of the related LocalArtifact
* @param servletResponse
* of the servlet
* @param request
* of the client
*
* @return responseEntity with status ok if successful
*/
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}/download")
@ResponseBody
ResponseEntity<Void> downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse,
final HttpServletRequest request);
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.mgmt.rest.api;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* A resource for download artifacts.
*
*/
@RequestMapping(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE)
public interface MgmtDownloadRestApi {
/**
* Handles the GET request for downloading an artifact.
*
* @param downloadId
* the generated download id
* @param response
* of the servlet
* @return {@link ResponseEntity} with status {@link HttpStatus#OK} if
* successful
*/
@RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING)
@ResponseBody
ResponseEntity<Void> downloadArtifactByDownloadId(@PathVariable final String downloadId,
final HttpServletResponse response);
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource;
package org.eclipse.hawkbit.mgmt.rest.api;
/**
* Constants for RESTful API.
@@ -14,23 +14,13 @@ package org.eclipse.hawkbit.rest.resource;
*
*
*/
public final class RestConstants {
public final class MgmtRestConstants {
/**
* API version definition. We are using only major versions.
*/
public static final String API_VERSION = "v1";
/**
* The base URL mapping for the spring acuator management context path.
*/
public static final String BASE_SYSTEM_MAPPING = "/system";
/**
* URL mapping for system admin operations.
*/
public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin";
/**
* The base URL mapping of the SP rest resources.
*/
@@ -50,6 +40,64 @@ public final class RestConstants {
*/
public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50";
/**
* The software module URL mapping rest resource.
*/
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}";
/**
* The target URL mapping, href link for assigned distribution set.
*/
public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS";
/**
* The target URL mapping, href link for installed distribution set.
*/
public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS";
/**
* The target URL mapping, href link for target attributes.
*/
public static final String TARGET_V1_ATTRIBUTES = "attributes";
/**
* The target URL mapping, href link for target actions.
*/
public static final String TARGET_V1_ACTIONS = "actions";
/**
* The target URL mapping, href link for canceled actions.
*/
public static final String TARGET_V1_CANCELED_ACTION = "canceledaction";
/**
* The target URL mapping, href link for canceled actions.
*/
public static final String TARGET_V1_ACTION_STATUS = "status";
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettags";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets";
/**
* The default offset parameter in case the offset parameter is not present
* in the request.
@@ -87,62 +135,6 @@ public final class RestConstants {
*/
public static final String REQUEST_PARAMETER_SEARCH = "q";
/**
* The target URL mapping, href link for assigned distribution set.
*/
public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS";
/**
* The target URL mapping, href link for installed distribution set.
*/
public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS";
/**
* The target URL mapping, href link for target attributes.
*/
public static final String TARGET_V1_ATTRIBUTES = "attributes";
/**
* The target URL mapping, href link for target actions.
*/
public static final String TARGET_V1_ACTIONS = "actions";
/**
* The target URL mapping, href link for canceled actions.
*/
public static final String TARGET_V1_CANCELED_ACTION = "canceledaction";
/**
* The target URL mapping, href link for canceled actions.
*/
public static final String TARGET_V1_ACTION_STATUS = "status";
/**
* The target URL mapping rest resource.
*/
public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";
public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/system";
/**
* The software module URL mapping rest resource.
*/
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
/**
* The tag URL mapping rest resource.
*/
public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
+ "/distributionsettags";
/**
* The tag URL mapping rest resource.
*/
public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets";
/**
* The software module type URL mapping rest resource.
*/
@@ -184,11 +176,8 @@ public final class RestConstants {
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/";
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}";
// constant class, private constructor.
private RestConstants() {
private MgmtRestConstants() {
}
}

View File

@@ -2,18 +2,17 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody;
import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody;
import org.eclipse.hawkbit.rest.resource.model.rolloutgroup.RolloutGroupResponseBody;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody;
import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -26,8 +25,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* REST Resource handling rollout CRUD operations.
*
*/
@RequestMapping(RestConstants.ROLLOUT_V1_REQUEST_MAPPING)
public interface RolloutRestApi {
@RequestMapping(MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING)
public interface MgmtRolloutRestApi {
/**
* Handles the GET request of retrieving all rollouts.
@@ -49,11 +48,11 @@ public interface RolloutRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<RolloutResponseBody>> getRollouts(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single rollout.
@@ -66,7 +65,7 @@ public interface RolloutRestApi {
*/
@RequestMapping(value = "/{rolloutId}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE,
"application/hal+json" })
public ResponseEntity<RolloutResponseBody> getRollout(@PathVariable("rolloutId") final Long rolloutId);
ResponseEntity<MgmtRolloutResponseBody> getRollout(@PathVariable("rolloutId") final Long rolloutId);
/**
* Handles the POST request for creating rollout.
@@ -81,7 +80,7 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<RolloutResponseBody> create(@RequestBody final RolloutRestRequestBody rolloutRequestBody);
ResponseEntity<MgmtRolloutResponseBody> create(@RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody);
/**
* Handles the POST request for starting a rollout.
@@ -96,8 +95,8 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/start", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> start(@PathVariable("rolloutId") final Long rolloutId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_ASYNC, defaultValue = "false") final boolean startAsync);
ResponseEntity<Void> start(@PathVariable("rolloutId") final Long rolloutId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_ASYNC, defaultValue = "false") final boolean startAsync);
/**
* Handles the POST request for pausing a rollout.
@@ -112,7 +111,7 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/pause", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> pause(@PathVariable("rolloutId") final Long rolloutId);
ResponseEntity<Void> pause(@PathVariable("rolloutId") final Long rolloutId);
/**
* Handles the POST request for resuming a rollout.
@@ -127,7 +126,7 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/resume", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> resume(@PathVariable("rolloutId") final Long rolloutId);
ResponseEntity<Void> resume(@PathVariable("rolloutId") final Long rolloutId);
/**
* Handles the GET request of retrieving all rollout groups referred to a
@@ -153,12 +152,12 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<RolloutGroupResponseBody>> getRolloutGroups(
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
@PathVariable("rolloutId") final Long rolloutId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request for retrieving a single rollout group.
@@ -167,12 +166,12 @@ public interface RolloutRestApi {
* the rolloutId to retrieve the group from
* @param groupId
* the groupId to retrieve the rollout group
* @return the OK response containing the RolloutGroupResponseBody
* @return the OK response containing the MgmtRolloutGroupResponseBody
* @throws EntityNotFoundException
*/
@RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups/{groupId}", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<RolloutGroupResponseBody> getRolloutGroup(@PathVariable("rolloutId") final Long rolloutId,
ResponseEntity<MgmtRolloutGroupResponseBody> getRolloutGroup(@PathVariable("rolloutId") final Long rolloutId,
@PathVariable("groupId") final Long groupId);
/**
@@ -200,10 +199,10 @@ public interface RolloutRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups/{groupId}/targets", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<TargetRest>> getRolloutGroupTargets(@PathVariable("rolloutId") final Long rolloutId,
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(@PathVariable("rolloutId") final Long rolloutId,
@PathVariable("groupId") final Long groupId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
}

View File

@@ -2,21 +2,20 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.MetadataRest;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.mgmt.json.model.MetadataRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -32,8 +31,8 @@ import org.springframework.web.multipart.MultipartFile;
* operations.
*
*/
@RequestMapping(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
public interface SoftwareModuleRestAPI {
@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
public interface MgmtSoftwareModuleRestAPI {
/**
* Handles POST request for artifact upload.
@@ -56,7 +55,7 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<ArtifactRest> uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<MgmtArtifact> uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam("file") final MultipartFile file,
@RequestParam(value = "filename", required = false) final String optionalFileName,
@RequestParam(value = "md5sum", required = false) final String md5Sum,
@@ -76,8 +75,7 @@ public interface SoftwareModuleRestAPI {
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public ResponseEntity<List<ArtifactRest>> getArtifacts(
@PathVariable("softwareModuleId") final Long softwareModuleId);
ResponseEntity<List<MgmtArtifact>> getArtifacts(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
* Handles the GET request of retrieving a single Artifact meta data
@@ -93,7 +91,7 @@ public interface SoftwareModuleRestAPI {
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public ResponseEntity<ArtifactRest> getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<MgmtArtifact> getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId);
/**
@@ -108,7 +106,7 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}/artifacts/{artifactId}")
@ResponseBody
public ResponseEntity<Void> deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<Void> deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("artifactId") final Long artifactId);
/**
@@ -132,11 +130,11 @@ public interface SoftwareModuleRestAPI {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<SoftwareModuleRest>> getSoftwareModules(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtSoftwareModule>> getSoftwareModules(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single software module.
@@ -150,8 +148,7 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleRest> getSoftwareModule(
@PathVariable("softwareModuleId") final Long softwareModuleId);
ResponseEntity<MgmtSoftwareModule> getSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
* Handles the POST request of creating new softwaremodules. The request
@@ -166,8 +163,8 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<SoftwareModuleRest>> createSoftwareModules(
@RequestBody final List<SoftwareModuleRequestBodyPost> softwareModules);
ResponseEntity<List<MgmtSoftwareModule>> createSoftwareModules(
@RequestBody final List<MgmtSoftwareModuleRequestBodyPost> softwareModules);
/**
* Handles the PUT request of updating a software module.
@@ -180,9 +177,9 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleRest> updateSoftwareModule(
ResponseEntity<MgmtSoftwareModule> updateSoftwareModule(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestBody final SoftwareModuleRequestBodyPut restSoftwareModule);
@RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule);
/**
* Handles the DELETE request for a single software module.
@@ -193,7 +190,7 @@ public interface SoftwareModuleRestAPI {
*
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}")
public ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
ResponseEntity<Void> deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId);
/**
* Gets a paged list of meta data for a software module.
@@ -217,12 +214,11 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<PagedList<MetadataRest>> getMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MetadataRest>> getMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Gets a single meta data value for a specific key of a software module.
@@ -236,7 +232,7 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = {
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<MetadataRest> getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<MetadataRest> getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey);
/**
@@ -251,7 +247,7 @@ public interface SoftwareModuleRestAPI {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = {
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<MetadataRest> updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<MetadataRest> updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata);
/**
@@ -264,7 +260,7 @@ public interface SoftwareModuleRestAPI {
* @return status OK if the delete request is successful
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}/metadata/{metadataKey}")
public ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<Void> deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
@PathVariable("metadataKey") final String metadataKey);
/**
@@ -280,8 +276,7 @@ public interface SoftwareModuleRestAPI {
@RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/metadata", consumes = {
MediaType.APPLICATION_JSON_VALUE,
"application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
public ResponseEntity<List<MetadataRest>> createMetadata(
@PathVariable("softwareModuleId") final Long softwareModuleId,
ResponseEntity<List<MetadataRest>> createMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
@RequestBody final List<MetadataRest> metadataRest);
}

View File

@@ -2,19 +2,18 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -28,8 +27,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* operations.
*
*/
@RequestMapping(RestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)
public interface SoftwareModuleTypeRestApi {
@RequestMapping(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)
public interface MgmtSoftwareModuleTypeRestApi {
/**
* Handles the GET request of retrieving all SoftwareModuleTypes .
*
@@ -51,11 +50,11 @@ public interface SoftwareModuleTypeRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<SoftwareModuleTypeRest>> getTypes(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtSoftwareModuleType>> getTypes(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single software module type .
@@ -69,7 +68,7 @@ public interface SoftwareModuleTypeRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleTypeId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleTypeRest> getSoftwareModuleType(
ResponseEntity<MgmtSoftwareModuleType> getSoftwareModuleType(
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
/**
@@ -81,7 +80,7 @@ public interface SoftwareModuleTypeRestApi {
*
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleTypeId}")
public ResponseEntity<Void> deleteSoftwareModuleType(
ResponseEntity<Void> deleteSoftwareModuleType(
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId);
/**
@@ -95,9 +94,9 @@ public interface SoftwareModuleTypeRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleTypeId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<SoftwareModuleTypeRest> updateSoftwareModuleType(
ResponseEntity<MgmtSoftwareModuleType> updateSoftwareModuleType(
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId,
@RequestBody final SoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
@RequestBody final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
/**
* Handles the POST request of creating new SoftwareModuleTypes. The request
@@ -112,7 +111,7 @@ public interface SoftwareModuleTypeRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<SoftwareModuleTypeRest>> createSoftwareModuleTypes(
@RequestBody final List<SoftwareModuleTypeRequestBodyPost> softwareModuleTypes);
ResponseEntity<List<MgmtSoftwareModuleType>> createSoftwareModuleTypes(
@RequestBody final List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes);
}

View File

@@ -2,23 +2,22 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.action.ActionRest;
import org.eclipse.hawkbit.rest.resource.model.action.ActionStatusRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.target.DistributionSetAssigmentRest;
import org.eclipse.hawkbit.rest.resource.model.target.TargetAttributes;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction;
import org.eclipse.hawkbit.mgmt.json.model.action.MgmtActionStatus;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtDistributionSetAssigment;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAttributes;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* Api for handling target operations.
*/
@RequestMapping(RestConstants.TARGET_V1_REQUEST_MAPPING)
public interface TargetRestApi {
@RequestMapping(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)
public interface MgmtTargetRestApi {
/**
* Handles the GET request of retrieving a single target.
@@ -45,7 +44,7 @@ public interface TargetRestApi {
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TargetRest> getTarget(@PathVariable("targetId") final String targetId);
ResponseEntity<MgmtTarget> getTarget(@PathVariable("targetId") final String targetId);
/**
* Handles the GET request of retrieving all targets.
@@ -68,11 +67,11 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<TargetRest>> getTargets(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtTarget>> getTargets(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the POST request of creating new targets. The request body must
@@ -87,7 +86,7 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<TargetRest>> createTargets(@RequestBody final List<TargetRequestBody> targets);
ResponseEntity<List<MgmtTarget>> createTargets(@RequestBody final List<MgmtTargetRequestBody> targets);
/**
* Handles the PUT request of updating a target. The ID is within the URL
@@ -105,8 +104,8 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{targetId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TargetRest> updateTarget(@PathVariable("targetId") final String targetId,
@RequestBody final TargetRequestBody targetRest);
ResponseEntity<MgmtTarget> updateTarget(@PathVariable("targetId") final String targetId,
@RequestBody final MgmtTargetRequestBody targetRest);
/**
* Handles the DELETE request of deleting a target.
@@ -119,7 +118,7 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{targetId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> deleteTarget(@PathVariable("targetId") final String targetId);
ResponseEntity<Void> deleteTarget(@PathVariable("targetId") final String targetId);
/**
* Handles the GET request of retrieving the attributes of a specific
@@ -133,7 +132,7 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/attributes", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TargetAttributes> getAttributes(@PathVariable("targetId") final String targetId);
ResponseEntity<MgmtTargetAttributes> getAttributes(@PathVariable("targetId") final String targetId);
/**
* Handles the GET request of retrieving the Actions of a specific target.
@@ -158,11 +157,11 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<ActionRest>> getActionHistory(@PathVariable("targetId") final String targetId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtAction>> getActionHistory(@PathVariable("targetId") final String targetId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a specific Actions of a specific
@@ -176,7 +175,7 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions/{actionId}", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<ActionRest> getAction(@PathVariable("targetId") final String targetId,
ResponseEntity<MgmtAction> getAction(@PathVariable("targetId") final String targetId,
@PathVariable("actionId") final Long actionId);
/**
@@ -196,7 +195,7 @@ public interface TargetRestApi {
* if the target or the action is not found
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{targetId}/actions/{actionId}")
public ResponseEntity<Void> cancelAction(@PathVariable("targetId") final String targetId,
ResponseEntity<Void> cancelAction(@PathVariable("targetId") final String targetId,
@PathVariable("actionId") final Long actionId,
@RequestParam(value = "force", required = false, defaultValue = "false") final boolean force);
@@ -223,11 +222,11 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions/{actionId}/status", produces = {
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<ActionStatusRest>> getActionStatusList(
@PathVariable("targetId") final String targetId, @PathVariable("actionId") final Long actionId,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam);
ResponseEntity<PagedList<MgmtActionStatus>> getActionStatusList(@PathVariable("targetId") final String targetId,
@PathVariable("actionId") final Long actionId,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam);
/**
* Handles the GET request of retrieving the assigned distribution set of an
@@ -242,8 +241,7 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/assignedDS", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<DistributionSetRest> getAssignedDistributionSet(
@PathVariable("targetId") final String targetId);
ResponseEntity<MgmtDistributionSet> getAssignedDistributionSet(@PathVariable("targetId") final String targetId);
/**
* Changes the assigned distribution set of a target.
@@ -260,8 +258,8 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.POST, value = "/{targetId}/assignedDS", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<Void> postAssignedDistributionSet(@PathVariable("targetId") final String targetId,
@RequestBody final DistributionSetAssigmentRest dsId);
ResponseEntity<Void> postAssignedDistributionSet(@PathVariable("targetId") final String targetId,
@RequestBody final MgmtDistributionSetAssigment dsId);
/**
* Handles the GET request of retrieving the installed distribution set of
@@ -276,7 +274,6 @@ public interface TargetRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetId}/installedDS", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<DistributionSetRest> getInstalledDistributionSet(
@PathVariable("targetId") final String targetId);
ResponseEntity<MgmtDistributionSet> getInstalledDistributionSet(@PathVariable("targetId") final String targetId);
}

View File

@@ -2,21 +2,20 @@
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.api;
package org.eclipse.hawkbit.mgmt.rest.api;
import java.util.List;
import org.eclipse.hawkbit.rest.resource.RestConstants;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.tag.AssignedTargetRequestBody;
import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.tag.TagRest;
import org.eclipse.hawkbit.rest.resource.model.tag.TargetTagAssigmentResultRest;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedTargetRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTargetTagAssigmentResult;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -29,8 +28,8 @@ import org.springframework.web.bind.annotation.RequestParam;
* REST Resource handling for TargetTag CRUD operations.
*
*/
@RequestMapping(RestConstants.TARGET_TAG_V1_REQUEST_MAPPING)
public interface TargetTagRestApi {
@RequestMapping(MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING)
public interface MgmtTargetTagRestApi {
/**
* Handles the GET request of retrieving all target tags.
@@ -52,11 +51,11 @@ public interface TargetTagRestApi {
* JsonResponseExceptionHandler is handling the response.
*/
@RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<PagedList<TagRest>> getTargetTags(
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
ResponseEntity<PagedList<MgmtTag>> getTargetTags(
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam,
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam);
/**
* Handles the GET request of retrieving a single target tag.
@@ -70,7 +69,7 @@ public interface TargetTagRestApi {
*/
@RequestMapping(method = RequestMethod.GET, value = "/{targetTagId}", produces = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TagRest> getTargetTag(@PathVariable("targetTagId") final Long targetTagId);
ResponseEntity<MgmtTag> getTargetTag(@PathVariable("targetTagId") final Long targetTagId);
/**
* Handles the POST request of creating new target tag. The request body
@@ -84,7 +83,7 @@ public interface TargetTagRestApi {
*/
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<List<TagRest>> createTargetTags(@RequestBody final List<TagRequestBodyPut> tags);
ResponseEntity<List<MgmtTag>> createTargetTags(@RequestBody final List<MgmtTagRequestBodyPut> tags);
/**
*
@@ -100,8 +99,8 @@ public interface TargetTagRestApi {
*/
@RequestMapping(method = RequestMethod.PUT, value = "/{targetTagId}", consumes = { "application/hal+json",
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<TagRest> updateTagretTag(@PathVariable("targetTagId") final Long targetTagId,
@RequestBody final TagRequestBodyPut restTargetTagRest);
ResponseEntity<MgmtTag> updateTagretTag(@PathVariable("targetTagId") final Long targetTagId,
@RequestBody final MgmtTagRequestBodyPut restTargetTagRest);
/**
* Handles the DELETE request for a single target tag.
@@ -114,7 +113,7 @@ public interface TargetTagRestApi {
*
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/{targetTagId}")
public ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") final Long targetTagId);
ResponseEntity<Void> deleteTargetTag(@PathVariable("targetTagId") final Long targetTagId);
/**
* Handles the GET request of retrieving all assigned targets by the given
@@ -127,8 +126,8 @@ public interface TargetTagRestApi {
* @throws EntityNotFoundException
* in case the given {@code targetTagId} doesn't exists.
*/
@RequestMapping(method = RequestMethod.GET, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
public ResponseEntity<List<TargetRest>> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId);
@RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
ResponseEntity<List<MgmtTarget>> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId);
/**
* Handles the POST request to toggle the assignment of targets by the given
@@ -143,11 +142,11 @@ public interface TargetTagRestApi {
* @throws EntityNotFoundException
* in case the given {@code targetTagId} doesn't exists.
*/
@RequestMapping(method = RequestMethod.POST, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING
+ "/toggleTagAssignment")
public ResponseEntity<TargetTagAssigmentResultRest> toggleTagAssignment(
ResponseEntity<MgmtTargetTagAssigmentResult> toggleTagAssignment(
@PathVariable("targetTagId") final Long targetTagId,
@RequestBody final List<AssignedTargetRequestBody> assignedTargetRequestBodies);
@RequestBody final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
/**
* Handles the POST request to assign targets to the given tag id.
@@ -161,9 +160,9 @@ public interface TargetTagRestApi {
* @throws EntityNotFoundException
* in case the given {@code targetTagId} doesn't exists.
*/
@RequestMapping(method = RequestMethod.POST, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
public ResponseEntity<List<TargetRest>> assignTargets(@PathVariable("targetTagId") final Long targetTagId,
@RequestBody final List<AssignedTargetRequestBody> assignedTargetRequestBodies);
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
ResponseEntity<List<MgmtTarget>> assignTargets(@PathVariable("targetTagId") final Long targetTagId,
@RequestBody final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
/**
* Handles the DELETE request to unassign all targets from the given tag id.
@@ -174,8 +173,8 @@ public interface TargetTagRestApi {
* @throws EntityNotFoundException
* in case the given {@code targetTagId} doesn't exists.
*/
@RequestMapping(method = RequestMethod.DELETE, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
public ResponseEntity<Void> unassignTargets(@PathVariable("targetTagId") final Long targetTagId);
@RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
ResponseEntity<Void> unassignTargets(@PathVariable("targetTagId") final Long targetTagId);
/**
* Handles the DELETE request to unassign one target from the given tag id.
@@ -188,8 +187,8 @@ public interface TargetTagRestApi {
* @throws EntityNotFoundException
* in case the given {@code targetTagId} doesn't exists.
*/
@RequestMapping(method = RequestMethod.DELETE, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING
@RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING
+ "/{controllerId}")
public ResponseEntity<Void> unassignTarget(@PathVariable("targetTagId") final Long targetTagId,
ResponseEntity<Void> unassignTarget(@PathVariable("targetTagId") final Long targetTagId,
@PathVariable("controllerId") final String controllerId);
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource.model;
package org.eclipse.hawkbit.mgmt.json.model;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;

View File

@@ -9,7 +9,7 @@
<artifactId>hawkbit-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
</parent>
<artifactId>hawkbit-rest-resource</artifactId>
<artifactId>hawkbit-mgmt-resource</artifactId>
<name>hawkBit :: REST Resources</name>
@@ -21,43 +21,14 @@
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-core</artifactId>
<artifactId>hawkbit-mgmt-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-api</artifactId>
<artifactId>hawkbit-rest-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-core</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<!-- Test -->
<dependency>

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource;
package org.eclipse.hawkbit.mgmt.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -29,6 +29,6 @@ import org.springframework.stereotype.Controller;
@Retention(RetentionPolicy.RUNTIME)
@Configuration
@ComponentScan
public @interface EnableRestResources {
public @interface EnableMgmtApi {
}

View File

@@ -6,7 +6,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource;
package org.eclipse.hawkbit.mgmt.rest.resource;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
@@ -14,6 +14,13 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.hawkbit.mgmt.json.model.MetadataRest;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult;
import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.SoftwareManagement;
@@ -22,12 +29,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
import org.eclipse.hawkbit.repository.model.DistributionSetType;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi;
import org.eclipse.hawkbit.rest.resource.model.MetadataRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody;
/**
* A mapper which maps repository model to RESTful model representation and
@@ -37,8 +38,8 @@ import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentR
*
*
*/
public final class DistributionSetMapper {
private DistributionSetMapper() {
public final class MgmtDistributionSetMapper {
private MgmtDistributionSetMapper() {
// Utility class
}
@@ -65,7 +66,7 @@ public final class DistributionSetMapper {
}
/**
* {@link DistributionSetRequestBodyPost}s to {@link DistributionSet}s.
* {@link MgmtDistributionSetRequestBodyPost}s to {@link DistributionSet}s.
*
* @param sets
* to convert
@@ -73,11 +74,11 @@ public final class DistributionSetMapper {
* to use for conversion
* @return converted list of {@link DistributionSet}s
*/
static List<DistributionSet> dsFromRequest(final Iterable<DistributionSetRequestBodyPost> sets,
static List<DistributionSet> dsFromRequest(final Iterable<MgmtDistributionSetRequestBodyPost> sets,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) {
final List<DistributionSet> mappedList = new ArrayList<>();
for (final DistributionSetRequestBodyPost dsRest : sets) {
for (final MgmtDistributionSetRequestBodyPost dsRest : sets) {
mappedList.add(fromRequest(dsRest, softwareManagement, distributionSetManagement));
}
return mappedList;
@@ -85,7 +86,7 @@ public final class DistributionSetMapper {
}
/**
* {@link DistributionSetRequestBodyPost} to {@link DistributionSet}.
* {@link MgmtDistributionSetRequestBodyPost} to {@link DistributionSet}.
*
* @param dsRest
* to convert
@@ -93,7 +94,7 @@ public final class DistributionSetMapper {
* to use for conversion
* @return converted {@link DistributionSet}
*/
static DistributionSet fromRequest(final DistributionSetRequestBodyPost dsRest,
static DistributionSet fromRequest(final MgmtDistributionSetRequestBodyPost dsRest,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) {
final DistributionSet result = new DistributionSet();
@@ -152,12 +153,12 @@ public final class DistributionSetMapper {
* the ds set
* @return the response
*/
public static DistributionSetRest toResponse(final DistributionSet distributionSet) {
public static MgmtDistributionSet toResponse(final DistributionSet distributionSet) {
if (distributionSet == null) {
return null;
}
final DistributionSetRest response = new DistributionSetRest();
RestModelMapper.mapNamedToNamed(response, distributionSet);
final MgmtDistributionSet response = new MgmtDistributionSet();
MgmtRestModelMapper.mapNamedToNamed(response, distributionSet);
response.setDsId(distributionSet.getId());
response.setVersion(distributionSet.getVersion());
@@ -165,35 +166,35 @@ public final class DistributionSetMapper {
response.setType(distributionSet.getType().getKey());
distributionSet.getModules()
.forEach(module -> response.getModules().add(SoftwareModuleMapper.toResponse(module)));
.forEach(module -> response.getModules().add(MgmtSoftwareModuleMapper.toResponse(module)));
response.setRequiredMigrationStep(distributionSet.isRequiredMigrationStep());
response.add(
linkTo(methodOn(DistributionSetRestApi.class).getDistributionSet(response.getDsId())).withRel("self"));
linkTo(methodOn(MgmtDistributionSetRestApi.class).getDistributionSet(response.getDsId())).withRel("self"));
response.add(linkTo(
methodOn(DistributionSetTypeRestApi.class).getDistributionSetType(distributionSet.getType().getId()))
methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(distributionSet.getType().getId()))
.withRel("type"));
response.add(linkTo(methodOn(DistributionSetRestApi.class).getMetadata(response.getDsId(),
Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET),
Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null))
response.add(linkTo(methodOn(MgmtDistributionSetRestApi.class).getMetadata(response.getDsId(),
Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET),
Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null))
.withRel("metadata"));
return response;
}
static TargetAssignmentResponseBody toResponse(final DistributionSetAssignmentResult dsAssignmentResult) {
final TargetAssignmentResponseBody result = new TargetAssignmentResponseBody();
static MgmtTargetAssignmentResponseBody toResponse(final DistributionSetAssignmentResult dsAssignmentResult) {
final MgmtTargetAssignmentResponseBody result = new MgmtTargetAssignmentResponseBody();
result.setAssigned(dsAssignmentResult.getAssigned());
result.setAlreadyAssigned(dsAssignmentResult.getAlreadyAssigned());
result.setTotal(dsAssignmentResult.getTotal());
return result;
}
static List<DistributionSetRest> toResponseDistributionSets(final Iterable<DistributionSet> sets) {
final List<DistributionSetRest> response = new ArrayList<>();
static List<MgmtDistributionSet> toResponseDistributionSets(final Iterable<DistributionSet> sets) {
final List<MgmtDistributionSet> response = new ArrayList<>();
if (sets != null) {
for (final DistributionSet set : sets) {
@@ -219,11 +220,11 @@ public final class DistributionSetMapper {
return mappedList;
}
static List<DistributionSetRest> toResponseFromDsList(final List<DistributionSet> sets) {
final List<DistributionSetRest> mappedList = new ArrayList<>();
static List<MgmtDistributionSet> toResponseFromDsList(final List<DistributionSet> sets) {
final List<MgmtDistributionSet> mappedList = new ArrayList<>();
if (sets != null) {
for (final DistributionSet set : sets) {
final DistributionSetRest response = toResponse(set);
final MgmtDistributionSet response = toResponse(set);
mappedList.add(response);
}

View File

@@ -6,18 +6,30 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.rest.resource;
package org.eclipse.hawkbit.mgmt.rest.resource;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.eclipse.hawkbit.mgmt.json.model.MetadataRest;
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPut;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentRequestBody;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment;
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi;
import org.eclipse.hawkbit.repository.DeploymentManagement;
import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult;
import org.eclipse.hawkbit.repository.DistributionSetFields;
import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.DistributionSetMetadataFields;
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
import org.eclipse.hawkbit.repository.SoftwareManagement;
import org.eclipse.hawkbit.repository.SystemManagement;
import org.eclipse.hawkbit.repository.TargetFields;
@@ -30,18 +42,6 @@ import org.eclipse.hawkbit.repository.model.DsMetadataCompositeKey;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.rsql.RSQLUtility;
import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi;
import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper;
import org.eclipse.hawkbit.rest.resource.model.MetadataRest;
import org.eclipse.hawkbit.rest.resource.model.PagedList;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPut;
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest;
import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentRequestBody;
import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
import org.eclipse.hawkbit.rest.resource.model.target.TargetRest;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,8 +57,8 @@ import org.springframework.web.bind.annotation.RestController;
* REST Resource handling for {@link DistributionSet} CRUD operations.
*/
@RestController
public class DistributionSetResource implements DistributionSetRestApi {
private static final Logger LOG = LoggerFactory.getLogger(DistributionSetResource.class);
public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
private static final Logger LOG = LoggerFactory.getLogger(MgmtDistributionSetResource.class);
@Autowired
private SoftwareManagement softwareManagement;
@@ -79,7 +79,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
private DistributionSetManagement distributionSetManagement;
@Override
public ResponseEntity<PagedList<DistributionSetRest>> getDistributionSets(final int pagingOffsetParam,
public ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(final int pagingOffsetParam,
final int pagingLimitParam, final String sortParam, final String rsqlParam) {
final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam);
@@ -95,20 +95,20 @@ public class DistributionSetResource implements DistributionSetRestApi {
findDsPage = this.distributionSetManagement.findDistributionSetsAll(pageable, false, null);
}
final List<DistributionSetRest> rest = DistributionSetMapper.toResponseFromDsList(findDsPage.getContent());
final List<MgmtDistributionSet> rest = MgmtDistributionSetMapper.toResponseFromDsList(findDsPage.getContent());
return new ResponseEntity<>(new PagedList<>(rest, findDsPage.getTotalElements()), HttpStatus.OK);
}
@Override
public ResponseEntity<DistributionSetRest> getDistributionSet(final Long distributionSetId) {
public ResponseEntity<MgmtDistributionSet> getDistributionSet(final Long distributionSetId) {
final DistributionSet foundDs = findDistributionSetWithExceptionIfNotFound(distributionSetId);
return new ResponseEntity<>(DistributionSetMapper.toResponse(foundDs), HttpStatus.OK);
return new ResponseEntity<>(MgmtDistributionSetMapper.toResponse(foundDs), HttpStatus.OK);
}
@Override
public ResponseEntity<List<DistributionSetRest>> createDistributionSets(
final List<DistributionSetRequestBodyPost> sets) {
public ResponseEntity<List<MgmtDistributionSet>> createDistributionSets(
final List<MgmtDistributionSetRequestBodyPost> sets) {
LOG.debug("creating {} distribution sets", sets.size());
// set default Ds type if ds type is null
@@ -116,10 +116,11 @@ public class DistributionSetResource implements DistributionSetRestApi {
.getTenantMetadata(this.currentTenant.getCurrentTenant()).getDefaultDsType().getKey()));
final Iterable<DistributionSet> createdDSets = this.distributionSetManagement.createDistributionSets(
DistributionSetMapper.dsFromRequest(sets, this.softwareManagement, this.distributionSetManagement));
MgmtDistributionSetMapper.dsFromRequest(sets, this.softwareManagement, this.distributionSetManagement));
LOG.debug("{} distribution sets created, return status {}", sets.size(), HttpStatus.CREATED);
return new ResponseEntity<>(DistributionSetMapper.toResponseDistributionSets(createdDSets), HttpStatus.CREATED);
return new ResponseEntity<>(MgmtDistributionSetMapper.toResponseDistributionSets(createdDSets),
HttpStatus.CREATED);
}
@Override
@@ -132,8 +133,8 @@ public class DistributionSetResource implements DistributionSetRestApi {
}
@Override
public ResponseEntity<DistributionSetRest> updateDistributionSet(final Long distributionSetId,
final DistributionSetRequestBodyPut toUpdate) {
public ResponseEntity<MgmtDistributionSet> updateDistributionSet(final Long distributionSetId,
final MgmtDistributionSetRequestBodyPut toUpdate) {
final DistributionSet set = findDistributionSetWithExceptionIfNotFound(distributionSetId);
if (toUpdate.getDescription() != null) {
@@ -148,12 +149,12 @@ public class DistributionSetResource implements DistributionSetRestApi {
set.setVersion(toUpdate.getVersion());
}
return new ResponseEntity<>(
DistributionSetMapper.toResponse(this.distributionSetManagement.updateDistributionSet(set)),
MgmtDistributionSetMapper.toResponse(this.distributionSetManagement.updateDistributionSet(set)),
HttpStatus.OK);
}
@Override
public ResponseEntity<PagedList<TargetRest>> getAssignedTargets(final Long distributionSetId,
public ResponseEntity<PagedList<MgmtTarget>> getAssignedTargets(final Long distributionSetId,
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) {
// check if distribution set exists otherwise throw exception
@@ -173,12 +174,12 @@ public class DistributionSetResource implements DistributionSetRestApi {
targetsAssignedDS = this.targetManagement.findTargetByAssignedDistributionSet(distributionSetId, pageable);
}
return new ResponseEntity<>(new PagedList<>(TargetMapper.toResponse(targetsAssignedDS.getContent()),
return new ResponseEntity<>(new PagedList<>(MgmtTargetMapper.toResponse(targetsAssignedDS.getContent()),
targetsAssignedDS.getTotalElements()), HttpStatus.OK);
}
@Override
public ResponseEntity<PagedList<TargetRest>> getInstalledTargets(final Long distributionSetId,
public ResponseEntity<PagedList<MgmtTarget>> getInstalledTargets(final Long distributionSetId,
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) {
// check if distribution set exists otherwise throw exception
// immediately
@@ -198,22 +199,24 @@ public class DistributionSetResource implements DistributionSetRestApi {
pageable);
}
return new ResponseEntity<>(new PagedList<TargetRest>(TargetMapper.toResponse(targetsInstalledDS.getContent()),
targetsInstalledDS.getTotalElements()), HttpStatus.OK);
return new ResponseEntity<>(
new PagedList<MgmtTarget>(MgmtTargetMapper.toResponse(targetsInstalledDS.getContent()),
targetsInstalledDS.getTotalElements()),
HttpStatus.OK);
}
@Override
public ResponseEntity<TargetAssignmentResponseBody> createAssignedTarget(final Long distributionSetId,
final List<TargetAssignmentRequestBody> targetIds) {
public ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(final Long distributionSetId,
final List<MgmtTargetAssignmentRequestBody> targetIds) {
final DistributionSetAssignmentResult assignDistributionSet = this.deployManagament.assignDistributionSet(
distributionSetId,
targetIds.stream()
.map(t -> new TargetWithActionType(t.getId(),
RestResourceConversionHelper.convertActionType(t.getType()), t.getForcetime()))
MgmtRestModelMapper.convertActionType(t.getType()), t.getForcetime()))
.collect(Collectors.toList()));
return new ResponseEntity<>(DistributionSetMapper.toResponse(assignDistributionSet), HttpStatus.OK);
return new ResponseEntity<>(MgmtDistributionSetMapper.toResponse(assignDistributionSet), HttpStatus.OK);
}
@Override
@@ -240,7 +243,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
}
return new ResponseEntity<>(
new PagedList<>(DistributionSetMapper.toResponseDsMetadata(metaDataPage.getContent()),
new PagedList<>(MgmtDistributionSetMapper.toResponseDsMetadata(metaDataPage.getContent()),
metaDataPage.getTotalElements()),
HttpStatus.OK);
@@ -253,7 +256,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
final DistributionSetMetadata findOne = this.distributionSetManagement
.findOne(new DsMetadataCompositeKey(ds, metadataKey));
return ResponseEntity.<MetadataRest> ok(DistributionSetMapper.toResponseDsMetadata(findOne));
return ResponseEntity.<MetadataRest> ok(MgmtDistributionSetMapper.toResponseDsMetadata(findOne));
}
@Override
@@ -264,7 +267,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
final DistributionSetMetadata updated = this.distributionSetManagement
.updateDistributionSetMetadata(new DistributionSetMetadata(metadataKey, ds, metadata.getValue()));
return ResponseEntity.ok(DistributionSetMapper.toResponseDsMetadata(updated));
return ResponseEntity.ok(MgmtDistributionSetMapper.toResponseDsMetadata(updated));
}
@Override
@@ -284,20 +287,20 @@ public class DistributionSetResource implements DistributionSetRestApi {
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
final List<DistributionSetMetadata> created = this.distributionSetManagement
.createDistributionSetMetadata(DistributionSetMapper.fromRequestDsMetadata(ds, metadataRest));
return new ResponseEntity<>(DistributionSetMapper.toResponseDsMetadata(created), HttpStatus.CREATED);
.createDistributionSetMetadata(MgmtDistributionSetMapper.fromRequestDsMetadata(ds, metadataRest));
return new ResponseEntity<>(MgmtDistributionSetMapper.toResponseDsMetadata(created), HttpStatus.CREATED);
}
@Override
public ResponseEntity<Void> assignSoftwareModules(final Long distributionSetId,
final List<SoftwareModuleAssigmentRest> softwareModuleIDs) {
final List<MgmtSoftwareModuleAssigment> softwareModuleIDs) {
// check if distribution set exists otherwise throw exception
// immediately
final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId);
final Set<SoftwareModule> softwareModuleToBeAssigned = new HashSet<>();
for (final SoftwareModuleAssigmentRest sm : softwareModuleIDs) {
for (final MgmtSoftwareModuleAssigment sm : softwareModuleIDs) {
final SoftwareModule softwareModule = this.softwareManagement.findSoftwareModuleById(sm.getId());
if (softwareModule != null) {
softwareModuleToBeAssigned.add(softwareModule);
@@ -321,7 +324,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
}
@Override
public ResponseEntity<PagedList<SoftwareModuleRest>> getAssignedSoftwareModules(final Long distributionSetId,
public ResponseEntity<PagedList<MgmtSoftwareModule>> getAssignedSoftwareModules(final Long distributionSetId,
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
// check if distribution set exists otherwise throw exception
// immediately
@@ -332,7 +335,7 @@ public class DistributionSetResource implements DistributionSetRestApi {
final Pageable pageable = new OffsetBasedPageRequest(sanitizedOffsetParam, sanitizedLimitParam, sorting);
final Page<SoftwareModule> softwaremodules = this.softwareManagement.findSoftwareModuleByAssignedTo(pageable,
foundDs);
return new ResponseEntity<>(new PagedList<>(SoftwareModuleMapper.toResponse(softwaremodules.getContent()),
return new ResponseEntity<>(new PagedList<>(MgmtSoftwareModuleMapper.toResponse(softwaremodules.getContent()),
softwaremodules.getTotalElements()), HttpStatus.OK);
}

Some files were not shown because too many files have changed in this diff Show More