/** * Create an instance of {@link TaskExecutionLimitationsType } * */ public TaskExecutionLimitationsType createTaskExecutionLimitationsType() { return new TaskExecutionLimitationsType(); }
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()); } }
@NotNull private NodeType createLocalNodeObject(TaskManagerConfiguration configuration) { NodeType node = getPrismContext().createKnownObjectable(NodeType.class); String nodeId = configuration.getNodeId(); node.setNodeIdentifier(nodeId); node.setName(new PolyStringType(nodeId)); node.setHostname(getMyHostname()); node.getIpAddress().addAll(getMyIpAddresses()); node.setJmxPort(configuration.getJmxPort()); node.setClustered(configuration.isClustered()); node.setRunning(true); node.setLastCheckInTime(getCurrentTime()); node.setBuild(getBuildInformation()); node.setTaskExecutionLimitations( new TaskExecutionLimitationsType() .groupLimitation(new TaskGroupExecutionLimitationType().groupName("").limit(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(nodeId).limit(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(TaskConstants.LIMIT_FOR_OTHER_GROUPS).limit(0))); generateInternalNodeIdentifier(node); return node; }
public TaskGroupExecutionLimitationType beginGroupLimitation() { TaskGroupExecutionLimitationType value = new TaskGroupExecutionLimitationType(); groupLimitation(value); return value; }
public int hashCode() { final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
@Test public void test120NodeAllowed() throws Exception { final String TEST_NAME = "test120NodeAllowed"; final OperationResult result = createResult(TEST_NAME, LOGGER); taskManager.getExecutionManager().setLocalExecutionLimitations( new TaskExecutionLimitationsType() .groupLimitation(new TaskGroupExecutionLimitationType().groupName("lightweight-tasks")) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(TaskConstants.LIMIT_FOR_OTHER_GROUPS).limit(0))); TaskType task = (TaskType) addObjectFromFile(taskFilename(TEST_NAME)).asObjectable(); waitForTaskStart(task.getOid(), result, 10000, 500); task = getTaskType(task.getOid(), result); assertNotNull("Task was not started even if it should be", task.getLastRunStartTimestamp()); }
/** * Create an instance of {@link TaskExecutionLimitationsType } * */ public TaskExecutionLimitationsType createTaskExecutionLimitationsType() { return new TaskExecutionLimitationsType(); }
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; }
/** * 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); } }
/** * Create an instance of {@link TaskExecutionLimitationsType } * */ public TaskExecutionLimitationsType createTaskExecutionLimitationsType() { return new TaskExecutionLimitationsType(); }
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; }
public TaskExecutionLimitationsType beginTaskExecutionLimitations() { TaskExecutionLimitationsType value = new TaskExecutionLimitationsType(); taskExecutionLimitations(value); return value; }
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); } } }