当前位置: 首页>>代码示例>>Java>>正文


Java UserManager类代码示例

本文整理汇总了Java中oracle.iam.identity.usermgmt.api.UserManager的典型用法代码示例。如果您正苦于以下问题:Java UserManager类的具体用法?Java UserManager怎么用?Java UserManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UserManager类属于oracle.iam.identity.usermgmt.api包,在下文中一共展示了UserManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
/**
 * Method to test the OIMClient. All the Identities (users) are queried from
 * OIM environment.
 * @param args 
 */
public void test() throws AccessDeniedException, UserSearchException
{        
    // Lookup User Manager service
    UserManager usermgr = this.oimClient.getService(UserManager.class);
    
    // Only fetch attributes defined in HashSet 
    HashSet attrQuery = new HashSet();
    attrQuery.add("usr_key");
    attrQuery.add("usr_login");
    attrQuery.add("Display Name");
    attrQuery.add("First Name");
    attrQuery.add("Last Name");

    // Call a method from User Manager service
    List<User> users = usermgr.search(new SearchCriteria("User Login", "*", SearchCriteria.Operator.EQUAL), attrQuery, new HashMap());
    logger.log(ODLLevel.NOTIFICATION, "OIM Users: {0}", new Object[]{users});
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:23,代码来源:OracleIdentityManagerClient.java

示例2: getOimUsrAttribute

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
/**
 * @param userID
 *            usr_login or usr_key
 * @param attributeName
 *            the name of the attr to get
 * @param isUserLogin
 *            true is userID is usr_login
 * @return attributeValue
 */
public static String getOimUsrAttribute(String userID, String attributeName, boolean isUserLogin)
{
	log.debug("enter getOimUsrAttribute " + userID + ", " + attributeName);

	if ( StringUtils.isBlank(userID) || StringUtils.isBlank(attributeName) )
	{
		log.warn("missing parameters");
		return null;
	}

	String attributeValue = null;

	try
	{
		UserManager userManager = Platform.getService(UserManager.class);
		Set<String> attrNames = new HashSet<String>();
		attrNames.add(attributeName);
		User user = userManager.getDetails(userID, attrNames, isUserLogin);
		attributeValue = (String) user.getAttribute(attributeName);
	}
	catch (Throwable t)
	{
		log.error(t.getMessage(), t);
	}

	log.debug("attributeValue=" + attributeValue);

	return attributeValue;
}
 
开发者ID:jaffadog,项目名称:oimutils,代码行数:39,代码来源:UserUtils.java

示例3: initializeConfig

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
/**
 * Initializes the class variables needed to process each row
 * @param header    Header row from CSV file
 * @param delimiter Separator for file
 * @param logger    Logger
 * @param usrMgr    OIM User Manager Service
 * @param keyAttrName Key User Attribute in order to identify OIM user
 */
public static void initializeConfig(String[] header, String delimiter, ODLLogger logger, UserManager usrMgr, String keyAttrName)
{
    UserProcessor.header = header;
    UserProcessor.delimiter = delimiter;
    UserProcessor.logger = logger;
    UserProcessor.usrMgr = usrMgr;
    UserProcessor.keyAttrName = keyAttrName;
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:17,代码来源:UserProcessor.java

示例4: main

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
    OIMClient oimClient = null;
    
    try
    {
        // Set system properties required for OIMClient
        System.setProperty("java.security.auth.login.config", AUTHWL_PATH);
        System.setProperty("APPSERVER_TYPE", APPSERVER_TYPE);
        System.setProperty("weblogic.security.SSL.trustedCAKeyStore", TRUST_KEYSTORE_FOR_SSL); // Provide if using SSL

        // Create an instance of OIMClient with OIM environment information 
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, FACTORY_INITIAL_TYPE);
        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIM_PROVIDER_URL);
        
        // Establish an OIM Client
        oimClient = new OIMClient(env);
        
        // Login to OIM with System Administrator Credentials
        oimClient.login(OIM_ADMIN_USERNAME, OIM_ADMIN_PASSWORD.toCharArray());
        
        // Get OIM services
        UserManager usrMgr = oimClient.getService(UserManager.class);
    
        boolean isUserLogin = true;
        
        // Single user lock operation
        String userLogin = "PPARKER";
        UserManagerResult result = usrMgr.lock(userLogin, isUserLogin);
        System.out.println("Entity ID: " + result.getEntityId());
        System.out.println("Failed Results: " + result.getFailedResults());
        System.out.println("Status: " + result.getStatus());
        System.out.println("Succeeded Results: " + result.getSucceededResults());
        System.out.println();
        
        // Bulk user lock operation
        ArrayList<String> userLogins = new ArrayList<String>();
        userLogins.add("FHARDY");
        userLogins.add("HOSBORN");
        UserManagerResult bulkResults = usrMgr.lock(userLogins, isUserLogin);
        System.out.println("Entity ID: " + bulkResults.getEntityId());
        System.out.println("Failed Results: " + bulkResults.getFailedResults());
        System.out.println("Status: " + bulkResults.getStatus());
        System.out.println("Succeeded Results: " + bulkResults.getSucceededResults());
    }
            
    finally
    {
        // Logout of OIM client
        if(oimClient != null)
        {
            oimClient.logout();
        }
    } 
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:57,代码来源:UserLockPreprocessEHTestDriver.java

