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 LinksAppearanceStoregetInstance()Returns the current store instance.List<LinkDecorator>getLinkDecorators(ResourceDescriptor descriptor, LinksAppearance appearance, OslcClient client)Resolves the link decorators for a givenResourceDescriptorandLinksAppearance.abstract LinksAppearancegetLinksAppearance()Gets the links appearance configuration.static booleanisLinksAppearanceDisabled()Determines whether the links appearance feature is disabled or not.protected abstract voidsaveLinksAppearance(LinksAppearance linksAppearance)Persists the validated links appearance configuration.static voidsetInstance(LinksAppearanceStore store)Replaces the current store instance with the given one.voidsetLinksAppearance(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 SettingStoreExceptionDetermines whether the links appearance feature is disabled or not.- Returns:
trueif the feature is disabled,falseotherwise.- 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 weresavedand 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 givenResourceDescriptorandLinksAppearance.- 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.
-
-