Small fixes

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-05-31 10:48:56 +02:00
committed by Michael Hirsch
parent 14cb962f42
commit b14d3bbd3c
42 changed files with 66 additions and 70 deletions

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
* Repository constants.
*
*/
public final class Constants {
public final class RepositoryConstants {
/**
* Prefix that the server puts in front of
@@ -30,7 +30,7 @@ public final class Constants {
*/
public static final int DEFAULT_DS_TYPES_IN_TENANT = 2;
private Constants() {
private RepositoryConstants() {
// Utility class.
}

View File

@@ -74,7 +74,7 @@ public interface SystemManagement {
/**
* Returns {@link TenantMetaData} of given and current tenant. Creates for
* new tenants also two {@link SoftwareModuleType} (os and app) and
* {@link Constants#DEFAULT_DS_TYPES_IN_TENANT} {@link DistributionSetType}s
* {@link RepositoryConstants#DEFAULT_DS_TYPES_IN_TENANT} {@link DistributionSetType}s
* (os and os_app).
*
* DISCLAIMER: this variant is used during initial login (where the tenant

View File

@@ -601,4 +601,4 @@ public interface TargetManagement {
+ SpringEvalExpressions.IS_CONTROLLER)
List<Target> updateTargets(@NotNull Collection<Target> targets);
}
}

View File

@@ -45,4 +45,4 @@ public interface ActionWithStatusCount {
*/
String getRolloutName();
}
}

View File

@@ -39,4 +39,4 @@ public interface Artifact extends TenantAwareBaseEntity {
*/
Long getSize();
}
}

View File

@@ -46,4 +46,4 @@ public interface BaseEntity extends Serializable, Identifiable<Long> {
*/
long getOptLockRevision();
}
}

View File

@@ -129,4 +129,4 @@ public interface DistributionSet extends NamedVersionedEntity {
*/
boolean isComplete();
}
}

View File

@@ -19,4 +19,4 @@ public interface DistributionSetMetadata extends MetaData {
*/
DistributionSet getDistributionSet();
}
}

View File

@@ -22,4 +22,4 @@ public interface DistributionSetTag extends Tag {
*/
List<DistributionSet> getAssignedToDistributionSet();
}
}

View File

@@ -170,4 +170,4 @@ public interface DistributionSetType extends NamedEntity {
*/
void setColour(final String colour);
}
}

View File

@@ -38,4 +38,4 @@ public interface ExternalArtifact extends Artifact {
*/
void setUrlSuffix(String urlSuffix);
}
}

View File

@@ -36,4 +36,4 @@ public interface MetaData extends Serializable {
*/
void setValue(String value);
}
}

View File

@@ -25,4 +25,4 @@ public interface NamedVersionedEntity extends NamedEntity {
*/
void setVersion(String version);
}
}

View File

@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.model;
* Repository model constants.
*
*/
public final class Constants {
public final class RepositoryModelConstants {
/**
* indicating that target action has no force time which is only needed in
@@ -20,7 +20,7 @@ public final class Constants {
*/
public static final Long NO_FORCE_TIME = 0L;
private Constants() {
private RepositoryModelConstants() {
// Utility class.
}

View File

@@ -156,4 +156,4 @@ public interface Rollout extends NamedEntity {
ERROR_STARTING;
}
}
}

View File

@@ -108,4 +108,4 @@ public interface SoftwareModule extends NamedVersionedEntity {
*/
List<DistributionSet> getAssignedTo();
}
}

View File

@@ -25,4 +25,4 @@ public interface SoftwareModuleMetadata extends MetaData {
*/
void setSoftwareModule(SoftwareModule softwareModule);
}
}

View File

@@ -57,4 +57,4 @@ public interface SoftwareModuleType extends NamedEntity {
*/
void setColour(final String colour);
}
}

View File

@@ -24,4 +24,4 @@ public interface Tag extends NamedEntity {
*/
void setColour(String colour);
}
}

View File

@@ -56,4 +56,4 @@ public interface TargetFilterQuery extends TenantAwareBaseEntity {
*/
void setQuery(String query);
}
}

View File

@@ -68,4 +68,4 @@ public interface TargetInfo extends Serializable {
*/
boolean isRequestControllerAttributes();
}
}

View File

@@ -21,4 +21,4 @@ public interface TargetTag extends Tag {
*/
List<Target> getAssignedToTargets();
}
}

View File

@@ -19,7 +19,7 @@ public class TargetWithActionStatus {
private Target target;
private Status status = null;
private Status status;
public TargetWithActionStatus(final Target target) {
this.target = target;

View File

@@ -51,7 +51,7 @@ public class TargetWithActionType {
if (actionType == ActionType.TIMEFORCED) {
return forceTime;
}
return Constants.NO_FORCE_TIME;
return RepositoryModelConstants.NO_FORCE_TIME;
}
/**

View File

@@ -19,4 +19,4 @@ public interface TenantAwareBaseEntity extends BaseEntity {
*/
String getTenant();
}
}