示例5: ProvisioningUtils

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
/**
 * Constructor
 * @param oimClient OIMClient with administrator logged in
 */
public ProvisioningUtils(OIMClient oimClient)
{
    this.usrMgr = oimClient.getService(UserManager.class);
    this.appInstService = oimClient.getService(ApplicationInstanceService.class);
    this.provService = oimClient.getService(ProvisioningService.class);
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:11,代码来源:ProvisioningUtils.java

示例6: execute

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
@Override
public EventResult execute(long processId, long eventId, Orchestration orchestration)
{
    logger.log(ODLLevel.NOTIFICATION, "Enter execute() with parameters: Process Id = [{0}], Event Id = [{1}], Orchestration = [{2}]", new Object[]{processId, eventId, orchestration});
    
    try
    {
        this.entMgr = Platform.getService(EntityManager.class);  
        this.usrMgr = Platform.getService(UserManager.class);  
        
         // Get the modified UDFs
        HashMap<String, Serializable> modUDFs = orchestration.getParameters();
        logger.log(ODLLevel.NOTIFICATION, "Modified UDFs: [{0}]", new Object[]{modUDFs});

        // Get USR_KEY of current userbeing modified
        String userKey = orchestration.getTarget().getEntityId();
        logger.log(ODLLevel.NOTIFICATION, "Target OIM User Key: [{0}]", new Object[]{userKey});

        // Get Target Type
        String targetType = orchestration.getTarget().getType();
        logger.log(ODLLevel.NOTIFICATION, "Target type: [{0}]", new Object[]{targetType});

        // Get new user state
        HashMap<String, Serializable> interEventData = orchestration.getInterEventData(); // Contains old and new values of user
        logger.log(ODLLevel.TRACE, "InterEventData: {0}", new Object[]{interEventData});
        User newUserState = (User) interEventData.get("NEW_USER_STATE");
        logger.log(ODLLevel.NOTIFICATION, "User: [{0}]", new Object[]{newUserState});
        
        // Perform attribute derivation of Department Number = "{Manager User Login}|{Manager USR Key}|{User Type}"
        executeEvent(newUserState, userKey, targetType);
    } 
    
    catch (Exception e) 
    {
        logger.log(ODLLevel.ERROR, e.getMessage(), e);
        throw new EventFailedException(processId,"","","","", new Exception(e.getMessage()));
    } 

    return new EventResult();
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:41,代码来源:BulkModifyUserEHPostProcess.java

示例7: main

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
    OIMClient oimClient = null;
    
    try
    {
        // Set system properties required for OIMClient
        System.setProperty("java.security.auth.login.config", AUTHWL_PATH);
        System.setProperty("APPSERVER_TYPE", APPSERVER_TYPE);
        System.setProperty("weblogic.security.SSL.trustedCAKeyStore", TRUST_KEYSTORE_FOR_SSL); // Provide if using SSL

        // Create an instance of OIMClient with OIM environment information 
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, FACTORY_INITIAL_TYPE);
        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIM_PROVIDER_URL);
        
        // Establish an OIM Client
        oimClient = new OIMClient(env);
        
        // Login to OIM with System Administrator Credentials
        oimClient.login(OIM_ADMIN_USERNAME, OIM_ADMIN_PASSWORD.toCharArray());
        
        // Get OIM services
        UserManager usrMgr = oimClient.getService(UserManager.class);
        ProvisioningService provService = oimClient.getService(ProvisioningService.class);
        
        String userLogin = "ASKYWALKER";
        String userKey = usrMgr.getDetails(userLogin, null, true).getId();
       
        /*User newUser = new User(userLogin);
        newUser.setAttribute(UserManagerConstants.AttributeName.LASTNAME.getId(), "Rhodes");
        newUser.setAttribute(UserManagerConstants.AttributeName.FIRSTNAME.getId(), "James");
        newUser.setAttribute(UserManagerConstants.AttributeName.USER_LOGIN.getId(), userLogin);;
        newUser.setOrganizationKey("1"); // ACT_KEY; Xellerate Users
        newUser.setUserType("End-User");
        newUser.setEmployeeType("EMP");*/
        
        // Single user lock operation
        //UserManagerResult result = usrMgr.create(newUser);
        UserManagerResult result = usrMgr.lock(userLogin, true);
        System.out.println("Entity ID: " + result.getEntityId());
        System.out.println("Failed Results: " + result.getFailedResults());
        System.out.println("Status: " + result.getStatus());
        System.out.println("Succeeded Results: " + result.getSucceededResults());
        System.out.println();
        
        /*SearchCriteria resourceObjectsCriteria = new SearchCriteria(ProvisioningConstants.AccountSearchAttribute.DISPLAY_NAME.getId(), "OpenLDAP", SearchCriteria.Operator.EQUAL);     
        List<Account> accounts = provService.getAccountsProvisionedToUser(userKey, resourceObjectsCriteria, null, true);
        
         // Iterate User's accounts of a specific resource object
        for(Account resourceAcct: accounts)
        {
           String accountId = resourceAcct.getAccountID(); // OIU_KEY
           String procInstFormKey = resourceAcct.getProcessInstanceKey(); // (ORC_KEY) Process Form Instance Key 
           String appInstName = resourceAcct.getAppInstance().getApplicationInstanceName(); // Application Instance Name
           String resourceObjectName = resourceAcct.getAppInstance().getObjectName(); // Resource Object Name
           LOGGER.log(ODLLevel.INFO, "Account Id: {0}", new Object[]{accountId});
           LOGGER.log(ODLLevel.INFO, "Process Instance Form Key: {0}", new Object[]{procInstFormKey});
           LOGGER.log(ODLLevel.INFO, "Application Instance Name: {0}", new Object[]{appInstName});
           LOGGER.log(ODLLevel.INFO, "Object Name: {0}", new Object[]{resourceObjectName});

        }*/
    }
            
    finally
    {
        // Logout of OIM client
        if(oimClient != null)
        {
            oimClient.logout();
        }
    } 
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:74,代码来源:UserCreatePreprocessEHTestDriver.java

