it.geosolutions.unredd.geostore.model
Class UNREDDResource<A extends AttributeDef,R extends ReverseAttributeDef>
java.lang.Object
it.geosolutions.unredd.geostore.model.UNREDDResource<A,R>
- Direct Known Subclasses:
- UNREDDChartData, UNREDDChartScript, UNREDDFeedback, UNREDDLayer, UNREDDLayerUpdate, UNREDDStatsData, UNREDDStatsDef
public abstract class UNREDDResource<A extends AttributeDef,R extends ReverseAttributeDef>
- extends Object
This is a generic GeoStore Resource, used in UNREDD project.
Its subclasses are mainly used for encoding and decoding RESTResource, and
related attributes.
Subclasses should define a set of attributes and
a set of reverse attributes
(see ReverseAttributeDef for an explation about reverse attrs).
The two pratical uses involve:
- RESTResource creation
es:
UNREDDLayerUpdate layerUpdate = new UNREDDLayerUpdate();
layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.LAYER, name);
layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.YEAR, Integer.toString(year));
RESTResource res = layerUpdate.createRESTResource();
res.setName(resName);
- Resource parsing
es:
Resource resource = ... (load resource from GeoStore)...
UNREDDChartScript chartScript = new UNREDDChartScript(resource);
String scriptPath = chartScript.getAttribute(UNREDDChartScript.Attributes.SCRIPTPATH);
- Author:
- ETj (etj at geo-solutions.it)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNREDDResource
public UNREDDResource()
UNREDDResource
public UNREDDResource(it.geosolutions.geostore.core.model.Resource resource)
getCategoryName
public abstract String getCategoryName()
getAttributeMap
protected abstract Map<String,it.geosolutions.geostore.core.model.enums.DataType> getAttributeMap()
getReverseAttributes
protected abstract List<String> getReverseAttributes()
setAttribute
public void setAttribute(A att,
String value)
setAttributes
public void setAttributes(Map<String,String> attributes)
- Set a collection of attributes.
Only those attributes whose key is declared in the
attributes model will be processed.
The rest will be ignored.
- Parameters:
attributes - The attributes to be set.
setAttribute
protected void setAttribute(String name,
String value)
getAttribute
public String getAttribute(A att)
addReverseAttribute
public void addReverseAttribute(R att,
String... values)
removeReverseAttribute
public boolean removeReverseAttribute(R att,
String value)
getReverseAttributesInternal
public List<String> getReverseAttributesInternal(R att)
getReverseAttributes
public List<String> getReverseAttributes(String attName)
createShortAttribute
public it.geosolutions.geostore.services.dto.ShortAttribute createShortAttribute(String name)
createShortAttributeList
public List<it.geosolutions.geostore.services.dto.ShortAttribute> createShortAttributeList()
createRESTResource
public it.geosolutions.geostore.services.rest.model.RESTResource createRESTResource()
getOriginalAttribute
public it.geosolutions.geostore.core.model.Attribute getOriginalAttribute(A att)
Copyright © 2012. All Rights Reserved.