Now lets look at the other important functionalities provided by the UserManager class.
1) Code
2) Result
User is locked/unlocked/disabled/enabled as expected
3) JavaDoc
You can find more information about the UserManager class and its methods in the javadoc link.
1) Code
public void misc(OIMClient oimclient){UserManager usrMgr = oimclient.getService(UserManager.class);try {usrMgr.lock("65", true, true);usrMgr.unlock("65", false);usrMgr.disable("65", false);usrMgr.enable("65", false);} catch (ValidationFailedException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (UserLockException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (NoSuchUserException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (AccessDeniedException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (UserUnlockException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (UserDisableException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (UserEnableException e) {// TODO Auto-generated catch blocke.printStackTrace();}}
2) Result
User is locked/unlocked/disabled/enabled as expected
3) JavaDoc
You can find more information about the UserManager class and its methods in the javadoc link.
what is value 65 mean here. any quick help. I believe it is user key. please confirm
ReplyDeleteYes you are right. 65 is the user key.
DeleteAlternately you can use the user login and provide the value 'true' for the flag.