public class DefaultDataSourceFactory extends Object implements DataSourceFactory, org.springframework.web.context.ServletContextAware
Modifier and Type | Class and Description |
---|---|
static class |
DefaultDataSourceFactory.NamedDataSource |
Constructor and Description |
---|
DefaultDataSourceFactory(UserAccessor userAccessor,
AttachmentManager attachmentManager,
FileTypeMap fileTypeMap,
ThumbnailManager thumbnailManager,
com.atlassian.plugin.PluginAccessor pluginAccessor,
SpaceLogoManager spaceLogoManager) |
Modifier and Type | Method and Description |
---|---|
com.atlassian.fugue.Maybe<PluginDataSourceFactory> |
forPlugin(String pluginKey)
Create a factory for a specific plugin.
|
DataSource |
getAvatar(com.atlassian.user.User user)
Construct a DataSource for a user's profile picture.
|
DataSource |
getDatasource(Attachment attachment,
boolean useThumbnail) |
DataSource |
getServletContainerResource(String path,
String name) |
DataSource |
getSpaceLogo(Space space)
Encapsulates the logo for the given
Space in a DataSource . |
DataSource |
getURLResource(URL url,
String name)
//TODO caching datasource
|
void |
setServletContext(javax.servlet.ServletContext servletContext) |
public DefaultDataSourceFactory(UserAccessor userAccessor, AttachmentManager attachmentManager, FileTypeMap fileTypeMap, ThumbnailManager thumbnailManager, com.atlassian.plugin.PluginAccessor pluginAccessor, SpaceLogoManager spaceLogoManager)
public DataSource getAvatar(com.atlassian.user.User user)
DataSourceFactory
getAvatar
in interface DataSourceFactory
user
- The user to retrieve the avatar for. If null, "Anonymous" will be assumed.public DataSource getSpaceLogo(Space space)
DataSourceFactory
Space
in a DataSource
.getSpaceLogo
in interface DataSourceFactory
space
- the space to retrieve the logo forDataSource
encapsulating the ...
Space
if configured
Space
logo if configured
Space
logo, SpaceLogo.DEFAULT_LOGO_PATH
DataSource.getName()
will return "<spacekey>-space-logo"public DataSource getServletContainerResource(String path, String name)
getServletContainerResource
in interface DataSourceFactory
path
- a path that must begin with a "/" and is interpreted as relative to the current context rootname
- a custom name for the DataSource that will be returned.public DataSource getDatasource(Attachment attachment, boolean useThumbnail) throws IOException
getDatasource
in interface DataSourceFactory
IOException
public DataSource getURLResource(URL url, String name)
getURLResource
in interface DataSourceFactory
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public com.atlassian.fugue.Maybe<PluginDataSourceFactory> forPlugin(String pluginKey)
DataSourceFactory
Allows the creation of DataSources
from <resource> descriptors.
forPlugin
in interface DataSourceFactory
pluginKey
- the key used to locate the pluginCopyright © 2003–2015 Atlassian. All rights reserved.