public class ServiceInvoker
extends java.lang.Object
ServiceDescriptor
.
This class divides the input
ServiceParam
s defined by the
ServiceDescriptor
into three different categories
according to how their values are acquired at service invocation time:
The DataLink-1.0 standard is not very explicit about this distinction, but the above division appears(?) to be the consensus of the standard authors. This does not however prevent service invocations filling these parameter values differently than according to the above outline. For instance, users may be given the option to change the values of fixed or row parameters for a given invocation.
Constructor | Description |
---|---|
ServiceInvoker(uk.ac.starlink.votable.datalink.ServiceDescriptor descriptor,
uk.ac.starlink.table.StarTable resultTable) |
Attempts to construct an invoker based on
a service descriptor and an associated results table.
|
Modifier and Type | Method | Description |
---|---|---|
java.net.URL |
completeUrl(java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> paramMap) |
Assembles an invocation URL from the base URL of this service and any
name-value pairs supplied in a given map.
|
java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> |
getFixedParamMap() |
Returns a parameter-value map for the fixed parameters.
|
uk.ac.starlink.votable.datalink.ServiceParam[] |
getFixedParams() |
Returns the 'fixed' parameters of this service.
|
java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> |
getRowParamMap(java.lang.Object[] row) |
Constructs a parameter-value map for the row parameters
at a given table row.
|
uk.ac.starlink.votable.datalink.ServiceParam[] |
getRowParams() |
Returns the 'row' parameters of this service.
|
uk.ac.starlink.votable.datalink.ServiceDescriptor |
getServiceDescriptor() |
Returns this invoker's service descriptor.
|
java.net.URL |
getUrl(java.lang.Object[] row,
java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> userParamMap) |
Assembles an invocation URL from the base URL of this service,
the values of any row parameters corresponding to a supplied
table row, and any additional parameters supplied explicitly.
|
uk.ac.starlink.votable.datalink.ServiceParam[] |
getUserParams() |
Returns the 'user' parameters of this service.
|
public ServiceInvoker(uk.ac.starlink.votable.datalink.ServiceDescriptor descriptor, uk.ac.starlink.table.StarTable resultTable) throws java.net.MalformedURLException, java.io.IOException
descriptor
- service descriptorresultTable
- result table corresponding to the descriptorjava.net.MalformedURLException
- if the descriptor's accessUrl is no goodjava.io.IOException
- if the descriptor references a column that is
not present in the result tablepublic uk.ac.starlink.votable.datalink.ServiceDescriptor getServiceDescriptor()
public uk.ac.starlink.votable.datalink.ServiceParam[] getRowParams()
public uk.ac.starlink.votable.datalink.ServiceParam[] getFixedParams()
public uk.ac.starlink.votable.datalink.ServiceParam[] getUserParams()
public java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> getFixedParamMap()
public java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> getRowParamMap(java.lang.Object[] row)
row
- a row of cell values from this invoker's tablepublic java.net.URL completeUrl(java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> paramMap)
paramMap
- map representing parameter values to be
appended to this service's base URLpublic java.net.URL getUrl(java.lang.Object[] row, java.util.Map<uk.ac.starlink.votable.datalink.ServiceParam,java.lang.String> userParamMap)
This utility method calls the methods
getRowParamMap
,
getFixedParamMap
and
completeUrl
.
row
- table rowuserParamMap
- additional non-'row' parameter-value pairs,
usually corresponding to the 'user' parametersCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.