com.atlassian.confluence.test.rpc
Class FuncTestRpcDelegator

java.lang.Object
  extended by com.atlassian.confluence.test.rpc.FuncTestRpcDelegator
All Implemented Interfaces:
FuncTestRpcHandler

public class FuncTestRpcDelegator
extends Object
implements FuncTestRpcHandler


Constructor Summary
FuncTestRpcDelegator()
           
 
Method Summary
 boolean addExistingProfilePicture(String token, String userName, String fileName)
          Attempts to add a existing profile picture to a user's profile.
 boolean addGroupAnyCase(String token, String groupname)
          Allows addition of a group without enforcing that the name be all lower case.
 boolean addMailServer(String token, String name, String from, String subjectPrefix, String hostname, int port)
           
 boolean addMailServer(String token, String name, String from, String subjectPrefix, String hostname, int port, String fromName)
           
 boolean addUserAnyCase(String token, String username, String email, String fullname, String password)
          Allows addition of a user without enforcing that the username be all lower case.
 boolean buildDidYouMeanIndex(String token)
          Start a task to build the DidYouMean Index.
 boolean changeAttachmentCreatedDate(String token, String contentId, String attachmentFileName, Date createdDate)
          Change the created date of an attachment
 boolean changeBlogPostModificationDate(String token, String blogId, Date modificationDate)
          Change the modification date of a blog post
 boolean changeCommentCreatedDate(String token, String commentId, Date createdDate)
          Change the created date of a comment
 String changeLoggerLevel(String token, String loggerName, String level)
           Change the level of the specified logger.
 boolean changePageCreatedDate(String token, String pageId, Date createdDate)
          Change the created date of a page
 boolean changePageModificationDate(String token, String pageId, Date modificationDate)
          Change the modification date of a page
 boolean changeSpaceCreatedDate(String token, String spaceKey, Date createdDate)
          Change the created date of a space
 boolean clearCustomHtml(String token)
          Clears the global custom html.
 boolean clearEventListeners(String token)
          Removes all temporary event listeners, regardless of their state.
 boolean clearIndex(String token)
          Blows away the main Confluence search index.
 boolean clearQueue(String token, String queueName)
          Removes all items from the specified queue
 Boolean clearSystemProperty(String token, String name)
          Unset a system property.
 String convertMarkupToXhtml(String token, String wikiMarkup, String pageId)
          Render a page as XHTML.
 String convertXhtmlToMarkup(String token, String xhtml, String pageId)
          Convert XHTML to WikiMarkup.
 Hashtable createDraft(String token, Hashtable draft)
          Creates a draft for the draft owner and draft type with the specified title and content.
 boolean createJohnsonEvent(String token, String message)
          Creates a Johnson event inside Confluence.
 int createTestUsers(String token, int count)
          Create test users with usernames "testuser0", "testuser1", etc.
 boolean createUserMacro(String token, String name, boolean hasBody, String bodyType, String outputType, String template, String title, String description, String category, String iconUrl, String documentationUrl, boolean hidden)
          Create a User Macro
 boolean disablePlugin(String token, String pluginKey)
          Disable a plugin.
 boolean disablePluginModule(String token, String pluginKey, String moduleKey)
          Disable plugin module
 boolean disconnectGroup(String token, String groupname)
          Disconnect a group from Confluence.
 boolean disconnectUser(String token, String username)
          Disconnect a user from Confluence.
 boolean doesDraftExist(String token, String contentId, String owner, String draftType, String spaceKey)
          Determines if a draft of the specified type and belonging to the specified owner exists.
 boolean enableCaptcha(String token, boolean enable)
          Sets the captcha mode
 boolean enableCaptchaDebugMode(String token, boolean enable)
          Sets the captcha mode into debug mode.
 boolean enablePlugin(String token, String pluginKey)
          Enable a plugin.
 boolean enablePluginModule(String token, String pluginKey, String moduleKey)
          Enable plugin module
 boolean enableWebSudo(String token, boolean enabled)
          Sets the web sudo enabled status
 boolean flushAllCaches(String token)
          Flushes all the caches.
 boolean followUser(String token, String userName, boolean followUser)
          Follows or stops following a user.
 Object getApplicationConfigProperty(String token, String propertyKey)
          Returns a property of the global ApplicationConfiguration instance.
 Hashtable getCacheStatistics(String token, String cacheName)
          Returns the cache statistics for a particular named cache.
 String getConfiguredThemeForSpace(String token, String spaceKey)
          Get the key of the configured theme for a space, whether or not that theme exists.
 Vector getContentPropertyKeys(String token, String entityId)
          Get the content property keys for a content entity given its id
 String getGlobalConfiguredTheme(String token)
          Get the key of the configured global theme, whether or not that theme exists.
 String getIdOfPagePermission(String token, String contentId, String permissionType, String username)
           
 boolean getIgnoreBaseURLWarning(String token)
          Whether the warning message for an un-advisable value for the Base URL is ignored or not.
 String getLeastRecentTestAppenderLogMessage(String token, String className)
           
 String getLocaleForUser(String token, String username)
          Gets the locale preference for the user.
 String getLocalisedText(String token, String messageKey)
          Get the localised string for given the message key in the logged-in user's locale.
 int getNumberOfIndexTasksInQueue(String token)
          Returns the size of the index queue.
 String getPersonalInformationId(String token, String username)
          Gets the personal information id for a given username
 int getQueueSize(String token, String queueName)
          Returns the size of the task queue with the specified name.
 Vector getUsersForActivity(String key)
          Call getUsersForActivity on the heartbeatManager bean
 int getVersionForPage(String token, String pageId)
          Get the version number for the page with pageId
 boolean isCurrentApplicationSet(String token)
          Check whether or not the trustedApplicationManager has its currentApplication set.
 boolean isSpringComponentPresent(String token, String name)
          Returns true if a Spring component with the given name exists in the application context.
 boolean logMessage(String token, String destination, String message)
          Log a message to the server's console.
 boolean logTestMessageForClass(String token, String className, String message, String level)
           
 boolean massCreateAttachments(String token, String pageId, String prefix, String numAttachments)
          Create a whole series of attachments on a single page.
 boolean nukeSpacesAndFlushEverything(String token)
          Kill all the spaces and flush all the queues and caches.
 boolean nukeUserAndGroupDependentObjects(String token)
          Remove the dependencies of all users and groups, except the default dependencies of the default groups and the current user.
 boolean pauseJob(String token, String jobName)
          Pauses a named job in the quartz scheduler
 boolean putStringMappingInCache(String token, String cacheName, String key, String value)
          Map a key to a value for a given cache.
 boolean registerEventListener(String token, String eventClassName)
          Registers a temporary event listener on the server to listen for the specified event.
 boolean registerTestAppenderForClass(String token, String className)
           
 boolean removeAllGroupsExceptDefaults(String token)
          Remove all groups aside from the default Confluence groups
 boolean removeAllJohnsonEvents(String token)
          Removes all Johnson events from Confluence
 boolean removeAllOtherUsers(String token)
          Remove all users except the current user.
 boolean removeAllTrustedApplications(String token)
          Removes all trusted applications from the database.
 boolean removeBandanaKey(String token, String space, String key)
          Remove a key from Bandana
 boolean removeDrafts(String token, String username)
          Removes all drafts owned by the specified User.
 boolean removeGroupUncleanly(String token, String groupname)
          Remove a Group without removing the things that refer to that group.
 boolean removeMailServer(String token, String serverName)
          Remove the named mail server.
 boolean removePersonalInformation(String token, String username)
          PersonalInformation gets created automatically by the standard create user methods.
 int removeTestUsers(String token, int count)
          Removes test users with usernames "testuser0", "testuser1", etc.
 boolean removeUserMacro(String token, String name)
          Remove a User Macro with the given name if it exists.
 boolean removeUserUncleanly(String token, String username)
          Remove a User without removing the things that refer to that user.
 boolean resetGlobalPermissions(String token)
          Reset global permissions to the system initial state.
 boolean resetTheme(String token)
          Reset the global theme to the default theme.
 boolean restoreAbstractPage(String token, String abstractPageId)
          Restores an abstract page from the trash.
 boolean resumeJob(String token, String jobName)
          Resumes a named job in the quartz scheduler
 boolean saveDateFormat(String token, String dateFormat)
           
 boolean saveDateTimeFormat(String token, String dateTimeFormat)
           
 boolean setApplicationConfigProperty(String token, String propertyKey, String propertyValue)
          Sets a property on the global ApplicationConfiguration instance.
 boolean setBooleanUserPreference(String token, String userName, String preferenceKey, String value)
          Sets a boolean user preference.
 boolean setContentTextProperty(String token, String entityId, String key, String value)
          Sets a text content property for a content entity given its id
 boolean setDirectoryPasswordEncoder(String token, String directoryName, String encoder)
          Changes the password encoder for the given directory
 boolean setDraftSaveInterval(String token, int seconds)
          Sets the given draft save interval.
 boolean setEnableJavascriptTop(String token, boolean set)
          Set the config for serving javascripts in the header.
 void setFuncTestRpcImpl(FuncTestRpcHandler funcTestRpcImpl)
           
 boolean setGlobalTheme(String token, String themeKey)
          Sets the global theme
 boolean setIgnoreBaseURLWarning(String token, boolean value)
          Affects whether the warning message for an un-advisable value for the Base URL is ignored or not.
 boolean setKeyboardShortcutPref(String token, String username, String enabled)
          Enables/Disables keyboard shortcuts for the given uesr
 boolean setLocaleForUser(String token, String username, String locale)
          Sets the locale preference for the user to the given named locale.
 boolean setSharedMode(String token, boolean set)
           
 boolean setStringUserPreference(String token, String userName, String preferenceKey, String value)
          Sets a string user preference.
 Boolean setSystemProperty(String token, String name, String value)
          Set a system property on the server to the supplied value.
 boolean setThemeForSpace(String token, String spaceKey, String themeKey)
          Sets the theme for the specified space
 boolean setUserDetails(String token, String username, String fullName, String email)
          Sets the fullname and email address of a user with a given username.
 boolean setUserStatus(String token, String wikiStatus)
          Set the current user's status.
 boolean setWatchOwnContentPref(String token, String username, String enabled)
          Enables/Disables autowatching for the given uesr
 boolean setWatchSpace(String token, String username, String spaceKey, String contentType, String enabled)
          Enables/Disables watching a space for the given user and content type.
 boolean setWebSudoTimeout(String token, int timeout)
          Sets the web sudo timeout in minutes
 boolean shutdownQuartz(String token)
          Shutdown the quartz scheduler to ensure single threadedness for testing
 boolean startActivity(String key, String user)
          Call startActivity on the heartbeatManager bean
 Hashtable storeXhtmlPage(String token, Hashtable pageStruct)
          The Confluence remote API store page performs wiki to XHTML conversion on the page content.
 boolean synchroniseUserDirectories(String token)
          Synchronizes all remote user directories with the local database cache
 boolean triggerJob(String token, String jobName)
          Triggers a named job in the quartz scheduler synchronously.
 boolean uninstallPlugin(String token, String pluginKey)
          Uninstall a plugin.
 boolean unregisterEventListener(String token, String eventClassName)
          Unregisters the temporary listener registered for the specified event.
 boolean unregisterTestAppenderForClass(String token, String className)
           
 Hashtable updateDraft(String token, Hashtable draft)
          Updates a draft located using the draft owner and draft type.
 boolean waitForEvent(String token, String eventClassName, String timeout, String timeUnit)
          Waits for an event to occur and returns when it has finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuncTestRpcDelegator

