Class TLcdWFSProxyModel.Builder

java.lang.Object
com.luciad.ogc.wfs.client.TLcdWFSProxyModel.Builder
Enclosing class:
TLcdWFSProxyModel

public static final class TLcdWFSProxyModel.Builder extends Object

A builder class for TLcdWFSProxyModel instances. You should at least call one of the server methods and one of the featureTypeName methods before you can call the build() method.

Example usages

  • Creating a model optimized for visualization
    
        TLcdWFSProxyModel proxyModel =
          TLcdWFSProxyModel.Builder.newBuilder()
            .server( "http://localhost:8081/LuciadFusion/wfs" )
            .featureTypeName( "riversType" )
            .build();
     
  • Creating a model to execute a single query
    
       TLcdWFSProxyModel proxyModel =
          TLcdWFSProxyModel.Builder.newBuilder()
            .server( "http://localhost:8081/LuciadFusion/wfs" )
            .featureTypeName( "riversType" )
            .build();
       //Disable the caching to ensure that a fresh query is sent to the server
       proxyModel.setCachingMode(TLcdWFSProxyModel.NO_CACHE);
       //Further configure the query parameters on the model
       proxyModel.setFilter( ... );
       proxyModel.setMaxFeatures( 100 );
       //Perform the query
       Enumeration elements = proxyModel.elements();
     
Since:
2016.1
  • Method Details

    • newBuilder

      public static TLcdWFSProxyModel.Builder newBuilder()
      Returns a new Builder instance.
      Returns:
      a new Builder instance.
    • server

      public TLcdWFSProxyModel.Builder server(String aServerAddress)
      Specifies the address of the WFS server.
      Parameters:
      aServerAddress - The address of the WFS server as a string.
      Returns:
      this builder instance
    • server

      public TLcdWFSProxyModel.Builder server(URI aServerURI)
      Specifies the address of the WFS server.
      Parameters:
      aServerURI - The address of the WFS server as a URI
      Returns:
      this builder instance
    • server

      public TLcdWFSProxyModel.Builder server(TLcdWFSClient aWFSClient)
      Specifies the address of the WFS server.
      Parameters:
      aWFSClient - A WFS client instance configured for the WFS server for which a TLcdWFSProxyModel is under construction.
      Returns:
      this builder instance
    • server

      public TLcdWFSProxyModel.Builder server(TLcdWFSCapabilities aWFSCapabilities)
      Specifies the address of the WFS server.
      Parameters:
      aWFSCapabilities - A WFS capabilities instance configured for the WFS server for which a TLcdWFSProxyModel is under construction.
      Returns:
      this builder instance
    • dataSource

      public TLcdWFSProxyModel.Builder dataSource(ILcdDataSource aDataSource)
      Specifies the server and featureTypeName parameters using the given data source.
      Parameters:
      aDataSource - the data source which has the information to fill builder parameters.
      Returns:
      this builder instance
      Since:
      2018.0
    • featureTypeName

      public TLcdWFSProxyModel.Builder featureTypeName(String aFeatureTypeName)
      Specifies the name of the feature type. If the name is specified as {namespace}localPart, the name is interpreted as a fully qualified name, consisting of a namespace and a local part. If the name is specified as prefix:localPart, the name is interpreted as a prefixed name, consisting of a prefix and a local part. In all other cases, the name is interpreted as an unqualified name, not linked to a namespace or prefix. An alternative approach to specify a qualified or prefixed name is to use the method featureTypeName(QName).
      Parameters:
      aFeatureTypeName - the name of the feature type
      Returns:
      this builder instance
      See Also:
    • featureTypeName

      public TLcdWFSProxyModel.Builder featureTypeName(QName aFeatureTypeName)
      Specifies the name of the feature type as a qualified name.
      Parameters:
      aFeatureTypeName - the name of the feature type
      Returns:
      this builder instance
      See Also:
    • modelDecoder

      public TLcdWFSProxyModel.Builder modelDecoder(String aOutputFormat, ILcdWFSModelDecoder aModelDecoder)

      Specifies the WFS model decoder that will be used to decode the response from the WFS server when this response is in the specified output format. For that output format, it will take precedence over the model decoder specified with modelDecoder(ILcdWFSModelDecoder).

      Note that this method only allows to specify one model decoder for each output format. If you call this method multiple times for the same format, only the model decoder of the last call will be considered.

      See How to receive GeoJSON data via a WFS request for an example usage of this method.

      Parameters:
      aOutputFormat - The output format. The output format should be one of the output formats exposed in the WFS capabilities (see the <wfs:OutputFormats> or the <ows:Parameter name="outputFormat"> in the capabilities).
      aModelDecoder - The model decoder
      Returns:
      This builder
      Since:
      2017.0
    • modelDecoder

      public TLcdWFSProxyModel.Builder modelDecoder(ILcdWFSModelDecoder aModelDecoder)
      Specifies the WFS model decoder that will be used to decode the response from the WFS server
      Parameters:
      aModelDecoder - The model decoder
      Returns:
      this builder instance
    • modelReferenceParser

      public TLcdWFSProxyModel.Builder modelReferenceParser(ILcdModelReferenceParser aModelReferenceParser)

      Specifies the reference parser that will be used by the proxy model. This should only be used to support servers that use custom reference names.

      The reference parser will be used for:

      • Parsing the defaultSRS of the feature type of the proxy model.
      • Decoding srsNames that occur in results of 'GetFeature' requests in case no custom model decoder is used.
      Parameters:
      aModelReferenceParser - The model reference parser
      Returns:
      this builder instance
    • requestProperty

      public TLcdWFSProxyModel.Builder requestProperty(String aKey, String aValue)
      Sets the general request property. If a property with the key already exists, overwrite its value with the new value. If null is specified as value, the property is removed.
      Parameters:
      aKey - the keyword by which the request is known (for example "accept")
      aValue - the value associated with it
      Returns:
      this builder instance
      See Also:
    • build

      public TLcdWFSProxyModel build() throws IOException

      Returns a new TLcdWFSProxyModel for the specified settings, which is optimized for being visualized on the map. You need to call one of the server methods and one of the featureTypeName methods on this builder before attempting to build the model.

      After calling this method, the builder can no longer be used. Any further interactions with it will throw exceptions.

      Returns:
      a new TLcdWFSProxyModel instance.
      Throws:
      IOException - if the proxy model cannot be created