public class LocalMVSService extends java.lang.Object implements LocationService, MVSService
MVSService
implementation used to communicate with a standalone instance of MVSuggest service.
The MVS location can be a path to the a whole MVS directory or only to a repository containing the layer templates.
An MVS repository has the following structure:
Constructor and Description |
---|
LocalMVSService() |
Modifier and Type | Method and Description |
---|---|
MVSQueryRequester |
createQueryRequester()
Creates an instance of
MVSQueryRequester used to send match requests |
void |
environmentCleanup(Configuration conf)
Performs cleanning tasks like removing temporal file.
|
void |
environmentSetup(Configuration conf)
Performs the necessary setup before running a job.
|
java.lang.String[] |
getLayers()
Gets the layers indexed by MVSuggest
|
MVSConfig |
getMVSConfig()
Gets the MVSuggest configuration bean
|
java.lang.String |
getTemplate(java.lang.String layer)
Gets the template content for a single layer
|
void |
init(Configuration config)
Initializes a single instance per task.
|
void |
init(java.lang.String serviceDirLocation, java.lang.String[] matchLayers)
Initialize the service with the specified server URL.
|
java.util.List<GeoAreaInfo> |
searchResult(java.util.List<java.lang.String> datas)
Return the geometric area informations of the data strings.
|
GeoAreaInfo |
searchResult(java.lang.String data)
Return the geometric area information of the data string.
|
public MVSQueryRequester createQueryRequester()
MVSService
MVSQueryRequester
used to send match requestscreateQueryRequester
in interface MVSService
public void environmentCleanup(Configuration conf) throws java.io.IOException
MVSService
environmentCleanup
in interface MVSService
conf
- the job configurationjava.io.IOException
public void environmentSetup(Configuration conf) throws java.io.IOException
MVSService
environmentSetup
in interface MVSService
conf
- the job configurationjava.io.IOException
public java.lang.String[] getLayers()
MVSService
getLayers
in interface MVSService
public MVSConfig getMVSConfig()
MVSService
getMVSConfig
in interface MVSService
public java.lang.String getTemplate(java.lang.String layer)
MVSService
getTemplate
in interface MVSService
layer
- the template content in JSON formatpublic void init(Configuration config) throws java.io.IOException
MVSService
init
in interface MVSService
config
- the job configurationjava.io.IOException
public void init(java.lang.String serviceDirLocation, java.lang.String[] matchLayers) throws java.io.IOException
LocationService
init
in interface LocationService
serviceDirLocation
- the server URLmatchLayers
- optional - which layers should be used to searchjava.io.IOException
- thrown if an IOException occurs.public java.util.List<GeoAreaInfo> searchResult(java.util.List<java.lang.String> datas) throws java.io.IOException
LocationService
searchResult
in interface LocationService
datas
- data stringsjava.io.IOException
- thrown if an IOException occurs.public GeoAreaInfo searchResult(java.lang.String data) throws java.io.IOException
LocationService
searchResult
in interface LocationService
data
- data stringjava.io.IOException
- thrown if an IOException occurs.Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.