Search in sources :

Example 6 with DummyObjectClass

use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.

the class TestVillage method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    super.initSystem(initTask, initResult);
    // Resources
    dummyResourceCtlSrc = DummyResourceContoller.create(RESOURCE_DUMMY_SOURCE_ID, resourceDummySrc);
    DummyObjectClass dummyAdAccountObjectClass = dummyResourceCtlSrc.getDummyResource().getAccountObjectClass();
    dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_FIRST_NAME, String.class, false, false);
    dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_LAST_NAME, String.class, false, false);
    dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_TYPE, String.class, false, false);
    dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_LOC, String.class, false, false);
    dummyResourceCtlSrc.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SRC_ORG, String.class, false, false);
    dummyResourceSrc = dummyResourceCtlSrc.getDummyResource();
    resourceDummySrc = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_SOURCE_FILE, RESOURCE_DUMMY_SOURCE_OID, initTask, initResult);
    resourceDummySrcType = resourceDummySrc.asObjectable();
    dummyResourceCtlSrc.setResource(resourceDummySrc);
    dummyResourceSrc.setSyncStyle(DummySyncStyle.SMART);
    resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, RESOURCE_OPENDJ_FILE, RESOURCE_OPENDJ_OID, initTask, initResult);
    resourceOpenDjType = resourceOpenDj.asObjectable();
    openDJController.setResource(resourceOpenDj);
    // Object Templates
    importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult);
    setDefaultUserTemplate(OBJECT_TEMPLATE_USER_OID);
    // Role
    importObjectFromFile(ROLE_BASIC_FILE, initResult);
    importObjectFromFile(ROLE_SIMPLE_FILE, initResult);
    importObjectFromFile(ROLE_META_FUNCTIONAL_ORG_FILE, initResult);
    importObjectFromFile(ROLE_META_PROJECT_ORG_FILE, initResult);
    // Org
    repoAddObjectsFromFile(ORGS_FILE, OrgType.class, initResult);
    // LDAP content
    openDJController.addEntryFromLdifFile(GROUP_GOV_MONKEY_ISLAND_LDIF_FILE);
    openDJController.addEntryFromLdifFile(GROUP_EXEC_MONKEY_ISLAND_LDIF_FILE);
    // Tasks
    importObjectFromFile(TASK_LIVE_SYNC_DUMMY_SOURCE_FILE, initResult);
    InternalMonitor.setTracePrismObjectClone(true);
}
Also used : DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass)

Example 7 with DummyObjectClass

use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.

the class DummyResourceContoller method extendSchemaAd.

/**
	 * Extend dummy schema to look like AD 
	 */
public void extendSchemaAd() throws ConnectException, FileNotFoundException, SchemaViolationException, ConflictException {
    DummyObjectClass accountObjectClass = dummyResource.getAccountObjectClass();
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_GIVEN_NAME_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_SN_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_SAM_ACCOUNT_NAME_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_USER_PRINCIPAL_NAME_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_USER_SHARED_FOLDER_OTHER_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_MAIL_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_DEPARTMENT_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_FACSIMILE_TELEPHONE_NUMBER_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_TELEPHONE_NUMBER_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_MOBILE_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_IP_PHONE_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_PHYSICAL_DELIVERY_OFFICE_NAME_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_DESCRIPTION_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_ACCOUNT_EXPIRES_NAME, Long.class, false, false);
    // This should in fact be icfs:groups but this is OK for now
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_AD_GROUPS_NAME, String.class, false, true);
    isExtendedSchema = true;
}
Also used : DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass)

Example 8 with DummyObjectClass

use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.

the class DummyResourceContoller method extendSchemaPosix.

/**
	 * Extend dummy schema to have an auxiliary OC.
	 */
public void extendSchemaPosix() throws ConnectException, FileNotFoundException, SchemaViolationException {
    DummyObjectClass posixAccount = new DummyObjectClass();
    // uid and gid are temporarily not required
    addAttrDef(posixAccount, DUMMY_ACCOUNT_ATTRIBUTE_POSIX_UID_NUMBER, Integer.class, false, false);
    addAttrDef(posixAccount, DUMMY_ACCOUNT_ATTRIBUTE_POSIX_GID_NUMBER, Integer.class, false, false);
    dummyResource.addAuxiliaryObjectClass(DUMMY_POSIX_ACCOUNT_OBJECT_CLASS_NAME, posixAccount);
    isExtendedSchema = true;
}
Also used : DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass)

Example 9 with DummyObjectClass

use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.

the class DummyResourceContoller method extendSchemaPirate.

/**
	 * Extend schema in piratey fashion. Arr! This is used in many tests. Lots of attributes, various combination of types, etc.  
	 */
