org.vfny.geoserver.global.dto
Class DataDTO

java.lang.Object
  extended byorg.vfny.geoserver.global.dto.DataDTO
All Implemented Interfaces:
java.lang.Cloneable, DataTransferObject

public final class DataDTO
extends java.lang.Object
implements DataTransferObject

Data Transfer Object used to represent GeoServer Catalog information.

Represents an instance of the catalog.xml file in the configuration of the server, along with associated configuration files for the feature types.

Data Transfer object are used to communicate between the GeoServer application and its configuration and persistent layers. As such the class is final - to allow for its future use as an on-the-wire message.

Example:


 DataDTO dDto = new DataDTO();
 Map m = new HashMap();
 NameSpaceInfoDTO ns = new NameSpaceInfoDTO();
 ns.setUri("dzwiers.refractions.net");
 m.put("nsDave",ns);
 dDto.setNameSpaces(m);
 ns = new NameSpaceInfoDTO();
 ns.setUri("jgarnett.refractions.net");
 ns.setDefault(true);
 dDto.addNameSpace("nsJody"ns);
 dDto.setDefaultNameSpace(ns);
 ...
 

See Also:
DataSource, FeatureTypeInfo, StyleConfig

Constructor Summary
DataDTO()
          Data constructor.
DataDTO(DataDTO dto)
          Creates a duplicate of the provided DataDTO using deep copy.
 
Method Summary
 java.lang.Object clone()
          Implement clone as a Deep copy.
 boolean equals(java.lang.Object other)
          Implement equals as part of the Object contract.
 java.util.Map getDataStores()
          Retrive a Map of DataStoreInfoDTO by "dataStoreID".
 java.lang.String getDefaultNameSpacePrefix()
          Return the getDefaultNameSpace.
 java.util.Map getFeaturesTypes()
          Retrive Map of FeatureTypeInfoDTO by "dataStoreID.typeName".
 java.util.Map getNameSpaces()
          Map of NamespaceDTO by "prefix".
 java.util.Map getStyles()
          Retrive Map of StyleDTO by "something?".
 int hashCode()
          Implement hashCode as part of the Object contract.
 void setDataStores(java.util.Map map)
          Replace DataStoreInfoDTO map.
 void setDefaultNameSpacePrefix(java.lang.String dnsp)
          Sets the default namespace.
 void setFeaturesTypes(java.util.Map map)
          Set the FeatureTypeInfoDTO map.
 void setNameSpaces(java.util.Map map)
          Sets the NameSpaceInfoDTO map.
 void setStyles(java.util.Map map)
          Set map of StyleDTO by "something?".
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataDTO

public DataDTO()
Data constructor.

does nothing


DataDTO

public DataDTO(DataDTO dto)
Creates a duplicate of the provided DataDTO using deep copy.

Creates a copy of the Data provided. If the Data provided is null then default values are used. All the datastructures are cloned.

Parameters:
dto - The catalog to copy.
Throws:
java.lang.NullPointerException - DOCUMENT ME!
Method Detail

clone

public java.lang.Object clone()
Implement clone as a Deep copy.

Specified by:
clone in interface DataTransferObject
Returns:
A copy of this Data
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object other)
Implement equals as part of the Object contract.

Recursively tests to determine if the object passed in is a copy of this object.

Specified by:
equals in interface DataTransferObject
Parameters:
other - The Data object to test.
Returns:
true when the object passed is the same as this object.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Implement hashCode as part of the Object contract.

Specified by:
hashCode in interface DataTransferObject
Returns:
Service hashcode or 0
See Also:
Object.hashCode()

getDataStores

public java.util.Map getDataStores()
Retrive a Map of DataStoreInfoDTO by "dataStoreID".

Returns:
Map of DataStoreInfoDTO by "dataStoreID"

getDefaultNameSpacePrefix

public java.lang.String getDefaultNameSpacePrefix()
Return the getDefaultNameSpace.

May consider just returning the "prefix" of the default Namespace here. It is unclear what happens when we are starting out with a Empty DataDTO class.

Returns:
Default namespace or null

getFeaturesTypes

public java.util.Map getFeaturesTypes()
Retrive Map of FeatureTypeInfoDTO by "dataStoreID.typeName".

Returns:
Map of FeatureTypeInfoDTO by "dataStoreID.typeName"

getNameSpaces

public java.util.Map getNameSpaces()
Map of NamespaceDTO by "prefix".

Returns:
Map of NamespaceDTO by "prefix".

getStyles

public java.util.Map getStyles()
Retrive Map of StyleDTO by "something?". Key is Style.id

Returns:
Map of StyleDTO by "something"?

setDataStores

public void setDataStores(java.util.Map map)
Replace DataStoreInfoDTO map.

Parameters:
map - Map of DataStoreInfoDTO by "dataStoreID"
Throws:
java.lang.NullPointerException - DOCUMENT ME!

setDefaultNameSpacePrefix

public void setDefaultNameSpacePrefix(java.lang.String dnsp)
Sets the default namespace.

Note the provided namespace must be present in the namespace map.

Parameters:
dnsp - the default namespace prefix.
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setFeaturesTypes

public void setFeaturesTypes(java.util.Map map)
Set the FeatureTypeInfoDTO map.

The dataStoreID used for the map must be in datastores.

Parameters:
map - of FeatureTypeInfoDTO by "dataStoreID.typeName"
Throws:
java.lang.NullPointerException - DOCUMENT ME!

setNameSpaces

public void setNameSpaces(java.util.Map map)
Sets the NameSpaceInfoDTO map.

The default prefix is not changed by this operation.

Parameters:
map - of NameSpaceInfoDTO by "prefix"
Throws:
java.lang.NullPointerException - DOCUMENT ME!

setStyles

public void setStyles(java.util.Map map)
Set map of StyleDTO by "something?".

Parameters:
map - Map of StyleDTO by "someKey"?
Throws:
java.lang.NullPointerException - DOCUMENT ME!