com.ragic.s3.service.workflow
Class ScriptUser

java.lang.Object
  extended by com.ragic.s3.service.workflow.ScriptUser

public class ScriptUser
extends java.lang.Object

ScriptUser is a class employed in Ragic Workflow, which allows the program to access and manipulate user data.

User: liberation
Date: 2010/12/1
Time: 10:38:37 pm


Constructor Summary
ScriptUser(com.ragic.s3.nui.User user, java.lang.String apname, com.ragic.s3.nui.RagicBundle bundle)
          Class constructor specifying user ID, AP name and a RagicBundle class.
 
Method Summary
 int createUser(java.lang.String email, java.lang.String fullName, java.lang.String password)
          Create a new account and returns a number to specify the condition it meets.
 java.lang.String getEmail()
          Returns e-mail of this user, which is also his/her account ID as well.
 java.util.List<java.lang.String> getGroups()
          Returns a list of group names in this AP that this user belongs to.
 java.lang.String getUserName()
          Returns this user's name in this AP.
 boolean isChangePassword()
          Returns if necessary to inform this user to change password when he/she logs in next time or not.
 boolean isIdentifiable()
          Returns whether Ragic can recognize this user or not.
 boolean isPassivelyAddedUser()
          Returns whether this user is passively joined by AP manager or not.
 boolean isValid()
          Returns whether this account is in the valid period or not.
 boolean registerUserToMainAccountDatabase(java.lang.String email)
          For internal use only.
 void setUserGroup(java.lang.String email, java.util.List<java.lang.String> groups)
          Adds a specific user into one or more than one groups at the same time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptUser

public ScriptUser(com.ragic.s3.nui.User user,
                  java.lang.String apname,
                  com.ragic.s3.nui.RagicBundle bundle)
Class constructor specifying user ID, AP name and a RagicBundle class.

Parameters:
user - value to be registered to the class variable user.
apname - value to be registered to the class variable apname.
bundle - value to be registered to the class variable bundle.
Method Detail

getEmail

public java.lang.String getEmail()
Returns e-mail of this user, which is also his/her account ID as well.

Returns:
this user's e-mail address

getUserName

public java.lang.String getUserName()
Returns this user's name in this AP.

Returns:
this user's name

isValid

public boolean isValid()
Returns whether this account is in the valid period or not.

Returns:
true if this account is valid. false otherwise.

isIdentifiable

public boolean isIdentifiable()
Returns whether Ragic can recognize this user or not. Oftentimes most users can be identified except for guests.

Returns:
true if this user can be recognized by Ragic. false otherwise.

isPassivelyAddedUser

public boolean isPassivelyAddedUser()
Returns whether this user is passively joined by AP manager or not. Basically most users except for the very first one is passively added.

Returns:
true if this user is passively added. false otherwise.

getGroups

public java.util.List<java.lang.String> getGroups()
Returns a list of group names in this AP that this user belongs to.

Returns:
a list of group this user joined.

isChangePassword

public boolean isChangePassword()
Returns if necessary to inform this user to change password when he/she logs in next time or not.

Returns:
true if required to inform this to change password. false otherwise.

createUser

public int createUser(java.lang.String email,
                      java.lang.String fullName,
                      java.lang.String password)
Create a new account and returns a number to specify the condition it meets. This method returns positive numbers when account has been successfully created, otherwise returns negative value. This number is usually employed for debugging, it therefore can be discarded.

Parameters:
email - e-mail address and login ID of this new user.
fullName - fullName this user would like to be called in Ragic.
password - password for login.
Returns:
-1 if this e-mail is not valid. -2 if this e-mail duplicates in this AP. 1 if successfully created and this is a new e-amil. 2 if successfully created and this e-mail has been used but deleted before.

registerUserToMainAccountDatabase

public boolean registerUserToMainAccountDatabase(java.lang.String email)
For internal use only.


setUserGroup

public void setUserGroup(java.lang.String email,
                         java.util.List<java.lang.String> groups)
Adds a specific user into one or more than one groups at the same time.

Parameters:
email - the ID of the user
groups - the list of groups that this user is going to be added to.


Copyright © 2009,2010,2011,2012 Ragic Corp. All Rights Reserved.