ibi.broker.api.data.user
Class User

java.lang.Object
  extended by ibi.broker.api.data.user.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

Allows the creation and manipulation of ReportCaster Users for the purpose of authentication and authorization. The User class is used in conjunction with other ReportCaster User Administration classes including UserManager. In the case of installations with Managed Reporting, the default implementation of the UserManager interface will have to be changed for this class to be used. The code below illustrates the usage of the User class. It is taken from the samples packaged with the product.


 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +  Copyright (c) 2004 Information Builders, Inc. All  Rights Reserved.     +
 +                                                                          +
 +  Information Builders offers sample API programs as a heuristic device.  +
 +  They are not intended, as is, for production use. Licensed users are    +
 +  welcome to alter and extend these samples and deploy them in other      +
 +  environments, or alternate configurations, as they see fit.             +
 +  Information Builders will support the documented functionality of       +
 +  its API classes and methods. However, Information Builders is not       +
 +  responsible for functionality or behavior of products built with        +
 +  its API unless the documented behavior of its discrete classes and      +
 +  methods is different than the actual results.                           +
 +                                                                          +
 +  Redistributions of IBI source code and documentation must be within     +
 +  the scope of the Information Builders Software License Agreement.       +
 +                                                                          +
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   

 public class U35_Update_UserProp 
{
        public U35_Update_UserProp(String[] arg) throws Exception
        {
                //   Example of arg
                //   name passw desc xxx@ibi.com
                
                String name = arg[0];
                String password = arg[1];
                String description = arg[2];
                String address = arg[3];
                
                // Create userManager
                CasterConnection casterConnection = Util.createCasterConnection();
                UserManager manager = casterConnection.getUserManager();
                
                // Retrive user from repository
                User user = manager.getUserByName(name);
                
                //update properties
                user.setAddress(address);
                user.setDescription(description);
                user.setPassword(password);

                // update user          
                manager.updateUser(user);
        }
        
        public static void main(String[] arg)
        {
                U35_Update_UserProp sampl = null;
                if(arg.length < 4) {
                         menu();
                         return;
                }
                try
                {
                        System.out.println("\n******* " + U35_Update_UserProp.class.getName() + " *****************");
                        sampl = new U35_Update_UserProp(arg);
                        System.out.println("\n" + sampl.getClass().getName() + " OK");
                }
                catch(Exception ce)
                {
                        ce.printStackTrace();
                        System.out.println(sampl.getClass().getName() + " FAIL");

                }
                
        }
        private static void menu()
        {
                System.out.println("Usage: java " + U35_Update_UserProp.class.getName() + " <name> <password> <description> <address> ");
        }
}

See Also:
Serialized Form

Field Summary
static java.lang.String ROLE_CASTER_ADMIN
          This is one of the valid values of the property role.
static java.lang.String ROLE_USER
          This is one of the valid values of the property role.
 
Constructor Summary
User()
           
User(java.lang.String name)
           
 
Method Summary
 java.lang.String getAddress()
          Returns the user's e-mail address.
 java.lang.String getDescription()
          Returns the description of the user.
 java.lang.String getMrRole()
           
 java.lang.String getName()
          Returns the users login name, also known as the casterUser or ReportCaster ID.
 java.lang.String getPassword()
          Returns the password associated with user name.
 java.lang.String getRole()
          Returns a String constant indicating the user's ReportCaster role.
 java.lang.String[] getUserListForGroupAdmin()
           
 boolean isActive()
          Returns the user's status as inactive or active.
 boolean isLibraryCapability()
          Returns the user's capability to use the library.
 boolean isScheduleCapability()
          Returns the user's capability to Schedule report distributions.
 void setActive(boolean active)
          Sets the user's status as inactive or active.
 void setAddress(java.lang.String address)
          Sets the user's e-mail address.
 void setDescription(java.lang.String description)
          Sets the description of the user.
 void setLibraryCapability(boolean isLibraryCapability)
          Sets the user's capability to use the library.
 void setMrRole(java.lang.String mrRole)
           
 void setName(java.lang.String name)
          Sets the user's login name, also known as the casterUser or ReportCaster ID.
 void setPassword(java.lang.String password)
          Sets the password associated with user name.
 void setRole(java.lang.String role)
          Accepts a String constant representing the user's ReportCaster role.
 void setScheduleCapability(boolean isScheduleCapability)
          Sets the user's capability to Schedule report distributions.
 void setUserListForGroupAdmin(java.lang.String[] userListForGroupAdmin)
           
 void validate(java.lang.String parentName)
          Assists in validating arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_CASTER_ADMIN

