org.mapfish.print.config
Class Config

java.lang.Object
  extended by org.mapfish.print.config.Config

public class Config
extends java.lang.Object

Bean mapping the root of the configuration file.


Field Summary
static org.apache.log4j.Logger LOGGER
           
 
Constructor Summary
Config()
           
 
Method Summary
static Config fromInputStream(java.io.InputStream instream)
           
static Config fromString(java.lang.String strConfig)
           
static Config fromYaml(java.io.File file)
          Create an instance out of the given file.
 int getBestScale(double target)
           
 java.util.TreeSet<java.lang.Integer> getDpis()
           
 java.util.TreeSet<java.lang.String> getFonts()
           
 org.apache.commons.httpclient.HttpClient getHttpClient()
          Get or create the http client to be used to fetch all the map data.
 Layout getLayout(java.lang.String name)
           
 org.pvalsecc.concurrent.OrderedResultsExecutor<MapTileTask> getMapRenderingExecutor()
           
 boolean isScalePresent(int scale)
           
 boolean isTilecacheMerging()
           
 void printClientConfig(org.json.JSONWriter json)
           
 void setConnectionTimeout(int connectionTimeout)
           
 void setDpis(java.util.TreeSet<java.lang.Integer> dpis)
           
 void setFonts(java.util.TreeSet<java.lang.String> fonts)
           
 void setGlobalParallelFetches(int globalParallelFetches)
           
 void setHosts(java.util.List<HostMatcher> hosts)
           
 void setLayouts(Layouts layouts)
           
 void setPerHostParallelFetches(int perHostParallelFetches)
           
 void setScales(java.util.TreeSet<java.lang.Integer> scales)
           
 void setSocketTimeout(int socketTimeout)
           
 void setTilecacheMerging(boolean tilecacheMerging)
           
 void stop()
          Stop all the threads and stuff used for this config.
 void validate()
          Called just after the config has been loaded to check it is valid.
 boolean validateUri(java.net.URI uri)
          Make sure an URI is authorized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final org.apache.log4j.Logger LOGGER
Constructor Detail

Config

public Config()
Method Detail

fromYaml

public static Config fromYaml(java.io.File file)
                       throws java.io.FileNotFoundException
Create an instance out of the given file.

Throws:
java.io.FileNotFoundException

fromInputStream

public static Config fromInputStream(java.io.InputStream instream)

fromString

public static Config fromString(java.lang.String strConfig)

getLayout

public Layout getLayout(java.lang.String name)

setLayouts

public void setLayouts(Layouts layouts)

setDpis

public void setDpis(java.util.TreeSet<java.lang.Integer> dpis)

getDpis

public java.util.TreeSet<java.lang.Integer> getDpis()

printClientConfig

public void printClientConfig(org.json.JSONWriter json)
                       throws org.json.JSONException
Throws:
org.json.JSONException

setScales

public void setScales(java.util.TreeSet<java.lang.Integer> scales)

isScalePresent

public boolean isScalePresent(int scale)

setHosts

public void setHosts(java.util.List<HostMatcher> hosts)

setFonts

public void setFonts(java.util.TreeSet<java.lang.String> fonts)

getFonts

public java.util.TreeSet<java.lang.String> getFonts()

validateUri

public boolean validateUri(java.net.URI uri)
                    throws java.net.UnknownHostException,
                           java.net.SocketException,
                           java.net.MalformedURLException
Make sure an URI is authorized

Throws:
java.net.UnknownHostException
java.net.SocketException
java.net.MalformedURLException

validate

public void validate()
Called just after the config has been loaded to check it is valid.

Throws:
InvalidValueException - When there is a problem

getBestScale

public int getBestScale(double target)
Returns:
The first scale that is bigger or equal than the target.

getMapRenderingExecutor

public org.pvalsecc.concurrent.OrderedResultsExecutor<MapTileTask> getMapRenderingExecutor()

stop

public void stop()
Stop all the threads and stuff used for this config.


setGlobalParallelFetches

public void setGlobalParallelFetches(int globalParallelFetches)

setPerHostParallelFetches

public void setPerHostParallelFetches(int perHostParallelFetches)

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()
Get or create the http client to be used to fetch all the map data.


setTilecacheMerging

public void setTilecacheMerging(boolean tilecacheMerging)

isTilecacheMerging

public boolean isTilecacheMerging()

setSocketTimeout

public void setSocketTimeout(int socketTimeout)

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)


Copyright © 2009 Camptocamp SA. All Rights Reserved.