com.atlassian.gadgets.directory.internal.impl
Class PluginExternalGadgetSpecDirectoryEntryProvider

java.lang.Object
  extended by com.atlassian.gadgets.directory.internal.impl.AbstractDirectoryEntryProvider<URI>
      extended by com.atlassian.gadgets.directory.internal.impl.PluginExternalGadgetSpecDirectoryEntryProvider
All Implemented Interfaces:
DirectoryEntryProvider, PluginGadgetSpecEventListener

public class PluginExternalGadgetSpecDirectoryEntryProvider
extends AbstractDirectoryEntryProvider<URI>
implements PluginGadgetSpecEventListener

A DirectoryEntryProvider for external gadget specs provided by plugins.


Constructor Summary
PluginExternalGadgetSpecDirectoryEntryProvider(GadgetSpecFactory gadgetSpecFactory)
          Creates a new instance that uses the specified GadgetSpecFactory to retrieve and parse gadget specs.
 
Method Summary
 boolean contains(URI gadgetSpecUri)
           
protected  com.google.common.base.Function<URI,Directory.Entry> convertToLocalizedDirectoryEntry(GadgetRequestContext gadgetRequestContext)
           
protected  Iterable<URI> internalEntries()
           
 void pluginGadgetSpecDisabled(PluginGadgetSpec pluginGadgetSpec)
           
 void pluginGadgetSpecEnabled(PluginGadgetSpec pluginGadgetSpec)
           
 String toString()
           
 
Methods inherited from class com.atlassian.gadgets.directory.internal.impl.AbstractDirectoryEntryProvider
entries, getGadgetSpec, stripNulls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginExternalGadgetSpecDirectoryEntryProvider

public PluginExternalGadgetSpecDirectoryEntryProvider(GadgetSpecFactory gadgetSpecFactory)
Creates a new instance that uses the specified GadgetSpecFactory to retrieve and parse gadget specs.

Parameters:
gadgetSpecFactory - the GadgetSpecFactory to use to retrieve and parse gadget specs. Must not be null or a NullPointerException will be thrown.
Method Detail

contains

public boolean contains(URI gadgetSpecUri)
Specified by:
contains in interface DirectoryEntryProvider
Parameters:
gadgetSpecUri - uri of the gadget spec to check if it's in the directory
Returns:
true if the gadget spec at the location specificied by the uri is in the directory, false otherwise

pluginGadgetSpecEnabled

public void pluginGadgetSpecEnabled(PluginGadgetSpec pluginGadgetSpec)
                             throws GadgetParsingException
Specified by:
pluginGadgetSpecEnabled in interface PluginGadgetSpecEventListener
Throws:
GadgetParsingException

pluginGadgetSpecDisabled

public void pluginGadgetSpecDisabled(PluginGadgetSpec pluginGadgetSpec)
Specified by:
pluginGadgetSpecDisabled in interface PluginGadgetSpecEventListener

internalEntries

protected Iterable<URI> internalEntries()
Specified by:
internalEntries in class AbstractDirectoryEntryProvider<URI>

convertToLocalizedDirectoryEntry

protected com.google.common.base.Function<URI,Directory.Entry> convertToLocalizedDirectoryEntry(GadgetRequestContext gadgetRequestContext)
Specified by:
convertToLocalizedDirectoryEntry in class AbstractDirectoryEntryProvider<URI>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 Atlassian. All Rights Reserved.