示例8: main

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
    OIMClient oimClient = null;
    
    try
    {
        // Set system properties required for OIMClient
        System.setProperty("java.security.auth.login.config", AUTHWL_PATH);
        System.setProperty("APPSERVER_TYPE", APPSERVER_TYPE);

        // Create an instance of OIMClient with OIM environment information 
        Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, FACTORY_INITIAL_TYPE);
        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, OIM_PROVIDER_URL);
        
        // Establish an OIM Client
        oimClient = new OIMClient(env);
        
        // Login to OIM with System Administrator Credentials
        oimClient.login(OIM_ADMIN_USERNAME, OIM_ADMIN_PASSWORD.toCharArray());
        
        // Get User Manager API Service
        UserManager usrMgr = oimClient.getService(UserManager.class);
        
        // Stage bulk modification data - Note user attribute must be have "Bulk Update" set to true.
        HashMap<String,Object> modAttrs = new HashMap<String,Object>();
        //modAttrs.put(UserManagerConstants.AttributeName.EMPTYPE.getId(), "EMP"); // Set User Type to Employee
        modAttrs.put(UserManagerConstants.AttributeName.EMPTYPE.getId(), "Full-Time");
        //modAttrs.put(UserManagerConstants.AttributeName.USERTYPE.getId(), "End-User Administrator");
        //modAttrs.put(UserManagerConstants.AttributeName.USERTYPE.getId(), "End-User");
        ArrayList<String> userIds = new ArrayList<String>();
        userIds.add("DDUMA");
        userIds.add("BLEVANDOWSKI");
        userIds.add("KCHESTER");

        // Perform bulk modifications across multiple users
        boolean useUserLogin = true;
        usrMgr.modify(userIds, modAttrs, useUserLogin);
       
        // Single user modification
        //User modUser = new User("DDUMA");
        //modUser.setManagerKey("71");
        //modUser.setEmployeeType("Consultant");
        //modUser.setFirstName("Dan");
        //usrMgr.modify("User Login", "DDUMA" , modUser);
        
    }
    
    finally
    {
        if( oimClient != null)
        {
            oimClient.logout();
        } 
    }
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:57,代码来源:BulkModifyUserTestDriver.java