public FuncTestRpcDelegator()
Method Detail

buildDidYouMeanIndex

public boolean buildDidYouMeanIndex(String token)
Description copied from interface: FuncTestRpcHandler
Start a task to build the DidYouMean Index. An IndexBuildCompleteEvent will be published when the index is complete.

Specified by:
buildDidYouMeanIndex in interface FuncTestRpcHandler

logMessage

public boolean logMessage(String token,
                          String destination,
                          String message)
                   throws RemoteException
Description copied from interface: FuncTestRpcHandler
Log a message to the server's console.

Only administrators can log messages.

The destination of the message has the following valid values:

Specified by:
logMessage in interface FuncTestRpcHandler
Parameters:
token - The token idenfitying the user.
destination - The destination of the message to be logged
message - The text message to be logged to the console
Returns:
boolean True if the message is logged (ie destination is a valid level)
Throws:
RemoteException

changeLoggerLevel

public String changeLoggerLevel(String token,
                                String loggerName,
                                String level)
                         throws RemoteException
Description copied from interface: FuncTestRpcHandler

Change the level of the specified logger.

The level parameter can be one of -


nukeSpacesAndFlushEverything

public boolean nukeSpacesAndFlushEverything(String token)
                                     throws RemoteException
Description copied from interface: FuncTestRpcHandler
Kill all the spaces and flush all the queues and caches.

