public class DefaultRasterStore extends AbstractDisposable implements DataStoreInitializer2, RasterStoreProviderServices, RasterStore, Observer
BASE_NEWPARAMETERS_PROVIDER_DEFINITION_FULLNAME, BASE_NEWPARAMETERS_PROVIDER_DEFINITION_NAME, BASE_PARAMETERS_PROVIDER_DEFINITION_FULLNAME, BASE_PARAMETERS_PROVIDER_DEFINITION_NAME, PROVIDER_PARAMTER_FULLNAME, PROVIDER_PARAMTER_NAME
DYNMETHOD_GETCOLORINTERPRETATION_NAME, DYNMETHOD_GETCOLORTABLE_NAME, DYNMETHOD_GETLEGEND_NAME
CSV_PROVIDER_NAME, DBASE_PROVIDER_NAME, FEATURE_METADATA_DEFINITION_NAME, GEOPACKAGE_PROVIDER_NAME, H2SPATIAL_PROVIDER_NAME, MDB_PROVIDER_NAME, METADATA_CONTAINERNAME, METADATA_CRS, METADATA_ENVELOPE, METADATA_FEATURETYPE, METADATA_PROVIDER, SHAPE_PROVIDER_NAME, SPATIAL_METADATA_DEFINITION_NAME
Constructor and Description |
---|
DefaultRasterStore() |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Provides each value of this Store to the provided
Visitor . |
void |
accept(Visitor visitor,
DataQuery dataQuery)
Provides each value of this Store to the provided
Visitor . |
void |
addBand(RasterStore store,
int band)
Add a band from other store.
|
void |
addBands(RasterStore store,
java.util.List<java.lang.Integer> bands)
Add a list of bands from other store.
|
void |
addObserver(Observer observer) |
void |
beginComplexNotification()
Sets the Observable in complex notification mode.
|
void |
clear() |
void |
clearAdditionalBands()
Remove any band that does not belong to itself.
|
java.lang.Object |
clone()
Creates a copy of the object.
|
BandAttributeDescriptor |
createBandAttributeDescriptor(int band,
java.lang.String name,
java.lang.Object value,
java.lang.String description,
java.util.List<java.lang.Object> values,
java.lang.String units)
Creates a
BandAttributeDescriptor . |
BandAttributeDescriptor |
createBandAttributeDescriptor(int band,
java.lang.String name,
java.lang.String description,
java.util.List<java.lang.Object> values)
Creates a
BandAttributeDescriptor . |
BandAttributeDescriptor |
createBandAttributeDescriptor(int band,
java.lang.String name,
java.lang.String description,
java.util.List<java.lang.Object> values,
java.lang.String units)
Creates a
BandAttributeDescriptor . |
BandDescriptor |
createBandDescriptor(int band,
java.util.List<BandAttributeDescriptor> attributes)
Creates a
BandDescriptor object. |
BandQuery |
createBandQuery(int band)
Creates a
BandQuery from band received as parameter. |
DataQuery |
createQuery()
Returns a new instance of a
DataQuery . |
RasterQuery |
createRasterQuery()
Returns a new
RasterQuery associated to this store. |
DataSet |
createSelection()
Creates a new selection.
|
void |
delegate(DynObject dynObject) |
void |
deleteObserver(Observer observer) |
void |
deleteObservers() |
void |
disableNotifications()
Disable the notification of events to registered Observers.
|
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
enableNotifications()
Enable (default) the notification of events to registered Observers.
|
void |
endComplexNotification()
Ends the complex notification mode.
|
BandDescriptor |
getBandDescriptor(int band)
Gets
BandsDescriptor of band received as parameter. |
java.util.List<BandDescriptor> |
getBandDescriptors() |
int |
getBands()
Gets number of total bands
|
RasterCache |
getCache() |
UnmodifiableBasicMap<java.lang.String,DataStore> |
getChildren()
Returns an UnmodifiableBasicMap with this store children.
|
DataSet |
getDataSet()
Returns all available data.
|
DataSet |
getDataSet(DataQuery dataQuery)
Returns a subset of data taking into account the properties and
restrictions of the DataQuery.
|
void |
getDataSet(DataQuery dataQuery,
Observer observer)
Loads a subset of data taking into account the properties and
restrictions of the DataQuery.
|
void |
getDataSet(Observer observer)
Loads all available data and notifies the observer for each loaded block of data.
|
BufferDimensions |
getDimensions()
Return the buffer dimensions of the complete store.
|
DynClass |
getDynClass() |
java.lang.Object |
getDynValue(java.lang.String name) |
Envelope |
getEnvelope()
Returns the envelope associated to this store buffer
|
DataServerExplorer |
getExplorer()
Returns the DataServerExplorer to which this DataStore belongs, if there
is any.
|
java.lang.String |
getFullName()
Returns a more descriptive name for the store that getName.
|
Interval |
getInterval()
Gets the
Interval of the store, that means the temporal
interval where the store has valid data. |
DataManager |
getManager() |
java.util.Set<?> |
getMetadataChildren()
Returns an unsorted set of child Metadata objects.
|
java.lang.Object |
getMetadataID()
Returns the unique identifier of the Metadata.
|
java.lang.String |
getMetadataName()
Returns the name of the Metadata, which allows to identify the type in
the Metadata registry.
|
java.lang.String |
getName()
Returns the name associated to the store.
|
DataStoreParameters |
getParameters()
Return the of parameters of this store
|
RasterStoreProvider |
getProvider()
Gets this provider
|
DataStoreProviderFactory |
getProviderFactory() |
java.lang.String |
getProviderName()
Return the provider name that use this store.
|
RasterSet |
getRasterSet()
Returns all available data in the store
|
void |
getRasterSet(Observer observer)
Adds an observer to the DataSet
|
RasterSet |
getRasterSet(RasterQuery rasterQuery)
Returns a subset of data taking into account the properties and
restrictions of the RasterQuery.
|
void |
getRasterSet(RasterQuery rasterQuery,
Observer observer)
Adds an observer to the queried DataSet
|
RasterStore |
getRasterStore() |
ResourcesStorage |
getResourcesStorage() |
DataSet |
getSelection()
Returns the selected set of data
|
DataStore |
getStore()
Return the Store instance
|
StoresRepository |
getStoresRepository() |
java.util.Collection<?> |
getTimes()
Gets all the possible values of time for which the store has data.
|
java.util.Collection<?> |
getTimes(Interval interval)
Gets all the possible values of time for which the store has data
and intersects with an interval.
|
boolean |
hasDynMethod(java.lang.String name) |
boolean |
hasDynValue(java.lang.String name) |
void |
implement(DynClass dynClass) |
void |
intialize(DataManager dataManager,
DataStoreParameters parameters) |
java.lang.Object |
invokeDynMethod(int code,
java.lang.Object[] args) |
java.lang.Object |
invokeDynMethod(java.lang.String name,
java.lang.Object[] args) |
boolean |
isOwnBand(int band)
Return true if the band is own.
|
boolean |
isTiled() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
notifyChange(DefaultRasterStoreNotification storeNotification)
Notifies change
|
void |
notifyChange(java.lang.String notification)
Notifies change
|
void |
notifyChange(java.lang.String notification,
Resource resource)
Call this to send a notification to observers of this store relative to
Resources
|
void |
notifyChange(java.lang.String notification,
ResourceProvider data)
Call this to send a notification to observers of this store
|
void |
refresh()
Refreshes this store state.
|
static void |
registerMetadataDefinition()
Registers metadata
|
static void |
registerPersistenceDefinition()
Registers persistence
|
void |
removeBand(int band)
Remove a band.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setDynValue(java.lang.String name,
java.lang.Object value) |
void |
setProvider(DataStoreProvider provider) |
void |
setSelection(DataSet selection)
Sets the current data selection with the given data set.
|
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
void |
useCache(java.lang.String providerName,
DynObject parameters) |
dispose, dispose
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFullNameQuietly, getNameQuietly
dispose
cloneQuietly, cloneQuietly
public static void registerPersistenceDefinition()
public static void registerMetadataDefinition() throws MetadataException
MetadataException
public DataManager getManager()
getManager
in interface RasterStoreProviderServices
public java.lang.String getName()
DataStore
getName
in interface DataStore
getName
in interface RasterStoreProviderServices
public java.lang.String getFullName()
DataStore
getFullName
in interface DataStore
public DataStoreParameters getParameters()
DataStore
getParameters
in interface DataStore
getParameters
in interface RasterStore
public java.lang.String getProviderName()
DataStore
getProviderName
in interface DataStore
public void refresh() throws DataException
DataStore
refresh
in interface DataStore
DataException
public DataSet getDataSet() throws DataException
DataStore
getDataSet
in interface DataStore
DataException
- if there is any error while loading the datapublic DataSet getDataSet(DataQuery dataQuery) throws DataException
DataStore
getDataSet
in interface DataStore
dataQuery
- defines the properties of the requested dataDataException
- if there is any error while loading the datapublic void getDataSet(Observer observer) throws DataException
DataStore
getDataSet
in interface DataStore
observer
- to be notified for each block of data loadedDataException
- if there is any error while loading the datapublic void getDataSet(DataQuery dataQuery, Observer observer) throws DataException
DataStore
getDataSet
in interface DataStore
dataQuery
- defines the properties of the requested dataobserver
- to be notified for each block of data loadedDataException
- if there is any error while loading the datapublic RasterSet getRasterSet(RasterQuery rasterQuery) throws DataException
RasterStore
getRasterSet
in interface RasterStore
DataException
public RasterSet getRasterSet() throws DataException
RasterStore
getRasterSet
in interface RasterStore
DataException
public void getRasterSet(Observer observer) throws DataException
getRasterSet
in interface RasterStore
observer
- DataException
public void getRasterSet(RasterQuery rasterQuery, Observer observer) throws DataException
getRasterSet
in interface RasterStore
rasterQuery
- observer
- DataException
public void accept(Visitor visitor) throws BaseException
DataStore
Visitor
.
The values received through the Visitor.visit(Object)
method
may be transient, reused or externally modifiable, so they can't
be used to be stored in any external form out of the visit method.
If you need to store any of the values out of the
Visitor.visit(Object)
method execution, create a copy or clone
the received value in order to be stored.accept
in interface DataStore
accept
in interface Visitable
visitor
- the visitor to apply to each value.BaseException
- if there is an error while performing the visitpublic void accept(Visitor visitor, DataQuery dataQuery) throws BaseException
DataStore
Visitor
.
The values received through the Visitor.visit(Object)
method
may be transient, reused or externally modifiable, so they can't
be used to be stored in any external form out of the visit method.
If you need to store any of the values out of the
Visitor.visit(Object)
method execution, create a copy or clone
the received value in order to be stored.accept
in interface DataStore
visitor
- the visitor to apply to each value.dataQuery
- defines the properties of the data to visitBaseException
- if there is an error while performing the visitpublic DataSet getSelection() throws DataException
DataStore
getSelection
in interface DataStore
DataException
public void setSelection(DataSet selection) throws DataException
DataStore
setSelection
in interface DataStore
DataException
public DataSet createSelection() throws DataException
DataStore
createSelection
in interface DataStore
DataException
public UnmodifiableBasicMap<java.lang.String,DataStore> getChildren()
DataStore
getChildren
in interface DataStore
public DataServerExplorer getExplorer() throws DataException, ValidateDataParametersException
DataStore
getExplorer
in interface DataStore
null
if this was not accessed through any
DataServerExplorer.DataException
ValidateDataParametersException
public DataQuery createQuery()
DataStore
DataQuery
.createQuery
in interface DataStore
DataQuery
instance.public Interval getInterval()
DataStore
Interval
of the store, that means the temporal
interval where the store has valid data.getInterval
in interface DataStore
public java.util.Collection<?> getTimes()
DataStore
public java.util.Collection<?> getTimes(Interval interval)
DataStore
public void disableNotifications()
ComplexObservable
disableNotifications
in interface ComplexObservable
public void enableNotifications()
ComplexObservable
enableNotifications
in interface ComplexObservable
public void beginComplexNotification()
ComplexObservable
beginComplexNotification
in interface ComplexObservable
public void endComplexNotification()
ComplexObservable
If a observer is a ComplexObserver
, it will be notified with a
single DefaultComplexNotification
instead of each of the notifications.
Some important notes to take into account when calling this method.
Observer
is processing a notification another Observer
is
registered to the source Observable
, it won't get any of the
notifications currently being notified, but future ones.endComplexNotification
in interface ComplexObservable
public void addObserver(Observer observer)
addObserver
in interface Observable
public void deleteObserver(Observer observer)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public java.util.Set<?> getMetadataChildren() throws MetadataException
Metadata
getMetadataChildren
in interface Metadata
MetadataException
public java.lang.Object getMetadataID() throws MetadataException
Metadata
getMetadataID
in interface Metadata
MetadataException
public java.lang.String getMetadataName() throws MetadataException
Metadata
getMetadataName
in interface Metadata
MetadataException
public DynClass getDynClass()
getDynClass
in interface DynObject
public java.lang.Object getDynValue(java.lang.String name) throws DynFieldNotFoundException
getDynValue
in interface DynObject
DynFieldNotFoundException
public void setDynValue(java.lang.String name, java.lang.Object value) throws DynFieldNotFoundException
setDynValue
in interface DynObject
DynFieldNotFoundException
public boolean hasDynValue(java.lang.String name)
hasDynValue
in interface DynObject
public java.lang.Object invokeDynMethod(java.lang.String name, java.lang.Object[] args) throws DynMethodException
invokeDynMethod
in interface DynObject
DynMethodException
public java.lang.Object invokeDynMethod(int code, java.lang.Object[] args) throws DynMethodException
invokeDynMethod
in interface DynObject
DynMethodException
public RasterQuery createRasterQuery()
RasterStore
RasterQuery
associated to this store.createRasterQuery
in interface RasterStore
public DataStore getStore()
DataStoreProviderServices
getStore
in interface DataStoreProviderServices
public void update(Observable observable, java.lang.Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.
public void notifyChange(java.lang.String notification)
notification
- public void notifyChange(java.lang.String notification, ResourceProvider data)
RasterStoreProviderServices
notifyChange
in interface RasterStoreProviderServices
public void notifyChange(DefaultRasterStoreNotification storeNotification)
storeNotification
- public RasterStoreProvider getProvider()
getProvider
in interface RasterStoreProviderServices
public Envelope getEnvelope() throws DataException, LocatorException, CreateEnvelopeException
RasterStore
getEnvelope
in interface RasterStore
DataException
LocatorException
CreateEnvelopeException
public java.util.List<BandDescriptor> getBandDescriptors()
getBandDescriptors
in interface RasterStore
public BandDescriptor getBandDescriptor(int band)
RasterStore
BandsDescriptor
of band received as parameter. If band does
not have BandDescriptor
, this method will return an
empty BandsDescriptor
.getBandDescriptor
in interface RasterStore
band
- Band to get its BandsDescriptor
public BandQuery createBandQuery(int band)
RasterStore
BandQuery
from band received as parameter.createBandQuery
in interface RasterStore
band
- Band to create BandQuerypublic int getBands()
RasterStore
getBands
in interface RasterStore
public BandDescriptor createBandDescriptor(int band, java.util.List<BandAttributeDescriptor> attributes)
RasterStoreProviderServices
BandDescriptor
object.createBandDescriptor
in interface RasterStoreProviderServices
band
- BandDescriptor bandattributes
- A list with available BandAttributeDescriptor
.public BandAttributeDescriptor createBandAttributeDescriptor(int band, java.lang.String name, java.lang.String description, java.util.List<java.lang.Object> values, java.lang.String units)
RasterStoreProviderServices
BandAttributeDescriptor
.createBandAttributeDescriptor
in interface RasterStoreProviderServices
band
- Band of attribute descriptor.name
- Name of attributedescription
- Descriptor of attributevalues
- Values of band attribute descriptorunits
- String unitsBandAttributeDescriptor
public BandAttributeDescriptor createBandAttributeDescriptor(int band, java.lang.String name, java.lang.Object value, java.lang.String description, java.util.List<java.lang.Object> values, java.lang.String units)
RasterStoreProviderServices
BandAttributeDescriptor
.createBandAttributeDescriptor
in interface RasterStoreProviderServices
band
- Band of attribute descriptor.name
- Name of attributedescription
- Descriptor of attributevalues
- Values of band attribute descriptorunits
- String unitsBandAttributeDescriptor
public BandAttributeDescriptor createBandAttributeDescriptor(int band, java.lang.String name, java.lang.String description, java.util.List<java.lang.Object> values)
RasterStoreProviderServices
BandAttributeDescriptor
.createBandAttributeDescriptor
in interface RasterStoreProviderServices
band
- Band of attribute descriptor.name
- Name of attributedescription
- Descriptor of attributevalues
- Values of band attribute descriptorBandAttributeDescriptor
public void notifyChange(java.lang.String notification, Resource resource)
RasterStoreProviderServices
notifyChange
in interface RasterStoreProviderServices
public RasterStore getRasterStore()
getRasterStore
in interface RasterStoreProviderServices
public void useCache(java.lang.String providerName, DynObject parameters) throws DataException
useCache
in interface DataStore
DataException
public RasterCache getCache()
getCache
in interface DataStore
getCache
in interface RasterStore
public void intialize(DataManager dataManager, DataStoreParameters parameters) throws InitializeException
intialize
in interface DataStoreInitializer2
InitializeException
public void setProvider(DataStoreProvider provider)
setProvider
in interface DataStoreInitializer2
public void addBand(RasterStore store, int band) throws DataException
RasterStore
addBand
in interface RasterStore
DataException
public void addBands(RasterStore store, java.util.List<java.lang.Integer> bands) throws DataException
RasterStore
addBands
in interface RasterStore
DataException
public void clearAdditionalBands()
RasterStore
clearAdditionalBands
in interface RasterStore
public void removeBand(int band)
RasterStore
removeBand
in interface RasterStore
public boolean isOwnBand(int band)
RasterStore
isOwnBand
in interface RasterStore
public DataStoreProviderFactory getProviderFactory()
getProviderFactory
in interface DataStore
public BufferDimensions getDimensions() throws InitializeException
RasterStore
getDimensions
in interface RasterStore
InitializeException
public boolean isTiled()
isTiled
in interface RasterStore
public boolean hasDynMethod(java.lang.String name)
hasDynMethod
in interface DynObject_v2
public StoresRepository getStoresRepository()
getStoresRepository
in interface DataStore
public ResourcesStorage getResourcesStorage()
getResourcesStorage
in interface DataStore