示例9: main

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
public static void main(String[] args)
{
    OracleIdentityManagerClient oimClientWrapper = null;
    
    try 
    {
        // Test OIMClient by logging in with a user and querying all the Identities
        oimClientWrapper = new OracleIdentityManagerClient(OIM_ADMIN_USERNAME, OIM_ADMIN_PASSWORD, AUTHWL_PATH, APPSERVER_TYPE, FACTORY_INITIAL_TYPE, OIM_PROVIDER_URL, false, TRUST_KEYSTORE_FOR_SSL);
        //oimClientWrapper.test();
        OIMClient oimClient = oimClientWrapper.getOIMClient();
        
        // Test platform service utilities
        PlatformServiceUtilities platServUtil = new PlatformServiceUtilities(oimClient);
        // platServUtil.uploadJar(JarElementType.JavaTasks, "/home/oracle/Desktop/OIMUtilities/dist/OIMUtilities.jar");
        //platServUtil.deleteJar(JarElementType.ThirdParty, "OIMUtilities.jar");
        //platServUtil.purgeCache();
        UserManager usrMgr = oimClient.getService(UserManager.class);
        System.out.println(usrMgr.getDetails("DMILES", new HashSet(), true));
        
        System.out.println(UserManagerConstants.AttributeName.PHONE_NUMBER.getId());
        System.out.println(MessageFormat.format("Failed for {0}", new Object[]{UserManagerConstants.AttributeName.TITLE.getId()}));
        // Test Role service utilities
        //RoleUtilities roleUtils = new RoleUtilities(oimClient);
        //System.out.println(roleUtils.getAllRoleCategories());
        //roleUtils.createRoleCategory("Groups", "Maps to LDAP groups.");
        //roleUtils.bulkCreateRoleCategories("sample_csv_files/RoleCategories.csv", ';');
        //System.out.println(roleUtils.getAllRoles(new HashSet(Arrays.asList("Role Name","Role Category Name","Role Category Key"))));
        //System.out.println(roleUtils.getRoleCategoryKeyByName("Security & Compliance"));
        //roleUtils.createRole("engineer", "Groups", "engineer Group");
        //roleUtils.bulkCreateRoles("sample_csv_files/Roles.csv", ';');
        //System.out.println(roleUtils.getAllRoleMembershipOfAUser("49"));
        //System.out.println(roleUtils.getRoleKeyByRoleName("engr"));
        //roleUtils.grantRoleToUser("engr", "49");
        //roleUtils.revokeRoleFromUser("engr", "49");
        
        // Plugin Registation
        String pluginZip = "/home/oracle/GitHub/OIMUtilities/Resources/Plugins/FlatFileUserModificationST/FlatFileUserModificationST.zip";
        PluginRegistration pluginReg = new PluginRegistration(oimClient);
        //pluginReg.unRegisterOIMPlugin("com.blogspot.oraclestack.eventhandlers.UserCreatePreprocessEH", "1.0");
        pluginReg.registerOIMPlugin(pluginZip);
        //pluginReg.unRegisterOIMPlugin("com.blogspot.oraclestack.eventhandlers.TelephoneNumberValidationEH", "1.0");
        //pluginReg.unRegisterOIMPlugin("com.blogspot.oraclestack.eventhandlers.SetMiddleNamePreprocessEH", "1.0");
        
    } 
    
    catch (Exception ex) 
    {
        Logger.getLogger(TestDriver.class.getName()).log(Level.SEVERE, null, ex);
    } 
     
    finally
    {
        oimClientWrapper.logout();
    } 
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:56,代码来源:TestDriver.java

示例10: EntitlementUtilities

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
public EntitlementUtilities(ProvisioningService provServOps, UserManager userMgrOps, EntitlementService entServ)
{
    this.provServOps = provServOps;
    this.userMgrOps = userMgrOps;
    this.entServ = entServ;
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:7,代码来源:EntitlementUtilities.java

示例11: GenerateRequestUtilities

import oracle.iam.identity.usermgmt.api.UserManager; //导入依赖的package包/类
/**
 * Constructor
 * @param oimService OIMService 
 */
public GenerateRequestUtilities(OIMClient oimClient)
{
    this.oimService = oimClient.getService(OIMService.class);
    this.usrMgrOps = oimClient.getService(UserManager.class);
}
 
开发者ID:rayedchan,项目名称:OIMUtilities,代码行数:10,代码来源:GenerateRequestUtilities.java


注:本文中的oracle.iam.identity.usermgmt.api.UserManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。