com.atlassian.gadgets.publisher.internal.impl
Class PublishedGadgetSpecStore
java.lang.Object
com.atlassian.gadgets.publisher.internal.impl.PublishedGadgetSpecStore
- All Implemented Interfaces:
- com.atlassian.gadgets.GadgetSpecProvider, com.atlassian.gadgets.LocalGadgetSpecProvider, com.atlassian.gadgets.plugins.PluginGadgetSpecEventListener, PublishedGadgetSpecWriter, com.atlassian.sal.api.lifecycle.LifecycleAware
public class PublishedGadgetSpecStore
- extends Object
- implements com.atlassian.gadgets.LocalGadgetSpecProvider, com.atlassian.gadgets.plugins.PluginGadgetSpecEventListener, PublishedGadgetSpecWriter, com.atlassian.sal.api.lifecycle.LifecycleAware
A fairly naive implementation that processes gadget spec file and substitutes values into it on the fly.
PublishedGadgetSpecStore
public PublishedGadgetSpecStore(GadgetSpecUrlBuilder urlBuilder,
GadgetSpecValidator validator,
GadgetProcessor gadgetProcessor,
@Qualifier(value="aggregatePermissions")
com.atlassian.gadgets.publisher.spi.PluginGadgetSpecProviderPermission permission,
com.atlassian.sal.api.ApplicationProperties applicationProperties)
onStart
public void onStart()
- Once the plugin system is fully started, we can process the gadgets, as all the plugins they depend upon will
have been loaded.
- Specified by:
onStart in interface com.atlassian.sal.api.lifecycle.LifecycleAware
contains
public boolean contains(URI gadgetSpecUri)
- Specified by:
contains in interface com.atlassian.gadgets.GadgetSpecProvider
entries
public Iterable<URI> entries()
- Specified by:
entries in interface com.atlassian.gadgets.GadgetSpecProvider
writeGadgetSpecTo
public void writeGadgetSpecTo(String pluginKey,
String location,
OutputStream output)
throws IOException
- Description copied from interface:
PublishedGadgetSpecWriter
- Writes the gadget spec from the specified plugin, with the specified resource location within the plugin, to the
specified
OutputStream. Output will be buffered internally, so there is no need for the calling code to
wrap the OutputStream with a BufferedOutputStream.
- Specified by:
writeGadgetSpecTo in interface PublishedGadgetSpecWriter
- Parameters:
pluginKey - the plugin key of the Plugin that contains the gadget spec to
store. Must not be null, or a NullPointerException will be thrown.location - the location of the gadget spec XML file resource within the plugin. Must not be null, or a NullPointerException will be thrown.output - the OutputStream to write the gadget spec XML to. Must not be null, or a
NullPointerException will be thrown.
- Throws:
IOException - if an error occurs in I/O processing
writeGadgetSpecTo
public void writeGadgetSpecTo(URI gadgetSpecUri,
OutputStream output)
throws IOException
- Specified by:
writeGadgetSpecTo in interface com.atlassian.gadgets.LocalGadgetSpecProvider
- Throws:
IOException
getLastModified
public Date getLastModified(URI gadgetSpecUri)
- Specified by:
getLastModified in interface com.atlassian.gadgets.LocalGadgetSpecProvider
pluginGadgetSpecEnabled
public void pluginGadgetSpecEnabled(com.atlassian.gadgets.plugins.PluginGadgetSpec pluginGadgetSpec)
throws com.atlassian.gadgets.GadgetParsingException
- Specified by:
pluginGadgetSpecEnabled in interface com.atlassian.gadgets.plugins.PluginGadgetSpecEventListener
- Throws:
com.atlassian.gadgets.GadgetParsingException
pluginGadgetSpecDisabled
public void pluginGadgetSpecDisabled(com.atlassian.gadgets.plugins.PluginGadgetSpec pluginGadgetSpec)
- Specified by:
pluginGadgetSpecDisabled in interface com.atlassian.gadgets.plugins.PluginGadgetSpecEventListener
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2013 Atlassian. All Rights Reserved.