use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test600AssignAccountSubman.
@Test
public void test600AssignAccountSubman() throws Exception {
final String TEST_NAME = "test600AssignAccountSubman";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
long tsStart = System.currentTimeMillis();
// WHEN
TestUtil.displayWhen(TEST_NAME);
assignRole(USER_SUBMAN_OID, ROLE_SUBMISSIVE_OID, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
long tsEnd = System.currentTimeMillis();
Entry entry = assertLdapSubAccount(USER_SUBMAN_USERNAME, USER_SUBMAN_FULL_NAME);
display("Sub entry", entry);
assertAttribute(entry, "title", null);
PrismObject<UserType> userAfter = getUser(USER_SUBMAN_OID);
String shadowOid = getSingleLinkOid(userAfter);
PrismObject<ShadowType> shadow = getShadowModel(shadowOid);
display("Shadow (model)", shadow);
accountSubmanOid = shadow.getOid();
Collection<ResourceAttribute<?>> identifiers = ShadowUtil.getPrimaryIdentifiers(shadow);
String accountBarbossaIcfUid = (String) identifiers.iterator().next().getRealValue();
assertNotNull("No identifier in " + shadow, accountBarbossaIcfUid);
assertEquals("Wrong ICFS UID", AdUtils.formatGuidToDashedNotation(MiscUtil.binaryToHex(entry.get(getPrimaryIdentifierAttributeName()).getBytes())), accountBarbossaIcfUid);
assertLdapPassword(getSubLdapConnectionConfig(), USER_SUBMAN_USERNAME, USER_SUBMAN_FULL_NAME, USER_SUBMAN_PASSWORD);
assertAttribute(entry, ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, "512");
ResourceAttribute<Long> createTimestampAttribute = ShadowUtil.getAttribute(shadow, new QName(MidPointConstants.NS_RI, "createTimeStamp"));
assertNotNull("No createTimestamp in " + shadow, createTimestampAttribute);
Long createTimestamp = createTimestampAttribute.getRealValue();
// LDAP server may be on a different host. Allow for some clock offset.
TestUtil.assertBetween("Wrong createTimestamp in " + shadow, roundTsDown(tsStart) - 120000, roundTsUp(tsEnd) + 120000, createTimestamp);
// assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host in project midpoint by Evolveum.
the class CapabilityScriptPanel method prepareOnResourceModel.
private IModel prepareOnResourceModel() {
CapabilityDto dto = (CapabilityDto) getModel().getObject();
ScriptCapabilityType script = (ScriptCapabilityType) dto.getCapability();
for (ScriptCapabilityType.Host host : script.getHost()) {
if (ProvisioningScriptHostType.RESOURCE.equals(host.getType())) {
return new PropertyModel<List<String>>(host, "language");
}
}
List<String> emptyList = new ArrayList<>();
return Model.of(emptyList);
}
use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host in project midpoint by Evolveum.
the class CapabilityScriptPanel method prepareOnConnectorModel.
private IModel prepareOnConnectorModel() {
CapabilityDto dto = (CapabilityDto) getModel().getObject();
ScriptCapabilityType script = (ScriptCapabilityType) dto.getCapability();
for (ScriptCapabilityType.Host host : script.getHost()) {
if (ProvisioningScriptHostType.CONNECTOR.equals(host.getType())) {
return new PropertyModel<List<String>>(host, "language");
}
}
List<String> emptyList = new ArrayList<>();
return Model.of(emptyList);
}
use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host in project midpoint by Evolveum.
the class PageConnectorHosts method initConnectorHostsColumns.
private List<IColumn<ConnectorHostType, String>> initConnectorHostsColumns() {
List<IColumn<ConnectorHostType, String>> columns = new ArrayList<>();
IColumn column = new CheckBoxHeaderColumn<ConnectorHostType>();
columns.add(column);
column = new LinkColumn<SelectableBean<ConnectorHostType>>(createStringResource("pageResources.connector.name"), "name", "value.name") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ConnectorHostType>> rowModel) {
ConnectorHostType host = rowModel.getObject().getValue();
// resourceDetailsPerformed(target, host.getOid());
}
};
columns.add(column);
columns.add(new PropertyColumn(createStringResource("pageResources.connector.hostname"), "value.hostname"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.port"), "value.port"));
columns.add(new PropertyColumn(createStringResource("pageResources.connector.timeout"), "value.timeout"));
columns.add(new CheckBoxColumn(createStringResource("pageResources.connector.protectConnection"), "value.protectConnection"));
InlineMenuHeaderColumn menu = new InlineMenuHeaderColumn(initInlineHostsMenu());
columns.add(menu);
return columns;
}
use of com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType.Host in project midpoint by Evolveum.
the class PageConnectorHosts method discoveryRemotePerformed.
private void discoveryRemotePerformed(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
PageBase page = (PageBase) getPage();
Task task = page.createSimpleTask(OPERATION_CONNECTOR_DISCOVERY);
OperationResult result = task.getResult();
List<SelectableBean<ConnectorHostType>> selected = WebComponentUtil.getSelectedData(getConnectorHostTable());
if (selected.isEmpty()) {
warn(getString("pageResources.message.noHostSelected"));
return;
}
for (SelectableBean<ConnectorHostType> bean : selected) {
if (bean.getValue() != null) {
ConnectorHostType host = bean.getValue();
try {
getModelService().discoverConnectors(host, task, result);
} catch (Exception ex) {
result.recordFatalError("Fail to discover connectors on host '" + host.getHostname() + ":" + host.getPort() + "'", ex);
}
}
}
result.recomputeStatus();
showResult(result);
}
Aggregations