public void extendSchemaPirate() throws ConnectException, FileNotFoundException, SchemaViolationException, ConflictException {
    populateWithDefaultSchema();
    DummyObjectClass accountObjectClass = dummyResource.getAccountObjectClass();
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, String.class, false, false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, String.class, false, false);
    DummyAttributeDefinition lootAttrDef = addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_LOOT_NAME, Integer.class, false, false);
    lootAttrDef.setReturnedByDefault(false);
    DummyAttributeDefinition treasureAttrDef = addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_TREASURE_NAME, String.class, false, false);
    treasureAttrDef.setReturnedByDefault(false);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_QUOTE_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, String.class, false, true);
    addAttrDef(accountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_WATER_NAME, String.class, false, false);
    DummyObjectClass groupObjectClass = dummyResource.getGroupObjectClass();
    addAttrDef(groupObjectClass, DUMMY_GROUP_ATTRIBUTE_DESCRIPTION, String.class, false, false);
    addAttrDef(groupObjectClass, DUMMY_GROUP_ATTRIBUTE_CC, String.class, false, false);
    DummyObjectClass privilegeObjectClass = dummyResource.getPrivilegeObjectClass();
    addAttrDef(privilegeObjectClass, DUMMY_PRIVILEGE_ATTRIBUTE_POWER, Integer.class, false, false);
    isExtendedSchema = true;
}
Also used : DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass) DummyAttributeDefinition(com.evolveum.icf.dummy.resource.DummyAttributeDefinition)

Example 10 with DummyObjectClass

use of com.evolveum.icf.dummy.resource.DummyObjectClass in project midpoint by Evolveum.

the class TestOrgSync method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    super.initSystem(initTask, initResult);
    reconciliationTaskResultListener = new DebugReconciliationTaskResultListener();
    reconciliationTaskHandler.setReconciliationTaskResultListener(reconciliationTaskResultListener);
    // Resources
    dummyResourceCtlHr = DummyResourceContoller.create(RESOURCE_DUMMY_HR_ID, resourceDummyHr);
    DummyObjectClass dummyAdAccountObjectClass = dummyResourceCtlHr.getDummyResource().getAccountObjectClass();
    dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_FIRST_NAME, String.class, false, false);
    dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, String.class, false, false);
    dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_ORGPATH, String.class, false, false);
    dummyResourceCtlHr.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_HR_RESPONSIBILITIES, String.class, false, true);
    dummyResourceHr = dummyResourceCtlHr.getDummyResource();
    resourceDummyHr = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_HR_FILE, RESOURCE_DUMMY_HR_OID, initTask, initResult);
    resourceDummyHrType = resourceDummyHr.asObjectable();
    dummyResourceCtlHr.setResource(resourceDummyHr);
    dummyResourceHr.setSyncStyle(DummySyncStyle.SMART);
    resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, RESOURCE_OPENDJ_FILE, RESOURCE_OPENDJ_OID, initTask, initResult);
    resourceOpenDjType = resourceOpenDj.asObjectable();
    openDJController.setResource(resourceOpenDj);
    // LDAP content
    openDJController.addEntryFromLdifFile(SCABB_OU_LDIF_FILE);
    openDJController.addEntryFromLdifFile(BOOTY_OU_LDIF_FILE);
    openDJController.addEntryFromLdifFile(BOOTY_LOOKOUT_OU_LDIF_FILE);
    // Object Templates
    importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult);
    setDefaultUserTemplate(OBJECT_TEMPLATE_USER_OID);
    importObjectFromFile(OBJECT_TEMPLATE_ORG_FILE, initResult);
    setDefaultObjectTemplate(OrgType.COMPLEX_TYPE, OBJECT_TEMPLATE_ORG_OID);
    importObjectFromFile(OBJECT_TEMPLATE_ROLE_FILE, initResult);
    setDefaultObjectTemplate(RoleType.COMPLEX_TYPE, OBJECT_TEMPLATE_ROLE_OID);
    // Org
    importObjectFromFile(ORG_TOP_FILE, initResult);
    // Role
    importObjectFromFile(ROLE_BASIC_FILE, initResult);
    importObjectFromFile(ROLE_META_REPLICATED_ORG_FILE, initResult);
    importObjectFromFile(ROLE_META_RESPONSIBILITY_FILE, initResult);
    // Tasks
    importObjectFromFile(TASK_LIVE_SYNC_DUMMY_HR_FILE, initResult);
}
Also used : DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass) DebugReconciliationTaskResultListener(com.evolveum.midpoint.model.impl.util.DebugReconciliationTaskResultListener) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)

Aggregations

DummyObjectClass (com.evolveum.icf.dummy.resource.DummyObjectClass)14 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)6 DebugReconciliationTaskResultListener (com.evolveum.midpoint.model.impl.util.DebugReconciliationTaskResultListener)2 FileNotFoundException (java.io.FileNotFoundException)2 ConnectException (java.net.ConnectException)2 ConnectionFailedException (org.identityconnectors.framework.common.exceptions.ConnectionFailedException)2 ConnectorIOException (org.identityconnectors.framework.common.exceptions.ConnectorIOException)2 ConflictException (com.evolveum.icf.dummy.resource.ConflictException)1 DummyAttributeDefinition (com.evolveum.icf.dummy.resource.DummyAttributeDefinition)1 ObjectAlreadyExistsException (com.evolveum.icf.dummy.resource.ObjectAlreadyExistsException)1 RoleType (com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType)1 GuardedString (org.identityconnectors.common.security.GuardedString)1 AlreadyExistsException (org.identityconnectors.framework.common.exceptions.AlreadyExistsException)1 ConnectorException (org.identityconnectors.framework.common.exceptions.ConnectorException)1