aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/libvoclient/_api
blob: df5aa6206ad53dd98633fd661f35938fab949c54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
**
**  VOCLient Library --  Client interface library to the DAL Server
**  application.  This API allows non-Java programs to make use of the  DAL
**  client interface by means of a remote procedure call between this
**  interface and the DAL server.  State is maintained in the server and
**  values passed back are language-neutral integer 'handles' on the remote
**  objects, or simple int/double/string values.
**
**  All tasks must initialize the VO Client and establish a connection to
**  the DAL server by calling voc_initVOClient() before making any service
**  connections, thereafter new connections may be opened/closed at will.
**  Convenience procedures allow for easy use of specific services, e.g. Cone
**  or Siap.  Service-specific parameters may be added to a query using the
**  voc_add<type>Param() calls.  No action is taken until an execute of the
**  query is performed, applications may get back a handle on the result and
**  interrogate attributes directly, the raw VOTable or a CSV/TSV/ASCII
**  representation of the result may also be returned.
**
**  High-Level Functions:
**  ---------------------
**
**               voc_initVOClient (config_opts)
**              voc_closeVOClient (shutdown_flag)
**              voc_abortVOClient (errcode, errmsg)
** 
**        string = voc_coneCaller (url, ra, dec, sr, otype)
**  status = voc_coneCallerToFile (url, ra, dec, sr, otype, file)
**        string = voc_siapCaller (url, ra, dec, rsize, dsize, fmt, otype)
**  status = voc_siapCallerToFile (url, ra, dec, rsize, dsize, fmt, otype, file)
**        string = voc_ssapCaller (url, ra, dec, size, band, time, fmt)
**  status = voc_ssapCallerToFile (url, ra, dec, size, band, time, fmt, file)
** 
**         string = voc_getRawURL (url, buflen)
**
**
**  Main DAL Interface Procedures:
**  ------------------------------
**
**       dal = voc_openConnection (svc_url, type)
**   dal = voc_openConeConnection (svc_url)		    # Utility aliases
**   dal = voc_openSiapConnection (svc_url)
**   dal = voc_openSsapConnection (svc_url)
**            voc_closeConnection (dal)
** 
**    count = voc_getServiceCount (dal)
**              voc_addServiceURL (dal, svc_url)
**        url = voc_getServiceURL (dal, index)
** 
**           query = voc_getQuery (dal, type)
**       query = voc_getConeQuery (dal, ra, dec, sr)
**       query = voc_getSiapQuery (dal, ra, dec, ra_size, dec_size, format)
**       query = voc_getSsapQuery (dal, ra, dec, size, band, time, format)
**
**         stat = voc_addIntParam (query, pname, ival)
**       stat = voc_addFloatParam (query, pname, dval)
**      stat = voc_addStringParam (query, pname, str)
** 
**   url_str = voc_getQueryString (query, type, index)
**
**          qr = voc_executeQuery (query)
**      qr = voc_getQueryResponse (query)
**       csv_tab = voc_executeCSV (query)
**       tsv_tab = voc_executeTSV (query)
**       ascii = voc_executeASCII (query)
**   vot_str = voc_executeVOTable (query)
**
**     count = voc_getRecordCount (qr)
**            rec = voc_getRecord (qr, recnum)
**         str = voc_getFieldAttr (qr, fieldnum, attr)
**
**        attr = voc_getAttribute (rec, char *attrname)
**       count = voc_getAttrCount (rec)                   
**     list_str = voc_getAttrList (rec)                   
**
**            ival = voc_intValue (attr)
**          dval = voc_floatValue (attr)
**          str = voc_stringValue (attr)
**
**          stat = voc_getDataset (rec, acref, fname) 
**
**
**  Sesame Name Resolver Interface:
**  -------------------------------
**
**          sr = voc_nameResolver (target)
**      pos_str = voc_resolverPos (sr)
**         radeg = voc_resolverRA (sr)
**       decdeg = voc_resolverDEC (sr)
**     ra_err = voc_resolverRAErr (sr)
**   dec_err = voc_resolverDECErr (sr)
**    typ_str = voc_resolverOtype (sr)
** 
**
**
**  RegistryQuery
**  ----------------------
** 
**  High-Level Query:
** 
**           res = voc_regSearch (sql, keywords, orValues)
**   res =voc_regSearchByService (svc, term, orValues)
** 
**  Programmatic Query:
** 
**          query = voc_regQuery (term, orValues) 	// OR keyword list?
** 
**           voc_regConstSvcType (query, svcType)	// search constraints
**          voc_regConstWaveband (query, waveband)
**                voc_regDALOnly (query, value)
**                voc_regSortRes (query, value)
** 
**          voc_regAddSearchTerm (query, term, orValue)	// OR term w/ previous
**       voc_regRemoveSearchTerm (query, term)		// remove search term
**     count = voc_regGetSTCount (query)
** 
**   str = voc_regGetQueryString (query)		// GET form of query
** 
**          res = voc_regExecute (query)		// return result obj
**       str = voc_regExecuteRaw (query)		// return raw XML
** 
**  RegistryQueryResult
** 
**     count = voc_resGetCount  (res)
** 
**         str = voc_resGetStr  (res, attribute, index)
**      dval = voc_resGetFloat  (res, attribute, index)
**        ival = voc_resGetInt  (res, attribute, index)
** 
**     For this implementation, we've chose to use the NVO Registry at
**  JHU/STScI, specifically the QueryRegistry() method which provides a
**  'SimpleResource' form of the resource record.  Support for the newer
**  IVOA standard will be added later, for now we can quickly access the most
**  commonly used fields of a resource using both a keyword and SQL form of
**  the search.
** 
*/