/** * Returns set of resource object attributes. * * The order of attributes is insignificant. * * The returned set is imutable! Any change to it will be ignored. * * @return set of resource object attributes. */ @Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Collection<ResourceAttribute<?>> getAttributes() { // TODO: Iterate over the list to assert correct types return (Set) getValue().getProperties(); }
public <T> T getResourceIcfConfigurationPropertyValue(ResourceType resource, String propertyLocalPart) throws SchemaException { if (propertyLocalPart == null) { return null; } PrismContainer<?> configurationProperties = getIcfConfigurationProperties(resource); if (configurationProperties == null) { return null; } for (PrismProperty<?> property : configurationProperties.getValue().getProperties()) { if (propertyLocalPart.equals(property.getElementName().getLocalPart())) { return (T) property.getAnyRealValue(); } } return null; }
private void transformConnectorTimeoutsConfiguration(APIConfiguration apiConfig, PrismContainer<?> connectorTimeoutsContainer) throws SchemaException { if (connectorTimeoutsContainer == null || connectorTimeoutsContainer.getValue() == null) { return; } for (PrismProperty prismProperty : connectorTimeoutsContainer.getValue().getProperties()) { QName propertQName = prismProperty.getElementName(); if (SchemaConstants.NS_ICF_CONFIGURATION.equals(propertQName.getNamespaceURI())) { String opName = propertQName.getLocalPart(); Class<? extends APIOperation> apiOpClass = ConnectorFactoryConnIdImpl.resolveApiOpClass(opName); if (apiOpClass != null) { apiConfig.setTimeout(apiOpClass, parseInt(prismProperty)); } else { throw new SchemaException("Unknown operation name " + opName + " in " + ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_TIMEOUTS_XML_ELEMENT_NAME); } } } }
List<QName> wrongNamespaceProperties = new ArrayList<>(); for (PrismProperty prismProperty : configurationPropertiesContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName();
for (PrismProperty prismProperty : connectorPoolContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName(); if (propertyQName.getNamespaceURI().equals(SchemaConstants.NS_ICF_CONFIGURATION)) {
for (PrismProperty prismProperty : resultsHandlerConfigurationContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName(); if (propertyQName.getNamespaceURI().equals(SchemaConstants.NS_ICF_CONFIGURATION)) {
protected PrismObject<ShadowType> repoAddShadowFromFile(File file, OperationResult parentResult) throws SchemaException, ObjectAlreadyExistsException, EncryptionException, IOException { OperationResult result = parentResult.createSubresult(AbstractIntegrationTest.class.getName() + ".repoAddShadowFromFile"); result.addParam("file", file.getPath()); LOGGER.debug("addShadowFromFile: {}", file); PrismObject<ShadowType> object = prismContext.parseObject(file); PrismContainer<Containerable> attrCont = object.findContainer(ShadowType.F_ATTRIBUTES); for (PrismProperty<?> attr: attrCont.getValue().getProperties()) { if (attr.getDefinition() == null) { ResourceAttributeDefinition<String> attrDef = ObjectFactory.createResourceAttributeDefinition(attr.getElementName(), DOMUtil.XSD_STRING, prismContext); attr.setDefinition((PrismPropertyDefinition) attrDef); } } addBasicMetadata(object); LOGGER.trace("Adding object:\n{}", object.debugDump()); repoAddObject(object, "from file "+file, result); result.recordSuccess(); return object; }
for (PrismProperty property: attributesContainer.getValue().getProperties()) { if (ocDef.isPrimaryIdentifier(property.getElementName())) { RefinedAttributeDefinition<?> attrDef = ocDef.findAttributeDefinition(property.getElementName());
public ShadowAttributesAsserter<R> assertAttributes(QName... expectedAttributes) { for (QName expectedAttribute: expectedAttributes) { PrismProperty<Object> attr = getAttributes().findProperty(ItemName.fromQName(expectedAttribute)); if (attr == null) { fail("Expected attribute "+expectedAttribute+" in "+desc()+" but there was none. Attributes present: "+presentAttributeNames()); } } for (PrismProperty<?> existingAttr : getAttributes().getProperties()) { if (!QNameUtil.contains(expectedAttributes, existingAttr.getElementName())) { fail("Unexpected attribute "+existingAttr.getElementName()+" in "+desc()+". Expected attributes: "+QNameUtil.prettyPrint(expectedAttributes)); } } return this; }
for (PrismProperty<?> property: attributesContainer.getValue().getProperties()) { if (ocDef.isPrimaryIdentifier(property.getElementName())) { RefinedAttributeDefinition<?> attrDef = ocDef.findAttributeDefinition(property.getElementName());