com.atlassian.confluence.content.service
Class NotationHelpBookmarkCommand

java.lang.Object
  extended by com.atlassian.confluence.content.service.NotationHelpBookmarkCommand
All Implemented Interfaces:
ServiceCommand

public class NotationHelpBookmarkCommand
extends Object
implements ServiceCommand

Stores a User's current section in notation help.


Constructor Summary
NotationHelpBookmarkCommand(String section)
           
 
Method Summary
 void execute()
          Execute the command.
 String getSection()
           
 Collection<ValidationError> getValidationErrors()
          Gets the list of errors that are preventing the command from being executed.
 boolean isAuthorized()
          Determine if the current user is authorized to execute this command.
 boolean isValid()
          Determine if the command is in a valid state to be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotationHelpBookmarkCommand

public NotationHelpBookmarkCommand(String section)
Method Detail

isValid

public boolean isValid()
Description copied from interface: ServiceCommand
Determine if the command is in a valid state to be executed. If this method returns true, then ServiceCommand.execute() is be expected to perform successfully (unless prevented by some system error). If this method returns false, execute will fail with a NotValidException.

This method should be called after checking ServiceCommand.isAuthorized(). If the current user is not authorized to execute this command, this method must throw a NotAuthorizedException.

If this method returns false, then ServiceCommand.getValidationErrors() must return a non-empty list of errors explaining why the command was not valid. If this method returns true, the collection returned by getValidationErrors() must be empty.

Specified by:
isValid in interface ServiceCommand
Returns:
true if the command is in a valid state to be executed, false otherwise

getValidationErrors

public Collection<ValidationError> getValidationErrors()
Description copied from interface: ServiceCommand
Gets the list of errors that are preventing the command from being executed. Calling this method before calling ServiceCommand.isValid() will always return an empty collection.

Specified by:
getValidationErrors in interface ServiceCommand
Returns:
a collection of ValidationError objects describing why command validation failed

isAuthorized

public boolean isAuthorized()
Description copied from interface: ServiceCommand
Determine if the current user is authorized to execute this command. The "current user" for a command is the user returned by AuthenticatedUserThreadLocal.getUser().

Specified by:
isAuthorized in interface ServiceCommand
Returns:
true if the current user is authorized to execute this command, false otherwise.

execute

public void execute()
Description copied from interface: ServiceCommand
Execute the command. After execution, the command should offer any indication of the results or products of the command as implementation-specific getter methods.

Specified by:
execute in interface ServiceCommand

getSection

public String getSection()


Copyright © 2003-2011 Atlassian. All Rights Reserved.