public static final java.lang.String ROLE_CASTER_ADMIN
This is one of the valid values of the property role.

See Also:
setRole(String role), Constant Field Values

ROLE_USER

public static final java.lang.String ROLE_USER
This is one of the valid values of the property role.

See Also:
setRole(String role), Constant Field Values
Constructor Detail

User

public User()

User

public User(java.lang.String name)
Method Detail

setName

public void setName(java.lang.String name)
Sets the user's login name, also known as the casterUser or ReportCaster ID. The String accepts a maximum value of 48 characters.

Parameters:
name - Accepts a String indicating the user's log in name.

getName

public java.lang.String getName()
Returns the users login name, also known as the casterUser or ReportCaster ID. The String returns a maximum value of 48 characters.

Returns:
Returns a String indicating the user's log in name.

setPassword

public void setPassword(java.lang.String password)
Sets the password associated with user name. The String accepts a maximum value of 240 characters.

Parameters:
password - A String indicating the user's password.

getPassword

public java.lang.String getPassword()
Returns the password associated with user name. The String returns a maximum value of 240 characters.

Returns:
A String indicating the user's password.

setRole

public void setRole(java.lang.String role)
Accepts a String constant representing the user's ReportCaster role. Valid values are ROLE_CASTER_ADMIN and ROLE_USER.

Parameters:
role - A String constant indicating the user's role.

getRole

public java.lang.String getRole()
Returns a String constant indicating the user's ReportCaster role. Valid values are ROLE_CASTER_ADMIN and ROLE_USER.

Returns:
A String constant indicating the user's role.

setDescription

public void setDescription(java.lang.String description)
Sets the description of the user. Accepts a String with a maximum of 90 characters.

Parameters:
description - A String that describes the user.

getDescription

public java.lang.String getDescription()
Returns the description of the user. Returns a String with a maximum of 90 characters.

Returns:
A String that describes the user.

setAddress

public void setAddress(java.lang.String address)
Sets the user's e-mail address. This is particularly important for Library users. The maximum length of the accepted String is 90 characters.

Parameters:
address - A String indicating the user's e-mail address.

getAddress

public java.lang.String getAddress()
Returns the user's e-mail address. This is particularly important for Library users. The maximum length of the returned String is 90 characters.

Returns:
A String indicating the user's e-mail address.

setActive

public void setActive(boolean active)
Sets the user's status as inactive or active. True indicates an active user.

Parameters:
active - A boolean indicating whether the user is active or not.

isActive

public boolean isActive()
Returns the user's status as inactive or active. True indicates an active user.

Returns:
A boolean indicating whether the user is active or not.

setLibraryCapability

public void setLibraryCapability(boolean isLibraryCapability)
Sets the user's capability to use the library. True indicates the user can use the Library.

Parameters:
isLibraryCapability - Accepts a boolean indicating whether or not the user can access the library.

isLibraryCapability

public boolean isLibraryCapability()
Returns the user's capability to use the library. True indicates the user can use the Library.

Returns:
Returns a boolean indicating whether or not the user can access the library.

setScheduleCapability

public void setScheduleCapability(boolean isScheduleCapability)
Sets the user's capability to Schedule report distributions. True indicates the user can schedule jobs.

Parameters:
isScheduleCapability - Accepts a boolean indicating whether or not the user can schedule report distributions.

isScheduleCapability

public boolean isScheduleCapability()
Returns the user's capability to Schedule report distributions. True indicates the user can schedule jobs.

Returns:
Returns a boolean indicating whether or not the user can schedule report distributions.

getMrRole

public java.lang.String getMrRole()

setMrRole

public void setMrRole(java.lang.String mrRole)

getUserListForGroupAdmin

public java.lang.String[] getUserListForGroupAdmin()

setUserListForGroupAdmin

public void setUserListForGroupAdmin(java.lang.String[] userListForGroupAdmin)

validate

public void validate(java.lang.String parentName)
              throws CasterException
Assists in validating arguments

Parameters:
parentName - represented parent of this object.
Throws:
CasterException


Copyright © 2006 Information Builders, Incorporated.