Specified by:
nukeSpacesAndFlushEverything in interface FuncTestRpcHandler
Throws:
RemoteException

nukeUserAndGroupDependentObjects

public boolean nukeUserAndGroupDependentObjects(String token)
                                         throws RemoteException
Description copied from interface: FuncTestRpcHandler
Remove the dependencies of all users and groups, except the default dependencies of the default groups and the current user. This also deletes all mail servers , as it is significantly faster to batch up RPC invocations.

Specified by:
nukeUserAndGroupDependentObjects in interface FuncTestRpcHandler
Throws:
RemoteException

removeAllOtherUsers

public boolean removeAllOtherUsers(String token)
                            throws RemoteException
Description copied from interface: FuncTestRpcHandler
Remove all users except the current user.

Specified by:
removeAllOtherUsers in interface FuncTestRpcHandler
Throws:
RemoteException

removeAllGroupsExceptDefaults

public boolean removeAllGroupsExceptDefaults(String token)
                                      throws RemoteException
Description copied from interface: FuncTestRpcHandler
Remove all groups aside from the default Confluence groups

Specified by:
removeAllGroupsExceptDefaults in interface FuncTestRpcHandler
Throws:
RemoteException

disconnectUser

public boolean disconnectUser(String token,
                              String username)
                       throws RemoteException
Description copied from interface: FuncTestRpcHandler
Disconnect a user from Confluence. Removes all their permissions, group memberships, their profile information and their personal space.

Specified by:
disconnectUser in interface FuncTestRpcHandler
Throws:
RemoteException

disconnectGroup

public boolean disconnectGroup(String token,
                               String groupname)
                        throws RemoteException
Description copied from interface: FuncTestRpcHandler
Disconnect a group from Confluence. Removes all its permissions.

Specified by:
disconnectGroup in interface FuncTestRpcHandler
Throws:
RemoteException

isCurrentApplicationSet

public boolean isCurrentApplicationSet(String token)
                                throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Check whether or not the trustedApplicationManager has its currentApplication set.

Specified by:
isCurrentApplicationSet in interface FuncTestRpcHandler
Throws:
NotPermittedException

removeAllTrustedApplications

public boolean removeAllTrustedApplications(String token)
                                     throws Exception
Description copied from interface: FuncTestRpcHandler
Removes all trusted applications from the database.

Specified by:
removeAllTrustedApplications in interface FuncTestRpcHandler
Throws:
Exception

massCreateAttachments

public boolean massCreateAttachments(String token,
                                     String pageId,
                                     String prefix,
                                     String numAttachments)
                              throws Exception
Description copied from interface: FuncTestRpcHandler
Create a whole series of attachments on a single page.

Specified by:
massCreateAttachments in interface FuncTestRpcHandler
Throws:
Exception

resetTheme

public boolean resetTheme(String token)
                   throws Exception
Description copied from interface: FuncTestRpcHandler
Reset the global theme to the default theme.

Specified by:
resetTheme in interface FuncTestRpcHandler
Throws:
Exception

getGlobalConfiguredTheme

public String getGlobalConfiguredTheme(String token)
                                throws Exception
Description copied from interface: FuncTestRpcHandler
Get the key of the configured global theme, whether or not that theme exists.

Specified by:
getGlobalConfiguredTheme in interface FuncTestRpcHandler
Throws:
Exception

getConfiguredThemeForSpace

public String getConfiguredThemeForSpace(String token,
                                         String spaceKey)
                                  throws Exception
Description copied from interface: FuncTestRpcHandler
Get the key of the configured theme for a space, whether or not that theme exists.

Specified by:
getConfiguredThemeForSpace in interface FuncTestRpcHandler
Throws:
Exception

setGlobalTheme

public boolean setGlobalTheme(String token,
                              String themeKey)
                       throws Exception
Description copied from interface: FuncTestRpcHandler
Sets the global theme

Specified by:
setGlobalTheme in interface FuncTestRpcHandler
themeKey - - the complete theme key
Throws:
Exception

setThemeForSpace

public boolean setThemeForSpace(String token,
                                String spaceKey,
                                String themeKey)
                         throws Exception
Description copied from interface: FuncTestRpcHandler
Sets the theme for the specified space

Specified by:
setThemeForSpace in interface FuncTestRpcHandler
spaceKey - - the key of the space to change
themeKey - - the complete theme key
Throws:
Exception

clearCustomHtml

public boolean clearCustomHtml(String token)
                        throws Exception
Description copied from interface: FuncTestRpcHandler
Clears the global custom html.

Specified by:
clearCustomHtml in interface FuncTestRpcHandler
Returns:
true always.
Throws:
Exception

uninstallPlugin

