Class SoapServiceHelperImpl
- java.lang.Object
-
- com.atlassian.confluence.rpc.soap.services.SoapServiceHelperImpl
-
- All Implemented Interfaces:
SoapServiceHelper
public class SoapServiceHelperImpl extends Object implements SoapServiceHelper
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentEntityManager
contentEntityManager
protected PageManager
pageManager
protected PermissionManager
permissionManager
protected SpaceManager
spaceManager
protected UserAccessor
userAccessor
protected WebSudoManager
webSudoManager
-
Constructor Summary
Constructors Constructor Description SoapServiceHelperImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertCanAdminister()
void
assertCanAdminister(Space space)
void
assertCanCreateBlogPost(Space space)
void
assertCanCreatePage(Space space)
void
assertCanExport(Space space)
void
assertCanModify(AbstractPage page)
void
assertCanModifyObject(Object obj, String typeDescription)
Determines if the current user can modify/edit the given objectvoid
assertCanRemove(AbstractPage page)
Throw an exception if the user can't remove the given page.void
assertCanView(AbstractPage page)
void
assertCanView(Space space)
void
assertHasValidWebSudoSession()
AbstractPage
retrieveAbstractPage(long abstractPageId)
Retrieves a given page, and throws RemoteException if the page is not found or the user has no view perm.ContentEntityObject
retrieveContent(long contentId)
Retrieves the content with the given ID, throwing an exception if the content can not be found, or the current user has not permission to view it.Page
retrievePage(String spaceKey, String pageTitle)
Retrieves a given page by space key and page title, and throws RemoteException if the page is not found or the user has no view perm.Space
retrieveSpace(String spaceKey)
Retrieves a given space, and throws RemoteException if the space is not found or the user has no view perm.ConfluenceUser
retrieveUser(String username)
Retrieves the user with the given usernamevoid
setContentEntityManager(ContentEntityManager contentEntityManager)
void
setPageManager(PageManager pageManager)
void
setPermissionManager(PermissionManager permissionManager)
void
setSpaceManager(SpaceManager spaceManager)
void
setUserAccessor(UserAccessor userAccessor)
void
setWebSudoManager(WebSudoManager webSudoManager)
-
-
-
Field Detail
-
spaceManager
protected SpaceManager spaceManager
-
permissionManager
protected PermissionManager permissionManager
-
pageManager
protected PageManager pageManager
-
userAccessor
protected UserAccessor userAccessor
-
contentEntityManager
protected ContentEntityManager contentEntityManager
-
webSudoManager
protected WebSudoManager webSudoManager
-
-
Method Detail
-
setWebSudoManager
public void setWebSudoManager(WebSudoManager webSudoManager)
-
setUserAccessor
public void setUserAccessor(UserAccessor userAccessor)
-
setSpaceManager
public void setSpaceManager(SpaceManager spaceManager)
-
setPageManager
public void setPageManager(PageManager pageManager)
-
setPermissionManager
public void setPermissionManager(PermissionManager permissionManager)
-
setContentEntityManager
public void setContentEntityManager(ContentEntityManager contentEntityManager)
-
retrieveContent
public ContentEntityObject retrieveContent(long contentId) throws RemoteException
Description copied from interface:SoapServiceHelper
Retrieves the content with the given ID, throwing an exception if the content can not be found, or the current user has not permission to view it.- Specified by:
retrieveContent
in interfaceSoapServiceHelper
- Parameters:
contentId
- the ID of the content to retrieve- Returns:
- the associated content object
- Throws:
RemoteException
- if the user lacks VIEW permission or the content does not exist
-
retrieveSpace
public Space retrieveSpace(String spaceKey) throws RemoteException
Retrieves a given space, and throws RemoteException if the space is not found or the user has no view perm.- Specified by:
retrieveSpace
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
retrieveAbstractPage
public AbstractPage retrieveAbstractPage(long abstractPageId) throws RemoteException
Retrieves a given page, and throws RemoteException if the page is not found or the user has no view perm.- Specified by:
retrieveAbstractPage
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
retrievePage
public Page retrievePage(String spaceKey, String pageTitle) throws RemoteException
Retrieves a given page by space key and page title, and throws RemoteException if the page is not found or the user has no view perm.- Specified by:
retrievePage
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
retrieveUser
public ConfluenceUser retrieveUser(String username) throws RemoteException
Description copied from interface:SoapServiceHelper
Retrieves the user with the given username- Specified by:
retrieveUser
in interfaceSoapServiceHelper
- Parameters:
username
- the username of the user- Returns:
- The User instance corresponding to the user
- Throws:
RemoteException
- if the username is empty or null
-
assertCanView
public void assertCanView(AbstractPage page) throws RemoteException
- Specified by:
assertCanView
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanView
public void assertCanView(Space space) throws RemoteException
- Specified by:
assertCanView
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanModifyObject
public void assertCanModifyObject(Object obj, String typeDescription) throws NotPermittedException
Description copied from interface:SoapServiceHelper
Determines if the current user can modify/edit the given objectIf the current user is a super-user, they will automatically pass this test
- Specified by:
assertCanModifyObject
in interfaceSoapServiceHelper
- Parameters:
obj
- the target objecttypeDescription
- the type of object (e.g. "labels")- Throws:
NotPermittedException
- if the user lacks EDIT permission
-
assertCanCreatePage
public void assertCanCreatePage(Space space) throws RemoteException
- Specified by:
assertCanCreatePage
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanCreateBlogPost
public void assertCanCreateBlogPost(Space space) throws RemoteException
- Specified by:
assertCanCreateBlogPost
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanModify
public void assertCanModify(AbstractPage page) throws RemoteException
- Specified by:
assertCanModify
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanRemove
public void assertCanRemove(AbstractPage page) throws RemoteException
Throw an exception if the user can't remove the given page.- Specified by:
assertCanRemove
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanAdminister
public void assertCanAdminister() throws RemoteException
- Specified by:
assertCanAdminister
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertHasValidWebSudoSession
public void assertHasValidWebSudoSession() throws RemoteException
- Specified by:
assertHasValidWebSudoSession
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanExport
public void assertCanExport(Space space) throws RemoteException
- Specified by:
assertCanExport
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
assertCanAdminister
public void assertCanAdminister(Space space) throws RemoteException
- Specified by:
assertCanAdminister
in interfaceSoapServiceHelper
- Throws:
RemoteException
-
-