public interface ILcdOGCModelProvider extends ILcdDisposable
Modifier and Type | Method and Description |
---|---|
default void |
dispose()
Disposes of this object and allows it to release any system resources that it is holding.
|
ILcdModel |
getModel(String aSourceName,
ALcdRequestContext aRequestContext)
Returns the
ILcdModel corresponding to the given source name and request context. |
default String |
getModelUpdateSequence(String aSourceName,
ALcdRequestContext aRequestContext)
Returns the update sequence value associated with the mode identified by the given source name.
|
close
ILcdModel getModel(String aSourceName, ALcdRequestContext aRequestContext) throws IOException
ILcdModel
corresponding to the given source name and request context.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.ILcdModel
corresponding to the given source name.IOException
- if the model can not be returned (because decoding fails).default String getModelUpdateSequence(String aSourceName, ALcdRequestContext aRequestContext) throws IOException
Returns the update sequence value associated with the mode identified by the given source name. The update sequence identifies the state of the model.
The update sequence should comply with a number of conditions:
By default, this method always returns "0"
. This means that the default implementation assumes that
models never change. If models change, this method should be implemented differently.
One way to generate update sequences would be to use a (persistent) counter that gets incremented on every
(file system) change. Another way would be to use System.currentTimeMillis()
from a correct clock.
This method must be used by model provider implementations that contain a model cache. The result of this method must be used to invalidate this cache if needed.
Because of caching on the request/view level, it is possible that the getModel
method
is called infrequently. This method will need to be called at least once for each request though. This means
that for performance reasons, this method needs to have a fast implementation, ideally avoiding any I/O.
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.IOException
- if the update sequence can not be determineddefault void dispose()
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.
dispose
in interface ILcdDisposable