@Override public String getNativeObjectClass() { return getObjectClassDefinition().getNativeObjectClass(); }
/** * Returns the native object class string for the resource object. * * Native object class is the name of the Resource Object Definition (Object * Class) as it is seen by the resource itself. The name of the Resource * Object Definition may be constrained by XSD or other syntax and therefore * may be "mangled" to conform to such syntax. The <i>native object * class</i> value will contain unmangled name (if available). * * Returns null if there is no native object class. * * The exception should be never thrown unless there is some bug in the * code. The validation of model consistency should be done at the time of * schema parsing. * * @return native object class * @throws IllegalStateException * if there is more than one description attribute. */ @Override public String getNativeObjectClass() { return getComplexTypeDefinition().getNativeObjectClass(); }
if (!StringUtils.isEmpty(definition.getNativeObjectClass())) { processor.addAnnotation(MidPointConstants.RA_NATIVE_OBJECT_CLASS, definition.getNativeObjectClass(), appinfo);
assertFalse("Empty secondary identifiers in account", accountDef.getSecondaryIdentifiers().isEmpty()); assertNotNull("No naming attribute in account", accountDef.getNamingAttribute()); assertFalse("No nativeObjectClass in account", StringUtils.isEmpty(accountDef.getNativeObjectClass()));
@Test public void test005ParsedSchema() throws Exception { final String TEST_NAME = "test005ParsedSchema"; TestUtil.displayTestTitle(TEST_NAME); // THEN // The returned type should have the schema pre-parsed assertNotNull(RefinedResourceSchemaImpl.hasParsedSchema(resourceType)); // Also test if the utility method returns the same thing ResourceSchema resourceSchema = RefinedResourceSchemaImpl.getResourceSchema(resourceType, prismContext); display("Parsed resource schema", resourceSchema); assertNotNull("No resource schema", resourceSchema); ObjectClassComplexTypeDefinition accountDef = resourceSchema.findObjectClassDefinition(RESOURCE_CSV_ACCOUNT_OBJECTCLASS); assertNotNull("Account definition is missing", accountDef); assertNotNull("Null identifiers in account", accountDef.getPrimaryIdentifiers()); assertFalse("Empty identifiers in account", accountDef.getPrimaryIdentifiers().isEmpty()); assertNotNull("No naming attribute in account", accountDef.getNamingAttribute()); assertFalse("No nativeObjectClass in account", StringUtils.isEmpty(accountDef.getNativeObjectClass())); assertAccountDefinition(accountDef); ResourceAttributeDefinition<String> icfsNameDef = accountDef.findAttributeDefinition(SchemaConstants.ICFS_NAME); assertNull("ICFS NAME definition sneaked in", icfsNameDef); ResourceAttributeDefinition<String> icfsUidDef = accountDef.findAttributeDefinition(SchemaConstants.ICFS_UID); assertNull("ICFS UID definition sneaked in", icfsUidDef); // Check whether it is reusing the existing schema and not parsing it all over again // Not equals() but == ... we want to really know if exactly the same // object instance is returned assertTrue("Broken caching", resourceSchema == RefinedResourceSchemaImpl.getResourceSchema(resourceType, prismContext)); }
assertFalse("Empty secondary identifiers in account", accountDef.getSecondaryIdentifiers().isEmpty()); assertNotNull("No naming attribute in account", accountDef.getNamingAttribute()); assertFalse("No nativeObjectClass in account", StringUtils.isEmpty(accountDef.getNativeObjectClass())); assertFalse("Empty secondary identifiers in posixAccount", posixAccountDef.getSecondaryIdentifiers().isEmpty()); assertNotNull("No naming attribute in posixAccount", posixAccountDef.getNamingAttribute()); assertFalse("No nativeObjectClass in posixAccount", StringUtils.isEmpty(posixAccountDef.getNativeObjectClass())); assertTrue("posixAccount is not auxiliary", posixAccountDef.isAuxiliary());
assertFalse("Empty secondary identifiers in account", accountDef1.getSecondaryIdentifiers().isEmpty()); assertNotNull("No naming attribute in account", accountDef1.getNamingAttribute()); assertFalse("No nativeObjectClass in account", StringUtils.isEmpty(accountDef1.getNativeObjectClass()));