Interface FuncTestRpcHandler
- All Known Implementing Classes:
FuncTestRpcDelegator
,FuncTestRpcHandlerImpl
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.int
addInboundWhitelistDomain
(String token, String host) int
addLabelToLabelable
(String token, String labelName, String labelableId, String labelableType) Adds a label to a labelable, because the public RPC API doesn't let you do it.boolean
addMailServer
(String token, String serverName, String protocol, String hostname, int port, String username, String password, String toAddress) Add a POP server to poll for emails in a particular account.boolean
addSmtpServer
(String token, String name, String from, String subjectPrefix, String hostname, int port, String fromName) boolean
Allows addition of a user without enforcing that the username be all lower case.boolean
assertThatIndexQueueEntryHasBeenProcessed
(String token, String searchableClassname, String searchableId) boolean
changeAttachmentCreatedDate
(String token, String contentId, String attachmentFileName, Date createdDate) Change the created date of an attachmentboolean
changeCommentCreatedDate
(String token, String commentId, Date createdDate) Change the created date of a commentboolean
changePageCreatedDate
(String token, String pageId, Date createdDate) Change the created date of a pageboolean
changePageModificationDate
(String token, String pageId, Date modificationDate) Change the modification date of a pageboolean
changeSpaceCreatedDate
(String token, String spaceKey, Date createdDate) Change the created date of a spaceboolean
checkIfMappingPresent
(String token, String title) boolean
clearCustomHtml
(String token) Clears the global custom html.boolean
clearEventListeners
(String token) Removes all temporary event listeners, regardless of their state.boolean
boolean
clearIndex
(String token) Blows away the main Confluence search index.boolean
clearQueue
(String token, String queueName) Removes all items from the specified queueboolean
clearRecordedLogMessages
(String token) clearSystemProperty
(String token, String name) Unset a system property.int
countDrafts
(String token, String owner) 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.createPagesFromPrototype
(String token, Hashtable pageStruct, int count) Creates a series of pages based on a prototype.createSpaces
(String token, int count) Creates a bunch of spaces.createTemplate
(String token, String templateName, String content, String spaceKey) Create a new template.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 Macroboolean
disablePluginWithoutPersisting
(String token, String pluginKey) Disable a plugin without persisting.boolean
disconnectGroup
(String token, String groupName) Disconnect a group from Confluence.boolean
disconnectUser
(String token, String username) Disconnect a user from Confluence.boolean
Determines if a draft of the specified type and belonging to the specified owner exists.boolean
enableCaptcha
(String token, boolean enable) Sets the captcha modeboolean
enableCaptchaDebugMode
(String token, boolean enable) Sets the captcha mode into debug mode.boolean
enableDailyReportNotification
(String token, String userName, boolean dailyReportEnabled) Sets the Daily Report email for a user to enabled or disabled.boolean
enableElevatedSecurityCheck
(String token, boolean enabled) boolean
enableWebSudo
(String token, boolean enabled) Sets the web sudo enabled statusfinishLoggingRequests
(String token) Finish logging http request and return any requests made.boolean
followUser
(String token, String userName, boolean followUser) Follows or stops following a user.getAliveThreads
(String token) getAllContentForAllLabels
(String token, int offset, int maxResults, String labelsString) Returns current and trashed CEOs having all of the labels supplied in the string.getApplicationConfigProperty
(String token, String propertyKey) Returns a property of the globalApplicationConfiguration
instance.getContentForAllLabels
(String token, int offset, int maxResults, String labels) Returns CEOs having all of the labels supplied in the string.getContentInSpacesForAllLabels
(String token, int offset, int maxResults, String spaceKeysString, String labelsString) Returns CEOs in the given spaces having all of the labels supplied in the string.getContentPropertiesString
(String token, String entityId, String key) Get the string value of aContentProperty
associated with a content entity given its id and the property namegetContentPropertiesStringForSpace
(String token, String spaceKey, String key) Get the string value of aContentProperty
associated with theSpaceDescription
of the spacegetContentPropertyKeys
(String token, String entityId) getContentStringProperty
(String token, String entityId, String key) Get the content property string value (in OS_PROPERTYENTRY) for a content entity given its id and property keygetDateTimeFormat
(String token) Get current DateTime formatgetExportBuildNumber
(String token) Returns the backward-compatibility of an exportgetForLabels
(String token, String labelableType, int offset, int maxResults, String labelsString) Returns any kind of Labelable entities having all of the labels supplied in the string.String[]
getGlobalPermissionsForGroup
(String token, String groupName) Gets the global permissions that the given group has.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.getLocaleForUser
(String token, String username) Gets the locale preference for the user.getLocalisedText
(String token, String messageKey) Get the localised string for given the message key in the logged-in user's locale.int
getNumberOfActiveUsers
(String token) Returns the number of active users, i.e.Returns the backwards-compatibility of a space importgetPersonalInformationId
(String token, String username) Gets the personal information id for a given usernamegetPluginExportCompatibility
(String token, String pluginKey) Returns the plugin compatibility matrix for exportsint
getQueueSize
(String token, String queueName) Returns the size of the task queue with the specified name.getRecentTestAppenderLogMessages
(String token, String className) getSystemProperty
(String token, String name) Retrieve the value of a system property.int
getVersionForPage
(String token, String pageId) Get the version number for the page with pageIdboolean
increaseHighValue
(String token) Put a number bigger than 65535 in Hibernate_unique_key table to force generated ids to be greater than max integer.boolean
isImportTaskRunning
(String token) boolean
Returns true if the plugin dependent upgrade tasksboolean
isSpringComponentPresent
(String token, String name) Returns true if a Spring component with the given name exists in the application context.boolean
isUnlimitedUserLicense
(String token) 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
pauseCrowdSyncJobs
(String token) 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
removeAllJohnsonEvents
(String token) Removes all Johnson events from Confluenceboolean
removeAllSpaces
(String token) Kill all the spaces and flush all the queues and caches.boolean
removeAttachmentUncleanly
(String token, String contentId, String attachmentFileName) Removes an attachment without cleaning up associated attachment infoboolean
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
removeInboundWhitelistDomain
(String token, int whitelistDomainId) 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.boolean
removeTestData
(String token, Vector<String> usersToKeep, Vector<String> groupsToKeep, Hashtable<String, Vector<String>> userGroupMemberships) Big Kahuna remove method.boolean
Called at the start of tests for which User management is handled by an external server such as LDAP or Crowd.int
removeTestUsers
(String token, int count) Removes test users with usernames "testuser0", "testuser1", etc.boolean
removeUserDirectory
(String token, String directoryId) Removes user directoryboolean
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
resetWelcomeMessage
(String token) boolean
restoreAbstractPage
(String token, String abstractPageId) Restores an abstract page from the trash.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 globalApplicationConfiguration
instance.boolean
setBooleanUserPreference
(String token, String userName, String preferenceKey, String value) Sets a boolean user preference.boolean
setContentPropertiesString
(String token, String entityId, String key, String value) Sets the string value of aContentProperty
associated with a content entity given its id and the property nameboolean
setContentPropertiesStringForSpace
(String token, String spaceKey, String key, String value) Sets the string value of aContentProperty
associated with theSpaceDescription
of the spaceboolean
setContentStringProperty
(String token, String entityId, String key, String value) Set the content property string value (in OS_PROPERTYENTRY) for a content entity given its id, property key and valueboolean
setDirectoryPasswordEncoder
(String token, String directoryName, String encoder) Changes the password encoder for the given directoryboolean
setEnableAnonymousRpc
(String token, String value) Toggle the setting to allow/deny anonymous RPC calls.boolean
setGlobalLanguage
(String token, String language) Changes to the default site languageboolean
setHibernateConnectionProviderLastExceptionTime
(String token, String timeStr) 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
setIndexingLanguage
(String token, String language) Changes the indexing languageboolean
setLocaleForUser
(String token, String username, String locale) Sets the locale preference for the user to the given named locale.boolean
setNetworkNotificationForUser
(String token, String userName, boolean watchNetwork) Sets Network watch emails for a user to enabled or disabled.boolean
setSiteBlogNotificationForUser
(String token, String userName, boolean globalBlogWatchForUser) Sets Site Blog watch emails for a user to enabled or disabled.boolean
setSmtpServer
(String token, String name, String from, String subjectPrefix, String hostname, int port, String fromName) Remove all existing SMTP servers and add the given server.boolean
setStringUserPreference
(String token, String userName, String preferenceKey, String value) Sets a string user preference.setSystemProperty
(String token, String name, String value) Set a system property on the server to the supplied value.boolean
setUserDetails
(String token, String username, String fullName, String email) Sets the fullname and email address of a user with a given username.boolean
setWatchOwnContentPref
(String token, String username, String enabled) Enables/Disables autowatching for the given uesrboolean
Enables/Disables watching a space for the given user and content type.boolean
setWatchSpaces
(String token, String username, String contentTypeStr, Hashtable spaces) Enables/Disables watching spaces for the given user and content type.boolean
setWebSudoTimeout
(String token, int timeoutMinutes) Sets the web sudo timeout in minutesboolean
setWelcomeMessage
(String token, String welcomeMessage) boolean
startActivity
(String token, String key, String user) Call startActivity on the heartbeat manager beanboolean
startLoggingRequests
(String token) Start logging http request urls.boolean
stopActivity
(String token, String key, String user) Call stopActivity on the heartbeatManager beanstoreXhtmlPage
(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 cacheboolean
unregisterEventListener
(String token, String eventClassName) Unregisters the temporary listener registered for the specified event.boolean
unregisterTestAppenderForClass
(String token, String className) boolean
updateGlobalSettingBoolean
(String token, String name, boolean value) Update aSettings
boolean field.updateGlobalSettingString
(String token, String name, String value) Update aSettings
String field.boolean
waitForEvent
(String token, String eventClassName, String timeout, String timeUnit) Waits for an event to occur and returns when it has finished.boolean
waitForEventQueue
(String token, String timeoutStr, String timeUnitStr) Waits for all events in queue to be processed.
-
Method Details
-
removeTestData
boolean removeTestData(String token, Vector<String> usersToKeep, Vector<String> groupsToKeep, Hashtable<String, Vector<String>> userGroupMemberships) throws RemoteExceptionBig Kahuna remove method. Removes EVERYTHING that is meant to be removed on test setup, keeping only the users, groups and memberships specified. This includes removing global templates.- Parameters:
token
- the token identifying the user.usersToKeep
- users like admin and sysadmin that should not be removedgroupsToKeep
- groups like admins and users that should not be removeduserGroupMemberships
- a map where the keys are group names and the values are lists of usernames in the group- Throws:
NotPermittedException
RemoteException
-
removeTestDataAfterExternalUserManagement
Called at the start of tests for which User management is handled by an external server such as LDAP or Crowd.All remove/create User calls can be made to that server in one batch, and then the Confluence instance data can be cleaned up. Generally this will take part in three stages:
1. Clean up requiring the 'old' users, groups and memberships to exist (e.g. personal spaces, permissions) 2. Sync with the external server, which will reset the user, groups and memberships 3. Perform any other clean-up required, from removing spaces to flushing caches.
see ServerStateManager.removeTestData()
- Throws:
Exception
-
removeAllSpaces
Kill all the spaces and flush all the queues and caches.- Throws:
RemoteException
-
createTemplate
String createTemplate(String token, String templateName, String content, String spaceKey) throws RemoteException, XhtmlException Create a new template. If spaceKey is not defined, a global template will be created.- Returns:
- template id
- Throws:
RemoteException
XhtmlException
-
getGlobalPermissionsForGroup
Gets the global permissions that the given group has.- Throws:
RemoteException
-
pauseCrowdSyncJobs
-
disconnectUser
Disconnect a user from Confluence. Removes all their permissions, group memberships, their profile information and their personal space.- Throws:
RemoteException
-
disconnectGroup
Disconnect a group from Confluence. Removes all its permissions.- Throws:
RemoteException
-
massCreateAttachments
boolean massCreateAttachments(String token, String pageId, String prefix, String numAttachments) throws Exception Create a whole series of attachments on a single page.- Throws:
Exception
-
clearCustomHtml
Clears the global custom html.- Returns:
- true always.
- Throws:
Exception
-
disablePluginWithoutPersisting
Disable a plugin without persisting.- Returns:
- true because a return type is required by XMLRPC
- Throws:
NotPermittedException
-
isSpringComponentPresent
Returns true if a Spring component with the given name exists in the application context. -
isPluginUpgradeTasksComplete
Returns true if the plugin dependent upgrade tasks -
waitForEvent
boolean waitForEvent(String token, String eventClassName, String timeout, String timeUnit) throws Exception Waits for an event to occur and returns when it has finished.- Parameters:
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
- SeeTimeUnit.name
- Returns:
- true if the event occurs within the timeout.
- Throws:
Exception
-
waitForEventQueue
Waits for all events in queue to be processed.- Returns:
- true if queue was exhausted, false on timeout or any error.
- Throws:
Exception
-
getContentPropertyKeys
-
getContentStringProperty
Get the content property string value (in OS_PROPERTYENTRY) for a content entity given its id and property key- Parameters:
token
-entityId
- the ID of the content object this property is stored againstkey
- the entity key of the property being stored- Returns:
- The string value of the property (or an empty string if no property was found)
-
getContentPropertiesString
Get the string value of aContentProperty
associated with a content entity given its id and the property name -
getContentPropertiesStringForSpace
Get the string value of aContentProperty
associated with theSpaceDescription
of the space -
setContentStringProperty
Set the content property string value (in OS_PROPERTYENTRY) for a content entity given its id, property key and value- Parameters:
token
-entityId
- the ID of the content object this property is stored againstkey
- the entity key of the property being storedvalue
- the string value of the property to set
-
setContentPropertiesString
Sets the string value of aContentProperty
associated with a content entity given its id and the property name -
setContentPropertiesStringForSpace
Sets the string value of aContentProperty
associated with theSpaceDescription
of the space -
getPersonalInformationId
Gets the personal information id for a given username -
removePersonalInformation
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).- Parameters:
username
- user whose personalInformation will be removed- Returns:
- true because it has to return something
- Throws:
NotPermittedException
-
getLocaleForUser
Gets the locale preference for the user. -
setLocaleForUser
Sets the locale preference for the user to the given named locale.- Throws:
RemoteException
-
setGlobalLanguage
Changes to the default site language- Throws:
RemoteException
-
setIndexingLanguage
Changes the indexing language- Throws:
RemoteException
-
setWatchOwnContentPref
boolean setWatchOwnContentPref(String token, String username, String enabled) throws RemoteException Enables/Disables autowatching for the given uesr- Throws:
RemoteException
-
setWatchSpaces
boolean setWatchSpaces(String token, String username, String contentTypeStr, Hashtable spaces) throws RemoteException Enables/Disables watching spaces for the given user and content type.- Throws:
RemoteException
-
setWatchSpace
boolean setWatchSpace(String token, String username, String spaceKey, String contentType, String enabled) throws RemoteException Enables/Disables watching a space for the given user and content type.- Throws:
RemoteException
-
setUserDetails
boolean setUserDetails(String token, String username, String fullName, String email) throws RemoteException Sets the fullname and email address of a user with a given username.- Returns:
- true because XMLRPC methods have to return something
- Throws:
RemoteException
- if the user was not found.
-
enableWebSudo
Sets the web sudo enabled status- Returns:
- true because void isn't allowed.
- Throws:
Exception
-
setWebSudoTimeout
Sets the web sudo timeout in minutes- Returns:
- true because void isn't allowed.
- Throws:
Exception
-
enableElevatedSecurityCheck
- Throws:
Exception
-
startActivity
Call startActivity on the heartbeat manager bean- Parameters:
token
- rpc authentication tokenkey
- the activity key to startuser
- the username of the user starting the activity- Returns:
- true if executes start activity without error.
- Throws:
Exception
-
stopActivity
Call stopActivity on the heartbeatManager bean- Parameters:
token
- rpc authentication tokenkey
- the activity key to stopuser
- the username of the user stopping the activity- Throws:
Exception
-
removeUserUncleanly
Remove a User without removing the things that refer to that user.- Throws:
Exception
-
removeGroupUncleanly
Remove a Group without removing the things that refer to that group.- Throws:
Exception
-
doesDraftExist
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.- Parameters:
token
- rpc authentication tokencontentId
- id of the content this draft is for ('0' for new content)owner
- owner/author of the draftdraftType
- type of content this draft is forspaceKey
- 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
-
countDrafts
-
createDraft
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.- Parameters:
token
- rpc authentication tokendraft
- 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()
orPage.getType()
."title"
- title of the draft."content"
- content of the draft as aString
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
.
-
removeDrafts
Removes all drafts owned by the specified User.- Parameters:
token
- rpc authentication tokenusername
- user to remove drafts for- Returns:
- true if this is successful, false if no user with this name.
-
clearQueue
Removes all items from the specified queue- Returns:
- true if this is successful, false if no queue with this name exists
-
getQueueSize
Returns the size of the task queue with the specified name.- Returns:
- the size of the task queue with the specified name.
-
removeMailServer
Remove the named mail server.- Parameters:
token
- the rpc authentication tokenserverName
- 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
-
getRecentTestAppenderLogMessages
-
registerTestAppenderForClass
-
unregisterTestAppenderForClass
-
logTestMessageForClass
-
getLocalisedText
Get the localised string for given the message key in the logged-in user's locale.- Parameters:
token
- the rpc authentication tokenmessageKey
- 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.
-
addUserAnyCase
boolean addUserAnyCase(String token, String username, String email, String fullname, String password) throws RemoteException 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.- Throws:
NotPermittedException
- if you do not have permissions to add the user.RemoteException
-
addGroupAnyCase
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.- Parameters:
groupname
- the name of the group to add- Returns:
- true if successfully added, otherwise false
- Throws:
RemoteException
-
changeSpaceCreatedDate
boolean changeSpaceCreatedDate(String token, String spaceKey, Date createdDate) throws RemoteException Change the created date of a space- Parameters:
spaceKey
- the space key of the space to change the created date- Throws:
RemoteException
-
changeCommentCreatedDate
boolean changeCommentCreatedDate(String token, String commentId, Date createdDate) throws RemoteException Change the created date of a comment- Throws:
RemoteException
-
changePageCreatedDate
Change the created date of a page- Parameters:
pageId
- the page id of the page to change the created date- Throws:
RemoteException
-
removeAttachmentUncleanly
boolean removeAttachmentUncleanly(String token, String contentId, String attachmentFileName) throws RemoteException Removes an attachment without cleaning up associated attachment info- Parameters:
token
- the authenticationcontentId
- the content that the attachment is attached toattachmentFileName
- the attachment- Returns:
- true
- Throws:
RemoteException
-
changeAttachmentCreatedDate
boolean changeAttachmentCreatedDate(String token, String contentId, String attachmentFileName, Date createdDate) throws RemoteException Change the created date of an attachment- Parameters:
contentId
- the id of the page or blogpost the attachment is attached toattachmentFileName
- the attachment file name of the attachment to change the created date- Throws:
RemoteException
-
changePageModificationDate
boolean changePageModificationDate(String token, String pageId, Date modificationDate) throws RemoteException Change the modification date of a page- Parameters:
pageId
- the page id of the page to change the modification datemodificationDate
- the last modification date to be set.- Throws:
RemoteException
-
getVersionForPage
Get the version number for the page with pageId- Throws:
RemoteException
-
saveDateFormat
-
saveDateTimeFormat
-
getDateTimeFormat
Get current DateTime format- Since:
- 7.14
-
addSmtpServer
-
setSmtpServer
boolean setSmtpServer(String token, String name, String from, String subjectPrefix, String hostname, int port, String fromName) Remove all existing SMTP servers and add the given server. -
addMailServer
boolean addMailServer(String token, String serverName, String protocol, String hostname, int port, String username, String password, String toAddress) Add a POP server to poll for emails in a particular account. The account's associated email address must also be passed. -
createJohnsonEvent
Creates a Johnson event inside Confluence. This method is used to test theConfluenceJohnsonFilter
.- Parameters:
message
- the description of the event to create
-
removeAllJohnsonEvents
Removes all Johnson events from Confluence -
enableCaptcha
Sets the captcha mode -
enableCaptchaDebugMode
Sets the captcha mode into debug mode. SeeCaptchaManager.setDebugMode(boolean)
. -
getSystemProperty
Retrieve the value of a system property. The property is returned as a map of the property key to its value, as XML-RPC doesn't support nulls and it's reasonably important to be able to tell if the property is set.- Parameters:
name
- the name of the property- Returns:
- a hash mapping the requested key to its value, if the property is set. Otherwise an empty map.
-
setSystemProperty
Set a system property on the server to the supplied value.- Parameters:
name
- the name of the propertyvalue
- the value of the property- Returns:
- always true since XML RPC can't handle void
-
clearSystemProperty
Unset a system property.- Parameters:
name
- the name of the property- Returns:
- always true since XML RPC can't handle void
-
clearIndex
Blows away the main Confluence search index. -
restoreAbstractPage
Restores an abstract page from the trash. -
getIdOfPagePermission
String getIdOfPagePermission(String token, String contentId, String permissionType, String username) - Returns:
- the id of the identified content permission or 0 if there is no match found.
-
createTestUsers
Create test users with usernames "testuser0", "testuser1", etc. Each user's password is the same as their username.- Returns:
- the number of users created
-
removeTestUsers
Removes test users with usernames "testuser0", "testuser1", etc. Logs a warning if a user cannot be removed.- Returns:
- the number of users removed
-
createUserMacro
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 Create a User Macro- Parameters:
bodyType
- how the body should be treated."raw"
,"escapehtml"
, or"rendered"
. May be null only ifhasBody
is false.outputType
- whether the macro is expected to return html or wiki markup."html"
or"wiki"
.template
- the velocity rendered by the macrotitle
- the title of the macro that appears in the Macro Browserdescription
- the description of the macro that appears in the Macro Browsercategory
- the category the macro should be listed under in the Macro BrowsericonUrl
- the URL of the macro icon that appears in the Macro BrowserdocumentationUrl
- the URL of the macro documentationhidden
- 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:
RuntimeException
- if the macro already existsNotPermittedException
-
removeUserMacro
Remove a User Macro with the given name if it exists.- Returns:
- true all the time because XMLRPC methods need a non-void return type.
- Throws:
NotPermittedException
-
registerEventListener
Registers a temporary event listener on the server to listen for the specified event. It is recommended that clients also unregister the event listener usingunregisterEventListener(String, String)
in a finally clause to ensure the temporary listener is cleaned up.Once the listener is registered, clients can use
waitForEvent(String, String, String, String)
to block until the event is published.- Throws:
Exception
-
unregisterEventListener
Unregisters the temporary listener registered for the specified event.- Throws:
Exception
-
clearEventListeners
Removes all temporary event listeners, regardless of their state.- Returns:
- true because some result is required.
- Throws:
Exception
-
setApplicationConfigProperty
Sets a property on the globalApplicationConfiguration
instance.- Returns:
- the previous value of the property
-
getApplicationConfigProperty
Returns a property of the globalApplicationConfiguration
instance.- Parameters:
propertyKey
-- Returns:
- the property mapped to
propertyKey
-
followUser
Follows or stops following a user. Can be done by any user, not just admins.- Parameters:
followUser
- true to follow a user, false to stop following- Throws:
RemoteException
-
storeXhtmlPage
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.- Parameters:
token
-pageStruct
-- Returns:
- the created page
- Throws:
RemoteException
-
synchroniseUserDirectories
Synchronizes all remote user directories with the local database cache- Returns:
- true
- Throws:
Exception
-
setDirectoryPasswordEncoder
boolean setDirectoryPasswordEncoder(String token, String directoryName, String encoder) throws Exception Changes the password encoder for the given directory- Returns:
- true
- Throws:
Exception
-
removeUserDirectory
Removes user directory- Parameters:
directoryId
- the id of the directory- Returns:
- true if the directory existed and was removed
- Throws:
Exception
-
addExistingProfilePicture
Attempts to add a existing profile picture to a user's profile.- Parameters:
userName
- the user name of the profilefileName
- file name of the picture- Returns:
- true if the picture is successfully added
- Throws:
Exception
-
setBooleanUserPreference
boolean setBooleanUserPreference(String token, String userName, String preferenceKey, String value) throws RemoteException Sets a boolean user preference.- Parameters:
userName
- the user name to set the preference forpreferenceKey
- the key of the preference to setvalue
- the string "true" or "false" to set as the preference- Throws:
RemoteException
-
setStringUserPreference
boolean setStringUserPreference(String token, String userName, String preferenceKey, String value) throws RemoteException Sets a string user preference.- Parameters:
userName
- the user name to set the preference forpreferenceKey
- the key of the preference to setvalue
- a string to set as the preference- Throws:
RemoteException
-
enableDailyReportNotification
Sets the Daily Report email for a user to enabled or disabled.- Parameters:
userName
- the user name to set the report state fordailyReportEnabled
- true if the daily report should be sent, false if not
-
setNetworkNotificationForUser
Sets Network watch emails for a user to enabled or disabled.- Parameters:
userName
- the user name to set the watch state forwatchNetwork
- true if the user should watch their network, false if not
-
setSiteBlogNotificationForUser
boolean setSiteBlogNotificationForUser(String token, String userName, boolean globalBlogWatchForUser) Sets Site Blog watch emails for a user to enabled or disabled.- Parameters:
userName
- the user name to set the watch state forglobalBlogWatchForUser
- true if the user should watch all blogs on the site network, false if not
-
getIgnoreBaseURLWarning
Whether the warning message for an un-advisable value for the Base URL is ignored or not.- Returns:
- true if the warning message is ignored.
-
setIgnoreBaseURLWarning
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.- Parameters:
value
- set to true to ignore the warning.- Throws:
RemoteException
-
setWelcomeMessage
-
resetWelcomeMessage
-
createPagesFromPrototype
Vector<Hashtable> createPagesFromPrototype(String token, Hashtable pageStruct, int count) throws RemoteException Creates a series of pages based on a prototype. Each page will have the same parent and content, and the title will be that of the template plus a space and an index.e.g. if the page title passed is "Hey Ho", the created pages will be "Hey Ho 1", "Hey Ho 2" and so on.
- Parameters:
pageStruct
- a template page to create multiple pages fromcount
- the number of pages to create - pages created are 1-indexed- Throws:
RemoteException
-
updateGlobalSettingBoolean
Update aSettings
boolean field.- Parameters:
token
-name
- name of the field used to store the setting (see field names insideSettings
.value
-- Returns:
- the old value
- Throws:
RemoteException
-
updateGlobalSettingString
Update aSettings
String field.- Parameters:
name
- name of the field used to store the setting (see field names insideSettings
.value
- theString
value the field should take- Returns:
- the old value
- Throws:
RemoteException
-
createSpaces
Creates a bunch of spaces.- Parameters:
count
- the number to create- Returns:
- the keys of the spaces created
- Throws:
RemoteException
- if you are not awesome enough to use this method
-
getNumberOfActiveUsers
Returns the number of active users, i.e. the number of users used for license purposes.- Returns:
- the number of active users
- Throws:
RemoteException
-
getExportBuildNumber
Returns the backward-compatibility of an export- Parameters:
token
- the authentication- Returns:
- the build number
-
getOldestSpaceImportAllowed
Returns the backwards-compatibility of a space import- Parameters:
token
- the authentication- Returns:
- the oldest build number allowed
-
getPluginExportCompatibility
Returns the plugin compatibility matrix for exports- Parameters:
token
- the authenticationpluginKey
- the plugin key- Returns:
- a version range in the form "4.3..5.0", separated by 2 dots, or null
-
isUnlimitedUserLicense
- Returns:
- true if the current licence has no user limit, false otherwise
- Throws:
RemoteException
-
getAliveThreads
- Throws:
RemoteException
-
setEnableAnonymousRpc
Toggle the setting to allow/deny anonymous RPC calls. You will also need to enable anonymous access at the permissions level using the Admin RPC interface.- Throws:
RemoteException
-
getContentForAllLabels
Hashtable<String,Object> getContentForAllLabels(String token, int offset, int maxResults, String labels) Returns CEOs having all of the labels supplied in the string. Labels are space-separated. -
getContentInSpacesForAllLabels
Hashtable<String,Object> getContentInSpacesForAllLabels(String token, int offset, int maxResults, String spaceKeysString, String labelsString) Returns CEOs in the given spaces having all of the labels supplied in the string. Labels and space keys are space-separated. -
getAllContentForAllLabels
Hashtable<String,Object> getAllContentForAllLabels(String token, int offset, int maxResults, String labelsString) Returns current and trashed CEOs having all of the labels supplied in the string. Labels are space-separated. -
getForLabels
Hashtable<String,Object> getForLabels(String token, String labelableType, int offset, int maxResults, String labelsString) Returns any kind of Labelable entities having all of the labels supplied in the string. Labels are space-separated. -
addLabelToLabelable
Adds a label to a labelable, because the public RPC API doesn't let you do it. Feel free to turn it all into REST to make the pain go away. -
startLoggingRequests
Start logging http request urls.Call
finishLoggingRequests(String)
to stop logging and to retrieve results.- Returns:
- true
-
finishLoggingRequests
Finish logging http request and return any requests made.Logging must have been previously started using
startLoggingRequests(String)
.- Returns:
- url of each request made
-
isImportTaskRunning
-
getAnonyimizedClusterNodeIdentifier
-
assertThatIndexQueueEntryHasBeenProcessed
boolean assertThatIndexQueueEntryHasBeenProcessed(String token, String searchableClassname, String searchableId) throws RemoteException - Throws:
RemoteException
-
increaseHighValue
Put a number bigger than 65535 in Hibernate_unique_key table to force generated ids to be greater than max integer.- Parameters:
token
- the rpc authentication token- Returns:
- true if successful.
-
getRecordedErrorLogMessages
-
clearRecordedLogMessages
-
setHibernateConnectionProviderLastExceptionTime
-
clearHibernateConnectionProviderLastExceptionTime
-
addInboundWhitelistDomain
-
removeInboundWhitelistDomain
-
checkIfMappingPresent
-