it.geosolutions.unredd.geostore.model
Class UNREDDResource<A extends AttributeDef,R extends ReverseAttributeDef>

java.lang.Object
  extended by 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:

Author:
ETj (etj at geo-solutions.it)

Constructor Summary
UNREDDResource()
           
UNREDDResource(it.geosolutions.geostore.core.model.Resource resource)
           
 
Method Summary
 void addReverseAttribute(R att, String... values)
           
 it.geosolutions.geostore.services.rest.model.RESTResource createRESTResource()
           
 it.geosolutions.geostore.services.dto.ShortAttribute createShortAttribute(String name)
           
 List<it.geosolutions.geostore.services.dto.ShortAttribute> createShortAttributeList()
           
 String getAttribute(A att)
           
protected abstract  Map<String,it.geosolutions.geostore.core.model.enums.DataType> getAttributeMap()
           
abstract  String getCategoryName()
           
 it.geosolutions.geostore.core.model.Attribute getOriginalAttribute(A att)
           
protected abstract  List<String> getReverseAttributes()
           
 List<String> getReverseAttributes(String attName)
           
 List<String> getReverseAttributesInternal(R att)
           
 boolean removeReverseAttribute(R att, String value)
           
 void setAttribute(A att, String value)
           
protected  void setAttribute(String name, String value)
           
 void setAttributes(Map<String,String> attributes)
          Set a collection of attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UNREDDResource

public UNREDDResource()

UNREDDResource

public UNREDDResource(it.geosolutions.geostore.core.model.Resource resource)
Method Detail

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.