use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.
the class FederationAdmin method updateDateFields.
private void updateDateFields(RegistryPackageType rpt) {
ExtrinsicObjectType nodeInfo = null;
for (JAXBElement identifiable : rpt.getRegistryObjectList().getIdentifiable()) {
RegistryObjectType registryObject = (RegistryObjectType) identifiable.getValue();
if (registryObject instanceof ExtrinsicObjectType && RegistryConstants.REGISTRY_NODE_OBJECT_TYPE.equals(registryObject.getObjectType())) {
nodeInfo = (ExtrinsicObjectType) registryObject;
break;
}
}
if (nodeInfo != null) {
boolean liveDateFound = false;
boolean lastUpdatedFound = false;
OffsetDateTime now = OffsetDateTime.now(ZoneId.of(ZoneOffset.UTC.toString()));
String rightNow = now.toString();
for (SlotType1 slot : nodeInfo.getSlot()) {
if (slot.getName().equals(RegistryConstants.XML_LIVE_DATE_NAME)) {
liveDateFound = true;
} else if (slot.getName().equals(RegistryConstants.XML_LAST_UPDATED_NAME)) {
ValueListType valueList = EbrimConstants.RIM_FACTORY.createValueListType();
valueList.getValue().add(rightNow);
slot.setValueList(EbrimConstants.RIM_FACTORY.createValueList(valueList));
lastUpdatedFound = true;
}
}
if (!liveDateFound) {
SlotType1 liveDate = slotHelper.create(RegistryConstants.XML_LIVE_DATE_NAME, rightNow, DATE_TIME);
nodeInfo.getSlot().add(liveDate);
}
if (!lastUpdatedFound) {
SlotType1 lastUpdated = slotHelper.create(RegistryConstants.XML_LAST_UPDATED_NAME, rightNow, DATE_TIME);
nodeInfo.getSlot().add(lastUpdated);
}
}
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project midpoint by Evolveum.
the class ExecuteScriptUtil method createInput.
public static ValueListType createInput(Collection<? extends PrismValue> values) {
ValueListType input = new ValueListType();
values.forEach(o -> input.getValue().add(o));
return input;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project midpoint by Evolveum.
the class SynchronousScriptExecutor method addInputIfNeeded.
private ExecuteScriptType addInputIfNeeded(ExecuteScriptType specifiedExecuteScriptBean, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException {
if (specifiedExecuteScriptBean.getInput() == null) {
FullDataBasedObjectSet objectSet = new FullDataBasedObjectSet(actx, result);
objectSet.collect();
ValueListType input = createInputCloned(objectSet.asObjectValues());
return implantInput(specifiedExecuteScriptBean, input);
} else {
return specifiedExecuteScriptBean;
}
}
Aggregations