com.atlassian.gadgets.directory.internal.impl
Class ConfigurableExternalGadgetSpecDirectoryEntryProvider
java.lang.Object
com.atlassian.gadgets.directory.internal.impl.AbstractDirectoryEntryProvider<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec>
com.atlassian.gadgets.directory.internal.impl.ConfigurableExternalGadgetSpecDirectoryEntryProvider
- All Implemented Interfaces:
- ConfigurableExternalGadgetSpecStore, DirectoryEntryProvider, org.springframework.beans.factory.DisposableBean
public class ConfigurableExternalGadgetSpecDirectoryEntryProvider
- extends AbstractDirectoryEntryProvider<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec>
- implements ConfigurableExternalGadgetSpecStore
This implementation delegates spec storage to ExternalGadgetSpecStore
to enforce the contract of that
interface (normalizing URIs on add, preventing duplicate storage, etc.) and so that user-added gadgets may be
persisted in between application sessions.
Constructor Summary |
ConfigurableExternalGadgetSpecDirectoryEntryProvider(com.atlassian.gadgets.spec.GadgetSpecFactory gadgetSpecFactory,
com.atlassian.gadgets.directory.spi.ExternalGadgetSpecStore externalGadgetSpecStore,
DirectoryUrlBuilder directoryUrlBuilder,
com.atlassian.sal.api.transaction.TransactionTemplate txTemplate,
com.atlassian.sal.api.executor.ThreadLocalDelegateExecutorFactory threadLocalDelegateExecutorFactory,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary |
void |
add(URI gadgetSpecUri)
Adds the specified gadget spec URI to the store. |
boolean |
contains(URI gadgetSpecUri)
|
protected com.google.common.base.Function<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec,com.atlassian.gadgets.directory.Directory.Entry> |
convertToLocalizedDirectoryEntry(com.atlassian.gadgets.GadgetRequestContext gadgetRequestContext)
|
protected Iterable<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec> |
internalEntries()
|
void |
remove(com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId gadgetSpecId)
Removes the gadget spec with the specified ID from the store |
String |
toString()
|
ConfigurableExternalGadgetSpecDirectoryEntryProvider
public ConfigurableExternalGadgetSpecDirectoryEntryProvider(com.atlassian.gadgets.spec.GadgetSpecFactory gadgetSpecFactory,
com.atlassian.gadgets.directory.spi.ExternalGadgetSpecStore externalGadgetSpecStore,
DirectoryUrlBuilder directoryUrlBuilder,
com.atlassian.sal.api.transaction.TransactionTemplate txTemplate,
com.atlassian.sal.api.executor.ThreadLocalDelegateExecutorFactory threadLocalDelegateExecutorFactory,
com.atlassian.event.api.EventPublisher eventPublisher)
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
internalEntries
protected Iterable<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec> internalEntries()
- Specified by:
internalEntries
in class AbstractDirectoryEntryProvider<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec>
add
public void add(URI gadgetSpecUri)
throws com.atlassian.gadgets.GadgetParsingException
- Description copied from interface:
ConfigurableExternalGadgetSpecStore
- Adds the specified gadget spec URI to the store. If the URI is
contained in the store, this method is a noop.
- Specified by:
add
in interface ConfigurableExternalGadgetSpecStore
- Parameters:
gadgetSpecUri
- the URI to add to the store
- Throws:
com.atlassian.gadgets.GadgetParsingException
remove
public void remove(com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId gadgetSpecId)
- Description copied from interface:
ConfigurableExternalGadgetSpecStore
- Removes the gadget spec with the specified ID from the store
- Specified by:
remove
in interface ConfigurableExternalGadgetSpecStore
- Parameters:
gadgetSpecId
- the id of the gadget to remove
convertToLocalizedDirectoryEntry
protected com.google.common.base.Function<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec,com.atlassian.gadgets.directory.Directory.Entry> convertToLocalizedDirectoryEntry(com.atlassian.gadgets.GadgetRequestContext gadgetRequestContext)
- Specified by:
convertToLocalizedDirectoryEntry
in class AbstractDirectoryEntryProvider<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec>
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012 Atlassian. All Rights Reserved.