org.geoserver.catalog.CatalogFactory Maven / Gradle / Ivy
The newest version!
/* Copyright (c) 2001 - 2008 TOPP - www.openplans.org. All rights reserved.
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.catalog;
import java.util.Map;
/**
* Factory used to create catalog objects.
*
* @author Justin Deoliveira, The Open Planning Project
*
*/
public interface CatalogFactory {
/**
* Creates a new data store.
*/
DataStoreInfo createDataStore();
/**
* Creats a new metadata link.
*/
MetadataLinkInfo createMetadataLink();
/**
* Creates a new coverage store.
*/
CoverageStoreInfo createCoverageStore();
/**
* Creates a new attribute type.
*/
AttributeTypeInfo createAttribute();
/**
* Creates a new feature type.
*/
FeatureTypeInfo createFeatureType();
/**
* Creates a new coverage.
*/
CoverageInfo createCoverage();
/**
* Creates a new coverage dimension.
*/
CoverageDimensionInfo createCoverageDimension();
/**
* Creates a new legend.
*/
LegendInfo createLegend();
/**
* Creates a new layer.
*/
LayerInfo createLayer();
/**
* Creates a new map.
*/
MapInfo createMap();
/**
* Creates a new base map.
*/
LayerGroupInfo createLayerGroup();
/**
* Creates a new style.
*/
StyleInfo createStyle();
/**
* Creates new namespace.
*
*/
NamespaceInfo createNamespace();
/**
* Creates a new workspace.
*/
WorkspaceInfo createWorkspace();
/**
* Extensible factory method.
*
* This method should lookup the appropritae instance of {@link Extension}
* to create the object. The lookup mechanism is specific to the runtime
* environement.
*
*
* @param clazz
* The class of object to create.
*
* @return The new object.
*/
T create(Class clazz);
/**
* Factory extension.
*/
interface Extension {
/**
* Determines if the extension can create objects of the specified
* class.
*
* @param clazz
* The class of object to create.
*
*/
boolean canCreate(Class clazz);
/**
* Creates an instance of the specified class.
*
* This method is only called if {@link #canCreate(Class)} returns
* true
.
*
*
* @param clazz
* The class of object to create.
* @param context
* A context to initialize the object.
*
* @return The new object.
*/
T create(Class clazz, Map