Package com.kheops.jmap.server
Class JMapServerLayer
java.lang.Object
com.kheops.jmap.metadata.LocalizedObject
com.kheops.jmap.metadata.JMapObject
com.kheops.jmap.server.JMapServerLayer
- All Implemented Interfaces:
LayerConstants,LayerNode,Serializable,Cloneable
- Direct Known Subclasses:
JMapServerRasterLayer,JMapServerVectorLayer
public abstract class JMapServerLayer
extends JMapObject
implements LayerNode, LayerConstants, Serializable, Cloneable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Aclprotected longprotected intprotected SpatialDataSourceInfoDeprecated.protected StringThe description of the layer.protected intprotected intThe type of elements this layer contains.protected Rectangleprotected intThe geometry type to extract from the associated spatial data source.protected intThe id of the layer.protected JMapServerInfoReportConfigprotected Exceptionprotected longprotected longLayer properties are stored as bitwise values in this property.protected ServerLayerUpdateStatusprotected doubleprotected doubleprotected StringThe name of the layer.protected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected intprotected Pointprotected intThe id of the project that owns this layer.protected longprotected intprotected JMapServerStyleManagerFields inherited from interface com.kheops.jmap.client.layers.LayerConstants
DEFAULT_MAXIMUM_SCALE, DEFAULT_MINIMUM_SCALE, PERSONAL_LAYER_BASE_ID, PERSONAL_LAYER_MAX_ID, PROJECT_LAYER_BASE_ID, PROJECT_LAYER_MAX_ID, PROPERTY_ALL_SETTINGS, PROPERTY_ALWAYS_DRAW_SELECTION, PROPERTY_DRAW_GRID, PROPERTY_EDITABLE, PROPERTY_EDITING, PROPERTY_INCLUDE_IN_CONTEXT, PROPERTY_INDEX, PROPERTY_LISTED, PROPERTY_LOCAL, PROPERTY_MAX_SCALE, PROPERTY_MIN_SCALE, PROPERTY_PUBLISHED, PROPERTY_QUERIABLE, PROPERTY_SELECTABLE, PROPERTY_USE_CLIENT_CACHE, PROPERTY_VISIBLE, REQUEST_MODE_BY_REGION, REQUEST_MODE_BY_TILE, RESERVED_LAYER_BASE_ID, RESERVED_LAYER_MAX_ID, SYSTEM_LAYER_BASE_AUTO_ID, SYSTEM_LAYER_BASE_ID, SYSTEM_LAYER_MAX_ID, TILING_MODE_AUTO, TILING_MODE_MANUAL, USER_LAYER_BASE_AUTO_ID, USER_LAYER_BASE_ID, USER_LAYER_MAX_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedJMapServerLayer(int dataSourceId) JMapServerLayer(SpatialDataSourceInfo dataSourceInfo) -
Method Summary
Modifier and TypeMethodDescriptionabstract JMapServerLayerclone()protected voidclone(JMapServerLayer serverLayer) Clones all properties from this server layer into the specified JMapServerLayer instance.booleanintReturns the dataSourceInfo for this layer.Returns the description of the layer.getDescription(Locale locale) Returns the description of this layer for a specific locale.intGets the time at which a layer is automatically refreshedintintgetId()Returns the id of the layer.longlongReturns a bitwise value that contains all layer properties.doubledoublegetName()Returns the name of the layer.Returns the name of this layer for a specific locale.intlongReturns the a mask which contains all read-only properties for this layer.getStyle(double scale) Returns the style that was set for the specified scale.inthashCode()protected booleanisDataStructureDifferent(JMapServerLayer oldLayer) Compare with database-persisted layer to determine if some properties have changed.booleanbooleanbooleanbooleanisIndex()Returns whether this layer should be drawn in the client overview.booleanisListed()Returns the current listed state of the layer.booleanbooleanReturns whether this layer is published.booleanReturns the current selectable state of the layer.booleanReturns the current visibility state of the layervoidremoveTranslationsOtherThan(Locale[] locales) Removes anyLocalefrom this object that are not in the specifiedlocales.voidsetDataSourceInfo(SpatialDataSourceInfo dataSourceInfo) voidsetDescription(String description) Sets the description of the layer.voidsetDescription(String description, Locale locale) Sets the description of this layer for the specified Locale.voidsetDynamicRefresh(int seconds) Sets the time at which a layer is automatically refreshed.voidsetElementType(int elementType) voidsetId(int id) Sets the id of the layer.voidsetIndex(boolean flag) Sets whether this layer should be drawn in the client overview.voidsetLastUpdateTime(long lastUpdateTime) voidsetLayerProperties(long value) Sets all layer properties.voidsetListed(boolean listed) Sets the listed state of the layer.voidsetMaximumVisibleScale(double maximumVisibleScale) voidsetMinimumVisibleScale(double maximumVisibleScale) voidSets the name of the layer.voidSets the name of this layer for the specified Locale.voidprotected voidsetProjectId(int projectId) final voidsetProperty(long property, boolean enabled) Sets the state for the specified property.voidsetPublished(boolean published) Sets whether this layer is published.voidsetReadOnlyMask(long value) Sets the read-only properties mask.final voidsetReadOnlyProperty(long property, boolean isReadOnly) Sets the read-only state for the specified property.voidsetSelectable(boolean flag) Sets the selectable state of the layer.voidSets the style that should be used for the specified scale.voidsetStyleManager(JMapServerStyleManager styleManager) voidsetVisible(boolean flag) Sets the visibility state of the layer.abstract LayerInfoprotected voidtoLayerInfo(LayerInfo layerInfo) Copies all properties from this server layer to the specified layer info.abstract voidupdate(Projection projectProjection) protected voidMethods inherited from class com.kheops.jmap.metadata.JMapObject
clone, setAclMethods inherited from class com.kheops.jmap.metadata.LocalizedObject
getAvailableLocales, getTranslation, isTranslationExists, setTranslation, updateTranslations
-
Field Details
-
OBJECT_VERSION_ID_5_0
protected static final int OBJECT_VERSION_ID_5_0- See Also:
-
OBJECT_VERSION_ID_6_0
protected static final int OBJECT_VERSION_ID_6_0- See Also:
-
OBJECT_VERSION_ID_6_5
protected static final int OBJECT_VERSION_ID_6_5- See Also:
-
OBJECT_VERSION_ID_7_0
protected static final int OBJECT_VERSION_ID_7_0- See Also:
-
OBJECT_VERSION_ID_7_0_FUNAFUTI
protected static final int OBJECT_VERSION_ID_7_0_FUNAFUTI- See Also:
-
OBJECT_VERSION_ID_7_0_ISTANBUL
protected static final int OBJECT_VERSION_ID_7_0_ISTANBUL- See Also:
-
id
protected int idThe id of the layer. -
projectId
protected int projectIdThe id of the project that owns this layer. -
name
The name of the layer. -
description
The description of the layer. -
elementType
protected int elementTypeThe type of elements this layer contains. -
lastUpdateTime
protected long lastUpdateTime -
maximumVisibleScale
protected double maximumVisibleScale -
minimumVisibleScale
protected double minimumVisibleScale -
styleManager
-
extent
-
offset
-
readOnlyMask
protected long readOnlyMask -
layerProperties
protected long layerPropertiesLayer properties are stored as bitwise values in this property. -
geometryType
protected int geometryTypeThe geometry type to extract from the associated spatial data source. -
dataSourceInfo
Deprecated.UsegetDataSourceInfo()instead. -
dataSourceId
protected int dataSourceId -
cacheTimeout
protected long cacheTimeout -
status
protected transient int status -
lastException
-
layerUpdateStatus
-
infoReportConfig
-
acl
-
objectVersionId
protected int objectVersionId -
dynamicRefresh
protected int dynamicRefresh
-
-
Constructor Details
-
JMapServerLayer
protected JMapServerLayer() -
JMapServerLayer
protected JMapServerLayer(int dataSourceId) -
JMapServerLayer
-
-
Method Details
-
getStyle
Returns the style that was set for the specified scale.- Parameters:
scale- the scale.- Returns:
- the style that was set for the specified scale.
-
setStyle
Sets the style that should be used for the specified scale.- Parameters:
scale- the scale.style- the style to use.
-
getDataSourceInfo
Returns the dataSourceInfo for this layer.- Returns:
- the dataSourceInfo for the layer.
-
getDataSourceId
public int getDataSourceId() -
setDataSourceInfo
- Parameters:
dataSourceInfo- The dataSourceInfo to set.
-
isEnabledCaching
public boolean isEnabledCaching() -
toLayerInfo
-
update
-
getUpdateStatus
-
clone
-
clone
Clones all properties from this server layer into the specified JMapServerLayer instance.- Parameters:
serverLayer- the instance that will receive cloned properties.
-
toLayerInfo
Copies all properties from this server layer to the specified layer info.- Parameters:
layerInfo- the layer info to copy properties into.
-
getInfoReportConfig
-
getDescription
Returns the description of the layer.- Returns:
- the description of the layer.
-
getDescription
Returns the description of this layer for a specific locale.- Returns:
- description.
-
setDescription
Sets the description of the layer.- Parameters:
description- the description of the layer.
-
setDescription
Sets the description of this layer for the specified Locale.- Parameters:
description- the new given description.locale- the locale for this description
-
getName
Returns the name of the layer. -
getName
Returns the name of this layer for a specific locale.- Returns:
- name.
-
setName
Sets the name of the layer.- Parameters:
name- the name of the layer.
-
setName
Sets the name of this layer for the specified Locale.- Parameters:
name- the new given name.locale- the locale for this name
-
isNamed
-
getElementType
public int getElementType()- Returns:
- Returns the elementType.
-
setElementType
public void setElementType(int elementType) - Parameters:
elementType- The elementType to set.
-
getId
public int getId()Returns the id of the layer. -
setId
public void setId(int id) Sets the id of the layer.- Parameters:
id- the id of the layer.
-
getProjectId
public int getProjectId() -
setProjectId
protected void setProjectId(int projectId) -
isIndex
public boolean isIndex()Returns whether this layer should be drawn in the client overview.- Returns:
- whether this layer should be drawn in the client overview.
- See Also:
-
setIndex
public void setIndex(boolean flag) Sets whether this layer should be drawn in the client overview.- Parameters:
flag- the new state of the property.- See Also:
-
getLastUpdateTime
public long getLastUpdateTime()- Returns:
- Returns the lastUpdateTime.
-
setLastUpdateTime
public void setLastUpdateTime(long lastUpdateTime) - Parameters:
lastUpdateTime- The lastUpdateTime to set.
-
getMaximumVisibleScale
public double getMaximumVisibleScale() -
setMaximumVisibleScale
public void setMaximumVisibleScale(double maximumVisibleScale) -
getMinimumVisibleScale
public double getMinimumVisibleScale() -
setMinimumVisibleScale
public void setMinimumVisibleScale(double maximumVisibleScale) -
setSelectable
public void setSelectable(boolean flag) Sets the selectable state of the layer. Selection tools can check this state using the method getSelectable to determine if this layer should be processed.- Parameters:
flag- if true, the layer will be selectable otherwise not selectable
-
isSelectable
public boolean isSelectable()Returns the current selectable state of the layer.- Returns:
- true if the layer is selectable, false otherwise
-
getStyleManager
- Returns:
- Returns the styleManager.
-
setStyleManager
- Parameters:
styleManager- the styleManager to set.
-
setListed
public void setListed(boolean listed) Sets the listed state of the layer. This flag can be used to determine if the layer should be hidden to the user in a list of layers.- Parameters:
listed- if true, the layer will be a listed layer otherwise a normal layer
-
isListed
public boolean isListed()Returns the current listed state of the layer.- Returns:
- true if the layer is a listed layer, false otherwise
-
setVisible
public void setVisible(boolean flag) Sets the visibility state of the layer. If a layer is invisible, it is not drawn in a view.- Specified by:
setVisiblein interfaceLayerNode- Parameters:
flag- if true, the layer will be visible otherwise invisible
-
isVisible
public boolean isVisible()Returns the current visibility state of the layer -
isPublished
public boolean isPublished()Returns whether this layer is published.- Returns:
- true if this layer is published.
-
setPublished
public void setPublished(boolean published) Sets whether this layer is published.- Parameters:
published- a boolean which defines if this layer is published.
-
getOffset
-
setOffset
-
setReadOnlyProperty
public final void setReadOnlyProperty(long property, boolean isReadOnly) Sets the read-only state for the specified property.- Parameters:
property- the property to set.isReadOnly- the read-only state.
-
setProperty
public final void setProperty(long property, boolean enabled) Sets the state for the specified property.- Parameters:
property- the property to set.enabled- the property state.
-
getReadOnlyMask
public long getReadOnlyMask()Returns the a mask which contains all read-only properties for this layer.- Returns:
- the mask which defines read-only properties of the layer.
-
setReadOnlyMask
public void setReadOnlyMask(long value) Sets the read-only properties mask.- Parameters:
value- the read-only mask.
-
getLayerProperties
public long getLayerProperties()Returns a bitwise value that contains all layer properties.- Returns:
- a value that contains all layer properties.
-
setLayerProperties
public void setLayerProperties(long value) Sets all layer properties.- Parameters:
value- a bitwise value that contains all layer properties.
-
validateObjectImpl
protected void validateObjectImpl() -
isDynamic
public boolean isDynamic()- Returns:
- true if the layer is dynamic and is automatically refreshed periodically.
- Since:
- 6.5
-
getDynamicRefresh
public int getDynamicRefresh()Gets the time at which a layer is automatically refreshed- Returns:
- the time in seconds
- Since:
- 6.5
-
setDynamicRefresh
public void setDynamicRefresh(int seconds) Sets the time at which a layer is automatically refreshed. A zero or negative value indicates that the layer is not dynamic.- Since:
- 6.5
-
isEditable
public boolean isEditable() -
hashCode
public int hashCode()- Overrides:
hashCodein classJMapObject
-
equals
- Overrides:
equalsin classJMapObject
-
removeTranslationsOtherThan
Description copied from class:LocalizedObjectRemoves anyLocalefrom this object that are not in the specifiedlocales.locales[0]should be the default language- Overrides:
removeTranslationsOtherThanin classLocalizedObject- Parameters:
locales-
-
isDataStructureDifferent
Compare with database-persisted layer to determine if some properties have changed. If any data-sensible property has changed, we need to update last update time to notify remote servers that layer data needs to be updated.- Returns:
trueif we need to update property lastUpdateTime,falseotherwise.
-
getDataSourceInfo()instead.