use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class AbstractOrgClosureTest method createPolyString.
protected PolyStringType createPolyString(String orig) {
PolyStringType poly = new PolyStringType();
poly.setOrig(orig);
return poly;
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class TaskManagerQuartzImpl method persist.
private void persist(Task task, OperationResult parentResult) {
if (task.getPersistenceStatus() == TaskPersistenceStatus.PERSISTENT) {
// Task already persistent. Nothing to do.
return;
}
TaskQuartzImpl taskImpl = (TaskQuartzImpl) task;
if (task.getName() == null) {
PolyStringType polyStringName = new PolyStringType("Task " + task.getTaskIdentifier());
taskImpl.setNameTransient(polyStringName);
}
if (taskImpl.getOid() != null) {
// We don't support user-specified OIDs
throw new IllegalArgumentException("Transient task must not have OID (task:" + task + ")");
}
// hack: set Category if it is not set yet
if (taskImpl.getCategory() == null) {
taskImpl.setCategoryTransient(taskImpl.getCategoryFromHandler());
}
// Make sure that the task has repository service instance, so it can fully work as "persistent"
if (taskImpl.getRepositoryService() == null) {
RepositoryService repoService = (RepositoryService) this.beanFactory.getBean("repositoryService");
taskImpl.setRepositoryService(repoService);
}
try {
addTaskToRepositoryAndQuartz(taskImpl, parentResult);
} catch (ObjectAlreadyExistsException ex) {
// This should not happen. If it does, it is a bug. It is OK to convert to a runtime exception
throw new IllegalStateException("Got ObjectAlreadyExistsException while not expecting it (task:" + task + ")", ex);
} catch (SchemaException ex) {
// This should not happen. If it does, it is a bug. It is OK to convert to a runtime exception
throw new IllegalStateException("Got SchemaException while not expecting it (task:" + task + ")", ex);
}
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class NodeRegistrar method createNodePrism.
private PrismObject<NodeType> createNodePrism(TaskManagerConfiguration configuration) {
PrismObjectDefinition<NodeType> nodeTypeDef = getPrismContext().getSchemaRegistry().findObjectDefinitionByCompileTimeClass(NodeType.class);
PrismObject<NodeType> nodePrism;
try {
nodePrism = nodeTypeDef.instantiate();
} catch (SchemaException e) {
throw new SystemException(e.getMessage(), e);
}
NodeType node = nodePrism.asObjectable();
node.setNodeIdentifier(configuration.getNodeId());
node.setName(new PolyStringType(configuration.getNodeId()));
node.setHostname(getMyAddress());
node.setJmxPort(configuration.getJmxPort());
node.setClustered(configuration.isClustered());
node.setRunning(true);
node.setLastCheckInTime(getCurrentTime());
node.setBuild(getBuildInformation());
generateInternalNodeIdentifier(node);
return nodePrism;
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class AbstractWebserviceTest method createPolyStringType.
/**
* Creates polystring type with String value passed in argument
* */
protected static PolyStringType createPolyStringType(String string, Document doc) {
PolyStringType polyStringType = new PolyStringType();
Element origElement = createTextElement(TYPES_POLYSTRING_ORIG, string, doc);
polyStringType.getContent().add(origElement);
return polyStringType;
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class TestWSSecurity method test141ModifyTitleAsDarthAdder.
@Test
public void test141ModifyTitleAsDarthAdder() throws Exception {
final String TEST_NAME = "test141ModifyTitleAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "title", ModificationTypeType.REPLACE, ModelClientUtil.createPolyStringType("Dark Lord"));
// WHEN
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
// THEN
assertSuccess(deltaOpList);
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT");
tailer.assertAudit(4);
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
PolyStringType title = user.getTitle();
assertEquals("Wrong title", "Dark Lord", ModelClientUtil.getOrig(title));
}
Aggregations