@@ -747,7 +747,7 @@ private boolean doSetUserStatus(long userId, State state) {
747747 public boolean enableAccount (long accountId ) {
748748 boolean success = false ;
749749 AccountVO acctForUpdate = _accountDao .createForUpdate ();
750- acctForUpdate .setState (State .Enabled );
750+ acctForUpdate .setState (State .enabled );
751751 success = _accountDao .update (Long .valueOf (accountId ), acctForUpdate );
752752 return success ;
753753 }
@@ -756,11 +756,11 @@ private boolean lockAccountInternal(long accountId) {
756756 boolean success = false ;
757757 Account account = _accountDao .findById (accountId );
758758 if (account != null ) {
759- if (account .getState ().equals (State .Locked )) {
759+ if (account .getState ().equals (State .locked )) {
760760 return true ; // already locked, no-op
761- } else if (account .getState ().equals (State .Enabled )) {
761+ } else if (account .getState ().equals (State .enabled )) {
762762 AccountVO acctForUpdate = _accountDao .createForUpdate ();
763- acctForUpdate .setState (State .Locked );
763+ acctForUpdate .setState (State .locked );
764764 success = _accountDao .update (Long .valueOf (accountId ), acctForUpdate );
765765 } else {
766766 if (s_logger .isInfoEnabled ()) {
@@ -956,11 +956,11 @@ public boolean disableAccount(long accountId) {
956956 }
957957
958958 AccountVO account = _accountDao .findById (accountId );
959- if ((account == null ) || account .getState ().equals (State .Disabled )) {
959+ if ((account == null ) || account .getState ().equals (State .disabled )) {
960960 success = true ;
961961 } else {
962962 AccountVO acctForUpdate = _accountDao .createForUpdate ();
963- acctForUpdate .setState (State .Disabled );
963+ acctForUpdate .setState (State .disabled );
964964 success = _accountDao .update (Long .valueOf (accountId ), acctForUpdate );
965965
966966 success = (success && doDisableAccount (accountId ));
@@ -1044,7 +1044,7 @@ public UserAccount createAccount(CreateAccountCmd cmd) {
10441044 newAccount .setAccountName (accountName );
10451045 newAccount .setDomainId (domainId );
10461046 newAccount .setType (userType );
1047- newAccount .setState (State .Enabled );
1047+ newAccount .setState (State .enabled );
10481048 newAccount .setNetworkDomain (networkDomain );
10491049 newAccount = _accountDao .persist (newAccount );
10501050 accountId = newAccount .getId ();
@@ -1057,7 +1057,7 @@ public UserAccount createAccount(CreateAccountCmd cmd) {
10571057 UserVO user = new UserVO ();
10581058 user .setUsername (username );
10591059 user .setPassword (password );
1060- user .setState (State .Enabled );
1060+ user .setState (State .enabled );
10611061 user .setFirstname (firstName );
10621062 user .setLastname (lastName );
10631063 user .setAccountId (accountId .longValue ());
@@ -1118,7 +1118,7 @@ public UserVO createUser(CreateUserCmd cmd){
11181118 UserVO user = new UserVO ();
11191119 user .setUsername (userName );
11201120 user .setPassword (password );
1121- user .setState (State .Enabled );
1121+ user .setState (State .enabled );
11221122 user .setFirstname (firstName );
11231123 user .setLastname (lastName );
11241124 user .setAccountId (accountId .longValue ());
@@ -1249,7 +1249,7 @@ public UserAccount disableUser(DisableUserCmd cmd) throws InvalidParameterValueE
12491249 throw new PermissionDeniedException ("Failed to disable user " + userId + ", permission denied." );
12501250 }
12511251
1252- boolean success = doSetUserStatus (userId , State .Disabled );
1252+ boolean success = doSetUserStatus (userId , State .disabled );
12531253 if (success ) {
12541254 //user successfully disabled
12551255 return _userAccountDao .findById (userId );
@@ -1280,7 +1280,7 @@ public UserAccount enableUser(EnableUserCmd cmd) throws InvalidParameterValueExc
12801280 throw new PermissionDeniedException ("Failed to enable user " + userId + ", permission denied." );
12811281 }
12821282
1283- success = doSetUserStatus (userId , State .Enabled );
1283+ success = doSetUserStatus (userId , State .enabled );
12841284
12851285 // make sure the account is enabled too
12861286 success = (success && enableAccount (user .getAccountId ()));
@@ -1319,16 +1319,16 @@ public UserAccount lockUser(LockUserCmd cmd) {
13191319
13201320 // make sure the account is enabled too
13211321 // if the user is either locked already or disabled already, don't change state...only lock currently enabled users
1322- if (user .getState ().equals (State .Locked )) {
1322+ if (user .getState ().equals (State .locked )) {
13231323 // already locked...no-op
13241324 return _userAccountDao .findById (id );
1325- } else if (user .getState ().equals (State .Enabled )) {
1326- success = doSetUserStatus (user .getId (), State .Locked );
1325+ } else if (user .getState ().equals (State .enabled )) {
1326+ success = doSetUserStatus (user .getId (), State .locked );
13271327
13281328 boolean lockAccount = true ;
13291329 List <UserVO > allUsersByAccount = _userDao .listByAccount (user .getAccountId ());
13301330 for (UserVO oneUser : allUsersByAccount ) {
1331- if (oneUser .getState ().equals (State .Enabled )) {
1331+ if (oneUser .getState ().equals (State .enabled )) {
13321332 lockAccount = false ;
13331333 break ;
13341334 }
0 commit comments