com.ibm.commerce.usermanagement.commands
Class MemberRoleAssignCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.usermanagement.commands.MemberRoleAssignCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, MemberRoleAssignCmd

public class MemberRoleAssignCmdImpl
extends ControllerCommandImpl
implements MemberRoleAssignCmd

The MemberRoleAssign command assigns roles for a member to orgentities.

The member can be a user, organization or organizational unit. Assigning roles to organization or organizational unit means that users who belong to an organization or organizational unit can take on roles assigned to that organization. In this case, the memberId and organEntityId should be same.

The assignment is stored in the MBRROLE table.

Use this command with SSL (Secure Sockets Layer) to ensure that the information are encrypted. To do so type the command with the HTTPS secure protocol.

The parameter URL and memberId are mandatory.

Behavior

Exception Conditions

See Also:
Serialized Form

Field Summary
protected  boolean bCheckURL
          Whether the URL parameter needs to be specified.
protected  boolean bToolsFramework
          Whether this command is called by the tools framework.
static java.lang.String CLASSNAME
          The name of this implementation of the command.
static java.lang.String COPYRIGHT
          IBM Copyright notice field.
protected   OrganizationAccessBean iabOrgEntity
          The organization access bean of the organization having the role assigned to.
protected  UserAccessBean iabUser
          The user access bean of the user having the role assigned to.
protected  boolean ibOrgEntity
          Whether an organization is having the roles assigned or a user.
protected  java.lang.Long inMemberId
          The long representation of the member identifier.
protected  java.lang.String istrMemberId
          The string representation of the member identifier.
protected  java.util.Vector ivecOrgEntityId
          A list of organization entity identifiers.
protected  java.util.Vector ivecRoleId
          A list of role identifiers.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.usermanagement.commands. MemberRoleAssignCmd
NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
MemberRoleAssignCmdImpl()
           
 
Method Summary
 void checkIsAllowed( AccessVector resource, java.lang.String action)
          Check if the access control by calling checkIsAllowed() in the super classes
 boolean getCheckURL()
          Returns whether the URL needs to be specified.
 java.lang.String getMemberId()
          Returns the member identifier of the member having the role assigned to.
 java.util.Vector getOrgEntities()
          Returns a list organization entity identifiers.
  AccessVector getResources()
          Returns the resources that needs to be checked before the command is executed for access control.
 java.util.Vector getRoles()
          Returns a list of role identifiers.
  TypedProperty getViewInputProperties()
          Returns the request properties with the tool framework objects removed.
 void performExecute()
          Assigns the specified member to the specified role.
 void reset()
          Resets the command to its original state so the object can be reused to assign a role to a member.
 void setCheckURL(boolean abCheckURL)
          Sets whether the URL needs to be specified.
 void setMemberId(java.lang.String astrMemberId)
          Sets the member identifier.
 void setRequestProperties( TypedProperty reqProperties)
          Sets the request properties.
 void validateParameters()
          Validates the parameters passed to the command before the role is assigned to the member.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM Copyright notice field.
See Also:
Constant Field Values

CLASSNAME

public static final java.lang.String CLASSNAME
The name of this implementation of the command.
See Also:
Constant Field Values

istrMemberId

protected java.lang.String istrMemberId
The string representation of the member identifier.

inMemberId

protected java.lang.Long inMemberId
The long representation of the member identifier.

ivecRoleId

protected java.util.Vector ivecRoleId
A list of role identifiers.

ivecOrgEntityId

protected java.util.Vector ivecOrgEntityId
A list of organization entity identifiers.

iabUser

protected UserAccessBean iabUser
The user access bean of the user having the role assigned to.

iabOrgEntity

protected OrganizationAccessBean iabOrgEntity
The organization access bean of the organization having the role assigned to.

ibOrgEntity

protected boolean ibOrgEntity
Whether an organization is having the roles assigned or a user.

bCheckURL

protected boolean bCheckURL
Whether the URL parameter needs to be specified.

bToolsFramework

protected boolean bToolsFramework
Whether this command is called by the tools framework.
Constructor Detail

MemberRoleAssignCmdImpl

public MemberRoleAssignCmdImpl()
Method Detail

getCheckURL

public boolean getCheckURL()
Returns whether the URL needs to be specified.
Specified by:
getCheckURL in interface MemberRoleAssignCmd
Returns:
Whether the URL needs to be specified.

getMemberId

public java.lang.String getMemberId()
Returns the member identifier of the member having the role assigned to.
Specified by:
getMemberId in interface MemberRoleAssignCmd
Returns:
The member identifier.

getOrgEntities

public java.util.Vector getOrgEntities()
Returns a list organization entity identifiers.
Specified by:
getOrgEntities in interface MemberRoleAssignCmd
Returns:
A list organization entity identifiers.

getResources

public AccessVector getResources()
                          throws ECException
Returns the resources that needs to be checked before the command is executed for access control.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
If a user is specified, null will be returned. Otherwise an organization is specified that an AccessVector containing the organization will be returned.
ECException

getRoles

public java.util.Vector getRoles()
Returns a list of role identifiers.
Specified by:
getRoles in interface MemberRoleAssignCmd
Returns:
A list of role identifiers.

getViewInputProperties

public TypedProperty getViewInputProperties()
Returns the request properties with the tool framework objects removed.
Specified by:
getViewInputProperties in interface ControllerCommand
Overrides:
getViewInputProperties in class ControllerCommandImpl
Returns:
The request properties without the tool framework objects.

checkIsAllowed

public void checkIsAllowed(AccessVector resource,
                           java.lang.String action)
                    throws ECException
Check if the access control by calling checkIsAllowed() in the super classes
Parameters:
resource - The resource.
action - The action.
Throws:
Throws - ECSystemException.
ECException

performExecute

public void performExecute()
                    throws ECException
Assigns the specified member to the specified role. Then calls the PostMemberRoleAssign command to execute some customized function after the member roles have been assigned.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - If there was a problem assigning the member to the role or executing the PostMemberRoleAssign command.

reset

public void reset()
Resets the command to its original state so the object can be reused to assign a role to a member.
Specified by:
reset in interface MemberRoleAssignCmd
Overrides:
reset in class AbstractECTargetableCommand

setCheckURL

public void setCheckURL(boolean abCheckURL)
Sets whether the URL needs to be specified.
Specified by:
setCheckURL in interface MemberRoleAssignCmd
Parameters:
abCheckURL - whether the URL needs to be specified.

setMemberId

public void setMemberId(java.lang.String astrMemberId)
Sets the member identifier.
Specified by:
setMemberId in interface MemberRoleAssignCmd
Parameters:
astrMemberId - the member identifier.

setRequestProperties

public void setRequestProperties(TypedProperty reqProperties)
                          throws ECException
Sets the request properties. This is done by calling ProcesRequestProperties command. Then the PreMemberRoleAssign is called for any preposing that may be needed before the role is assigned to the member.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
reqProperties - the parameters passed to the command.
Throws:
ECException - If there was any invalid parameter specified or a problem indicated by the PreMemberRoeAssign command.

validateParameters

public void validateParameters()
                        throws ECException
Validates the parameters passed to the command before the role is assigned to the member. Validation consists of ensure that the member specified exists and determining whether it is an organization or a user. The it will verify the roles specified and find their corresponding organization.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException - If either the role or the member does exist, an ECApplicationException will be thrown.