Changeset 4440 for trunk/Nebulous/nebclient
- Timestamp:
- Jun 29, 2005, 4:35:06 PM (21 years ago)
- Location:
- trunk/Nebulous/nebclient
- Files:
-
- 7 edited
-
bootstrap.sh (modified) (1 diff)
-
configure.ac (modified) (1 diff)
-
nebulous.wsdl (modified) (4 diffs)
-
src/Makefile.am (modified) (2 diffs)
-
src/nebclient.c (modified) (14 diffs)
-
src/nebclient.h (modified) (1 diff)
-
src/test.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/nebclient/bootstrap.sh
r3098 r4440 3 3 # Copyright (C) 2005 Joshua Hoblitt 4 4 # 5 # $Id: bootstrap.sh,v 1. 7 2005-01-27 01:08:05 jhoblitt Exp $5 # $Id: bootstrap.sh,v 1.8 2005-06-30 02:35:05 jhoblitt Exp $ 6 6 7 wsdl2h -o src/ idata.h -c idata.wsdl \8 && soapcpp2 -d src -c src/ idata.h \7 wsdl2h -o src/nebulous.h -c nebulous.wsdl \ 8 && soapcpp2 -d src -c src/nebulous.h \ 9 9 && rm -f src/*.xml 10 10 -
trunk/Nebulous/nebclient/configure.ac
r3017 r4440 1 1 dnl Copyright (C) 2005 Joshua Hoblitt 2 2 dnl 3 dnl $Id: configure.ac,v 1. 2 2005-01-16 10:37:59jhoblitt Exp $3 dnl $Id: configure.ac,v 1.3 2005-06-30 02:35:05 jhoblitt Exp $ 4 4 5 5 dnl Process this file with autoconf to produce a configure script. 6 AC_INIT([ idataclient], [0.0.1], [jhoblitt@cpan.org])6 AC_INIT([nebulousclient], [0.0.1], [jhoblitt@cpan.org]) 7 7 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) 8 AC_REVISION([$Revision: 1. 2$])8 AC_REVISION([$Revision: 1.3 $]) 9 9 10 10 dnl generate config.h -
trunk/Nebulous/nebclient/nebulous.wsdl
r3061 r4440 1 1 <?xml version="1.0"?> 2 <definitions name=" IDataServer"3 targetNamespace="urn: PS/IPP/IData/Server/SOAP"4 xmlns:tns="urn: PS/IPP/IData/Server/SOAP"2 <definitions name="NebulousServer" 3 targetNamespace="urn:Nebulous/Server/SOAP" 4 xmlns:tns="urn:Nebulous/Server/SOAP" 5 5 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 6 6 xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" 7 7 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 8 8 xmlns="http://schemas.xmlsoap.org/wsdl/" 9 xmlns:ns="urn: PS/IPP/IData/Server/SOAP">9 xmlns:ns="urn:Nebulous/Server/SOAP"> 10 10 11 11 <types> 12 12 <schema xmlns="http://www.w3.org/2001/XMLSchema" 13 targetNamespace="urn: PS/IPP/IData/Server/SOAP"13 targetNamespace="urn:Nebulous/Server/SOAP" 14 14 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 15 15 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> … … 85 85 86 86 87 <portType name=" PS/IPP/IData/Server/SOAPPort">87 <portType name="Nebulous/Server/SOAPPort"> 88 88 <operation name="create_object"> 89 89 <input message="tns:create_objectRequest" /> … … 138 138 139 139 140 <binding name="SOAP" type="tns: PS/IPP/IData/Server/SOAPPort">140 <binding name="SOAP" type="tns:Nebulous/Server/SOAPPort"> 141 141 <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 142 142 <operation name="create_object"> 143 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#create_object" />144 <input> 145 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"146 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 147 </input> 148 <output> 149 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"143 <soap:operation soapAction="urn:Nebulous/Server/SOAP#create_object" /> 144 <input> 145 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 146 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 147 </input> 148 <output> 149 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 150 150 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 151 151 </output> 152 152 </operation> 153 153 <operation name="replicate_object"> 154 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#replicate_object" />155 <input> 156 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"157 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 158 </input> 159 <output> 160 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"154 <soap:operation soapAction="urn:Nebulous/Server/SOAP#replicate_object" /> 155 <input> 156 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 157 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 158 </input> 159 <output> 160 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 161 161 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 162 162 </output> 163 163 </operation> 164 164 <operation name="lock_object"> 165 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#lock_object" />166 <input> 167 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"168 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 169 </input> 170 <output> 171 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"165 <soap:operation soapAction="urn:Nebulous/Server/SOAP#lock_object" /> 166 <input> 167 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 168 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 169 </input> 170 <output> 171 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 172 172 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 173 173 </output> 174 174 </operation> 175 175 <operation name="unlock_object"> 176 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#unlock_object" />177 <input> 178 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"179 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 180 </input> 181 <output> 182 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"176 <soap:operation soapAction="urn:Nebulous/Server/SOAP#unlock_object" /> 177 <input> 178 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 179 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 180 </input> 181 <output> 182 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 183 183 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 184 184 </output> 185 185 </operation> 186 186 <operation name="find_instances"> 187 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#find_instances" />188 <input> 189 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"190 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 191 </input> 192 <output> 193 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"187 <soap:operation soapAction="urn:Nebulous/Server/SOAP#find_instances" /> 188 <input> 189 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 190 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 191 </input> 192 <output> 193 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 194 194 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 195 195 </output> 196 196 </operation> 197 197 <operation name="delete_instance"> 198 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#delete_instance" />199 <input> 200 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"201 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 202 </input> 203 <output> 204 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"198 <soap:operation soapAction="urn:Nebulous/Server/SOAP#delete_instance" /> 199 <input> 200 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 201 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 202 </input> 203 <output> 204 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 205 205 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 206 206 </output> 207 207 </operation> 208 208 <operation name="stat_object"> 209 <soap:operation soapAction="urn: PS/IPP/IData/Server/SOAP#stat_object" />210 <input> 211 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"212 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 213 </input> 214 <output> 215 <soap:body use="encoded" namespace="urn: PS/IPP/IData/Server/SOAP"209 <soap:operation soapAction="urn:Nebulous/Server/SOAP#stat_object" /> 210 <input> 211 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 212 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 213 </input> 214 <output> 215 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 216 216 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 217 217 </output> … … 220 220 221 221 222 <service name=" PS/IPP/IData/Server/SOAP">223 <port name=" PS/IPP/IData/Server/SOAPPort" binding="tns:SOAP">224 <soap:address location="http://localhost:80/ idata" />222 <service name="Nebulous/Server/SOAP"> 223 <port name="Nebulous/Server/SOAPPort" binding="tns:SOAP"> 224 <soap:address location="http://localhost:80/nebulous" /> 225 225 </port> 226 226 </service> -
trunk/Nebulous/nebclient/src/Makefile.am
r3052 r4440 1 1 # Copyright (C) 2005 Joshua Hoblitt 2 2 # 3 # $Id: Makefile.am,v 1. 3 2005-01-19 00:31:35jhoblitt Exp $3 # $Id: Makefile.am,v 1.4 2005-06-30 02:35:06 jhoblitt Exp $ 4 4 5 include_HEADERS= idataclient.h6 lib_LTLIBRARIES = lib idataclient.la7 lib idataclient_la_LDFLAGS = -release @PACKAGE_VERSION@8 lib idataclient_la_SOURCES =\9 idataclient.h\10 idataclient.c\5 include_HEADERS=nebclient.h 6 lib_LTLIBRARIES = libnebclient.la 7 libnebclient_la_LDFLAGS = -release @PACKAGE_VERSION@ 8 libnebclient_la_SOURCES =\ 9 nebclient.h\ 10 nebclient.c\ 11 11 xmalloc.h\ 12 12 xmalloc.c\ … … 21 21 bin_PROGRAMS = test 22 22 test_SOURCES = test.c 23 test_LDADD = lib idataclient.la23 test_LDADD = libnebclient.la -
trunk/Nebulous/nebclient/src/nebclient.c
r4121 r4440 1 1 /* 2 * idataclient.c - idataclient2 * nebclient.c - nebulous client 3 3 * 4 4 * Copyright (C) 2005 Joshua Hoblitt 5 5 * 6 * $Id: nebclient.c,v 1. 3 2005-06-06 21:21:05jhoblitt Exp $6 * $Id: nebclient.c,v 1.4 2005-06-30 02:35:06 jhoblitt Exp $ 7 7 */ 8 8 … … 18 18 #include "soapH.h" 19 19 #include "SOAP.nsmap" 20 #include " idataclient.h"20 #include "nebclient.h" 21 21 22 22 #define ERRBUF_SIZE 255 23 23 24 static off_t idataCopyFile(char *source, char *dest);25 static off_t idataCopyFilehandle(int sourceFH, int destFH);26 27 void idataServerInit(idataServer *server)24 static off_t nebCopyFile(char *source, char *dest); 25 static off_t nebCopyFilehandle(int sourceFH, int destFH); 26 27 void nebServerInit(nebServer *server) 28 28 { 29 29 soap_init(server); 30 30 } 31 31 32 char * idataServerErr(idataServer *server)32 char *nebServerErr(nebServer *server) 33 33 { 34 34 char *fault; … … 45 45 } 46 46 47 void idataServerCleanup(idataServer *server)47 void nebServerCleanup(nebServer *server) 48 48 { 49 49 soap_end(server); // remove deserialized data and clean up … … 51 51 } 52 52 53 int idataCreate(idataServer *server, char *key, unsigned int class, char *volume, char *comment, char **URI)53 int nebCreate(nebServer *server, char *key, unsigned int class, char *volume, char *comment, char **URI) 54 54 { 55 55 struct ns1__create_USCOREobjectResponse response; … … 61 61 strcpy(*URI, response.result); 62 62 63 if (! idataParseURI(*URI, &filename)) {63 if (!nebParseURI(*URI, &filename)) { 64 64 fprintf(stderr, "can not parse URI\n"); 65 65 … … 81 81 } 82 82 83 int idataReplicate(idataServer *server, char *key, char *volume, char **URI )83 int nebReplicate(nebServer *server, char *key, char *volume, char **URI ) 84 84 { 85 85 struct ns1__replicate_USCOREobjectResponse response; … … 91 91 strcpy(*URI, response.result); 92 92 93 if (! idataParseURI(*URI, &filename)) {93 if (!nebParseURI(*URI, &filename)) { 94 94 fprintf(stderr, "can not parse URI\n"); 95 95 … … 97 97 } 98 98 99 sourceFH = idataOpen(server, key, IDATA_READ);99 sourceFH = nebOpen(server, key, NEB_READ); 100 100 if (sourceFH == -1) { 101 101 fprintf(stderr, "can not open key %s\n", key ); … … 111 111 } 112 112 113 idataCopyFilehandle(sourceFH, destFH);113 nebCopyFilehandle(sourceFH, destFH); 114 114 115 115 if (close(sourceFH) == -1) { … … 130 130 } 131 131 132 int idataCull( idataServer *server,char *key )133 { 134 135 return 0; 136 } 137 138 int idataLock(idataServer *server, char *key, rw flag )139 { 140 141 return 0; 142 } 143 144 int idataUnlock(idataServer *server, char *key, rw flag )145 { 146 147 return 0; 148 } 149 150 int idataFindInstances(idataServer *server, char *key, char *volume, char ***locations)132 int nebCull( nebServer *server,char *key ) 133 { 134 135 return 0; 136 } 137 138 int nebLock(nebServer *server, char *key, rw flag ) 139 { 140 141 return 0; 142 } 143 144 int nebUnlock(nebServer *server, char *key, rw flag ) 145 { 146 147 return 0; 148 } 149 150 int nebFindInstances(nebServer *server, char *key, char *volume, char ***locations) 151 151 { 152 152 struct ns1__find_USCOREinstancesResponse response; … … 179 179 } 180 180 181 int idataFind(idataServer *server, char *key )182 { 183 184 return 0; 185 } 186 187 int idataOpen(idataServer *server, char *key, rw flag )188 { 189 190 return 0; 191 } 192 193 int idataDelete(idataServer *server, char *key )194 { 195 196 return 0; 197 } 198 199 int idataCopy(idataServer *server, char *key, char *newKey )200 { 201 202 return 0; 203 } 204 205 int idataMove(idataServer *server, char *key, char *newKey )206 { 207 208 return 0; 209 } 210 211 int idataDelete_instance(idataServer *server, char *URI )212 { 213 214 return 0; 215 } 216 217 int idataStat(idataServer *server, char *key )218 { 219 220 return 0; 221 } 222 223 int idataErr(idataServer *server, char *errString )224 { 225 226 return 0; 227 } 228 229 int idataParseURI(const char *URI, char **filename)181 int nebFind(nebServer *server, char *key ) 182 { 183 184 return 0; 185 } 186 187 int nebOpen(nebServer *server, char *key, rw flag ) 188 { 189 190 return 0; 191 } 192 193 int nebDelete(nebServer *server, char *key ) 194 { 195 196 return 0; 197 } 198 199 int nebCopy(nebServer *server, char *key, char *newKey ) 200 { 201 202 return 0; 203 } 204 205 int nebMove(nebServer *server, char *key, char *newKey ) 206 { 207 208 return 0; 209 } 210 211 int nebDelete_instance(nebServer *server, char *URI ) 212 { 213 214 return 0; 215 } 216 217 int nebStat(nebServer *server, char *key ) 218 { 219 220 return 0; 221 } 222 223 int nebErr(nebServer *server, char *errString ) 224 { 225 226 return 0; 227 } 228 229 int nebParseURI(const char *URI, char **filename) 230 230 { 231 231 regex_t myregex; … … 270 270 } 271 271 272 void idataFree(void *ptr) {272 void nebFree(void *ptr) { 273 273 xfree(ptr); 274 274 } 275 275 276 static off_t idataCopyFile(char *source, char *dest)276 static off_t nebCopyFile(char *source, char *dest) 277 277 { 278 278 int sourceFH; … … 294 294 } 295 295 296 bytesCopied = idataCopyFilehandle(sourceFH, destFH);296 bytesCopied = nebCopyFilehandle(sourceFH, destFH); 297 297 if (bytesCopied < 0) { 298 298 return -1; … … 314 314 } 315 315 316 static off_t idataCopyFilehandle(int sourceFH, int destFH)316 static off_t nebCopyFilehandle(int sourceFH, int destFH) 317 317 { 318 318 off_t bytesTotal; -
trunk/Nebulous/nebclient/src/nebclient.h
r4121 r4440 1 1 /* 2 * idataclient - idata client2 * nebclient.h - nebulous client header 3 3 * 4 4 * Copyright (C) 2005 Joshua Hoblitt 5 5 * 6 * $Id: nebclient.h,v 1. 5 2005-06-06 21:21:05jhoblitt Exp $6 * $Id: nebclient.h,v 1.6 2005-06-30 02:35:06 jhoblitt Exp $ 7 7 */ 8 8 9 #ifndef IDATACLIENT_H10 #define IDATACLIENT_H 19 #ifndef NEBCLIENT_H 10 #define NEBCLIENT_H 1 11 11 12 12 #include "soapH.h" 13 13 14 typedef enum { IDATA_READ, IDATA_WRITE } rw;15 typedef struct soap idataServer;14 typedef enum { NEB_READ, NEB_WRITE } rw; 15 typedef struct soap nebServer; 16 16 17 void idataServerInit(idataServer *server);17 void nebServerInit(nebServer *server); 18 18 19 char * idataServerErr(idataServer *server);19 char *nebServerErr(nebServer *server); 20 20 21 void idataServerCleanup(idataServer *server);21 void nebServerCleanup(nebServer *server); 22 22 23 int idataCreate(idataServer *server, char *key, unsigned int class, char *volume, char *comment, char **URI);23 int nebCreate(nebServer *server, char *key, unsigned int class, char *volume, char *comment, char **URI); 24 24 25 int idataReplicate(idataServer *server, char *key, char *volume, char **URI);25 int nebReplicate(nebServer *server, char *key, char *volume, char **URI); 26 26 27 int idataCull(idataServer *server, char *key);27 int nebCull(nebServer *server, char *key); 28 28 29 int idataLock(idataServer *server, char *key, rw flag);29 int nebLock(nebServer *server, char *key, rw flag); 30 30 31 int idataUnlock(idataServer *server, char *key, rw flag);31 int nebUnlock(nebServer *server, char *key, rw flag); 32 32 33 int idataFindInstances(idataServer *server, char *key, char *volume, char ***locations);33 int nebFindInstances(nebServer *server, char *key, char *volume, char ***locations); 34 34 35 int idataFind(idataServer *server, char *key);35 int nebFind(nebServer *server, char *key); 36 36 37 int idataOpen(idataServer *server, char *key, rw flag);37 int nebOpen(nebServer *server, char *key, rw flag); 38 38 39 int idataDelete(idataServer *server, char *key);39 int nebDelete(nebServer *server, char *key); 40 40 41 int idataCopy(idataServer *server, char *key, char *newKey);41 int nebCopy(nebServer *server, char *key, char *newKey); 42 42 43 int idataMove(idataServer *server, char *key, char *newKey);43 int nebMove(nebServer *server, char *key, char *newKey); 44 44 45 int idataDelete_instance(idataServer *server, char *URI);45 int nebDelete_instance(nebServer *server, char *URI); 46 46 47 int idataStat(idataServer *server, char *key);47 int nebStat(nebServer *server, char *key); 48 48 49 int idataErr(idataServer *server, char *errString);49 int nebErr(nebServer *server, char *errString); 50 50 51 int idataParseURI(const char *URI, char **filename);51 int nebParseURI(const char *URI, char **filename); 52 52 53 void idataFree(void *ptr);53 void nebFree(void *ptr); 54 54 55 #endif // IDATACLIENT_H55 #endif // NEBLIENT_H -
trunk/Nebulous/nebclient/src/test.c
r4120 r4440 1 1 #include <stdio.h> 2 2 #include <unistd.h> 3 #include " idataclient.h"3 #include "nebclient.h" 4 4 5 5 int main (int argc, char **argv) { 6 idataServer server;6 nebServer server; 7 7 char *URI; 8 8 int fh; … … 10 10 char **foo; 11 11 12 idataServerInit(&server);12 nebServerInit(&server); 13 13 14 fh = idataCreate(&server, argv[1], 0, NULL, NULL, &URI);14 fh = nebCreate(&server, argv[1], 0, NULL, NULL, &URI); 15 15 16 16 if (fh > 0) { 17 17 printf( "uri is %s\n", URI ); 18 18 19 idataFree(URI);19 nebFree(URI); 20 20 21 21 if(close(fh) != 0){ … … 25 25 printf( "local error\n" ); 26 26 } else { 27 printf( "server error: %s\n", idataServerErr(&server) );27 printf( "server error: %s\n", nebServerErr(&server) ); 28 28 } 29 29 30 n = idataFindInstances(&server, argv[1], NULL, &foo);30 n = nebFindInstances(&server, argv[1], NULL, &foo); 31 31 printf( "found %d instances\n", n ); 32 32 33 idataServerCleanup(&server);33 nebServerCleanup(&server); 34 34 35 35 exit(0);
Note:
See TracChangeset
for help on using the changeset viewer.
