org.vfny.geoserver.config.WCSConfig Maven / Gradle / Ivy
The newest version!
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
* This code is licensed under the GPL 2.0 license, availible at the root
* application directory.
*/
package org.vfny.geoserver.config;
import org.vfny.geoserver.global.WCS;
import org.vfny.geoserver.global.dto.ServiceDTO;
import org.vfny.geoserver.global.dto.WCSDTO;
/**
* WCS purpose.
*
*
* Description of WCS Used to store WCS data.
*
*
*
*
* @author $Author: Alessio Fabiani ([email protected]) $ (last modification)
* @author $Author: Simone Giannecchini ([email protected]) $ (last modification)
* @version $Id: WCSConfig.java 6326 2007-03-15 18:36:40Z jdeolive $
*/
public class WCSConfig extends ServiceConfig {
public static final String CONFIG_KEY = "Config.WCS";
private boolean gmlPrefixing;
/**
* WCS constructor.
*
*
* Creates a WCS to represent an instance with default data.
*
*
* @see defaultSettings()
*/
public WCSConfig() {
super();
}
/**
* WCS constructor.
*
*
* Creates a copy of the WCS provided. If the WCS provided is null then
* default values are used. All the data structures are cloned.
*
*
* @param w The WCS to copy.
*/
public WCSConfig(WCSDTO w) {
super(w.getService());
gmlPrefixing = w.isGmlPrefixing();
}
/**
* Creates the WCSConfig.
*
* @param wcs The wcs module.
*
*/
public WCSConfig(WCS wcs) {
this((WCSDTO) wcs.toDTO());
}
/**
* Implement loadDTO.
*
*
* Takes a WMSDTO and loads it into this WMSConfig Object
*
*
* @param dto an instance of WMSDTO
*
* @throws NullPointerException DOCUMENT ME!
*
* @see org.vfny.geoserver.config.DataStructure#loadDTO(java.lang.Object)
*/
public void update(WCSDTO dto) {
if (dto == null) {
throw new NullPointerException("WCS Data Transfer Object required");
}
super.update(dto.getService());
gmlPrefixing = dto.isGmlPrefixing();
}
/**
* Implement toDTO.
*
*
* Returns a copy of the data in a ServiceDTO object
*
*
* @return a copy of the data in a ServiceDTO object
*
* @see org.vfny.geoserver.config.DataStructure#toDTO()
*/
public WCSDTO toDTO() {
WCSDTO WCSDto = new WCSDTO();
WCSDto.setService((ServiceDTO) super.toServDTO());
WCSDto.setGmlPrefixing(gmlPrefixing);
return WCSDto;
}
/**
* isGmlPrefixing purpose.
*
*
* Description ...
*
*
* @return
*/
public boolean isGmlPrefixing() {
return gmlPrefixing;
}
/**
* setGmlPrefixing purpose.
*
*
* Description ...
*
*
* @param b
*/
public void setGmlPrefixing(boolean b) {
gmlPrefixing = b;
}
}