ccc.commands
Class UpdateCurrentUserCommand

java.lang.Object
  extended by ccc.commands.Command<java.lang.Void>
      extended by ccc.commands.UpdateCurrentUserCommand

public class UpdateCurrentUserCommand
extends Command<java.lang.Void>

Command: update a user's own email and password.

Author:
Civic Computing Ltd.

Constructor Summary
UpdateCurrentUserCommand(IRepositoryFactory repoFactory, java.util.UUID userId, User delta)
          Constructor.
 
Method Summary
protected  void authorize(UserEntity actor)
          Confirm that the actor may execute this command.
 java.lang.Void doExecute(UserEntity actor, java.util.Date happenedOn)
          Execute the command.
protected  CommandType getType()
          Get the type of this command.
protected  void validate()
          Validate the command's inputs.
 
Methods inherited from class ccc.commands.Command
afterExecute, beforeExecute, execute, getAudit, getComments, getData, getGroups, getRepository, getUsers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateCurrentUserCommand

public UpdateCurrentUserCommand(IRepositoryFactory repoFactory,
                                java.util.UUID userId,
                                User delta)
Constructor.

Parameters:
repoFactory - The repository factory for this command.
userId - The user's id.
delta - The changes to apply.
Method Detail

doExecute

public java.lang.Void doExecute(UserEntity actor,
                                java.util.Date happenedOn)
Execute the command.

Specified by:
doExecute in class Command<java.lang.Void>
Parameters:
actor - The user who performed the command.
happenedOn - When the command was performed.
Returns:
The result of the command, of type T.

validate

protected void validate()
Validate the command's inputs.

Overrides:
validate in class Command<java.lang.Void>

authorize

protected void authorize(UserEntity actor)
Confirm that the actor may execute this command.

The default implementation allows any actor to execute the command.

Overrides:
authorize in class Command<java.lang.Void>
Parameters:
actor - The actor performing the command.

getType

protected CommandType getType()
Get the type of this command.

Specified by:
getType in class Command<java.lang.Void>
Returns:
The type as an enum.


Copyright © 2010. All Rights Reserved.