public boolean uninstallPlugin(String token,
                               String pluginKey)
                        throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Uninstall a plugin. (There's an install method in the standard rpc plugin)

Specified by:
uninstallPlugin in interface FuncTestRpcHandler
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

disablePlugin

public boolean disablePlugin(String token,
                             String pluginKey)
                      throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Disable a plugin.

Specified by:
disablePlugin in interface FuncTestRpcHandler
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

enablePlugin

public boolean enablePlugin(String token,
                            String pluginKey)
                     throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Enable a plugin.

Specified by:
enablePlugin in interface FuncTestRpcHandler
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

enablePluginModule

public boolean enablePluginModule(String token,
                                  String pluginKey,
                                  String moduleKey)
                           throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Enable plugin module

Specified by:
enablePluginModule in interface FuncTestRpcHandler
pluginKey - the key of the plugin
moduleKey - the key of the module
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

disablePluginModule

public boolean disablePluginModule(String token,
                                   String pluginKey,
                                   String moduleKey)
                            throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Disable plugin module

Specified by:
disablePluginModule in interface FuncTestRpcHandler
pluginKey - the key of the plugin
moduleKey - the key of the module
Returns:
true because a return type is required by XMLRPC
Throws:
NotPermittedException

isSpringComponentPresent

public boolean isSpringComponentPresent(String token,
                                        String name)
Description copied from interface: FuncTestRpcHandler
Returns true if a Spring component with the given name exists in the application context.

Specified by:
isSpringComponentPresent in interface FuncTestRpcHandler

pauseJob

public boolean pauseJob(String token,
                        String jobName)
                 throws Exception
Description copied from interface: FuncTestRpcHandler
Pauses a named job in the quartz scheduler

Specified by:
pauseJob in interface FuncTestRpcHandler
Throws:
Exception

resumeJob

public boolean resumeJob(String token,
                         String jobName)
                  throws Exception
Description copied from interface: FuncTestRpcHandler
Resumes a named job in the quartz scheduler

Specified by:
resumeJob in interface FuncTestRpcHandler
Throws:
Exception

triggerJob

public boolean triggerJob(String token,
                          String jobName)
                   throws Exception
Description copied from interface: FuncTestRpcHandler
Triggers a named job in the quartz scheduler synchronously. Note that Quartz's triggerJob function is asynchronous, but we use a listener internally to provide synchronicity.

Specified by:
triggerJob in interface FuncTestRpcHandler
Throws:
Exception

waitForEvent

public boolean waitForEvent(String token,
                            String eventClassName,
                            String timeout,
                            String timeUnit)
                     throws Exception
Description copied from interface: FuncTestRpcHandler
Waits for an event to occur and returns when it has finished.

Specified by:
waitForEvent in interface FuncTestRpcHandler
eventClassName - the fully qualified classname of the event to wait for.
timeout - number of milliseconds to wait for the event before giving up completely.
timeUnit - See TimeUnit.name
Returns:
true if the event occurs within the timeout.
Throws:
Exception

shutdownQuartz

public boolean shutdownQuartz(String token)
                       throws Exception
Description copied from interface: FuncTestRpcHandler
Shutdown the quartz scheduler to ensure single threadedness for testing

Specified by:
shutdownQuartz in interface FuncTestRpcHandler
Throws:
Exception

removeBandanaKey

public boolean removeBandanaKey(String token,
                                String space,
                                String key)
Description copied from interface: FuncTestRpcHandler
Remove a key from Bandana

Specified by:
removeBandanaKey in interface FuncTestRpcHandler

getContentPropertyKeys

public Vector getContentPropertyKeys(String token,
                                     String entityId)
Description copied from interface: FuncTestRpcHandler
Get the content property keys for a content entity given its id

Specified by:
getContentPropertyKeys in interface FuncTestRpcHandler

setContentTextProperty

public boolean setContentTextProperty(String token,
                                      String entityId,
                                      String key,
                                      String value)
Description copied from interface: FuncTestRpcHandler
Sets a text content property for a content entity given its id

Specified by:
setContentTextProperty in interface FuncTestRpcHandler

getPersonalInformationId

public String getPersonalInformationId(String token,
                                       String username)
Description copied from interface: FuncTestRpcHandler
Gets the personal information id for a given username

Specified by:
getPersonalInformationId in interface FuncTestRpcHandler

removePersonalInformation

public boolean removePersonalInformation(String token,
                                         String username)
                                  throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
PersonalInformation gets created automatically by the standard create user methods. This method exists to allow testing that the PersonalInformation will get created appropriately when it doesn't exist (eg for LDAP users logging in).

Specified by:
removePersonalInformation in interface FuncTestRpcHandler
username - user whose personalInformation will be removed
Returns:
true because it has to return something
Throws:
NotPermittedException

getLocaleForUser

public String getLocaleForUser(String token,
                               String username)
Description copied from interface: FuncTestRpcHandler
Gets the locale preference for the user.

Specified by:
getLocaleForUser in interface FuncTestRpcHandler

setLocaleForUser

public boolean setLocaleForUser(String token,
                                String username,
                                String locale)
                         throws RemoteException
Description copied from interface: FuncTestRpcHandler
Sets the locale preference for the user to the given named locale.

Specified by:
setLocaleForUser in interface FuncTestRpcHandler
Throws:
RemoteException

setUserDetails

public boolean setUserDetails(String token,
                              String username,
                              String fullName,
                              String email)
                       throws RemoteException
Description copied from interface: FuncTestRpcHandler
Sets the fullname and email address of a user with a given username.

Specified by:
setUserDetails in interface FuncTestRpcHandler
Returns:
true because XMLRPC methods have to return something
Throws:
RemoteException - if the user was not found.

putStringMappingInCache

public boolean putStringMappingInCache(String token,
                                       String cacheName,
                                       String key,
                                       String value)
                                throws Exception
Description copied from interface: FuncTestRpcHandler
Map a key to a value for a given cache. Only accepts strings. This allows us to manipulate the number of entries in the cache. This method will create the named cache if it doesn't exist.

Specified by:
putStringMappingInCache in interface FuncTestRpcHandler
Returns:
true because void is not allowed.
Throws:
Exception

getCacheStatistics

public Hashtable getCacheStatistics(String token,
                                    String cacheName)
                             throws Exception
Description copied from interface: FuncTestRpcHandler
Returns the cache statistics for a particular named cache.

Specified by:
getCacheStatistics in interface FuncTestRpcHandler
cacheName - the key of the cache, rather than the "niceName"
Returns:
A hashtable representing the cache statistics
Throws:
Exception

flushAllCaches

public boolean flushAllCaches(String token)
                       throws Exception
Description copied from interface: FuncTestRpcHandler
Flushes all the caches.

Specified by:
flushAllCaches in interface FuncTestRpcHandler
Returns:
true because void isn't allowed.
Throws:
Exception

enableWebSudo

public boolean enableWebSudo(String token,
                             boolean enabled)
                      throws Exception
Description copied from interface: FuncTestRpcHandler
Sets the web sudo enabled status

Specified by:
enableWebSudo in interface FuncTestRpcHandler
Returns:
true because void isn't allowed.
Throws:
Exception

setWebSudoTimeout

public boolean setWebSudoTimeout(String token,
                                 int timeout)
                          throws Exception
Description copied from interface: FuncTestRpcHandler
Sets the web sudo timeout in minutes

Specified by:
setWebSudoTimeout in interface FuncTestRpcHandler
Returns:
true because void isn't allowed.
Throws:
Exception

startActivity

public boolean startActivity(String key,
                             String user)
                      throws Exception
Description copied from interface: FuncTestRpcHandler
Call startActivity on the heartbeatManager bean

Specified by:
startActivity in interface FuncTestRpcHandler
Throws:
Exception

setKeyboardShortcutPref

public boolean setKeyboardShortcutPref(String token,
                                       String username,
                                       String enabled)
                                throws RemoteException
Description copied from interface: FuncTestRpcHandler
Enables/Disables keyboard shortcuts for the given uesr

Specified by:
setKeyboardShortcutPref in interface FuncTestRpcHandler
Throws:
RemoteException

setWatchOwnContentPref

public boolean setWatchOwnContentPref(String token,
                                      String username,
                                      String enabled)
                               throws RemoteException
Description copied from interface: FuncTestRpcHandler
Enables/Disables autowatching for the given uesr

Specified by:
setWatchOwnContentPref in interface FuncTestRpcHandler
Throws:
RemoteException

setWatchSpace

public boolean setWatchSpace(String token,
                             String username,
                             String spaceKey,
                             String contentType,
                             String enabled)
                      throws RemoteException
Description copied from interface: FuncTestRpcHandler
Enables/Disables watching a space for the given user and content type.

Specified by:
setWatchSpace in interface FuncTestRpcHandler
Throws:
RemoteException

getUsersForActivity

public Vector getUsersForActivity(String key)
                           throws Exception
Description copied from interface: FuncTestRpcHandler
Call getUsersForActivity on the heartbeatManager bean

Specified by:
getUsersForActivity in interface FuncTestRpcHandler
Throws:
Exception

setSharedMode

public boolean setSharedMode(String token,
                             boolean set)
                      throws Exception
Specified by:
setSharedMode in interface FuncTestRpcHandler
Throws:
Exception

setEnableJavascriptTop

public boolean setEnableJavascriptTop(String token,
                                      boolean set)
Description copied from interface: FuncTestRpcHandler
Set the config for serving javascripts in the header.

Specified by:
setEnableJavascriptTop in interface FuncTestRpcHandler

registerEventListener

public boolean registerEventListener(String token,
                                     String eventClassName)
                              throws Exception
Description copied from interface: FuncTestRpcHandler
Registers a temporary event listener on the server to listen for the specified event. It is recommended that clients also unregister the event listener using FuncTestRpcHandler.unregisterEventListener(String, String) in a finally clause to ensure the temporary listener is cleaned up.

Once the listener is registered, clients can use FuncTestRpcHandler.waitForEvent(String, String, String, String) to block until the event is published.

Specified by:
registerEventListener in interface FuncTestRpcHandler
Throws:
Exception

unregisterEventListener

public boolean unregisterEventListener(String token,
                                       String eventClassName)
                                throws Exception
Description copied from interface: FuncTestRpcHandler
Unregisters the temporary listener registered for the specified event.

Specified by:
unregisterEventListener in interface FuncTestRpcHandler
Throws:
Exception

clearEventListeners

public boolean clearEventListeners(String token)
                            throws Exception
Description copied from interface: FuncTestRpcHandler
Removes all temporary event listeners, regardless of their state.

Specified by:
clearEventListeners in interface FuncTestRpcHandler
Returns:
true because some result is required.
Throws:
Exception

removeMailServer

public boolean removeMailServer(String token,
                                String serverName)
                         throws Exception
Description copied from interface: FuncTestRpcHandler
Remove the named mail server.

Specified by:
removeMailServer in interface FuncTestRpcHandler
Parameters:
token - the rpc authentication token
serverName - the name of the server to be removed.
Returns:
true if the named server was removed (or there was no server by that name), otherwise false.
Throws:
Exception

getLeastRecentTestAppenderLogMessage

public String getLeastRecentTestAppenderLogMessage(String token,
                                                   String className)
Specified by:
getLeastRecentTestAppenderLogMessage in interface FuncTestRpcHandler

registerTestAppenderForClass

public boolean registerTestAppenderForClass(String token,
                                            String className)
Specified by:
registerTestAppenderForClass in interface FuncTestRpcHandler

unregisterTestAppenderForClass

public boolean unregisterTestAppenderForClass(String token,
                                              String className)
Specified by:
unregisterTestAppenderForClass in interface FuncTestRpcHandler

logTestMessageForClass

public boolean logTestMessageForClass(String token,
                                      String className,
                                      String message,
                                      String level)
Specified by:
logTestMessageForClass in interface FuncTestRpcHandler

getLocalisedText

public String getLocalisedText(String token,
                               String messageKey)
Description copied from interface: FuncTestRpcHandler
Get the localised string for given the message key in the logged-in user's locale.

Specified by:
getLocalisedText in interface FuncTestRpcHandler
Parameters:
token - the rpc authentication token
messageKey - the i18n message key
Returns:
the localised version of the message key in the logged-in user's locale, or the message key itself if it does not have a corresponding value.

removeUserUncleanly

public boolean removeUserUncleanly(String token,
                                   String username)
                            throws Exception
Description copied from interface: FuncTestRpcHandler
Remove a User without removing the things that refer to that user.

Specified by:
removeUserUncleanly in interface FuncTestRpcHandler
Throws:
Exception

removeGroupUncleanly

public boolean removeGroupUncleanly(String token,
                                    String groupname)
                             throws Exception
Description copied from interface: FuncTestRpcHandler
Remove a Group without removing the things that refer to that group.

Specified by:
removeGroupUncleanly in interface FuncTestRpcHandler
Throws:
Exception

doesDraftExist

public boolean doesDraftExist(String token,
                              String contentId,
                              String owner,
                              String draftType,
                              String spaceKey)
Description copied from interface: FuncTestRpcHandler
Determines if a draft of the specified type and belonging to the specified owner exists.

Specified by:
doesDraftExist in interface FuncTestRpcHandler
Parameters:
token - rpc authentication token
contentId - id of the content this draft is for ('0' for new content)
owner - owner/author of the draft
draftType - type of content this draft is for
spaceKey - space key, to allow new drafts in multiple spaces
Returns:
true if a draft of the specified type and belonging to the specified owner exists, else false

createDraft

public Hashtable createDraft(String token,
                             Hashtable draft)
Description copied from interface: FuncTestRpcHandler
Creates a draft for the draft owner and draft type with the specified title and content. If the draft already exists the current draft is updated.

Specified by:
createDraft in interface FuncTestRpcHandler
Parameters:
token - rpc authentication token
draft - the draft object to create Required: "owner" - the username of owner/author of the draft. Set to null for anonymous users. "draftType" - type of content the draft is for i.e. BlogPost.getType() or Page.getType(). "title" - title of the draft. "content" - content of the draft as a String in Confluence XML storage format. Optional: "pageId" - page that the draft is associated with. "spaceKey" - if no there is no page, the space that the draft is written in.
Returns:
the draft created returned in the same format as above, with the additional field id.

updateDraft

public Hashtable updateDraft(String token,
                             Hashtable draft)
Description copied from interface: FuncTestRpcHandler
Updates a draft located using the draft owner and draft type. Draft is then updated with the specified title and content

Specified by:
updateDraft in interface FuncTestRpcHandler
Parameters:
token - rpc authentication token
draft - the draft object to create see #createDraft(java.lang.String, java.util.Hashtable)
Returns:
the draft updated returns null if the draft does not exist

removeDrafts

public boolean removeDrafts(String token,
                            String username)
Description copied from interface: FuncTestRpcHandler
Removes all drafts owned by the specified User.

Specified by:
removeDrafts in interface FuncTestRpcHandler
Parameters:
token - rpc authentication token
username - user to remove drafts for
Returns:
true if this is successful, false if no user with this name.

setDraftSaveInterval

public boolean setDraftSaveInterval(String token,
                                    int seconds)
Description copied from interface: FuncTestRpcHandler
Sets the given draft save interval.

Specified by:
setDraftSaveInterval in interface FuncTestRpcHandler
Parameters:
token - rpc authentication token
seconds - number of seconds for which the draft save interval should be
Returns:
true if this is successful, false if not set

clearQueue

public boolean clearQueue(String token,
                          String queueName)
Description copied from interface: FuncTestRpcHandler
Removes all items from the specified queue

Specified by:
clearQueue in interface FuncTestRpcHandler
Returns:
true if this is successful, false if no queue with this name exists

getQueueSize

public int getQueueSize(String token,
                        String queueName)
Description copied from interface: FuncTestRpcHandler
Returns the size of the task queue with the specified name.

Specified by:
getQueueSize in interface FuncTestRpcHandler
Returns:
the size of the task queue with the specified name.

addUserAnyCase

public boolean addUserAnyCase(String token,
                              String username,
                              String email,
                              String fullname,
                              String password)
                       throws RemoteException
Description copied from interface: FuncTestRpcHandler
Allows addition of a user without enforcing that the username be all lower case. This is for use in tests where you need mixed case user - useful for emulating an external provider such as LDAP.

Specified by:
addUserAnyCase in interface FuncTestRpcHandler
Throws:
NotPermittedException - if you do not have permissions to add the user.
RemoteException

addGroupAnyCase

public boolean addGroupAnyCase(String token,
                               String groupname)
                        throws RemoteException
Description copied from interface: FuncTestRpcHandler
Allows addition of a group without enforcing that the name be all lower case. This is for use in tests where you need mixed case user - useful for emulating an external provider such as LDAP.

Specified by:
addGroupAnyCase in interface FuncTestRpcHandler
groupname - the name of the group to add
Returns:
true if successfully added, otherwise false
Throws:
RemoteException

changeSpaceCreatedDate

public boolean changeSpaceCreatedDate(String token,
                                      String spaceKey,
                                      Date createdDate)
                               throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the created date of a space

Specified by:
changeSpaceCreatedDate in interface FuncTestRpcHandler
spaceKey - the space key of the space to change the created date
Throws:
RemoteException

changeCommentCreatedDate

public boolean changeCommentCreatedDate(String token,
                                        String commentId,
                                        Date createdDate)
                                 throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the created date of a comment

Specified by:
changeCommentCreatedDate in interface FuncTestRpcHandler
Throws:
RemoteException

changePageCreatedDate

public boolean changePageCreatedDate(String token,
                                     String pageId,
                                     Date createdDate)
                              throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the created date of a page

Specified by:
changePageCreatedDate in interface FuncTestRpcHandler
pageId - the page id of the page to change the created date
Throws:
RemoteException

changeAttachmentCreatedDate

public boolean changeAttachmentCreatedDate(String token,
                                           String contentId,
                                           String attachmentFileName,
                                           Date createdDate)
                                    throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the created date of an attachment

Specified by:
changeAttachmentCreatedDate in interface FuncTestRpcHandler
contentId - the id of the page or blogpost the attachment is attached to
attachmentFileName - the attachment file name of the attachment to change the created date
Throws:
RemoteException

changeBlogPostModificationDate

public boolean changeBlogPostModificationDate(String token,
                                              String blogId,
                                              Date modificationDate)
                                       throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the modification date of a blog post

Specified by:
changeBlogPostModificationDate in interface FuncTestRpcHandler
blogId - the id of the blog to modify
modificationDate - the last modification date to be set.
Returns:
true if successful, otherwise false.
Throws:
RemoteException

changePageModificationDate

public boolean changePageModificationDate(String token,
                                          String pageId,
                                          Date modificationDate)
                                   throws RemoteException
Description copied from interface: FuncTestRpcHandler
Change the modification date of a page

Specified by:
changePageModificationDate in interface FuncTestRpcHandler
pageId - the page id of the page to change the modification date
modificationDate - the last modification date to be set.
Throws:
RemoteException

getVersionForPage

public int getVersionForPage(String token,
                             String pageId)
                      throws RemoteException
Description copied from interface: FuncTestRpcHandler
Get the version number for the page with pageId

Specified by:
getVersionForPage in interface FuncTestRpcHandler
Throws:
RemoteException

saveDateFormat

public boolean saveDateFormat(String token,
                              String dateFormat)
Specified by:
saveDateFormat in interface FuncTestRpcHandler

saveDateTimeFormat

public boolean saveDateTimeFormat(String token,
                                  String dateTimeFormat)
Specified by:
saveDateTimeFormat in interface FuncTestRpcHandler

addMailServer

public boolean addMailServer(String token,
                             String name,
                             String from,
                             String subjectPrefix,
                             String hostname,
                             int port)
Specified by:
addMailServer in interface FuncTestRpcHandler

addMailServer

public boolean addMailServer(String token,
                             String name,
                             String from,
                             String subjectPrefix,
                             String hostname,
                             int port,
                             String fromName)
Specified by:
addMailServer in interface FuncTestRpcHandler

convertMarkupToXhtml

public String convertMarkupToXhtml(String token,
                                   String wikiMarkup,
                                   String pageId)
Description copied from interface: FuncTestRpcHandler
Render a page as XHTML.

Specified by:
convertMarkupToXhtml in interface FuncTestRpcHandler

convertXhtmlToMarkup

public String convertXhtmlToMarkup(String token,
                                   String xhtml,
                                   String pageId)
Description copied from interface: FuncTestRpcHandler
Convert XHTML to WikiMarkup.

Specified by:
convertXhtmlToMarkup in interface FuncTestRpcHandler

setFuncTestRpcImpl

public void setFuncTestRpcImpl(FuncTestRpcHandler funcTestRpcImpl)

removeAllJohnsonEvents

public boolean removeAllJohnsonEvents(String token)
Description copied from interface: FuncTestRpcHandler
Removes all Johnson events from Confluence

Specified by:
removeAllJohnsonEvents in interface FuncTestRpcHandler

enableCaptcha

public boolean enableCaptcha(String token,
                             boolean enable)
Description copied from interface: FuncTestRpcHandler
Sets the captcha mode

Specified by:
enableCaptcha in interface FuncTestRpcHandler

enableCaptchaDebugMode

public boolean enableCaptchaDebugMode(String token,
                                      boolean enable)
Description copied from interface: FuncTestRpcHandler
Sets the captcha mode into debug mode. See CaptchaManager.setDebugMode(boolean).

Specified by:
enableCaptchaDebugMode in interface FuncTestRpcHandler

createJohnsonEvent

public boolean createJohnsonEvent(String token,
                                  String message)
Description copied from interface: FuncTestRpcHandler
Creates a Johnson event inside Confluence. This method is used to test the ConfluenceJohnsonFilter.

Specified by:
createJohnsonEvent in interface FuncTestRpcHandler
message - the description of the event to create

setSystemProperty

public Boolean setSystemProperty(String token,
                                 String name,
                                 String value)
Description copied from interface: FuncTestRpcHandler
Set a system property on the server to the supplied value.

Specified by:
setSystemProperty in interface FuncTestRpcHandler
name - the name of the property
value - the value of the property
Returns:
always true since XML RPC can't handle void

clearSystemProperty

public Boolean clearSystemProperty(String token,
                                   String name)
Description copied from interface: FuncTestRpcHandler
Unset a system property.

Specified by:
clearSystemProperty in interface FuncTestRpcHandler
name - the name of the property
Returns:
always true since XML RPC can't handle void

clearIndex

public boolean clearIndex(String token)
Description copied from interface: FuncTestRpcHandler
Blows away the main Confluence search index.

Specified by:
clearIndex in interface FuncTestRpcHandler

resetGlobalPermissions

public boolean resetGlobalPermissions(String token)
                               throws RemoteException
Description copied from interface: FuncTestRpcHandler
Reset global permissions to the system initial state.

Specified by:
resetGlobalPermissions in interface FuncTestRpcHandler
Throws:
RemoteException
See Also:
SpacePermission.getDefaultGlobalPermissions()

restoreAbstractPage

public boolean restoreAbstractPage(String token,
                                   String abstractPageId)
Description copied from interface: FuncTestRpcHandler
Restores an abstract page from the trash.

Specified by:
restoreAbstractPage in interface FuncTestRpcHandler

getIdOfPagePermission

public String getIdOfPagePermission(String token,
                                    String contentId,
                                    String permissionType,
                                    String username)
Specified by:
getIdOfPagePermission in interface FuncTestRpcHandler
Returns:
the id of the identified content permission or 0 if there is no match found.

createTestUsers

public int createTestUsers(String token,
                           int count)
Description copied from interface: FuncTestRpcHandler
Create test users with usernames "testuser0", "testuser1", etc. Each user's password is the same as their username.

Specified by:
createTestUsers in interface FuncTestRpcHandler
Returns:
the number of users created

removeTestUsers

public int removeTestUsers(String token,
                           int count)
Description copied from interface: FuncTestRpcHandler
Removes test users with usernames "testuser0", "testuser1", etc. Logs a warning if a user cannot be removed.

Specified by:
removeTestUsers in interface FuncTestRpcHandler
Returns:
the number of users removed

createUserMacro

public boolean createUserMacro(String token,
                               String name,
                               boolean hasBody,
                               String bodyType,
                               String outputType,
                               String template,
                               String title,
                               String description,
                               String category,
                               String iconUrl,
                               String documentationUrl,
                               boolean hidden)
                        throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Create a User Macro

Specified by:
createUserMacro in interface FuncTestRpcHandler
bodyType - how the body should be treated. "raw", "escapehtml", or "rendered". May be null only if hasBody is false.
outputType - whether the macro is expected to return html or wiki markup. "html" or "wiki".
template - the velocity rendered by the macro
title - the title of the macro that appears in the Macro Browser
description - the description of the macro that appears in the Macro Browser
category - the category the macro should be listed under in the Macro Browser
iconUrl - the URL of the macro icon that appears in the Macro Browser
documentationUrl - the URL of the macro documentation
hidden - true if the Macro should not be searchable in the Macro Browser
Returns:
true all the time because XMLRPC methods need a non-void return type.
Throws:
NotPermittedException

removeUserMacro

public boolean removeUserMacro(String token,
                               String name)
                        throws NotPermittedException
Description copied from interface: FuncTestRpcHandler
Remove a User Macro with the given name if it exists.

Specified by:
removeUserMacro in interface FuncTestRpcHandler
Returns:
true all the time because XMLRPC methods need a non-void return type.
Throws:
NotPermittedException

setApplicationConfigProperty

public boolean setApplicationConfigProperty(String token,
                                            String propertyKey,
                                            String propertyValue)
Description copied from interface: FuncTestRpcHandler
Sets a property on the global ApplicationConfiguration instance.

Specified by:
setApplicationConfigProperty in interface FuncTestRpcHandler
Returns:
the previous value of the property

getApplicationConfigProperty

public Object getApplicationConfigProperty(String token,
                                           String propertyKey)
Description copied from interface: FuncTestRpcHandler
Returns a property of the global ApplicationConfiguration instance.

Specified by:
getApplicationConfigProperty in interface FuncTestRpcHandler
Returns:
the property mapped to propertyKey

followUser

public boolean followUser(String token,
                          String userName,
                          boolean followUser)
                   throws RemoteException
Description copied from interface: FuncTestRpcHandler
Follows or stops following a user. Can be done by any user, not just admins.

Specified by:
followUser in interface FuncTestRpcHandler
followUser - true to follow a user, false to stop following
Throws:
RemoteException

setUserStatus

public boolean setUserStatus(String token,
                             String wikiStatus)
                      throws Exception
Description copied from interface: FuncTestRpcHandler
Set the current user's status. Can be done by any user, not just admins.

Specified by:
setUserStatus in interface FuncTestRpcHandler
wikiStatus - the status string in wiki markup.
Returns:
true
Throws:
Exception

storeXhtmlPage

public Hashtable storeXhtmlPage(String token,
                                Hashtable pageStruct)
                         throws RemoteException
Description copied from interface: FuncTestRpcHandler
The Confluence remote API store page performs wiki to XHTML conversion on the page content. This version will store the supplied content exactly as it is. This is necessary for tests where the automatic conversion is not helpful, such as user macro testing.

Specified by:
storeXhtmlPage in interface FuncTestRpcHandler
Returns:
the created page
Throws:
RemoteException

synchroniseUserDirectories

public boolean synchroniseUserDirectories(String token)
                                   throws Exception
Description copied from interface: FuncTestRpcHandler
Synchronizes all remote user directories with the local database cache

Specified by:
synchroniseUserDirectories in interface FuncTestRpcHandler
Returns:
true
Throws:
Exception

setDirectoryPasswordEncoder

public boolean setDirectoryPasswordEncoder(String token,
                                           String directoryName,
                                           String encoder)
                                    throws Exception
Description copied from interface: FuncTestRpcHandler
Changes the password encoder for the given directory

Specified by:
setDirectoryPasswordEncoder in interface FuncTestRpcHandler
Returns:
true
Throws:
Exception

getNumberOfIndexTasksInQueue

public int getNumberOfIndexTasksInQueue(String token)
Description copied from interface: FuncTestRpcHandler
Returns the size of the index queue.

Specified by:
getNumberOfIndexTasksInQueue in interface FuncTestRpcHandler
Returns:

addExistingProfilePicture

public boolean addExistingProfilePicture(String token,
                                         String userName,
                                         String fileName)
                                  throws Exception
Description copied from interface: FuncTestRpcHandler
Attempts to add a existing profile picture to a user's profile.

Specified by:
addExistingProfilePicture in interface FuncTestRpcHandler
userName - the user name of the profile
fileName - file name of the picture
Returns:
true if the picture is successfully added
Throws:
Exception

setBooleanUserPreference

public boolean setBooleanUserPreference(String token,
                                        String userName,
                                        String preferenceKey,
                                        String value)
                                 throws RemoteException
Description copied from interface: FuncTestRpcHandler
Sets a boolean user preference.

Specified by:
setBooleanUserPreference in interface FuncTestRpcHandler
userName - the user name to set the preference for
preferenceKey - the key of the preference to set
value - the string "true" or "false" to set as the preference
Throws:
RemoteException

setStringUserPreference

public boolean setStringUserPreference(String token,
                                       String userName,
                                       String preferenceKey,
                                       String value)
                                throws RemoteException
Description copied from interface: FuncTestRpcHandler
Sets a string user preference.

Specified by:
setStringUserPreference in interface FuncTestRpcHandler
userName - the user name to set the preference for
preferenceKey - the key of the preference to set
value - a string to set as the preference
Throws:
RemoteException

getIgnoreBaseURLWarning

public boolean getIgnoreBaseURLWarning(String token)
Description copied from interface: FuncTestRpcHandler
Whether the warning message for an un-advisable value for the Base URL is ignored or not.

Specified by:
getIgnoreBaseURLWarning in interface FuncTestRpcHandler
Returns:
true if the warning message is ignored.

setIgnoreBaseURLWarning

public boolean setIgnoreBaseURLWarning(String token,
                                       boolean value)
                                throws RemoteException
Description copied from interface: FuncTestRpcHandler
Affects whether the warning message for an un-advisable value for the Base URL is ignored or not. If ignored, any warning messages about the Base URL will not be displayed.

Specified by:
setIgnoreBaseURLWarning in interface FuncTestRpcHandler
value - set to true to ignore the warning.
Throws:
RemoteException


Copyright © 2003-2011 Atlassian. All Rights Reserved.