Class TLcdOGCModelProvider

java.lang.Object
com.luciad.ogc.common.TLcdOGCModelProvider
All Implemented Interfaces:
ILcdOGCModelProvider, ILcdDisposable, AutoCloseable

public class TLcdOGCModelProvider extends Object implements ILcdOGCModelProvider

Default model provider implementation that delegates to the given ILcdOGCModelDecoderFactory. This implementation

  • supports multi-dimensions
  • adds a model cache

The getModelUpdateSequence method implementation is based on the use of System.currentTimeMillis(). When a model gets decoded, it is assigned an update sequence, based on the current time. When invalidate(String) or invalidateAll() is called, it will trigger the model to be re-decoded, and the model update sequence will be updated. When the model changes in-memory (detected using a model listener), the update sequence will be updated as well.

Since:
2017.0
  • Constructor Details

  • Method Details

    • getModel

      public ILcdModel getModel(String aSourceName, ALcdRequestContext aRequestContext) throws IOException
      Description copied from interface: ILcdOGCModelProvider
      Returns the ILcdModel corresponding to the given source name and request context.
      Specified by:
      getModel in interface ILcdOGCModelProvider
      Parameters:
      aSourceName - the source name of the model.
      aRequestContext - the request context. This can be null if the method is called by a process which is not handling a request.
      Returns:
      the ILcdModel corresponding to the given source name.
      Throws:
      IOException - if the model can not be returned (because decoding fails).
    • getModelUpdateSequence

      public String getModelUpdateSequence(String aSourceName, ALcdRequestContext aRequestContext) throws IOException

      See ILcdOGCModelProvider for more information about this method.

      This implementation listens to the model, and in case of a change, updates the update sequence using System.currentTimeMillis().

      Specified by:
      getModelUpdateSequence in interface ILcdOGCModelProvider
      Parameters:
      aSourceName - the source name of the model.
      aRequestContext - the request context. This can be null if the method is called by a process which is not handling a request.
      Returns:
      the update sequence value associated with the mode identified by the given source name.
      Throws:
      IOException - if the update sequence can not be determined
    • invalidate

      public void invalidate(String aSourceName)
      Clears the model cache for the given source. Note that this will cause getModelUpdateSequence to return a different value for new calls for the given source name.
      Parameters:
      aSourceName - the source name.
    • invalidateAll

      public void invalidateAll()
      Clears the entire model cache. Note that this will cause getModelUpdateSequence to return a different value for new calls for all models.
    • dispose

      public void dispose()
      Description copied from interface: ILcdDisposable

      Disposes of this object and allows it to release any system resources that it is holding.

      The result of calling any other method (other than finalize) on this object subsequent to a call to this method is undefined.

      Specified by:
      dispose in interface ILcdDisposable
      Specified by:
      dispose in interface ILcdOGCModelProvider