Package com.sodius.oslc.server.process
Class LinksAppearanceStore
- java.lang.Object
-
- com.sodius.oslc.server.process.LinksAppearanceStore
-
public abstract class LinksAppearanceStore extends Object
Manages persistence of Links Appearance.- Since:
- 3.3.0
-
-
Constructor Summary
Constructors Constructor Description LinksAppearanceStore()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static LinksAppearanceStore
getInstance()
Returns the current store instance.List<LinkDecorator>
getLinkDecorators(ResourceDescriptor descriptor, LinksAppearance appearance, OslcClient client)
Resolves the link decorators for a givenResourceDescriptor
andLinksAppearance
.abstract LinksAppearance
getLinksAppearance()
Gets the links appearance configuration.static boolean
isLinksAppearanceDisabled()
Determines whether the links appearance feature is disabled or not.protected abstract void
saveLinksAppearance(LinksAppearance linksAppearance)
Persists the validated links appearance configuration.static void
setInstance(LinksAppearanceStore store)
Replaces the current store instance with the given one.void
setLinksAppearance(LinksAppearance linksAppearance)
Creates or updates the links appearance configuration.
-
-
-
Method Detail
-
getInstance
public static LinksAppearanceStore getInstance()
Returns the current store instance.- Returns:
- the current instance.
- See Also:
setInstance(LinksAppearanceStore)
-
setInstance
public static void setInstance(LinksAppearanceStore store)
Replaces the current store instance with the given one.- Parameters:
store
- the new store.
-
isLinksAppearanceDisabled
public static boolean isLinksAppearanceDisabled() throws SettingStoreException
Determines whether the links appearance feature is disabled or not.- Returns:
true
if the feature is disabled,false
otherwise.- Throws:
SettingStoreException
- if the corresponding setting cannot be read.
-
getLinksAppearance
public abstract LinksAppearance getLinksAppearance() throws LinksAppearanceException
Gets the links appearance configuration. Implementations MUST resolve the attributes in the same order they weresaved
and MUST NOT care about theLinksAppearance.isDisabled()
property; it's managed by Foundation.- Returns:
- links appearance configuration.
- Throws:
LinksAppearanceException
- if configuration cannot be retrieved.
-
saveLinksAppearance
protected abstract void saveLinksAppearance(LinksAppearance linksAppearance) throws LinksAppearanceException
Persists the validated links appearance configuration. Implementations MUST not care about theLinksAppearance.isDisabled()
property; it's managed by Foundation.- Parameters:
linksAppearance
- current configuration.- Throws:
LinksAppearanceException
- if configuration cannot be stored.
-
setLinksAppearance
public void setLinksAppearance(LinksAppearance linksAppearance) throws LinksAppearanceException
Creates or updates the links appearance configuration.- Parameters:
linksAppearance
- current configuration.- Throws:
IllegalArgumentException
- if some saving validation fails.LinksAppearanceException
- if configuration cannot be stored.
-
getLinkDecorators
public List<LinkDecorator> getLinkDecorators(ResourceDescriptor descriptor, LinksAppearance appearance, OslcClient client)
Resolves the link decorators for a givenResourceDescriptor
andLinksAppearance
.- Parameters:
descriptor
- the given resource descriptor.appearance
- the given links appearance.client
- an OSLC client to resolve enumeration values if any.- Returns:
- the corresponding decorators, if any. An empty map if none is configured/applicable.
-
-