View File

@@ -37,4 +37,4 @@ public interface TenantConfiguration extends TenantAwareBaseEntity {
*/
void setValue(String value);
}
}

View File

@@ -31,4 +31,4 @@ public interface TenantMetaData extends BaseEntity {
*/
String getTenant();
}
}

View File

@@ -19,7 +19,7 @@ import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import javax.validation.constraints.NotNull;
import org.eclipse.hawkbit.repository.Constants;
import org.eclipse.hawkbit.repository.RepositoryConstants;
import org.eclipse.hawkbit.repository.ControllerManagement;
import org.eclipse.hawkbit.repository.TargetManagement;
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
@@ -216,7 +216,7 @@ public class JpaControllerManagement implements ControllerManagement {
handleFinishedCancelation(actionStatus, action);
break;
case RETRIEVED:
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Cancellation request retrieved.");
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Cancellation request retrieved.");
break;
default:
// do nothing
@@ -230,7 +230,7 @@ public class JpaControllerManagement implements ControllerManagement {
private void handleFinishedCancelation(final ActionStatus actionStatus, final JpaAction action) {
// in case of successful cancellation we also report the success at
// the canceled action itself.
actionStatus.addMessage(Constants.SERVER_MESSAGE_PREFIX + "Cancellation completion is finished sucessfully.");
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "Cancellation completion is finished sucessfully.");
DeploymentHelper.successCancellation(action, actionRepository, targetManagement, targetInfoRepository,
entityManager);
}

View File

@@ -145,7 +145,7 @@ public class JpaDeploymentManagement implements DeploymentManagement {
return assignDistributionSetByTargetId((JpaDistributionSet) pset,
targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()),
ActionType.FORCED, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME);
ActionType.FORCED, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME);
}
@@ -155,7 +155,7 @@ public class JpaDeploymentManagement implements DeploymentManagement {
@CacheEvict(value = { "distributionUsageAssigned" }, allEntries = true)
public DistributionSetAssignmentResult assignDistributionSet(final Long dsID, final String... targetIDs) {
return assignDistributionSet(dsID, ActionType.FORCED,
org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME, targetIDs);
org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME, targetIDs);
}
@Override

View File

@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.cache;
import org.eclipse.hawkbit.repository.jpa.model.CacheFieldEntityListener;
/**
* Constants for cache keys used in multiple classes.
* RepositoryConstants for cache keys used in multiple classes.
*
*
*

View File

@@ -842,7 +842,7 @@ public class DeploymentManagementTest extends AbstractJpaIntegrationTest {
final DistributionSet ds = testdataFactory.createDistributionSet("a");
// assign ds to create an action
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
ds.getId(), ActionType.SOFT, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME,
ds.getId(), ActionType.SOFT, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME,
target.getControllerId());
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
// verify preparation
@@ -865,7 +865,7 @@ public class DeploymentManagementTest extends AbstractJpaIntegrationTest {
final DistributionSet ds = testdataFactory.createDistributionSet("a");
// assign ds to create an action
final DistributionSetAssignmentResult assignDistributionSet = deploymentManagement.assignDistributionSet(
ds.getId(), ActionType.FORCED, org.eclipse.hawkbit.repository.model.Constants.NO_FORCE_TIME,
ds.getId(), ActionType.FORCED, org.eclipse.hawkbit.repository.model.RepositoryModelConstants.NO_FORCE_TIME,
target.getControllerId());
final Action action = deploymentManagement.findActionWithDetails(assignDistributionSet.getActions().get(0));
// verify perparation

View File

@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.repository.util;
import org.eclipse.hawkbit.ExcludePathAwareShallowETagFilter;
import org.eclipse.hawkbit.repository.ArtifactManagement;
import org.eclipse.hawkbit.repository.Constants;
import org.eclipse.hawkbit.repository.RepositoryConstants;
import org.eclipse.hawkbit.repository.ControllerManagement;
import org.eclipse.hawkbit.repository.DeploymentManagement;
import org.eclipse.hawkbit.repository.DistributionSetManagement;
@@ -72,7 +72,7 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware {
* {@link TestdataFactory#findOrCreateDefaultTestDsType()} and two
* {@link SystemManagement#getTenantMetadata()};
*/
protected static final int DEFAULT_DS_TYPES = Constants.DEFAULT_DS_TYPES_IN_TENANT + 1;
protected static final int DEFAULT_DS_TYPES = RepositoryConstants.DEFAULT_DS_TYPES_IN_TENANT + 1;
@Autowired
protected EntityFactory entityFactory;