|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.publisher.internal.impl.PublishedGadgetSpecStoreImpl
public class PublishedGadgetSpecStoreImpl
A fairly naive implementation that processes gadget spec file and substitutes values into it on the fly.
Constructor Summary | |
---|---|
PublishedGadgetSpecStoreImpl(GadgetSpecUrlBuilder urlBuilder,
GadgetSpecValidator validator,
GadgetProcessor gadgetProcessor,
PluginGadgetSpecProviderPermission permission,
com.atlassian.sal.api.ApplicationProperties applicationProperties)
|
Method Summary | |
---|---|
boolean |
contains(URI gadgetSpecUri)
Returns true if the URI is in the store, false otherwise. |
Iterable<URI> |
entries()
Returns all the gadget URIs contained by this store. |
Date |
getLastModified(URI gadgetSpecUri)
Return the date the gadget spec was last modified. |
void |
pluginGadgetSpecDisabled(PluginGadgetSpec pluginGadgetSpec)
Called when a gadget spec is disabled from a plugin. |
void |
pluginGadgetSpecEnabled(PluginGadgetSpec pluginGadgetSpec)
Called when a gadget spec is enabled from a plugin. |
String |
toString()
|
void |
writeGadgetSpecTo(String pluginKey,
String location,
OutputStream output)
Writes the gadget spec from the specified plugin, with the specified resource location within the plugin, to the specified OutputStream . |
void |
writeGadgetSpecTo(URI gadgetSpecUri,
OutputStream output)
Writes the gadget spec found at the specified URI, to the specified OutputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PublishedGadgetSpecStoreImpl(GadgetSpecUrlBuilder urlBuilder, GadgetSpecValidator validator, GadgetProcessor gadgetProcessor, PluginGadgetSpecProviderPermission permission, com.atlassian.sal.api.ApplicationProperties applicationProperties)
Method Detail |
---|
public boolean contains(URI gadgetSpecUri)
GadgetSpecProvider
true
if the URI is in the store, false
otherwise.
contains
in interface GadgetSpecProvider
gadgetSpecUri
- URI to check is in the store
true
if the URI is in the store, false
otherwisepublic Iterable<URI> entries()
GadgetSpecProvider
entries
in interface GadgetSpecProvider
public void writeGadgetSpecTo(String pluginKey, String location, OutputStream output) throws IOException
PublishedGadgetSpecWriter
OutputStream
. Output will be buffered internally, so there is no need for the calling code to
wrap the OutputStream
with a BufferedOutputStream
.
writeGadgetSpecTo
in interface PublishedGadgetSpecWriter
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.
IOException
- if an error occurs in I/O processingpublic void writeGadgetSpecTo(URI gadgetSpecUri, OutputStream output) throws IOException
LocalGadgetSpecProvider
OutputStream
. It is assumed that the
caller has already checked that the URI is provided by this provider by calling the GadgetSpecProvider.contains(java.net.URI)
method. If not, this method will throw a com.atlassian.gadgets.GadgetSpecUriNotAllowedException
.
writeGadgetSpecTo
in interface LocalGadgetSpecProvider
gadgetSpecUri
- URI of the gadget spec to write. 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.
IOException
- if an error occurs in I/O processingpublic Date getLastModified(URI gadgetSpecUri)
LocalGadgetSpecProvider
getLastModified
in interface LocalGadgetSpecProvider
public void pluginGadgetSpecEnabled(PluginGadgetSpec pluginGadgetSpec) throws GadgetParsingException
PluginGadgetSpecEventListener
pluginGadgetSpecEnabled
in interface PluginGadgetSpecEventListener
pluginGadgetSpec
- the gadget spec that was enabled. Must not be null
, or a NullPointerException
will be thrown.
GadgetParsingException
public void pluginGadgetSpecDisabled(PluginGadgetSpec pluginGadgetSpec)
PluginGadgetSpecEventListener
pluginGadgetSpecDisabled
in interface PluginGadgetSpecEventListener
pluginGadgetSpec
- the gadget spec that was enabled. Must not be null
, or a NullPointerException
will be thrown.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |