public TaskExecutionLimitationsType groupLimitation(TaskGroupExecutionLimitationType value) { getGroupLimitation().add(value); return this; }
/** * Creates a new {@code TaskExecutionLimitationsType} instance by deeply copying a given {@code TaskExecutionLimitationsType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public TaskExecutionLimitationsType(final TaskExecutionLimitationsType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'TaskExecutionLimitationsType' from 'null'."); } // 'GroupLimitation' collection. if (o.groupLimitation!= null) { copyGroupLimitation(o.getGroupLimitation(), this.getGroupLimitation()); } }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public TaskExecutionLimitationsType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final TaskExecutionLimitationsType clone = ((TaskExecutionLimitationsType) super.clone()); // 'GroupLimitation' collection. if (this.groupLimitation!= null) { clone.groupLimitation = null; copyGroupLimitation(this.getGroupLimitation(), clone.getGroupLimitation()); } return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<TaskGroupExecutionLimitationType> theGroupLimitation; theGroupLimitation = (((this.groupLimitation!= null)&&(!this.groupLimitation.isEmpty()))?this.getGroupLimitation():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "groupLimitation", theGroupLimitation), currentHashCode, theGroupLimitation); } return currentHashCode; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof TaskExecutionLimitationsType)) { return false; } if (this == object) { return true; } final TaskExecutionLimitationsType that = ((TaskExecutionLimitationsType) object); { List<TaskGroupExecutionLimitationType> lhsGroupLimitation; lhsGroupLimitation = (((this.groupLimitation!= null)&&(!this.groupLimitation.isEmpty()))?this.getGroupLimitation():null); List<TaskGroupExecutionLimitationType> rhsGroupLimitation; rhsGroupLimitation = (((that.groupLimitation!= null)&&(!that.groupLimitation.isEmpty()))?that.getGroupLimitation():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "groupLimitation", lhsGroupLimitation), LocatorUtils.property(thatLocator, "groupLimitation", rhsGroupLimitation), lhsGroupLimitation, rhsGroupLimitation)) { return false; } } return true; }
private static Integer getNodeLimitation(NodeType node, String group) { if (node.getTaskExecutionLimitations() == null) { return null; } group = MiscUtil.nullIfEmpty(group); for (TaskGroupExecutionLimitationType limit : node.getTaskExecutionLimitations().getGroupLimitation()) { if (Objects.equals(group, MiscUtil.nullIfEmpty(limit.getGroupName()))) { return limit.getLimit(); } } for (TaskGroupExecutionLimitationType limit : node.getTaskExecutionLimitations().getGroupLimitation()) { if (TaskConstants.LIMIT_FOR_OTHER_GROUPS.equals(limit.getGroupName())) { return limit.getLimit(); } } return null; }
void setLocalExecutionLimitations(Scheduler scheduler, TaskExecutionLimitationsType limitations) { try { Map<String, Integer> newLimits = new HashMap<>(); if (limitations != null) { for (TaskGroupExecutionLimitationType limit : limitations.getGroupLimitation()) { newLimits.put(MiscUtil.nullIfEmpty(limit.getGroupName()), limit.getLimit()); } } else { // no limits -> everything is allowed } Map<String, Integer> oldLimits = scheduler.getExecutionLimits(); // just for the logging purposes scheduler.setExecutionLimits(newLimits); if (oldLimits == null || !new HashMap<>(oldLimits).equals(newLimits)) { LOGGER.info("Quartz scheduler execution limits set to: {} (were: {})", newLimits, oldLimits); } } catch (SchedulerException e) { // should never occur, as local scheduler shouldn't throw such exceptions throw new SystemException("Couldn't set local Quartz scheduler execution capabilities: " + e.getMessage(), e); } } }