Package org.openremote.manager.map
Class MapService
java.lang.Object
org.openremote.manager.map.MapService
- All Implemented Interfaces:
org.openremote.model.ContainerService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classTheMapService.Metadataclass validates thatMapService.Metadata.boundsandMapService.Metadata.centerfollow the mbtiles-spec. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Connectionprotected intstatic final Stringprotected com.fasterxml.jackson.databind.node.ObjectNodeprotected ConcurrentMap<String, com.fasterxml.jackson.databind.node.ObjectNode> protected ConcurrentMap<String, com.fasterxml.jackson.databind.node.ObjectNode> protected MapService.Metadatastatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final intstatic final Stringstatic final Stringprotected Stringstatic final Stringstatic final StringFields inherited from interface org.openremote.model.ContainerService
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcloseQuietly(PreparedStatement query, ResultSet result) voidcom.fasterxml.jackson.databind.node.ObjectNodecom.fasterxml.jackson.databind.node.ObjectNodegetMapSettings(String realm, URI host) Dynamically build Mapbox GL settings based on mapsettings.jsoncom.fasterxml.jackson.databind.node.ObjectNodegetMapSettingsJs(String realm, URI host) Dynamically build Mapbox JS settings based on mapsettings.jsonbyte[]getMapTile(int zoom, int column, int row) protected static MapService.MetadatagetMetadata(Connection connection) voidinit(org.openremote.model.Container container) com.fasterxml.jackson.databind.node.ObjectNodesaveMapConfig(org.openremote.model.manager.MapConfig mapConfiguration) voidsaveMapMetadata(MapService.Metadata metadata) voidsaveUploadedFile(String filename, InputStream fileInputStream) setData(boolean skipCustom) Connects to mbtiles DB and loads metadatavoidstart(org.openremote.model.Container container) voidstop(org.openremote.model.Container container) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openremote.model.ContainerService
getPriority
-
Field Details
-
MAP_SHARED_DATA_BASE_URI
- See Also:
-
OR_MAP_TILESERVER_HOST
- See Also:
-
OR_MAP_TILESERVER_HOST_DEFAULT
-
OR_MAP_TILESERVER_PORT
- See Also:
-
OR_MAP_TILESERVER_PORT_DEFAULT
public static final int OR_MAP_TILESERVER_PORT_DEFAULT- See Also:
-
OR_CUSTOM_MAP_SIZE_LIMIT
- See Also:
-
OR_CUSTOM_MAP_SIZE_LIMIT_DEFAULT
public static final int OR_CUSTOM_MAP_SIZE_LIMIT_DEFAULT- See Also:
-
RASTER_MAP_TILE_PATH
- See Also:
-
TILESERVER_TILE_PATH
- See Also:
-
OR_MAP_TILESERVER_REQUEST_TIMEOUT
- See Also:
-
OR_MAP_TILESERVER_REQUEST_TIMEOUT_DEFAULT
public static final int OR_MAP_TILESERVER_REQUEST_TIMEOUT_DEFAULT- See Also:
-
OR_PATH_PREFIX
- See Also:
-
OR_PATH_PREFIX_DEFAULT
- See Also:
-
connection
-
metadata
-
mapConfig
protected com.fasterxml.jackson.databind.node.ObjectNode mapConfig -
mapSettings
-
mapSettingsJs
-
pathPrefix
-
customMapLimit
protected int customMapLimit
-
-
Constructor Details
-
MapService
public MapService()
-
-
Method Details
-
saveMapConfig
public com.fasterxml.jackson.databind.node.ObjectNode saveMapConfig(org.openremote.model.manager.MapConfig mapConfiguration) throws RuntimeException - Throws:
RuntimeException
-
getMetadata
-
closeQuietly
-
init
- Specified by:
initin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
start
- Specified by:
startin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
setData
Connects to mbtiles DB and loads metadata- Returns:
- Path of connected mbtiles file
- Throws:
IOExceptionClassNotFoundExceptionSQLExceptionNullPointerException
-
stop
- Specified by:
stopin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
getMapSettings
Dynamically build Mapbox GL settings based on mapsettings.json -
getMapSettingsJs
Dynamically build Mapbox JS settings based on mapsettings.json -
getMapTile
public byte[] getMapTile(int zoom, int column, int row) -
saveUploadedFile
public void saveUploadedFile(String filename, InputStream fileInputStream) throws IOException, IllegalArgumentException - Throws:
IOExceptionIllegalArgumentException
-
deleteUploadedFile
- Throws:
IOException
-
saveMapMetadata
-
getCustomMapInfo
- Throws:
IOException
-