public class

NotationHelpBookmarkCommand

extends Object
implements ServiceCommand
java.lang.Object
   ↳ com.atlassian.confluence.content.service.NotationHelpBookmarkCommand

Class Overview

Stores a User's current section in notation help.

Summary

Public Constructors
NotationHelpBookmarkCommand(String section)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.core.service.ServiceCommand

Public Constructors

public NotationHelpBookmarkCommand (String section)

Public Methods

public void execute ()

Execute the command. After execution, the command should offer any indication of the results or products of the command as implementation-specific getter methods.

public String getSection ()

public Collection<ValidationError> getValidationErrors ()

Gets the list of errors that are preventing the command from being executed. Calling this method before calling isValid() will always return an empty collection.

Returns
  • a collection of ValidationError objects describing why command validation failed

public boolean isAuthorized ()

Determine if the current user is authorized to execute this command. The "current user" for a command is the user returned by getUser().

Returns
  • true if the current user is authorized to execute this command, false otherwise.

public boolean isValid ()

Determine if the command is in a valid state to be executed. If this method returns true, then 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 isAuthorized(). If the current user is not authorized to execute this command, this method must throw a NotAuthorizedException.

If this method returns false, then 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.

Returns
  • true if the command is in a valid state to be executed, false otherwise