Package com.sodius.oslc.server.process
Class LinksAppearanceStore
java.lang.Object
com.sodius.oslc.server.process.LinksAppearanceStore
Manages persistence of Links Appearance.
- Since:
- 3.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LinksAppearanceStoreReturns the current store instance.getLinkDecorators(ResourceDescriptor descriptor, LinksAppearance appearance, OslcClient client) Resolves the link decorators for a givenResourceDescriptorandLinksAppearance.abstract LinksAppearanceGets the links appearance configuration.static booleanDetermines 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.
-
Constructor Details
-
LinksAppearanceStore
public LinksAppearanceStore()
-
-
Method Details
-
getInstance
Returns the current store instance.- Returns:
- the current instance.
- See Also:
-
setInstance
Replaces the current store instance with the given one.- Parameters:
store- the new store.
-
isLinksAppearanceDisabled
Determines 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
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
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.
-