Re-applied base entity based equals hashcode policy
This commit is contained in:
@@ -127,55 +127,30 @@ public class Action extends TenantAwareBaseEntity implements Comparable<Action>
|
|||||||
return status == Status.CANCELING || status == Status.CANCELED;
|
return status == Status.CANCELING || status == Status.CANCELED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param active
|
|
||||||
* the active to set
|
|
||||||
*/
|
|
||||||
public void setActive(final boolean active) {
|
public void setActive(final boolean active) {
|
||||||
this.active = active;
|
this.active = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the status
|
|
||||||
*/
|
|
||||||
public Status getStatus() {
|
public Status getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param status
|
|
||||||
* the status to set
|
|
||||||
*/
|
|
||||||
public void setStatus(final Status status) {
|
public void setStatus(final Status status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the downloadProgressPercent
|
|
||||||
*/
|
|
||||||
public int getDownloadProgressPercent() {
|
public int getDownloadProgressPercent() {
|
||||||
return downloadProgressPercent;
|
return downloadProgressPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param downloadProgressPercent
|
|
||||||
* the downloadProgressPercent to set
|
|
||||||
*/
|
|
||||||
public void setDownloadProgressPercent(final int downloadProgressPercent) {
|
public void setDownloadProgressPercent(final int downloadProgressPercent) {
|
||||||
this.downloadProgressPercent = downloadProgressPercent;
|
this.downloadProgressPercent = downloadProgressPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the active
|
|
||||||
*/
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param actionType
|
|
||||||
* the actionType to set
|
|
||||||
*/
|
|
||||||
public void setActionType(final ActionType actionType) {
|
public void setActionType(final ActionType actionType) {
|
||||||
this.actionType = actionType;
|
this.actionType = actionType;
|
||||||
}
|
}
|
||||||
@@ -187,69 +162,38 @@ public class Action extends TenantAwareBaseEntity implements Comparable<Action>
|
|||||||
return actionType;
|
return actionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the actionStatus
|
|
||||||
*/
|
|
||||||
public List<ActionStatus> getActionStatus() {
|
public List<ActionStatus> getActionStatus() {
|
||||||
return actionStatus;
|
return actionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param target
|
|
||||||
* the target to set
|
|
||||||
*/
|
|
||||||
public void setTarget(final Target target) {
|
public void setTarget(final Target target) {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the target
|
|
||||||
*/
|
|
||||||
public Target getTarget() {
|
public Target getTarget() {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the forcedTime
|
|
||||||
*/
|
|
||||||
public long getForcedTime() {
|
public long getForcedTime() {
|
||||||
return forcedTime;
|
return forcedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param forcedTime
|
|
||||||
* the forcedTime to set
|
|
||||||
*/
|
|
||||||
public void setForcedTime(final long forcedTime) {
|
public void setForcedTime(final long forcedTime) {
|
||||||
this.forcedTime = forcedTime;
|
this.forcedTime = forcedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rolloutGroup
|
|
||||||
*/
|
|
||||||
public RolloutGroup getRolloutGroup() {
|
public RolloutGroup getRolloutGroup() {
|
||||||
return rolloutGroup;
|
return rolloutGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rolloutGroup
|
|
||||||
* the rolloutGroup to set
|
|
||||||
*/
|
|
||||||
public void setRolloutGroup(final RolloutGroup rolloutGroup) {
|
public void setRolloutGroup(final RolloutGroup rolloutGroup) {
|
||||||
this.rolloutGroup = rolloutGroup;
|
this.rolloutGroup = rolloutGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rollout
|
|
||||||
*/
|
|
||||||
public Rollout getRollout() {
|
public Rollout getRollout() {
|
||||||
return rollout;
|
return rollout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rollout
|
|
||||||
* the rollout to set
|
|
||||||
*/
|
|
||||||
public void setRollout(final Rollout rollout) {
|
public void setRollout(final Rollout rollout) {
|
||||||
this.rollout = rollout;
|
this.rollout = rollout;
|
||||||
}
|
}
|
||||||
@@ -311,42 +255,25 @@ public class Action extends TenantAwareBaseEntity implements Comparable<Action>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
result = prime * result + (active ? 1231 : 1237);
|
|
||||||
result = prime * result + (int) (forcedTime ^ (forcedTime >>> 32));
|
|
||||||
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
|
||||||
result = prime * result + (isHitAutoForceTime(System.currentTimeMillis()) ? 1231 : 1237);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) {
|
||||||
|
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof Action)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Action other = (Action) obj;
|
|
||||||
if (actionType != other.actionType) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (active != other.active) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (forcedTime != other.forcedTime) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (status != other.status) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,9 +336,6 @@ public class Action extends TenantAwareBaseEntity implements Comparable<Action>
|
|||||||
/**
|
/**
|
||||||
* The action type for this action relation.
|
* The action type for this action relation.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public enum ActionType {
|
public enum ActionType {
|
||||||
FORCED, SOFT, TIMEFORCED;
|
FORCED, SOFT, TIMEFORCED;
|
||||||
|
|||||||
@@ -144,10 +144,7 @@ public class ActionStatus extends TenantAwareBaseEntity {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((action == null) ? 0 : action.hashCode());
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
result = prime * result + ((messages == null) ? 0 : messages.hashCode());
|
|
||||||
result = prime * result + ((occurredAt == null) ? 0 : occurredAt.hashCode());
|
|
||||||
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,34 +156,10 @@ public class ActionStatus extends TenantAwareBaseEntity {
|
|||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof ActionStatus)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final ActionStatus other = (ActionStatus) obj;
|
|
||||||
if (action == null) {
|
|
||||||
if (other.action != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!action.equals(other.action)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (messages == null) {
|
|
||||||
if (other.messages != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!messages.equals(other.messages)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (occurredAt == null) {
|
|
||||||
if (other.occurredAt != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!occurredAt.equals(other.occurredAt)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (status != other.status) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import org.eclipse.hawkbit.repository.model.Action.Status;
|
|||||||
* Custom JPA Model for querying {@link Action} include the count of the
|
* Custom JPA Model for querying {@link Action} include the count of the
|
||||||
* action's {@link ActionStatus}.
|
* action's {@link ActionStatus}.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ActionWithStatusCount {
|
public class ActionWithStatusCount {
|
||||||
private final Long actionStatusCount;
|
private final Long actionStatusCount;
|
||||||
@@ -70,9 +67,9 @@ public class ActionWithStatusCount {
|
|||||||
final String rolloutName) {
|
final String rolloutName) {
|
||||||
this.actionId = actionId;
|
this.actionId = actionId;
|
||||||
this.actionType = actionType;
|
this.actionType = actionType;
|
||||||
this.actionActive = active;
|
actionActive = active;
|
||||||
this.actionForceTime = forcedTime;
|
actionForceTime = forcedTime;
|
||||||
this.actionStatus = status;
|
actionStatus = status;
|
||||||
this.actionCreatedAt = actionCreatedAt;
|
this.actionCreatedAt = actionCreatedAt;
|
||||||
this.actionLastModifiedAt = actionLastModifiedAt;
|
this.actionLastModifiedAt = actionLastModifiedAt;
|
||||||
this.dsId = dsId;
|
this.dsId = dsId;
|
||||||
@@ -81,12 +78,12 @@ public class ActionWithStatusCount {
|
|||||||
this.actionStatusCount = actionStatusCount;
|
this.actionStatusCount = actionStatusCount;
|
||||||
this.rolloutName = rolloutName;
|
this.rolloutName = rolloutName;
|
||||||
|
|
||||||
this.action = new Action();
|
action = new Action();
|
||||||
this.action.setActionType(actionType);
|
action.setActionType(actionType);
|
||||||
this.action.setActive(actionActive);
|
action.setActive(actionActive);
|
||||||
this.action.setForcedTime(actionForceTime);
|
action.setForcedTime(actionForceTime);
|
||||||
this.action.setStatus(actionStatus);
|
action.setStatus(actionStatus);
|
||||||
this.action.setId(actionId);
|
action.setId(actionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -58,9 +58,7 @@ public abstract class Artifact extends TenantAwareBaseEntity {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((md5Hash == null) ? 0 : md5Hash.hashCode());
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
result = prime * result + ((sha1Hash == null) ? 0 : sha1Hash.hashCode());
|
|
||||||
result = prime * result + ((size == null) ? 0 : size.hashCode());
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,31 +70,10 @@ public abstract class Artifact extends TenantAwareBaseEntity {
|
|||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof Artifact)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Artifact other = (Artifact) obj;
|
|
||||||
if (md5Hash == null) {
|
|
||||||
if (other.md5Hash != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!md5Hash.equals(other.md5Hash)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (sha1Hash == null) {
|
|
||||||
if (other.sha1Hash != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!sha1Hash.equals(other.sha1Hash)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (size == null) {
|
|
||||||
if (other.size != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!size.equals(other.size)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,7 @@
|
|||||||
package org.eclipse.hawkbit.repository.model;
|
package org.eclipse.hawkbit.repository.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic assigment result bean.
|
* Generic assignment result bean.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AssignmentResult {
|
public class AssignmentResult {
|
||||||
@@ -36,23 +33,14 @@ public class AssignmentResult {
|
|||||||
total = assigned + alreadyAssigned;
|
total = assigned + alreadyAssigned;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the assignedTargets
|
|
||||||
*/
|
|
||||||
public int getAssigned() {
|
public int getAssigned() {
|
||||||
return assigned;
|
return assigned;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the total
|
|
||||||
*/
|
|
||||||
public int getTotal() {
|
public int getTotal() {
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the alreadyAssigned
|
|
||||||
*/
|
|
||||||
public int getAlreadyAssigned() {
|
public int getAlreadyAssigned() {
|
||||||
return alreadyAssigned;
|
return alreadyAssigned;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* Use to display software modules for the selected distribution.
|
* Use to display software modules for the selected distribution.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class CustomSoftwareModule implements Serializable {
|
public class CustomSoftwareModule implements Serializable {
|
||||||
|
|
||||||
@@ -39,16 +36,10 @@ public class CustomSoftwareModule implements Serializable {
|
|||||||
this.assigned = assigned;
|
this.assigned = assigned;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the softwareModule
|
|
||||||
*/
|
|
||||||
public SoftwareModule getSoftwareModule() {
|
public SoftwareModule getSoftwareModule() {
|
||||||
return softwareModule;
|
return softwareModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the assigned
|
|
||||||
*/
|
|
||||||
public boolean isAssigned() {
|
public boolean isAssigned() {
|
||||||
return assigned;
|
return assigned;
|
||||||
}
|
}
|
||||||
@@ -63,7 +54,7 @@ public class CustomSoftwareModule implements Serializable {
|
|||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (assigned ? 1231 : 1237);
|
result = prime * result + (assigned ? 1231 : 1237);
|
||||||
result = prime * result + ((softwareModule == null) ? 0 : softwareModule.hashCode());
|
result = prime * result + (softwareModule == null ? 0 : softwareModule.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +66,7 @@ public class CustomSoftwareModule implements Serializable {
|
|||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof CustomSoftwareModule)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final CustomSoftwareModule other = (CustomSoftwareModule) obj;
|
final CustomSoftwareModule other = (CustomSoftwareModule) obj;
|
||||||
|
|||||||
@@ -160,11 +160,6 @@ public class DistributionSet extends NamedVersionedEntity {
|
|||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -173,11 +168,6 @@ public class DistributionSet extends NamedVersionedEntity {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
@@ -234,11 +224,6 @@ public class DistributionSet extends NamedVersionedEntity {
|
|||||||
return installedAtTargets;
|
return installedAtTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DistributionSet [getName()=" + getName() + ", getOptLockRevision()=" + getOptLockRevision()
|
return "DistributionSet [getName()=" + getName() + ", getOptLockRevision()=" + getOptLockRevision()
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ public class DistributionSetIdName implements Serializable {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -50,40 +47,27 @@ public class DistributionSetIdName implements Serializable {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (id == null ? 0 : id.hashCode());
|
result = prime * result + (id == null ? 0 : id.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof DistributionSetIdName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final DistributionSetIdName other = (DistributionSetIdName) obj;
|
final DistributionSetIdName other = (DistributionSetIdName) obj;
|
||||||
@@ -97,11 +81,6 @@ public class DistributionSetIdName implements Serializable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// only return the ID because it's used in vaadin for setting the item
|
// only return the ID because it's used in vaadin for setting the item
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ import javax.persistence.Table;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_ds_metadata")
|
@Table(name = "sp_ds_metadata")
|
||||||
public class DistributionSetMetadata implements Serializable {
|
public class DistributionSetMetadata implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@@ -49,11 +45,11 @@ public class DistributionSetMetadata implements Serializable {
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "ds_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_metadata_ds") )
|
@JoinColumn(name = "ds_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_metadata_ds"))
|
||||||
private DistributionSet distributionSet;
|
private DistributionSet distributionSet;
|
||||||
|
|
||||||
public DistributionSetMetadata() {
|
public DistributionSetMetadata() {
|
||||||
|
// Default constructor for JPA.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,49 +69,74 @@ public class DistributionSetMetadata implements Serializable {
|
|||||||
return new DsMetadataCompositeKey(distributionSet, key);
|
return new DsMetadataCompositeKey(distributionSet, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the key
|
|
||||||
*/
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param key
|
|
||||||
* the key to set
|
|
||||||
*/
|
|
||||||
public void setKey(final String key) {
|
public void setKey(final String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param distributionSet
|
|
||||||
* the distributionSet to set
|
|
||||||
*/
|
|
||||||
public void setDistributionSet(final DistributionSet distributionSet) {
|
public void setDistributionSet(final DistributionSet distributionSet) {
|
||||||
this.distributionSet = distributionSet;
|
this.distributionSet = distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the value
|
|
||||||
*/
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param value
|
|
||||||
* the value to set
|
|
||||||
*/
|
|
||||||
public void setValue(final String value) {
|
public void setValue(final String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the distributionSet
|
|
||||||
*/
|
|
||||||
public DistributionSet getDistributionSet() {
|
public DistributionSet getDistributionSet() {
|
||||||
return distributionSet;
|
return distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + (distributionSet == null ? 0 : distributionSet.hashCode());
|
||||||
|
result = prime * result + (key == null ? 0 : key.hashCode());
|
||||||
|
result = prime * result + (value == null ? 0 : value.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof DistributionSetMetadata)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final DistributionSetMetadata other = (DistributionSetMetadata) obj;
|
||||||
|
if (distributionSet == null) {
|
||||||
|
if (other.distributionSet != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!distributionSet.equals(other.distributionSet)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (key == null) {
|
||||||
|
if (other.key != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!key.equals(other.key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
if (other.value != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!value.equals(other.value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,11 @@ import javax.persistence.UniqueConstraint;
|
|||||||
* A {@link DistributionSetTag} is used to describe DistributionSet attributes
|
* A {@link DistributionSetTag} is used to describe DistributionSet attributes
|
||||||
* and use them also for filtering the DistributionSet list.
|
* and use them also for filtering the DistributionSet list.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_distributionset_tag", indexes = {
|
@Table(name = "sp_distributionset_tag", indexes = {
|
||||||
@Index(name = "sp_idx_distribution_set_tag_prim", columnList = "tenant,id") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
@Index(name = "sp_idx_distribution_set_tag_prim", columnList = "tenant,id") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
||||||
"name", "tenant" }, name = "uk_ds_tag") )
|
"name", "tenant" }, name = "uk_ds_tag"))
|
||||||
public class DistributionSetTag extends Tag {
|
public class DistributionSetTag extends Tag {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -69,11 +64,6 @@ public class DistributionSetTag extends Tag {
|
|||||||
return assignedToDistributionSet;
|
return assignedToDistributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -82,11 +72,6 @@ public class DistributionSetTag extends Tag {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class DistributionSetType extends NamedEntity {
|
|||||||
public DistributionSetType(final String key, final String name, final String description, final String color) {
|
public DistributionSetType(final String key, final String name, final String description, final String color) {
|
||||||
super(name, description);
|
super(name, description);
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.colour = color;
|
colour = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -289,10 +289,7 @@ public class DistributionSetType extends NamedEntity {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((colour == null) ? 0 : colour.hashCode());
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
result = prime * result + (deleted ? 1231 : 1237);
|
|
||||||
result = prime * result + ((elements == null) ? 0 : elements.hashCode());
|
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,31 +304,7 @@ public class DistributionSetType extends NamedEntity {
|
|||||||
if (!(obj instanceof DistributionSetType)) {
|
if (!(obj instanceof DistributionSetType)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final DistributionSetType other = (DistributionSetType) obj;
|
|
||||||
if (colour == null) {
|
|
||||||
if (other.colour != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!colour.equals(other.colour)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (deleted != other.deleted) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (elements == null) {
|
|
||||||
if (other.elements != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!elements.equals(other.elements)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (key == null) {
|
|
||||||
if (other.key != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!key.equals(other.key)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class DistributionSetTypeElement implements Serializable {
|
|||||||
public DistributionSetTypeElement(final DistributionSetType dsType, final SoftwareModuleType smType,
|
public DistributionSetTypeElement(final DistributionSetType dsType, final SoftwareModuleType smType,
|
||||||
final boolean mandatory) {
|
final boolean mandatory) {
|
||||||
super();
|
super();
|
||||||
this.key = new DistributionSetTypeElementCompositeKey(dsType, smType);
|
key = new DistributionSetTypeElementCompositeKey(dsType, smType);
|
||||||
this.dsType = dsType;
|
this.dsType = dsType;
|
||||||
this.smType = smType;
|
this.smType = smType;
|
||||||
this.mandatory = mandatory;
|
this.mandatory = mandatory;
|
||||||
@@ -100,37 +100,7 @@ public class DistributionSetTypeElement implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public String toString() {
|
||||||
final int prime = 31;
|
return "DistributionSetTypeElement [mandatory=" + mandatory + ", dsType=" + dsType + ", smType=" + smType + "]";
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
|
||||||
result = prime * result + (mandatory ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(final Object obj) {
|
|
||||||
if (this == obj) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (obj == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!(obj instanceof DistributionSetTypeElement)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final DistributionSetTypeElement other = (DistributionSetTypeElement) obj;
|
|
||||||
if (key == null) {
|
|
||||||
if (other.key != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!key.equals(other.key)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (mandatory != other.mandatory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,43 +61,4 @@ public class DistributionSetTypeElementCompositeKey implements Serializable {
|
|||||||
public void setSmType(final Long smType) {
|
public void setSmType(final Long smType) {
|
||||||
this.smType = smType;
|
this.smType = smType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((dsType == null) ? 0 : dsType.hashCode());
|
|
||||||
result = prime * result + ((smType == null) ? 0 : smType.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(final Object obj) {
|
|
||||||
if (this == obj) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (obj == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!(obj instanceof DistributionSetTypeElementCompositeKey)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final DistributionSetTypeElementCompositeKey other = (DistributionSetTypeElementCompositeKey) obj;
|
|
||||||
if (dsType == null) {
|
|
||||||
if (other.dsType != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!dsType.equals(other.dsType)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (smType == null) {
|
|
||||||
if (other.smType != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!smType.equals(other.smType)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,19 +18,14 @@ import java.io.Serializable;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class DsMetadataCompositeKey implements Serializable {
|
public final class DsMetadataCompositeKey implements Serializable {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
private Long distributionSet;
|
private Long distributionSet;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DsMetadataCompositeKey() {
|
public DsMetadataCompositeKey() {
|
||||||
|
// Default constructor for JPA.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,55 +39,31 @@ public final class DsMetadataCompositeKey implements Serializable {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the key
|
|
||||||
*/
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param key
|
|
||||||
* the key to set
|
|
||||||
*/
|
|
||||||
public void setKey(final String key) {
|
public void setKey(final String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the distributionSet
|
|
||||||
*/
|
|
||||||
public Long getDistributionSet() {
|
public Long getDistributionSet() {
|
||||||
return distributionSet;
|
return distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param distributionSet
|
|
||||||
* the distributionSet to set
|
|
||||||
*/
|
|
||||||
public void setDistributionSet(final Long distributionSet) {
|
public void setDistributionSet(final Long distributionSet) {
|
||||||
this.distributionSet = distributionSet;
|
this.distributionSet = distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((distributionSet == null) ? 0 : distributionSet.hashCode());
|
result = prime * result + (distributionSet == null ? 0 : distributionSet.hashCode());
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
result = prime * result + (key == null ? 0 : key.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
// code
|
// code
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ExternalArtifact extends Artifact {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "provider", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_art_to_ext_provider") )
|
@JoinColumn(name = "provider", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_art_to_ext_provider"))
|
||||||
private ExternalArtifactProvider externalArtifactProvider;
|
private ExternalArtifactProvider externalArtifactProvider;
|
||||||
|
|
||||||
@Column(name = "url_suffix", length = 512)
|
@Column(name = "url_suffix", length = 512)
|
||||||
@@ -44,7 +44,7 @@ public class ExternalArtifact extends Artifact {
|
|||||||
|
|
||||||
// CascadeType.PERSIST as we register ourself at the BSM
|
// CascadeType.PERSIST as we register ourself at the BSM
|
||||||
@ManyToOne(optional = false, cascade = { CascadeType.PERSIST })
|
@ManyToOne(optional = false, cascade = { CascadeType.PERSIST })
|
||||||
@JoinColumn(name = "software_module", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_external_assigned_sm") )
|
@JoinColumn(name = "software_module", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_external_assigned_sm"))
|
||||||
private SoftwareModule softwareModule;
|
private SoftwareModule softwareModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,11 +127,6 @@ public class ExternalArtifact extends Artifact {
|
|||||||
this.urlSuffix = urlSuffix;
|
this.urlSuffix = urlSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() { // NOSONAR - as this is generated
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -140,11 +135,6 @@ public class ExternalArtifact extends Artifact {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ import javax.persistence.Table;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* External repositories for artifact storage. The SP server provides URLs for
|
* External repositories for artifact storage. The SP server provides URLs for
|
||||||
* the targets to download rom these external ressources but does not access
|
* the targets to download from these external resources but does not access
|
||||||
* thenm itself.
|
* them itself.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Table(name = "sp_external_provider", indexes = {
|
@Table(name = "sp_external_provider", indexes = {
|
||||||
@@ -60,41 +57,22 @@ public class ExternalArtifactProvider extends NamedEntity {
|
|||||||
basePath = "";
|
basePath = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the basePath
|
|
||||||
*/
|
|
||||||
public String getBasePath() {
|
public String getBasePath() {
|
||||||
return basePath;
|
return basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the defaultSuffix
|
|
||||||
*/
|
|
||||||
public String getDefaultSuffix() {
|
public String getDefaultSuffix() {
|
||||||
return defaultSuffix;
|
return defaultSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param basePath
|
|
||||||
* the basePath to set
|
|
||||||
*/
|
|
||||||
public void setBasePath(final String basePath) {
|
public void setBasePath(final String basePath) {
|
||||||
this.basePath = basePath;
|
this.basePath = basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param defaultSuffix
|
|
||||||
* the defaultSuffix to set
|
|
||||||
*/
|
|
||||||
public void setDefaultSuffix(final String defaultSuffix) {
|
public void setDefaultSuffix(final String defaultSuffix) {
|
||||||
this.defaultSuffix = defaultSuffix;
|
this.defaultSuffix = defaultSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() { // NOSONAR - as this is generated
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -103,11 +81,6 @@ public class ExternalArtifactProvider extends NamedEntity {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class LocalArtifact extends Artifact {
|
|||||||
private String filename;
|
private String filename;
|
||||||
|
|
||||||
@ManyToOne(optional = false, cascade = { CascadeType.PERSIST })
|
@ManyToOne(optional = false, cascade = { CascadeType.PERSIST })
|
||||||
@JoinColumn(name = "software_module", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_assigned_sm") )
|
@JoinColumn(name = "software_module", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_assigned_sm"))
|
||||||
private SoftwareModule softwareModule;
|
private SoftwareModule softwareModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,11 +73,6 @@ public class LocalArtifact extends Artifact {
|
|||||||
this.filename = filename;
|
this.filename = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() { // NOSONAR - as this is generated
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -86,11 +81,6 @@ public class LocalArtifact extends Artifact {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
@@ -106,33 +96,20 @@ public class LocalArtifact extends Artifact {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the softwareModule
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public SoftwareModule getSoftwareModule() {
|
public SoftwareModule getSoftwareModule() {
|
||||||
return softwareModule;
|
return softwareModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param softwareModule
|
|
||||||
* the softwareModule to set
|
|
||||||
*/
|
|
||||||
public final void setSoftwareModule(final SoftwareModule softwareModule) {
|
public final void setSoftwareModule(final SoftwareModule softwareModule) {
|
||||||
this.softwareModule = softwareModule;
|
this.softwareModule = softwareModule;
|
||||||
this.softwareModule.addArtifact(this);
|
this.softwareModule.addArtifact(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the gridFsFileName
|
|
||||||
*/
|
|
||||||
public String getGridFsFileName() {
|
public String getGridFsFileName() {
|
||||||
return gridFsFileName;
|
return gridFsFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the filename
|
|
||||||
*/
|
|
||||||
public String getFilename() {
|
public String getFilename() {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,43 +60,4 @@ public abstract class NamedEntity extends TenantAwareBaseEntity {
|
|||||||
public void setName(final String name) {
|
public void setName(final String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + ((description == null) ? 0 : description.hashCode());
|
|
||||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(final Object obj) {
|
|
||||||
if (this == obj) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!super.equals(obj)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final NamedEntity other = (NamedEntity) obj;
|
|
||||||
if (description == null) {
|
|
||||||
if (other.description != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!description.equals(other.description)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (name == null) {
|
|
||||||
if (other.name != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!name.equals(other.name)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,6 @@ import javax.persistence.MappedSuperclass;
|
|||||||
/**
|
/**
|
||||||
* Extension for {@link NamedEntity} that are versioned.
|
* Extension for {@link NamedEntity} that are versioned.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
public abstract class NamedVersionedEntity extends NamedEntity {
|
public abstract class NamedVersionedEntity extends NamedEntity {
|
||||||
@@ -53,4 +48,27 @@ public abstract class NamedVersionedEntity extends NamedEntity {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = super.hashCode();
|
||||||
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof NamedVersionedEntity)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,20 +36,20 @@ import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_rollout", indexes = {
|
@Table(name = "sp_rollout", indexes = {
|
||||||
@Index(name = "sp_idx_rollout_01", columnList = "tenant,name") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
@Index(name = "sp_idx_rollout_01", columnList = "tenant,name") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
||||||
"name", "tenant" }, name = "uk_rollout") )
|
"name", "tenant" }, name = "uk_rollout"))
|
||||||
public class Rollout extends NamedEntity {
|
public class Rollout extends NamedEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToMany(targetEntity = RolloutGroup.class)
|
@OneToMany(targetEntity = RolloutGroup.class)
|
||||||
@JoinColumn(name = "rollout", insertable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rollout_rolloutgroup") )
|
@JoinColumn(name = "rollout", insertable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rollout_rolloutgroup"))
|
||||||
private List<RolloutGroup> rolloutGroups;
|
private List<RolloutGroup> rolloutGroups;
|
||||||
|
|
||||||
@Column(name = "target_filter", length = 1024, nullable = false)
|
@Column(name = "target_filter", length = 1024, nullable = false)
|
||||||
private String targetFilterQuery;
|
private String targetFilterQuery;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "distribution_set", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolltout_ds") )
|
@JoinColumn(name = "distribution_set", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolltout_ds"))
|
||||||
private DistributionSet distributionSet;
|
private DistributionSet distributionSet;
|
||||||
|
|
||||||
@Column(name = "status")
|
@Column(name = "status")
|
||||||
@@ -79,159 +79,86 @@ public class Rollout extends NamedEntity {
|
|||||||
@Transient
|
@Transient
|
||||||
private transient TotalTargetCountStatus totalTargetCountStatus;
|
private transient TotalTargetCountStatus totalTargetCountStatus;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the distributionSet
|
|
||||||
*/
|
|
||||||
public DistributionSet getDistributionSet() {
|
public DistributionSet getDistributionSet() {
|
||||||
return distributionSet;
|
return distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param distributionSet
|
|
||||||
* the distributionSet to set
|
|
||||||
*/
|
|
||||||
public void setDistributionSet(final DistributionSet distributionSet) {
|
public void setDistributionSet(final DistributionSet distributionSet) {
|
||||||
this.distributionSet = distributionSet;
|
this.distributionSet = distributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rolloutGroups
|
|
||||||
*/
|
|
||||||
public List<RolloutGroup> getRolloutGroups() {
|
public List<RolloutGroup> getRolloutGroups() {
|
||||||
return rolloutGroups;
|
return rolloutGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rolloutGroups
|
|
||||||
* the rolloutGroups to set
|
|
||||||
*/
|
|
||||||
public void setRolloutGroups(final List<RolloutGroup> rolloutGroups) {
|
public void setRolloutGroups(final List<RolloutGroup> rolloutGroups) {
|
||||||
this.rolloutGroups = rolloutGroups;
|
this.rolloutGroups = rolloutGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the targetFilterQuery
|
|
||||||
*/
|
|
||||||
public String getTargetFilterQuery() {
|
public String getTargetFilterQuery() {
|
||||||
return targetFilterQuery;
|
return targetFilterQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param targetFilterQuery
|
|
||||||
* the targetFilterQuery to set
|
|
||||||
*/
|
|
||||||
public void setTargetFilterQuery(final String targetFilterQuery) {
|
public void setTargetFilterQuery(final String targetFilterQuery) {
|
||||||
this.targetFilterQuery = targetFilterQuery;
|
this.targetFilterQuery = targetFilterQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the status
|
|
||||||
*/
|
|
||||||
public RolloutStatus getStatus() {
|
public RolloutStatus getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param status
|
|
||||||
* the status to set
|
|
||||||
*/
|
|
||||||
public void setStatus(final RolloutStatus status) {
|
public void setStatus(final RolloutStatus status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the lastCheck
|
|
||||||
*/
|
|
||||||
public long getLastCheck() {
|
public long getLastCheck() {
|
||||||
return lastCheck;
|
return lastCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastCheck
|
|
||||||
* the lastCheck to set
|
|
||||||
*/
|
|
||||||
public void setLastCheck(final long lastCheck) {
|
public void setLastCheck(final long lastCheck) {
|
||||||
this.lastCheck = lastCheck;
|
this.lastCheck = lastCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the actionType
|
|
||||||
*/
|
|
||||||
public ActionType getActionType() {
|
public ActionType getActionType() {
|
||||||
return actionType;
|
return actionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param actionType
|
|
||||||
* the actionType to set
|
|
||||||
*/
|
|
||||||
public void setActionType(final ActionType actionType) {
|
public void setActionType(final ActionType actionType) {
|
||||||
this.actionType = actionType;
|
this.actionType = actionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the forcedTime
|
|
||||||
*/
|
|
||||||
public long getForcedTime() {
|
public long getForcedTime() {
|
||||||
return forcedTime;
|
return forcedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param forcedTime
|
|
||||||
* the forcedTime to set
|
|
||||||
*/
|
|
||||||
public void setForcedTime(final long forcedTime) {
|
public void setForcedTime(final long forcedTime) {
|
||||||
this.forcedTime = forcedTime;
|
this.forcedTime = forcedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the totalTargets
|
|
||||||
*/
|
|
||||||
public long getTotalTargets() {
|
public long getTotalTargets() {
|
||||||
return totalTargets;
|
return totalTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param totalTargets
|
|
||||||
* the totalTargets to set
|
|
||||||
*/
|
|
||||||
public void setTotalTargets(final long totalTargets) {
|
public void setTotalTargets(final long totalTargets) {
|
||||||
this.totalTargets = totalTargets;
|
this.totalTargets = totalTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rolloutGroupsTotal
|
|
||||||
*/
|
|
||||||
public int getRolloutGroupsTotal() {
|
public int getRolloutGroupsTotal() {
|
||||||
return rolloutGroupsTotal;
|
return rolloutGroupsTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rolloutGroupsTotal
|
|
||||||
* the rolloutGroupsTotal to set
|
|
||||||
*/
|
|
||||||
public void setRolloutGroupsTotal(final int rolloutGroupsTotal) {
|
public void setRolloutGroupsTotal(final int rolloutGroupsTotal) {
|
||||||
this.rolloutGroupsTotal = rolloutGroupsTotal;
|
this.rolloutGroupsTotal = rolloutGroupsTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rolloutGroupsCreated
|
|
||||||
*/
|
|
||||||
public int getRolloutGroupsCreated() {
|
public int getRolloutGroupsCreated() {
|
||||||
return rolloutGroupsCreated;
|
return rolloutGroupsCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rolloutGroupsCreated
|
|
||||||
* the rolloutGroupsCreated to set
|
|
||||||
*/
|
|
||||||
public void setRolloutGroupsCreated(final int rolloutGroupsCreated) {
|
public void setRolloutGroupsCreated(final int rolloutGroupsCreated) {
|
||||||
this.rolloutGroupsCreated = rolloutGroupsCreated;
|
this.rolloutGroupsCreated = rolloutGroupsCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the totalTargetCountStatus
|
|
||||||
*/
|
|
||||||
public TotalTargetCountStatus getTotalTargetCountStatus() {
|
public TotalTargetCountStatus getTotalTargetCountStatus() {
|
||||||
if (totalTargetCountStatus == null) {
|
if (totalTargetCountStatus == null) {
|
||||||
totalTargetCountStatus = new TotalTargetCountStatus(totalTargets);
|
totalTargetCountStatus = new TotalTargetCountStatus(totalTargets);
|
||||||
@@ -239,10 +166,6 @@ public class Rollout extends NamedEntity {
|
|||||||
return totalTargetCountStatus;
|
return totalTargetCountStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param totalTargetCountStatus
|
|
||||||
* the totalTargetCountStatus to set
|
|
||||||
*/
|
|
||||||
public void setTotalTargetCountStatus(final TotalTargetCountStatus totalTargetCountStatus) {
|
public void setTotalTargetCountStatus(final TotalTargetCountStatus totalTargetCountStatus) {
|
||||||
this.totalTargetCountStatus = totalTargetCountStatus;
|
this.totalTargetCountStatus = totalTargetCountStatus;
|
||||||
}
|
}
|
||||||
@@ -256,7 +179,7 @@ public class Rollout extends NamedEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Michael Hirsch
|
* State machine for rollout.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum RolloutStatus {
|
public enum RolloutStatus {
|
||||||
@@ -308,4 +231,27 @@ public class Rollout extends NamedEntity {
|
|||||||
*/
|
*/
|
||||||
ERROR_STARTING;
|
ERROR_STARTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = super.hashCode();
|
||||||
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof Rollout)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ import javax.persistence.UniqueConstraint;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_rolloutgroup", indexes = {
|
@Table(name = "sp_rolloutgroup", indexes = {
|
||||||
@Index(name = "sp_idx_rolloutgroup_01", columnList = "tenant,name") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
@Index(name = "sp_idx_rolloutgroup_01", columnList = "tenant,name") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
||||||
"name", "rollout", "tenant" }, name = "uk_rolloutgroup") )
|
"name", "rollout", "tenant" }, name = "uk_rolloutgroup"))
|
||||||
public class RolloutGroup extends NamedEntity {
|
public class RolloutGroup extends NamedEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "rollout", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolloutgroup_rollout") )
|
@JoinColumn(name = "rollout", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolloutgroup_rollout"))
|
||||||
private Rollout rollout;
|
private Rollout rollout;
|
||||||
|
|
||||||
@Column(name = "status")
|
@Column(name = "status")
|
||||||
@@ -210,8 +210,7 @@ public class RolloutGroup extends NamedEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Rollout goup state machine.
|
||||||
* @author Michael Hirsch
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum RolloutGroupStatus {
|
public enum RolloutGroupStatus {
|
||||||
@@ -478,4 +477,27 @@ public class RolloutGroup extends NamedEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = super.hashCode();
|
||||||
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof RolloutGroup)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ public class SoftwareModule extends NamedVersionedEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SoftwareModule [deleted=" + deleted + ", getVersion()=" + getVersion() + ", getOptLockRevision()="
|
return "SoftwareModule [deleted=" + deleted + ", name=" + getName() + ", version=" + getVersion()
|
||||||
+ getOptLockRevision() + ", getId()=" + getId() + ", getType()=" + getType().getName() + "]";
|
+ ", revision=" + getOptLockRevision() + ", Id=" + getId() + ", type=" + getType().getName() + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* To hold software module name and Id.
|
* To hold software module name and Id.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SoftwareModuleIdName implements Serializable {
|
public class SoftwareModuleIdName implements Serializable {
|
||||||
|
|
||||||
@@ -35,25 +33,14 @@ public class SoftwareModuleIdName implements Serializable {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {// NOSONAR - as this is generated
|
public int hashCode() {// NOSONAR - as this is generated
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -62,11 +49,6 @@ public class SoftwareModuleIdName implements Serializable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {// NOSONAR - as this is generated
|
public boolean equals(final Object obj) {// NOSONAR - as this is generated
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ import javax.persistence.Table;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_sw_metadata")
|
@Table(name = "sp_sw_metadata")
|
||||||
public class SoftwareModuleMetadata implements Serializable {
|
public class SoftwareModuleMetadata implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@@ -106,9 +102,9 @@ public class SoftwareModuleMetadata implements Serializable {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
result = prime * result + (key == null ? 0 : key.hashCode());
|
||||||
result = prime * result + ((softwareModule == null) ? 0 : softwareModule.hashCode());
|
result = prime * result + (softwareModule == null ? 0 : softwareModule.hashCode());
|
||||||
result = prime * result + ((value == null) ? 0 : value.hashCode());
|
result = prime * result + (value == null ? 0 : value.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ import javax.persistence.UniqueConstraint;
|
|||||||
/**
|
/**
|
||||||
* Type of a software modules.
|
* Type of a software modules.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_software_module_type", indexes = {
|
@Table(name = "sp_software_module_type", indexes = {
|
||||||
@@ -28,9 +25,6 @@ import javax.persistence.UniqueConstraint;
|
|||||||
@UniqueConstraint(columnNames = { "type_key", "tenant" }, name = "uk_smt_type_key"),
|
@UniqueConstraint(columnNames = { "type_key", "tenant" }, name = "uk_smt_type_key"),
|
||||||
@UniqueConstraint(columnNames = { "name", "tenant" }, name = "uk_smt_name") })
|
@UniqueConstraint(columnNames = { "name", "tenant" }, name = "uk_smt_name") })
|
||||||
public class SoftwareModuleType extends NamedEntity {
|
public class SoftwareModuleType extends NamedEntity {
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Column(name = "type_key", nullable = false, length = 64)
|
@Column(name = "type_key", nullable = false, length = 64)
|
||||||
@@ -92,48 +86,26 @@ public class SoftwareModuleType extends NamedEntity {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the key
|
|
||||||
*/
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the max
|
|
||||||
*/
|
|
||||||
public int getMaxAssignments() {
|
public int getMaxAssignments() {
|
||||||
return maxAssignments;
|
return maxAssignments;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the deleted
|
|
||||||
*/
|
|
||||||
public boolean isDeleted() {
|
public boolean isDeleted() {
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param deleted
|
|
||||||
* the deleted to set
|
|
||||||
*/
|
|
||||||
public void setDeleted(final boolean deleted) {
|
public void setDeleted(final boolean deleted) {
|
||||||
this.deleted = deleted;
|
this.deleted = deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return the software type color
|
|
||||||
*/
|
|
||||||
public String getColour() {
|
public String getColour() {
|
||||||
return colour;
|
return colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param colour
|
|
||||||
* the col
|
|
||||||
*/
|
|
||||||
public void setColour(final String colour) {
|
public void setColour(final String colour) {
|
||||||
this.colour = colour;
|
this.colour = colour;
|
||||||
}
|
}
|
||||||
@@ -143,4 +115,26 @@ public class SoftwareModuleType extends NamedEntity {
|
|||||||
return "SoftwareModuleType [key=" + key + ", getName()=" + getName() + ", getId()=" + getId() + "]";
|
return "SoftwareModuleType [key=" + key + ", getName()=" + getName() + ", getId()=" + getId() + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = super.hashCode();
|
||||||
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof SoftwareModuleType)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,25 +69,15 @@ public final class SwMetadataCompositeKey implements Serializable {
|
|||||||
this.softwareModule = softwareModule;
|
this.softwareModule = softwareModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
result = prime * result + (key == null ? 0 : key.hashCode());
|
||||||
result = prime * result + ((softwareModule == null) ? 0 : softwareModule.hashCode());
|
result = prime * result + (softwareModule == null ? 0 : softwareModule.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
// code
|
// code
|
||||||
|
|||||||
@@ -14,14 +14,9 @@ import javax.persistence.MappedSuperclass;
|
|||||||
import org.springframework.hateoas.Identifiable;
|
import org.springframework.hateoas.Identifiable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Tag can be used as describing and organisational meta information for any
|
* A Tag can be used as describing and organizational meta information for any
|
||||||
* kind of entity.
|
* kind of entity.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@MappedSuperclass
|
@MappedSuperclass
|
||||||
public abstract class Tag extends NamedEntity implements Identifiable<Long> {
|
public abstract class Tag extends NamedEntity implements Identifiable<Long> {
|
||||||
@@ -57,14 +52,31 @@ public abstract class Tag extends NamedEntity implements Identifiable<Long> {
|
|||||||
this.colour = colour;
|
this.colour = colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Tag [getOptLockRevision()=" + getOptLockRevision() + ", getId()=" + getId() + "]";
|
return "Tag [getOptLockRevision()=" + getOptLockRevision() + ", getId()=" + getId() + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = super.hashCode();
|
||||||
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof Tag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,11 +56,6 @@ import org.springframework.data.domain.Persistable;
|
|||||||
* {@link TargetStatus#REGISTERED}, i.e. a target {@link DistributionSet} .
|
* {@link TargetStatus#REGISTERED}, i.e. a target {@link DistributionSet} .
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_target", indexes = {
|
@Table(name = "sp_target", indexes = {
|
||||||
@@ -182,25 +177,14 @@ public class Target extends NamedEntity implements Persistable<Long> {
|
|||||||
this.assignedDistributionSet = assignedDistributionSet;
|
this.assignedDistributionSet = assignedDistributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param controllerId
|
|
||||||
* the controllerId to set
|
|
||||||
*/
|
|
||||||
public void setControllerId(final String controllerId) {
|
public void setControllerId(final String controllerId) {
|
||||||
this.controllerId = controllerId;
|
this.controllerId = controllerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param tags
|
|
||||||
* the tags to set
|
|
||||||
*/
|
|
||||||
public void setTags(final Set<TargetTag> tags) {
|
public void setTags(final Set<TargetTag> tags) {
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the actions
|
|
||||||
*/
|
|
||||||
public List<Action> getActions() {
|
public List<Action> getActions() {
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
@@ -209,11 +193,6 @@ public class Target extends NamedEntity implements Persistable<Long> {
|
|||||||
return new TargetIdName(getId(), getControllerId(), getName());
|
return new TargetIdName(getId(), getControllerId(), getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.springframework.data.domain.Persistable#isNew()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transient
|
||||||
public boolean isNew() {
|
public boolean isNew() {
|
||||||
|
|||||||
@@ -57,32 +57,25 @@ public class TargetFilterQuery extends TenantAwareBaseEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {// NOSONAR - as this is generated
|
public int hashCode() {
|
||||||
if (this == obj) {
|
final int prime = 31;
|
||||||
return true;
|
int result = super.hashCode();
|
||||||
}
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
if (obj == null) {
|
return result;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final TargetFilterQuery other = (TargetFilterQuery) obj;
|
|
||||||
if (name == null) {
|
|
||||||
if (other.name != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!name.equals(other.name)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) {
|
||||||
final int prime = 31;
|
if (this == obj) {
|
||||||
int result = 1;
|
return true;
|
||||||
result = prime * result + (name == null ? 0 : name.hashCode());
|
}
|
||||||
return result;
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof TargetFilterQuery)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,39 +39,22 @@ public class TargetIdName implements Serializable {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the controller id
|
|
||||||
*/
|
|
||||||
public String getControllerId() {
|
public String getControllerId() {
|
||||||
return controllerId;
|
return controllerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* the id to set
|
|
||||||
*/
|
|
||||||
public void setControllerId(final String id) {
|
public void setControllerId(final String id) {
|
||||||
this.controllerId = id;
|
controllerId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param name
|
|
||||||
* the name to set
|
|
||||||
*/
|
|
||||||
public void setName(final String name) {
|
public void setName(final String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the targetId
|
|
||||||
*/
|
|
||||||
public long getTargetId() {
|
public long getTargetId() {
|
||||||
return targetId;
|
return targetId;
|
||||||
}
|
}
|
||||||
@@ -85,15 +68,10 @@ public class TargetIdName implements Serializable {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + (int) (targetId ^ (targetId >>> 32));
|
result = prime * result + (int) (targetId ^ targetId >>> 32);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
@@ -112,11 +90,6 @@ public class TargetIdName implements Serializable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// only return the ID because it's used in vaadin for setting the item
|
// only return the ID because it's used in vaadin for setting the item
|
||||||
|
|||||||
@@ -54,19 +54,11 @@ import org.springframework.data.domain.Persistable;
|
|||||||
* modifying the {@link Target} itself when a controller reports it's
|
* modifying the {@link Target} itself when a controller reports it's
|
||||||
* {@link #lastTargetQuery} for example.
|
* {@link #lastTargetQuery} for example.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Table(name = "sp_target_info", indexes = {
|
@Table(name = "sp_target_info", indexes = {
|
||||||
@Index(name = "sp_idx_target_info_02", columnList = "target_id,update_status") })
|
@Index(name = "sp_idx_target_info_02", columnList = "target_id,update_status") })
|
||||||
@Entity
|
@Entity
|
||||||
// @DynamicUpdate
|
|
||||||
public class TargetInfo implements Persistable<Long>, Serializable {
|
public class TargetInfo implements Persistable<Long>, Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(TargetInfo.class);
|
private static final Logger LOG = LoggerFactory.getLogger(TargetInfo.class);
|
||||||
@@ -81,9 +73,6 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY, targetEntity = Target.class)
|
@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY, targetEntity = Target.class)
|
||||||
@JoinColumn(name = "target_id", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_stat_targ"))
|
@JoinColumn(name = "target_id", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_stat_targ"))
|
||||||
@MapsId
|
@MapsId
|
||||||
// use deprecated annotation until HHH-8862 is fixed
|
|
||||||
// @SuppressWarnings( "deprecation" )
|
|
||||||
// @org.hibernate.annotations.ForeignKey( name = "fk_targ_stat_targ" )
|
|
||||||
private Target target;
|
private Target target;
|
||||||
|
|
||||||
@Column(name = "address", length = 512)
|
@Column(name = "address", length = 512)
|
||||||
@@ -111,9 +100,7 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
@MapKeyColumn(name = "attribute_key", nullable = false, length = 32)
|
@MapKeyColumn(name = "attribute_key", nullable = false, length = 32)
|
||||||
@CollectionTable(name = "sp_target_attributes", joinColumns = {
|
@CollectionTable(name = "sp_target_attributes", joinColumns = {
|
||||||
@JoinColumn(name = "target_id") }, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_attrib_target"))
|
@JoinColumn(name = "target_id") }, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_attrib_target"))
|
||||||
// use deprecated annotation until HHH-8862 is fixed
|
|
||||||
|
|
||||||
// @org.hibernate.annotations.ForeignKey( name = "fk_targ_attrib_target" )
|
|
||||||
private final Map<String, String> controllerAttributes = Collections.synchronizedMap(new HashMap<String, String>());
|
private final Map<String, String> controllerAttributes = Collections.synchronizedMap(new HashMap<String, String>());
|
||||||
|
|
||||||
// set default request controller attributes to true, because we want to
|
// set default request controller attributes to true, because we want to
|
||||||
@@ -138,21 +125,11 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
targetId = null;
|
targetId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.springframework.data.domain.Persistable#getId()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return targetId;
|
return targetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.springframework.data.domain.Persistable#isNew()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transient
|
||||||
public boolean isNew() {
|
public boolean isNew() {
|
||||||
@@ -198,114 +175,62 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the targetId
|
|
||||||
*/
|
|
||||||
public Long getTargetId() {
|
public Long getTargetId() {
|
||||||
return targetId;
|
return targetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param targetId
|
|
||||||
* the targetId to set
|
|
||||||
*/
|
|
||||||
public void setTargetId(final Long targetId) {
|
public void setTargetId(final Long targetId) {
|
||||||
this.targetId = targetId;
|
this.targetId = targetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the target
|
|
||||||
*/
|
|
||||||
public Target getTarget() {
|
public Target getTarget() {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param target
|
|
||||||
* the target to set
|
|
||||||
*/
|
|
||||||
public void setTarget(final Target target) {
|
public void setTarget(final Target target) {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the lastTargetQuery
|
|
||||||
*/
|
|
||||||
public Long getLastTargetQuery() {
|
public Long getLastTargetQuery() {
|
||||||
return lastTargetQuery;
|
return lastTargetQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastTargetQuery
|
|
||||||
* the lastTargetQuery to set
|
|
||||||
*/
|
|
||||||
public void setLastTargetQuery(final Long lastTargetQuery) {
|
public void setLastTargetQuery(final Long lastTargetQuery) {
|
||||||
this.lastTargetQuery = lastTargetQuery;
|
this.lastTargetQuery = lastTargetQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param requestControllerAttributes
|
|
||||||
* the requestControllerAttributes to set
|
|
||||||
*/
|
|
||||||
public void setRequestControllerAttributes(final boolean requestControllerAttributes) {
|
public void setRequestControllerAttributes(final boolean requestControllerAttributes) {
|
||||||
this.requestControllerAttributes = requestControllerAttributes;
|
this.requestControllerAttributes = requestControllerAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the controllerAttributes
|
|
||||||
*/
|
|
||||||
public Map<String, String> getControllerAttributes() {
|
public Map<String, String> getControllerAttributes() {
|
||||||
return controllerAttributes;
|
return controllerAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the requestControllerAttributes
|
|
||||||
*/
|
|
||||||
public boolean isRequestControllerAttributes() {
|
public boolean isRequestControllerAttributes() {
|
||||||
return requestControllerAttributes;
|
return requestControllerAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the installationDate
|
|
||||||
*/
|
|
||||||
public Long getInstallationDate() {
|
public Long getInstallationDate() {
|
||||||
return installationDate;
|
return installationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param installationDate
|
|
||||||
* the installationDate to set
|
|
||||||
*/
|
|
||||||
public void setInstallationDate(final Long installationDate) {
|
public void setInstallationDate(final Long installationDate) {
|
||||||
this.installationDate = installationDate;
|
this.installationDate = installationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the updateStatus
|
|
||||||
*/
|
|
||||||
public TargetUpdateStatus getUpdateStatus() {
|
public TargetUpdateStatus getUpdateStatus() {
|
||||||
return updateStatus;
|
return updateStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param updateStatus
|
|
||||||
* the updateStatus to set
|
|
||||||
*/
|
|
||||||
public void setUpdateStatus(final TargetUpdateStatus updateStatus) {
|
public void setUpdateStatus(final TargetUpdateStatus updateStatus) {
|
||||||
this.updateStatus = updateStatus;
|
this.updateStatus = updateStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the installedDistributionSet
|
|
||||||
*/
|
|
||||||
public DistributionSet getInstalledDistributionSet() {
|
public DistributionSet getInstalledDistributionSet() {
|
||||||
return installedDistributionSet;
|
return installedDistributionSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param installedDistributionSet
|
|
||||||
* the installedDistributionSet to set
|
|
||||||
*/
|
|
||||||
public void setInstalledDistributionSet(final DistributionSet installedDistributionSet) {
|
public void setInstalledDistributionSet(final DistributionSet installedDistributionSet) {
|
||||||
this.installedDistributionSet = installedDistributionSet;
|
this.installedDistributionSet = installedDistributionSet;
|
||||||
}
|
}
|
||||||
@@ -339,8 +264,6 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
* target poll time, e.g. the last poll time, the next poll time and the
|
* target poll time, e.g. the last poll time, the next poll time and the
|
||||||
* overdue poll time.
|
* overdue poll time.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static final class PollStatus {
|
public static final class PollStatus {
|
||||||
private final LocalDateTime lastPollDate;
|
private final LocalDateTime lastPollDate;
|
||||||
@@ -386,15 +309,41 @@ public class TargetInfo implements Persistable<Long>, Serializable {
|
|||||||
return currentDate;
|
return currentDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PollTime [lastPollDate=" + lastPollDate + ", nextPollDate=" + nextPollDate + ", overdueDate="
|
return "PollTime [lastPollDate=" + lastPollDate + ", nextPollDate=" + nextPollDate + ", overdueDate="
|
||||||
+ overdueDate + ", currentDate=" + currentDate + "]";
|
+ overdueDate + ", currentDate=" + currentDate + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + (target == null ? 0 : target.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof TargetInfo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final TargetInfo other = (TargetInfo) obj;
|
||||||
|
if (target == null) {
|
||||||
|
if (other.target != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!target.equals(other.target)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import javax.persistence.UniqueConstraint;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sp_target_tag", indexes = {
|
@Table(name = "sp_target_tag", indexes = {
|
||||||
@Index(name = "sp_idx_target_tag_prim", columnList = "tenant,id") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
@Index(name = "sp_idx_target_tag_prim", columnList = "tenant,id") }, uniqueConstraints = @UniqueConstraint(columnNames = {
|
||||||
"name", "tenant" }, name = "uk_targ_tag") )
|
"name", "tenant" }, name = "uk_targ_tag"))
|
||||||
public class TargetTag extends Tag {
|
public class TargetTag extends Tag {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -65,18 +65,10 @@ public class TargetTag extends Tag {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the assignedToTargets
|
|
||||||
*/
|
|
||||||
public List<Target> getAssignedToTargets() {
|
public List<Target> getAssignedToTargets() {
|
||||||
return assignedToTargets;
|
return assignedToTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -85,11 +77,6 @@ public class TargetTag extends Tag {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ package org.eclipse.hawkbit.repository.model;
|
|||||||
* status. A {@link Target} can have only one status. independent of the number
|
* status. A {@link Target} can have only one status. independent of the number
|
||||||
* of {@link UpdateAction}s that have to be applied.
|
* of {@link UpdateAction}s that have to be applied.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public enum TargetUpdateStatus {
|
public enum TargetUpdateStatus {
|
||||||
|
|
||||||
|
|||||||
@@ -76,22 +76,22 @@ public abstract class TenantAwareBaseEntity extends BaseEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() { // NOSONAR - as this is generated
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((tenant == null) ? 0 : tenant.hashCode());
|
result = prime * result + (tenant == null ? 0 : tenant.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof TenantAwareBaseEntity)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final TenantAwareBaseEntity other = (TenantAwareBaseEntity) obj;
|
final TenantAwareBaseEntity other = (TenantAwareBaseEntity) obj;
|
||||||
|
|||||||
@@ -27,10 +27,6 @@ import javax.persistence.UniqueConstraint;
|
|||||||
@Table(name = "sp_tenant_configuration", uniqueConstraints = @UniqueConstraint(columnNames = { "conf_key",
|
@Table(name = "sp_tenant_configuration", uniqueConstraints = @UniqueConstraint(columnNames = { "conf_key",
|
||||||
"tenant" }, name = "uk_tenant_key"))
|
"tenant" }, name = "uk_tenant_key"))
|
||||||
public class TenantConfiguration extends TenantAwareBaseEntity implements Serializable {
|
public class TenantConfiguration extends TenantAwareBaseEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Column(name = "conf_key", length = 128)
|
@Column(name = "conf_key", length = 128)
|
||||||
@@ -89,24 +85,14 @@ public class TenantConfiguration extends TenantAwareBaseEntity implements Serial
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
result = prime * result + (key == null ? 0 : key.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
public boolean equals(final Object obj) { // NOSONAR - as this is generated
|
||||||
// code
|
// code
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ public class TenantMetaData extends BaseEntity {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = super.hashCode();
|
int result = super.hashCode();
|
||||||
result = prime * result + ((defaultDsType == null) ? 0 : defaultDsType.hashCode());
|
result = prime * result + this.getClass().getName().hashCode();
|
||||||
result = prime * result + ((tenant == null) ? 0 : tenant.hashCode());
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,24 +94,10 @@ public class TenantMetaData extends BaseEntity {
|
|||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getClass() != obj.getClass()) {
|
if (!(obj instanceof TenantMetaData)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final TenantMetaData other = (TenantMetaData) obj;
|
|
||||||
if (defaultDsType == null) {
|
|
||||||
if (other.defaultDsType != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!defaultDsType.equals(other.defaultDsType)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (tenant == null) {
|
|
||||||
if (other.tenant != null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (!tenant.equals(other.tenant)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class TestDataUtil {
|
|||||||
return distributionSetManagement.createDistributionSet(
|
return distributionSetManagement.createDistributionSet(
|
||||||
buildDistributionSet(suffix != null && suffix.length() > 0 ? suffix : "DS", version,
|
buildDistributionSet(suffix != null && suffix.length() > 0 ? suffix : "DS", version,
|
||||||
findOrCreateDistributionSetType(distributionSetManagement, "ecl_os_app_jvm",
|
findOrCreateDistributionSetType(distributionSetManagement, "ecl_os_app_jvm",
|
||||||
"OC mandatory App/JVM optional", mand, opt),
|
"OS mandatory App/JVM optional", mand, opt),
|
||||||
os, jvm, ah).setRequiredMigrationStep(isRequiredMigrationStep));
|
os, jvm, ah).setRequiredMigrationStep(isRequiredMigrationStep));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,12 +33,10 @@ public class ActionTest {
|
|||||||
final Action timeforcedAction = new Action();
|
final Action timeforcedAction = new Action();
|
||||||
timeforcedAction.setActionType(ActionType.TIMEFORCED);
|
timeforcedAction.setActionType(ActionType.TIMEFORCED);
|
||||||
timeforcedAction.setForcedTime(timeForceTimeAt);
|
timeforcedAction.setForcedTime(timeForceTimeAt);
|
||||||
final int knownHashCode = timeforcedAction.hashCode();
|
|
||||||
assertThat(timeforcedAction.isForce()).isFalse();
|
assertThat(timeforcedAction.isForce()).isFalse();
|
||||||
|
|
||||||
// wait until timeforce time is hit
|
// wait until timeforce time is hit
|
||||||
Thread.sleep(sleepTime + 100);
|
Thread.sleep(sleepTime + 100);
|
||||||
assertThat(timeforcedAction.isForce()).isTrue();
|
assertThat(timeforcedAction.isForce()).isTrue();
|
||||||
assertThat(timeforcedAction.hashCode()).isNotEqualTo(knownHashCode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user