Changeset 24557 for branches/eam_branches/20090522/Nebulous
- Timestamp:
- Jun 25, 2009, 2:00:56 PM (17 years ago)
- Location:
- branches/eam_branches/20090522
- Files:
-
- 2 deleted
- 32 edited
- 3 copied
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous/Changes (modified) (2 diffs)
-
Nebulous/MANIFEST (modified) (2 diffs)
-
Nebulous/bin (modified) (1 prop)
-
Nebulous/bin/neb-locate (modified) (2 diffs)
-
Nebulous/bin/neb-ls (modified) (1 diff)
-
Nebulous/bin/neb-replicate (modified) (1 diff)
-
Nebulous/bin/neb-rm (modified) (4 diffs)
-
Nebulous/bin/neb-stat (modified) (1 diff)
-
Nebulous/examples (modified) (1 prop)
-
Nebulous/lib (modified) (1 prop)
-
Nebulous/lib/Nebulous/Client.pm (modified) (8 diffs)
-
Nebulous/lib/Nebulous/Client.pod (modified) (3 diffs)
-
Nebulous/nebclient (modified) (1 prop)
-
Nebulous/nebclient/nebulous.wsdl (modified) (3 diffs)
-
Nebulous/nebclient/src/nebclient.c (modified) (1 diff)
-
Nebulous/nebclient/src/nebclient.h (modified) (2 diffs)
-
Nebulous/nebclient/src/nebulous.h (modified) (3 diffs)
-
Nebulous/nebclient/src/soapC.c (modified) (6 diffs)
-
Nebulous/nebclient/src/soapClient.c (modified) (2 diffs)
-
Nebulous/nebclient/src/soapH.h (modified) (9 diffs)
-
Nebulous/nebclient/src/soapServer.c (modified) (3 diffs)
-
Nebulous/nebclient/src/soapStub.h (modified) (8 diffs)
-
Nebulous/nebclient/tests/tap (modified) (1 prop)
-
Nebulous/nebclient/tests/tests.c (modified) (2 diffs)
-
Nebulous/t (modified) (1 prop)
-
Nebulous/t/49_client_new.t (copied) (copied from trunk/Nebulous/t/49_client_new.t )
-
Nebulous/t/50_client_create.t (copied) (copied from trunk/Nebulous/t/50_client_create.t )
-
Nebulous/t/50_client_new.t (deleted)
-
Nebulous/t/51_client_create.t (deleted)
-
Nebulous/t/59_client_delete.t (modified) (5 diffs)
-
Nebulous/t/62_client_delete_instance.t (modified) (2 diffs)
-
Nebulous/t/66_client_xattr.t (modified) (15 diffs)
-
Nebulous/t/68_client_chmod.t (copied) (copied from trunk/Nebulous/t/68_client_chmod.t )
-
Nebulous/t/70_neb-ls.t (modified) (3 diffs)
-
Nebulous/t/conf/startup.pl.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090522
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/Nebulous
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/Changes
r23934 r24557 1 1 Revision history for Nebulous 2 3 0.17 4 - add chmod() API 5 - change neb-ls to always output in --long format 6 - add neb-rm --force flag 7 - change neb-locate's output seperator to \n 2 8 3 9 0.10 … … 9 15 - add neb-swap 10 16 - add nebclient:nebSetXattr() 17 - add neb-rm --move flag 11 18 12 19 0.09 Wed Jul 9 16:36:27 HST 2008 -
branches/eam_branches/20090522/Nebulous/MANIFEST
r23934 r24557 79 79 t/00_distribution.t 80 80 t/01_load.t 81 t/ 50_client_new.t82 t/5 1_client_create.t81 t/49_client_new.t 82 t/50_client_create.t 83 83 t/51_client_open_create.t 84 84 t/52_client_replicate.t … … 98 98 t/66_client_xattr.t 99 99 t/67_client_swap.t 100 t/68_client_chmod.t 100 101 t/70_neb-ls.t 101 102 t/90_nebclient.t -
branches/eam_branches/20090522/Nebulous/bin
- Property svn:mergeinfo changed
/trunk/Nebulous/bin merged: 24264,24346,24348,24440-24441,24462-24464,24512
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/Nebulous/bin/neb-locate
r16179 r24557 41 41 unless defined $neb; 42 42 43 $volume = 'any' if defined $all; 44 43 45 my $uris; 44 46 if (defined $volume) { … … 70 72 } 71 73 72 print join(" ", @files), "\n";74 print join("\n", @files), "\n"; 73 75 74 76 __END__ -
branches/eam_branches/20090522/Nebulous/bin/neb-ls
r23934 r24557 21 21 22 22 $server = $ENV{'NEB_SERVER'} unless $server; 23 24 # make --long the default 25 $long = 1; 23 26 24 27 GetOptions( -
branches/eam_branches/20090522/Nebulous/bin/neb-replicate
r23696 r24557 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server, $volume, $copies );18 my ($server, $volume, $copies, $set_copies); 19 19 $copies = 1; # default to making just one copy 20 20 -
branches/eam_branches/20090522/Nebulous/bin/neb-rm
r13074 r24557 16 16 use Pod::Usage qw( pod2usage ); 17 17 18 my ($server); 18 my ( 19 $force, 20 $move, 21 $server, 22 ); 19 23 20 24 $server = $ENV{'NEB_SERVER'} unless $server; 21 25 22 26 GetOptions( 27 'force|f' => \$force, 28 'move|m' => \$move, 23 29 'server|s=s' => \$server, 24 30 ) || pod2usage( 2 ); … … 35 41 36 42 foreach my $key (@ARGV) { 37 $neb->delete($key) or warn "failed to delete key: $key"; 43 unless (defined $move) { 44 $neb->delete($key) or warn "failed to delete key: $key"; 45 } else { 46 $neb->move($key, "${key}.rm") or warn "failed to move key: $key"; 47 } 38 48 } 39 49 … … 48 58 =head1 SYNOPSIS 49 59 50 neb-rm [--server <URL>] <key...>60 neb-rm [--server <URL>] [--force] [--move] <key...> 51 61 52 62 =head1 DESCRIPTION … … 58 68 59 69 =over 4 70 71 =item * --force|-f 72 73 When set, C<<key>> will be removed from the nebulous database even if the on 74 disk file(s) are missing. 75 76 Optional. 77 78 =item * --move|-m 79 80 When set, this flag causes C<<key>> to be renamed to C<<key>.rm> instead of 81 being deleted. 82 83 Optional. 60 84 61 85 =item * --server|-s <URL> -
branches/eam_branches/20090522/Nebulous/bin/neb-stat
r18016 r24557 41 41 my $stat = $neb->stat($key); 42 42 die "nebulous key: $key not found" unless $stat; 43 my $instances = $neb->find_instances($key, ' :any');43 my $instances = $neb->find_instances($key, 'any'); 44 44 die "no instances found" unless $instances; 45 45 -
branches/eam_branches/20090522/Nebulous/examples
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/lib
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pm
r23934 r24557 9 9 no warnings qw( uninitialized ); 10 10 11 our $VERSION = '0. 09';11 our $VERSION = '0.17'; 12 12 13 13 use Digest::MD5; … … 16 16 use Nebulous::Client::Log; 17 17 use Nebulous::Util qw( :standard ); 18 use Params::Validate qw( validate validate_pos SCALAR UNDEF );18 use Params::Validate qw( validate validate_pos SCALAR UNDEF BOOLEAN ); 19 19 #use SOAP::Lite +trace => [qw( debug )]; 20 20 use SOAP::Lite; … … 329 329 my $uri = $self->delete_instance($key, @$locations[0]); 330 330 331 eval { 332 _nuke_file(_get_file_path(@$locations[0])); 333 }; 334 if ($@) { 335 $log->logdie($@); 336 } 337 331 338 $log->debug("leaving"); 332 339 … … 803 810 my $self = shift; 804 811 805 my ( $key ) = validate_pos( @_, 806 { 807 type => SCALAR, 812 my ($key, $force) = validate_pos( @_, 813 { 814 type => SCALAR, 815 }, 816 { 817 type => BOOLEAN, 818 optional => 1, 819 default => undef, 820 callbacks => { 821 'is boolean' => sub { 822 $_[0] == 0 or $_[0] == 1 or $_[0] == undef; 823 }, 824 }, 808 825 }, 809 826 ); … … 817 834 # a lock is implicitly removed when the last storage object is deleted 818 835 foreach my $uri ( @$locations ) { 836 # it is being assumed here that it is better to have files on disk and 837 # not in the database then the inverse. 838 my $path; 839 eval { 840 $path = _get_file_path( $uri ); 841 }; 842 if ($@) { 843 if ($force) { 844 $log->warn($@); 845 $log->warn("exception ignored because force is in effect"); 846 } else { 847 $log->logdie($@); 848 } 849 } 850 819 851 $self->delete_instance($key, $uri) or return undef; 852 853 eval { 854 _nuke_file( $path ); 855 }; 856 if ($@) { 857 if ($force) { 858 $log->warn($@); 859 $log->warn("exception ignored because force is in effect"); 860 } else { 861 $log->logdie($@); 862 } 863 } 820 864 } 821 865 … … 959 1003 $log->debug( "entered - @_" ); 960 1004 961 # it is being assumed here that it is better to have files on disk and not in962 # the database then the inverse.963 964 my $path;965 eval {966 $path = _get_file_path( $uri );967 };968 $log->logdie( $@ ) if $@;969 970 1005 my $response = $self->{ 'server' }->delete_instance($key, $uri); 971 1006 if ( $response->fault ) { … … 982 1017 $log->debug( "server deleted instance" ); 983 1018 984 eval {985 _nuke_file( $path );986 };987 $log->logdie( $@ ) if $@;988 989 1019 $log->debug( "leaving" ); 990 1020 … … 1045 1075 1046 1076 return $stats; 1077 } 1078 1079 1080 sub chmod 1081 { 1082 my $self = shift; 1083 1084 my ($key, $mode) = validate_pos( @_, 1085 { 1086 type => SCALAR, 1087 }, 1088 { 1089 type => SCALAR, 1090 regex => qr/\d{3,4}/, 1091 }, 1092 ); 1093 1094 $log->debug( "entered - @_" ); 1095 1096 my $response = $self->{ 'server' }->chmod_object($key, $mode); 1097 if ( $response->fault ) { 1098 $self->set_err($response->faultstring); 1099 if ($response->faultstring =~ /is valid object key/) { 1100 $log->debug( "leaving" ); 1101 return; 1102 } 1103 if ($response->faultstring =~ /is allowable mode/) { 1104 $log->debug( "leaving" ); 1105 return; 1106 } 1107 1108 $log->logdie("unhandled fault - ", $self->err); 1109 } 1110 1111 my $response_mode = $response->result; 1112 1113 $log->debug( "leaving" ); 1114 1115 return $response_mode; 1047 1116 } 1048 1117 -
branches/eam_branches/20090522/Nebulous/lib/Nebulous/Client.pod
r20094 r24557 13 13 ); 14 14 15 my $uri = $neb->create( "key", "node01");16 my $fh = $neb->open_create( "key", "node01");17 $neb->replicate( "key", "node01");18 $neb->cull( "key", "node01");19 $neb->lock( "key", 'write' );20 $neb->unlock( "key", 'write' );15 my $uri = $neb->create( $key, $vol ); 16 my $fh = $neb->open_create( $key, $vol ); 17 $neb->replicate( $key, $vol ); 18 $neb->cull( $key, $vol ); 19 $neb->lock( $key, 'write' ); 20 $neb->unlock( $key, 'write' ); 21 21 $neb->setxattr( $key, $name, $value, $flags ); 22 22 $neb->getxattr( $key, $name ); … … 24 24 $neb->removexattr( $key, $name ); 25 25 my $uris = $neb->find_objects( $pattern ); 26 my $uris = $neb->find_instances( "key", "node01");27 my $path = $neb->find( "key");28 my $fh = $neb->open( "key", 'read' );29 $neb->delete( "key");30 $neb->copy( "key", "new_key", "node01");31 $neb->move( "key", "new_key");32 $neb->swap( "key1", "key2");26 my $uris = $neb->find_instances( $key, $vol ); 27 my $path = $neb->find( $key ); 28 my $fh = $neb->open( $key, 'read' ); 29 $neb->delete( $key ); 30 $neb->copy( $key, $new_key, $vol ); 31 $neb->move( $key, $new_key ); 32 $neb->swap( $key1, $key2 ); 33 33 $neb->delete_instance( $uri ); 34 my $stats = $neb->stat( "key");34 my $stats = $neb->stat( $key ); 35 35 my $mounts = $neb->mounts(); 36 my $mode = $neb->chmod( $key, $mode ); 36 37 37 38 =head1 DESCRIPTION … … 425 426 ] 426 427 428 =item * chmod( $key, $mode ); 429 430 Accepts 2 parameters, both mandatory. C<$key> is the nebulous key to operate 431 on and C<$mode> are the POSIX like file permissions to set on all instances of 432 C<$key>. C<$mode> must be specified in oct. Returns C<$mode> or sucess or an 433 exception on failure. 434 427 435 =back 428 436 -
branches/eam_branches/20090522/Nebulous/nebclient
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/nebclient/nebulous.wsdl
r23935 r24557 140 140 </message> 141 141 142 <message name="chmod_objectRequest"> 143 <part name="key" type="xsd:string" /> 144 <part name="mode" type="xsd:int" /> 145 </message> 146 <message name="chmod_objectResponse"> 147 <!-- fixme --> 148 <part name="result" type="xsd:int" /> 149 </message> 150 142 151 143 152 <portType name="Nebulous/Server/SOAPPort"> … … 240 249 --> 241 250 </operation> 251 <operation name="chmod_object"> 252 <input message="tns:chmod_objectRequest" /> 253 <output message="tns:chmod_objectResponse" /> 254 <!-- 255 <fault name="" message="" /> 256 --> 257 </operation> 242 258 </portType> 243 259 … … 390 406 <operation name="stat_object"> 391 407 <soap:operation soapAction="urn:Nebulous/Server/SOAP#stat_object" /> 408 <input> 409 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 410 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 411 </input> 412 <output> 413 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" 414 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 415 </output> 416 </operation> 417 <operation name="chmod_object"> 418 <soap:operation soapAction="urn:Nebulous/Server/SOAP#chmod_object" /> 392 419 <input> 393 420 <soap:body use="encoded" namespace="urn:Nebulous/Server/SOAP" -
branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.c
r23935 r24557 832 832 } 833 833 834 835 int nebChmod(nebServer *server, const char *key, mode_t mode) 836 { 837 int response; 838 839 REQUIRE_SERVER; 840 841 if (!key) { 842 nebSetErr(server, "parameter 'key' may not be NULL"); 843 844 return -1; 845 } 846 847 // FIXME is this leaking memory when response goes out of scope? the gsoap 848 // manual seems to 'suggest' that this is temporary data that gets cleaed 849 // up on the next soap function call 850 if (soap_call_ns1__chmod_USCOREobject(server->soap, server->endpoint, 851 NULL, (char *)key, mode, &response) != SOAP_OK) { 852 nebSetServerErr(server); 853 return -1; 854 } 855 856 return 0; 857 } 858 859 834 860 char *nebErr(nebServer *server) 835 861 { -
branches/eam_branches/20090522/Nebulous/nebclient/src/nebclient.h
r23935 r24557 11 11 #ifndef NEBCLIENT_H 12 12 #define NEBCLIENT_H 1 13 14 // #include <sys/stat.h> 13 15 14 16 #ifdef __cplusplus … … 296 298 ); 297 299 300 /** Change permissions of a storage objects 301 * 302 * This function will change the file permissions of all currently on disk 303 * instances of a storage object. 304 * 305 * @return the new mode or NULL on failure. 306 */ 307 308 int nebChmod( 309 nebServer *server, ///< nebServer object 310 const char *key, /// storage object key (name) 311 mode_t mode /// chmod(2) compatible mode (mode_t) 312 ); 313 298 314 /** Returns the error message from the last nebclient function that failed. 299 315 * -
branches/eam_branches/20090522/Nebulous/nebclient/src/nebulous.h
r23935 r24557 1 1 /* src/nebulous.h 2 2 Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat 3 2009-0 4-20 22:15:21GMT3 2009-06-01 23:55:50 GMT 4 4 Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved. 5 5 This part of the software is released under one of the following licenses: … … 119 119 - @ref ns1__delete_USCOREinstance 120 120 - @ref ns1__stat_USCOREobject 121 - @ref ns1__chmod_USCOREobject 121 122 122 123 @section SOAP_ports Endpoints of Binding "SOAP" … … 893 894 ); 894 895 896 /******************************************************************************\ 897 * * 898 * ns1__chmod_USCOREobject * 899 * * 900 \******************************************************************************/ 901 902 903 /// Operation "ns1__chmod_USCOREobject" of service binding "SOAP" 904 905 /** 906 907 Operation details: 908 909 - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 910 - SOAP action="urn:Nebulous/Server/SOAP#chmod_object" 911 912 C stub function (defined in soapClient.c[pp] generated by soapcpp2): 913 @code 914 int soap_call_ns1__chmod_USCOREobject( 915 struct soap *soap, 916 NULL, // char *endpoint = NULL selects default endpoint for this operation 917 NULL, // char *action = NULL selects default action for this operation 918 // request parameters: 919 char* key, 920 int mode, 921 // response parameters: 922 int *result 923 ); 924 @endcode 925 926 C server function (called from the service dispatcher defined in soapServer.c[pp]): 927 @code 928 int ns1__chmod_USCOREobject( 929 struct soap *soap, 930 // request parameters: 931 char* key, 932 int mode, 933 // response parameters: 934 int *result 935 ); 936 @endcode 937 938 */ 939 940 //gsoap ns1 service method-style: chmod_USCOREobject rpc 941 //gsoap ns1 service method-encoding: chmod_USCOREobject http://schemas.xmlsoap.org/soap/encoding/ 942 //gsoap ns1 service method-action: chmod_USCOREobject urn:Nebulous/Server/SOAP#chmod_object 943 int ns1__chmod_USCOREobject( 944 char* key, ///< Request parameter 945 int mode, ///< Request parameter 946 int *result ///< Response parameter 947 ); 948 895 949 /* End of src/nebulous.h */ -
branches/eam_branches/20090522/Nebulous/nebclient/src/soapC.c
r23935 r24557 12 12 #endif 13 13 14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-0 4-20 22:15:22GMT")14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-06-01 23:55:50 GMT") 15 15 16 16 … … 161 161 case SOAP_TYPE_int: 162 162 return soap_in_int(soap, NULL, NULL, "xsd:int"); 163 case SOAP_TYPE_ns1__chmod_USCOREobject: 164 return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, "ns1:chmod_object"); 165 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 166 return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, "ns1:chmod_objectResponse"); 163 167 case SOAP_TYPE_ns1__stat_USCOREobject: 164 168 return soap_in_ns1__stat_USCOREobject(soap, NULL, NULL, "ns1:stat_object"); … … 250 254 return soap_in_int(soap, NULL, NULL, NULL); 251 255 } 256 if (!soap_match_tag(soap, t, "ns1:chmod_object")) 257 { *type = SOAP_TYPE_ns1__chmod_USCOREobject; 258 return soap_in_ns1__chmod_USCOREobject(soap, NULL, NULL, NULL); 259 } 260 if (!soap_match_tag(soap, t, "ns1:chmod_objectResponse")) 261 { *type = SOAP_TYPE_ns1__chmod_USCOREobjectResponse; 262 return soap_in_ns1__chmod_USCOREobjectResponse(soap, NULL, NULL, NULL); 263 } 252 264 if (!soap_match_tag(soap, t, "ns1:stat_object")) 253 265 { *type = SOAP_TYPE_ns1__stat_USCOREobject; … … 440 452 case SOAP_TYPE_int: 441 453 return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); 454 case SOAP_TYPE_ns1__chmod_USCOREobject: 455 return soap_out_ns1__chmod_USCOREobject(soap, tag, id, (const struct ns1__chmod_USCOREobject *)ptr, "ns1:chmod_object"); 456 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 457 return soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, (const struct ns1__chmod_USCOREobjectResponse *)ptr, "ns1:chmod_objectResponse"); 442 458 case SOAP_TYPE_ns1__stat_USCOREobject: 443 459 return soap_out_ns1__stat_USCOREobject(soap, tag, id, (const struct ns1__stat_USCOREobject *)ptr, "ns1:stat_object"); … … 527 543 switch (type) 528 544 { 545 case SOAP_TYPE_ns1__chmod_USCOREobject: 546 soap_serialize_ns1__chmod_USCOREobject(soap, (const struct ns1__chmod_USCOREobject *)ptr); 547 break; 548 case SOAP_TYPE_ns1__chmod_USCOREobjectResponse: 549 soap_serialize_ns1__chmod_USCOREobjectResponse(soap, (const struct ns1__chmod_USCOREobjectResponse *)ptr); 550 break; 529 551 case SOAP_TYPE_ns1__stat_USCOREobject: 530 552 soap_serialize_ns1__stat_USCOREobject(soap, (const struct ns1__stat_USCOREobject *)ptr); … … 1195 1217 #endif 1196 1218 1219 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *a) 1220 { 1221 (void)soap; (void)a; /* appease -Wall -Werror */ 1222 soap_default_string(soap, &a->key); 1223 soap_default_int(soap, &a->mode); 1224 } 1225 1226 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a) 1227 { 1228 (void)soap; (void)a; /* appease -Wall -Werror */ 1229 soap_serialize_string(soap, &a->key); 1230 soap_embedded(soap, &a->mode, SOAP_TYPE_int); 1231 } 1232 1233 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap *soap, const struct ns1__chmod_USCOREobject *a, const char *tag, const char *type) 1234 { 1235 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobject); 1236 if (soap_out_ns1__chmod_USCOREobject(soap, tag, id, a, type)) 1237 return soap->error; 1238 return soap_putindependent(soap); 1239 } 1240 1241 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobject *a, const char *type) 1242 { 1243 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobject), type)) 1244 return soap->error; 1245 if (soap_out_string(soap, "key", -1, &a->key, "")) 1246 return soap->error; 1247 if (soap_out_int(soap, "mode", -1, &a->mode, "")) 1248 return soap->error; 1249 return soap_element_end_out(soap, tag); 1250 } 1251 1252 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap *soap, struct ns1__chmod_USCOREobject *p, const char *tag, const char *type) 1253 { 1254 if ((p = soap_in_ns1__chmod_USCOREobject(soap, tag, p, type))) 1255 if (soap_getindependent(soap)) 1256 return NULL; 1257 return p; 1258 } 1259 1260 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobject *a, const char *type) 1261 { 1262 size_t soap_flag_key = 1; 1263 size_t soap_flag_mode = 1; 1264 if (soap_element_begin_in(soap, tag, 0, type)) 1265 return NULL; 1266 a = (struct ns1__chmod_USCOREobject *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobject, sizeof(struct ns1__chmod_USCOREobject), 0, NULL, NULL, NULL); 1267 if (!a) 1268 return NULL; 1269 soap_default_ns1__chmod_USCOREobject(soap, a); 1270 if (soap->body && !*soap->href) 1271 { 1272 for (;;) 1273 { soap->error = SOAP_TAG_MISMATCH; 1274 if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) 1275 if (soap_in_string(soap, "key", &a->key, "xsd:string")) 1276 { soap_flag_key--; 1277 continue; 1278 } 1279 if (soap_flag_mode && soap->error == SOAP_TAG_MISMATCH) 1280 if (soap_in_int(soap, "mode", &a->mode, "xsd:int")) 1281 { soap_flag_mode--; 1282 continue; 1283 } 1284 if (soap->error == SOAP_TAG_MISMATCH) 1285 soap->error = soap_ignore_element(soap); 1286 if (soap->error == SOAP_NO_TAG) 1287 break; 1288 if (soap->error) 1289 return NULL; 1290 } 1291 if (soap_element_end_in(soap, tag)) 1292 return NULL; 1293 } 1294 else 1295 { a = (struct ns1__chmod_USCOREobject *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobject, 0, sizeof(struct ns1__chmod_USCOREobject), 0, NULL); 1296 if (soap->body && soap_element_end_in(soap, tag)) 1297 return NULL; 1298 } 1299 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_mode > 0)) 1300 { soap->error = SOAP_OCCURS; 1301 return NULL; 1302 } 1303 return a; 1304 } 1305 1306 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *a) 1307 { 1308 (void)soap; (void)a; /* appease -Wall -Werror */ 1309 a->result = NULL; 1310 } 1311 1312 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a) 1313 { 1314 (void)soap; (void)a; /* appease -Wall -Werror */ 1315 soap_serialize_PointerToint(soap, &a->result); 1316 } 1317 1318 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap *soap, const struct ns1__chmod_USCOREobjectResponse *a, const char *tag, const char *type) 1319 { 1320 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__chmod_USCOREobjectResponse); 1321 if (soap_out_ns1__chmod_USCOREobjectResponse(soap, tag, id, a, type)) 1322 return soap->error; 1323 return soap_putindependent(soap); 1324 } 1325 1326 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, int id, const struct ns1__chmod_USCOREobjectResponse *a, const char *type) 1327 { 1328 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse), type)) 1329 return soap->error; 1330 if (soap_out_PointerToint(soap, "result", -1, &a->result, "")) 1331 return soap->error; 1332 return soap_element_end_out(soap, tag); 1333 } 1334 1335 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap *soap, struct ns1__chmod_USCOREobjectResponse *p, const char *tag, const char *type) 1336 { 1337 if ((p = soap_in_ns1__chmod_USCOREobjectResponse(soap, tag, p, type))) 1338 if (soap_getindependent(soap)) 1339 return NULL; 1340 return p; 1341 } 1342 1343 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap *soap, const char *tag, struct ns1__chmod_USCOREobjectResponse *a, const char *type) 1344 { 1345 size_t soap_flag_result = 1; 1346 if (soap_element_begin_in(soap, tag, 0, type)) 1347 return NULL; 1348 a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL, NULL, NULL); 1349 if (!a) 1350 return NULL; 1351 soap_default_ns1__chmod_USCOREobjectResponse(soap, a); 1352 if (soap->body && !*soap->href) 1353 { 1354 for (;;) 1355 { soap->error = SOAP_TAG_MISMATCH; 1356 if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH) 1357 if (soap_in_PointerToint(soap, "result", &a->result, "xsd:int")) 1358 { soap_flag_result--; 1359 continue; 1360 } 1361 if (soap->error == SOAP_TAG_MISMATCH) 1362 soap->error = soap_ignore_element(soap); 1363 if (soap->error == SOAP_NO_TAG) 1364 break; 1365 if (soap->error) 1366 return NULL; 1367 } 1368 if (soap_element_end_in(soap, tag)) 1369 return NULL; 1370 } 1371 else 1372 { a = (struct ns1__chmod_USCOREobjectResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__chmod_USCOREobjectResponse, 0, sizeof(struct ns1__chmod_USCOREobjectResponse), 0, NULL); 1373 if (soap->body && soap_element_end_in(soap, tag)) 1374 return NULL; 1375 } 1376 return a; 1377 } 1378 1197 1379 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__stat_USCOREobject(struct soap *soap, struct ns1__stat_USCOREobject *a) 1198 1380 { -
branches/eam_branches/20090522/Nebulous/nebclient/src/soapClient.c
r23935 r24557 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-0 4-20 22:15:21GMT")12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-06-01 23:55:50 GMT") 13 13 14 14 … … 812 812 } 813 813 814 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result) 815 { struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject; 816 struct ns1__chmod_USCOREobjectResponse *soap_tmp_ns1__chmod_USCOREobjectResponse; 817 if (!soap_endpoint) 818 soap_endpoint = "http://localhost:80/nebulous"; 819 if (!soap_action) 820 soap_action = "urn:Nebulous/Server/SOAP#chmod_object"; 821 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 822 soap_tmp_ns1__chmod_USCOREobject.key = key; 823 soap_tmp_ns1__chmod_USCOREobject.mode = mode; 824 soap_begin(soap); 825 soap_serializeheader(soap); 826 soap_serialize_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject); 827 if (soap_begin_count(soap)) 828 return soap->error; 829 if (soap->mode & SOAP_IO_LENGTH) 830 { if (soap_envelope_begin_out(soap) 831 || soap_putheader(soap) 832 || soap_body_begin_out(soap) 833 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "") 834 || soap_body_end_out(soap) 835 || soap_envelope_end_out(soap)) 836 return soap->error; 837 } 838 if (soap_end_count(soap)) 839 return soap->error; 840 if (soap_connect(soap, soap_endpoint, soap_action) 841 || soap_envelope_begin_out(soap) 842 || soap_putheader(soap) 843 || soap_body_begin_out(soap) 844 || soap_put_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", "") 845 || soap_body_end_out(soap) 846 || soap_envelope_end_out(soap) 847 || soap_end_send(soap)) 848 return soap_closesock(soap); 849 if (!result) 850 return soap_closesock(soap); 851 soap_default_int(soap, result); 852 if (soap_begin_recv(soap) 853 || soap_envelope_begin_in(soap) 854 || soap_recv_header(soap) 855 || soap_body_begin_in(soap)) 856 return soap_closesock(soap); 857 soap_tmp_ns1__chmod_USCOREobjectResponse = soap_get_ns1__chmod_USCOREobjectResponse(soap, NULL, "ns1:chmod_objectResponse", ""); 858 if (soap->error) 859 { if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) 860 return soap_recv_fault(soap); 861 return soap_closesock(soap); 862 } 863 if (soap_body_end_in(soap) 864 || soap_envelope_end_in(soap) 865 || soap_end_recv(soap)) 866 return soap_closesock(soap); 867 if (result && soap_tmp_ns1__chmod_USCOREobjectResponse->result) 868 *result = *soap_tmp_ns1__chmod_USCOREobjectResponse->result; 869 return soap_closesock(soap); 870 } 871 814 872 #ifdef __cplusplus 815 873 } -
branches/eam_branches/20090522/Nebulous/nebclient/src/soapH.h
r23198 r24557 42 42 43 43 #ifndef SOAP_TYPE_SOAP_ENV__Fault 44 #define SOAP_TYPE_SOAP_ENV__Fault (6 4)44 #define SOAP_TYPE_SOAP_ENV__Fault (67) 45 45 #endif 46 46 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); … … 56 56 57 57 #ifndef SOAP_TYPE_SOAP_ENV__Reason 58 #define SOAP_TYPE_SOAP_ENV__Reason (6 3)58 #define SOAP_TYPE_SOAP_ENV__Reason (66) 59 59 #endif 60 60 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); … … 70 70 71 71 #ifndef SOAP_TYPE_SOAP_ENV__Detail 72 #define SOAP_TYPE_SOAP_ENV__Detail (6 0)72 #define SOAP_TYPE_SOAP_ENV__Detail (63) 73 73 #endif 74 74 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); … … 84 84 85 85 #ifndef SOAP_TYPE_SOAP_ENV__Code 86 #define SOAP_TYPE_SOAP_ENV__Code ( 58)86 #define SOAP_TYPE_SOAP_ENV__Code (61) 87 87 #endif 88 88 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); … … 98 98 99 99 #ifndef SOAP_TYPE_SOAP_ENV__Header 100 #define SOAP_TYPE_SOAP_ENV__Header ( 57)100 #define SOAP_TYPE_SOAP_ENV__Header (60) 101 101 #endif 102 102 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); … … 109 109 #endif 110 110 111 #ifndef SOAP_TYPE_ns1__chmod_USCOREobject 112 #define SOAP_TYPE_ns1__chmod_USCOREobject (59) 113 #endif 114 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *); 115 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *); 116 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobject(struct soap*, const struct ns1__chmod_USCOREobject *, const char*, const char*); 117 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobject(struct soap*, const char*, int, const struct ns1__chmod_USCOREobject *, const char*); 118 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobject(struct soap*, struct ns1__chmod_USCOREobject *, const char*, const char*); 119 SOAP_FMAC3 struct ns1__chmod_USCOREobject * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobject(struct soap*, const char*, struct ns1__chmod_USCOREobject *, const char*); 120 121 #ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse 122 #define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58) 123 #endif 124 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *); 125 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *); 126 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__chmod_USCOREobjectResponse(struct soap*, const struct ns1__chmod_USCOREobjectResponse *, const char*, const char*); 127 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, int, const struct ns1__chmod_USCOREobjectResponse *, const char*); 128 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_get_ns1__chmod_USCOREobjectResponse(struct soap*, struct ns1__chmod_USCOREobjectResponse *, const char*, const char*); 129 SOAP_FMAC3 struct ns1__chmod_USCOREobjectResponse * SOAP_FMAC4 soap_in_ns1__chmod_USCOREobjectResponse(struct soap*, const char*, struct ns1__chmod_USCOREobjectResponse *, const char*); 130 111 131 #ifndef SOAP_TYPE_ns1__stat_USCOREobject 112 132 #define SOAP_TYPE_ns1__stat_USCOREobject (56) … … 402 422 403 423 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason 404 #define SOAP_TYPE_PointerToSOAP_ENV__Reason (6 6)424 #define SOAP_TYPE_PointerToSOAP_ENV__Reason (69) 405 425 #endif 406 426 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); … … 415 435 416 436 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail 417 #define SOAP_TYPE_PointerToSOAP_ENV__Detail (6 5)437 #define SOAP_TYPE_PointerToSOAP_ENV__Detail (68) 418 438 #endif 419 439 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); … … 428 448 429 449 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Code 430 #define SOAP_TYPE_PointerToSOAP_ENV__Code ( 59)450 #define SOAP_TYPE_PointerToSOAP_ENV__Code (62) 431 451 #endif 432 452 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); -
branches/eam_branches/20090522/Nebulous/nebclient/src/soapServer.c
r23935 r24557 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-0 4-20 22:15:21GMT")12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-06-01 23:55:50 GMT") 13 13 14 14 … … 105 105 if (!soap_match_tag(soap, soap->tag, "ns1:stat_object")) 106 106 return soap_serve_ns1__stat_USCOREobject(soap); 107 if (!soap_match_tag(soap, soap->tag, "ns1:chmod_object")) 108 return soap_serve_ns1__chmod_USCOREobject(soap); 107 109 return soap->error = SOAP_NO_METHOD; 108 110 } … … 713 715 } 714 716 717 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap *soap) 718 { struct ns1__chmod_USCOREobject soap_tmp_ns1__chmod_USCOREobject; 719 struct ns1__chmod_USCOREobjectResponse soap_tmp_ns1__chmod_USCOREobjectResponse; 720 int soap_tmp_int; 721 soap_default_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse); 722 soap_default_int(soap, &soap_tmp_int); 723 soap_tmp_ns1__chmod_USCOREobjectResponse.result = &soap_tmp_int; 724 soap_default_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject); 725 soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"; 726 if (!soap_get_ns1__chmod_USCOREobject(soap, &soap_tmp_ns1__chmod_USCOREobject, "ns1:chmod_object", NULL)) 727 return soap->error; 728 if (soap_body_end_in(soap) 729 || soap_envelope_end_in(soap) 730 || soap_end_recv(soap)) 731 return soap->error; 732 soap->error = ns1__chmod_USCOREobject(soap, soap_tmp_ns1__chmod_USCOREobject.key, soap_tmp_ns1__chmod_USCOREobject.mode, &soap_tmp_int); 733 if (soap->error) 734 return soap->error; 735 soap_serializeheader(soap); 736 soap_serialize_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse); 737 if (soap_begin_count(soap)) 738 return soap->error; 739 if (soap->mode & SOAP_IO_LENGTH) 740 { if (soap_envelope_begin_out(soap) 741 || soap_putheader(soap) 742 || soap_body_begin_out(soap) 743 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "") 744 || soap_body_end_out(soap) 745 || soap_envelope_end_out(soap)) 746 return soap->error; 747 }; 748 if (soap_end_count(soap) 749 || soap_response(soap, SOAP_OK) 750 || soap_envelope_begin_out(soap) 751 || soap_putheader(soap) 752 || soap_body_begin_out(soap) 753 || soap_put_ns1__chmod_USCOREobjectResponse(soap, &soap_tmp_ns1__chmod_USCOREobjectResponse, "ns1:chmod_objectResponse", "") 754 || soap_body_end_out(soap) 755 || soap_envelope_end_out(soap) 756 || soap_end_send(soap)) 757 return soap->error; 758 return soap_closesock(soap); 759 } 760 715 761 #ifdef __cplusplus 716 762 } -
branches/eam_branches/20090522/Nebulous/nebclient/src/soapStub.h
r23935 r24557 306 306 #endif 307 307 308 #ifndef SOAP_TYPE_ns1__chmod_USCOREobjectResponse 309 #define SOAP_TYPE_ns1__chmod_USCOREobjectResponse (58) 310 /* ns1:chmod_objectResponse */ 311 struct ns1__chmod_USCOREobjectResponse 312 { 313 int *result; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type xsd:int */ 314 }; 315 #endif 316 317 #ifndef SOAP_TYPE_ns1__chmod_USCOREobject 318 #define SOAP_TYPE_ns1__chmod_USCOREobject (59) 319 /* ns1:chmod_object */ 320 struct ns1__chmod_USCOREobject 321 { 322 char *key; /* optional element of type xsd:string */ 323 int mode; /* required element of type xsd:int */ 324 }; 325 #endif 326 308 327 #ifndef SOAP_TYPE_SOAP_ENV__Header 309 #define SOAP_TYPE_SOAP_ENV__Header ( 57)328 #define SOAP_TYPE_SOAP_ENV__Header (60) 310 329 /* SOAP Header: */ 311 330 struct SOAP_ENV__Header … … 318 337 319 338 #ifndef SOAP_TYPE_SOAP_ENV__Code 320 #define SOAP_TYPE_SOAP_ENV__Code ( 58)339 #define SOAP_TYPE_SOAP_ENV__Code (61) 321 340 /* SOAP Fault Code: */ 322 341 struct SOAP_ENV__Code … … 328 347 329 348 #ifndef SOAP_TYPE_SOAP_ENV__Detail 330 #define SOAP_TYPE_SOAP_ENV__Detail (6 0)349 #define SOAP_TYPE_SOAP_ENV__Detail (63) 331 350 /* SOAP-ENV:Detail */ 332 351 struct SOAP_ENV__Detail … … 339 358 340 359 #ifndef SOAP_TYPE_SOAP_ENV__Reason 341 #define SOAP_TYPE_SOAP_ENV__Reason (6 3)360 #define SOAP_TYPE_SOAP_ENV__Reason (66) 342 361 /* SOAP-ENV:Reason */ 343 362 struct SOAP_ENV__Reason … … 348 367 349 368 #ifndef SOAP_TYPE_SOAP_ENV__Fault 350 #define SOAP_TYPE_SOAP_ENV__Fault (6 4)369 #define SOAP_TYPE_SOAP_ENV__Fault (67) 351 370 /* SOAP Fault: */ 352 371 struct SOAP_ENV__Fault … … 437 456 SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4); 438 457 458 SOAP_FMAC5 int SOAP_FMAC6 ns1__chmod_USCOREobject(struct soap*, char *key, int mode, int *result); 459 439 460 /******************************************************************************\ 440 461 * * … … 472 493 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__stat_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, struct ns1__stat_USCOREobjectResponse *_param_4); 473 494 495 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__chmod_USCOREobject(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, int mode, int *result); 496 474 497 /******************************************************************************\ 475 498 * * … … 509 532 510 533 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__stat_USCOREobject(struct soap*); 534 535 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__chmod_USCOREobject(struct soap*); 511 536 512 537 #ifdef __cplusplus -
branches/eam_branches/20090522/Nebulous/nebclient/tests/tap
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/nebclient/tests/tests.c
r21461 r24557 20 20 char *key = "foobarbaz"; 21 21 22 plan_tests(2 8);22 plan_tests(29); 23 23 24 24 if (getenv("NEB_SERVER")) { … … 136 136 neb_ok(server, nebMove(server, "copyiedfile", "movedfile"), "move object"); 137 137 138 neb_ok(server, nebChmod(server, "movedfile", 0440) == 0, "chmod object"); 139 138 140 if (!nebDelete(server, "movedfile")) { 139 141 diag( "cleanup failed %s\n", nebErr(server)); -
branches/eam_branches/20090522/Nebulous/t
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/t/59_client_delete.t
r18858 r24557 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 9;12 plan tests => 13; 13 13 14 14 use lib qw( ./t ./lib ); … … 26 26 proxy => "http://$hostport/nebulous", 27 27 ); 28 $neb->create( "foo" );28 my $uri = $neb->create( "foo" ); 29 29 30 30 ok( $neb->delete( "foo" ), "delete object" ); 31 32 ok( ! -e _get_file_path($uri), "deleted file" ); 31 33 32 34 my $locations = $neb->find_instances( "foo" ); … … 76 78 } 77 79 80 # force flag 81 Test::Nebulous->setup; 82 83 { 84 my $neb = Nebulous::Client->new( 85 proxy => "http://$hostport/nebulous", 86 ); 87 $neb->create( "foo" ); 88 89 is( $neb->delete("foo", undef), 1, "force flag false" ); 90 } 91 92 Test::Nebulous->setup; 93 94 { 95 my $neb = Nebulous::Client->new( 96 proxy => "http://$hostport/nebulous", 97 ); 98 $neb->create( "foo" ); 99 100 is( $neb->delete("foo", 1), 1, "force flag false" ); 101 } 102 78 103 Test::Nebulous->setup; 79 104 … … 84 109 $neb->delete(); 85 110 }; 86 like( $@, qr/1 wasexpected/, "no params" );111 like( $@, qr/1 - 2 were expected/, "no params" ); 87 112 88 113 Test::Nebulous->setup; … … 92 117 proxy => "http://$hostport/nebulous", 93 118 ); 94 $neb->delete( "foo", 2);119 $neb->delete( "foo", 3); 95 120 }; 96 like( $@, qr/1 was expected/, "too many params" ); 121 like( $@, qr/is boolean/, "force flag not boolean" ); 122 123 Test::Nebulous->setup; 124 125 eval { 126 my $neb = Nebulous::Client->new( 127 proxy => "http://$hostport/nebulous", 128 ); 129 $neb->delete( "foo", 0, 2 ); 130 }; 131 like( $@, qr/1 - 2 were expected/, "too many params" ); 97 132 98 133 Test::Nebulous->cleanup; -
branches/eam_branches/20090522/Nebulous/t/62_client_delete_instance.t
r23934 r24557 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 1 1;12 plan tests => 10; 13 13 14 14 use lib qw( ./t ./lib ); … … 35 35 36 36 is( $uri, @$locations[0], "delete instance" ); 37 38 ok( ! -e _get_file_path( @$locations[0] ), "deleted file" );39 37 } 40 38 -
branches/eam_branches/20090522/Nebulous/t/66_client_xattr.t
r17750 r24557 1 1 #!/usr/bin/perl 2 2 3 # Copryight (C) 2007-2008 Joshua Hoblitt 4 # 5 # $Id: 66_client_xattr.t,v 1.1 2008-05-20 00:54:30 jhoblitt Exp $ 3 # Copryight (C) 2007-2009 Joshua Hoblitt 6 4 7 5 use strict; … … 9 7 10 8 use Apache::Test qw( -withtestmore ); 11 plan tests => 32; 12 9 plan tests => 44; 13 10 14 11 use lib qw( ./t ./lib ); … … 20 17 my $hostport = Apache::Test->config->{ 'hostport' }; 21 18 19 my $neb = Nebulous::Client->new( 20 proxy => "http://$hostport/nebulous", 21 ); 22 22 23 # 1 key / xattr 23 24 … … 25 26 26 27 { 27 my $neb = Nebulous::Client->new(28 proxy => "http://$hostport/nebulous",29 );30 31 28 my $uri = $neb->create('foo'); 32 29 33 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');30 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 34 31 { 35 32 my $xattrs = $neb->listxattr('foo'); 36 33 is(scalar @$xattrs, 1, 'number of xattrs'); 37 is(@$xattrs[0], ' bar', 'xattr name');38 } 39 40 my $value = $neb->getxattr('foo', ' bar');34 is(@$xattrs[0], 'user.bar', 'xattr name'); 35 } 36 37 my $value = $neb->getxattr('foo', 'user.bar'); 41 38 is($value, 'baz', 'xattr value'); 42 39 43 ok($neb->removexattr('foo', ' bar'), "remove object xattr");40 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 44 41 { 45 42 my $xattrs = $neb->listxattr('foo'); … … 53 50 54 51 { 55 my $neb = Nebulous::Client->new(56 proxy => "http://$hostport/nebulous",57 );58 59 52 my $uri = $neb->create('foo'); 60 53 61 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');62 ok($neb->setxattr('foo', ' bonk', 'quix', 'create'), 'set object xattr');54 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 55 ok($neb->setxattr('foo', 'user.bonk', 'quix', 'create'), 'set object xattr'); 63 56 64 57 { 65 58 my $xattrs = $neb->listxattr('foo'); 66 59 is(scalar @$xattrs, 2, 'number of xattrs'); 67 is(@$xattrs[0], ' bar', 'xattr name');68 is(@$xattrs[1], ' bonk', 'xattr name');69 } 70 71 my $value = $neb->getxattr('foo', ' bar');60 is(@$xattrs[0], 'user.bar', 'xattr name'); 61 is(@$xattrs[1], 'user.bonk', 'xattr name'); 62 } 63 64 my $value = $neb->getxattr('foo', 'user.bar'); 72 65 is($value, 'baz', 'xattr value'); 73 $value = $neb->getxattr('foo', ' bonk');66 $value = $neb->getxattr('foo', 'user.bonk'); 74 67 is($value, 'quix', 'xattr value'); 75 68 76 ok($neb->removexattr('foo', ' bar'), "remove object xattr");77 ok($neb->removexattr('foo', ' bonk'), "remove object xattr");69 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 70 ok($neb->removexattr('foo', 'user.bonk'), "remove object xattr"); 78 71 { 79 72 my $xattrs = $neb->listxattr('foo'); … … 87 80 88 81 { 89 my $neb = Nebulous::Client->new(90 proxy => "http://$hostport/nebulous",91 );92 93 82 my $uri = $neb->create('foo'); 94 83 95 ok($neb->setxattr('foo', ' bar', 'baz', 'create'), 'set object xattr');96 ok($neb->setxattr('foo', ' bar', 'quix', 'replace'), 're-set object xattr');84 ok($neb->setxattr('foo', 'user.bar', 'baz', 'create'), 'set object xattr'); 85 ok($neb->setxattr('foo', 'user.bar', 'quix', 'replace'), 're-set object xattr'); 97 86 98 87 { 99 88 my $xattrs = $neb->listxattr('foo'); 100 89 is(scalar @$xattrs, 1, 'number of xattrs'); 101 is(@$xattrs[0], ' bar', 'xattr name');102 } 103 104 my $value = $neb->getxattr('foo', ' bar');90 is(@$xattrs[0], 'user.bar', 'xattr name'); 91 } 92 93 my $value = $neb->getxattr('foo', 'user.bar'); 105 94 is($value, 'quix', 'xattr value'); 106 95 107 ok($neb->removexattr('foo', ' bar'), "remove object xattr");96 ok($neb->removexattr('foo', 'user.bar'), "remove object xattr"); 108 97 { 109 98 my $xattrs = $neb->listxattr('foo'); … … 117 106 118 107 eval { 119 my $neb = Nebulous::Client->new( 120 proxy => "http://$hostport/nebulous", 121 ); 122 108 $neb->setxattr('foo', 'user.bar', 'baz', 'create'); 109 }; 110 like($@, qr/is valid object key/, "create xattr on non-existant key"); 111 112 Test::Nebulous->setup; 113 114 eval { 115 $neb->create('foo'); 116 117 $neb->setxattr('foo', 'luser.bar', 'baz', 'create'); 118 }; 119 like($@, qr/xattr is in user. namespace/, "user. namspace"); 120 121 Test::Nebulous->setup; 122 123 eval { 124 $neb->setxattr('foo', 'user.bar', 'baz', 'replace'); 125 }; 126 like($@, qr/is valid object key/, "replace xattr on non-existant key"); 127 128 Test::Nebulous->setup; 129 130 eval { 123 131 $neb->setxattr(); 124 132 }; … … 128 136 129 137 eval { 130 my $neb = Nebulous::Client->new( 131 proxy => "http://$hostport/nebulous", 132 ); 133 134 $neb->create('foo'); 135 136 $neb->setxattr('foo', 'bar'); 138 $neb->create('foo'); 139 140 $neb->setxattr('foo', 'user.bar'); 137 141 }; 138 142 like($@, qr/4 were expected/, "too few params"); … … 141 145 142 146 eval { 143 my $neb = Nebulous::Client->new( 144 proxy => "http://$hostport/nebulous", 145 ); 146 147 $neb->create('foo'); 148 149 $neb->setxattr('foo', 'bar', 'baz'); 147 $neb->create('foo'); 148 149 $neb->setxattr('foo', 'user.bar', 'baz'); 150 150 }; 151 151 like($@, qr/4 were expected/, "too few params"); … … 154 154 155 155 eval { 156 my $neb = Nebulous::Client->new( 157 proxy => "http://$hostport/nebulous", 158 ); 159 160 $neb->create('foo'); 161 162 $neb->setxattr('foo', 'bar', 'baz', 'create', 'quix'); 156 $neb->create('foo'); 157 158 $neb->setxattr('foo', 'user.bar', 'baz', 'create', 'quix'); 163 159 }; 164 160 like($@, qr/4 were expected/, "too many params"); 165 161 162 # getxattr 163 164 Test::Nebulous->setup; 165 166 eval { 167 $neb->getxattr('foo', 'bar'); 168 }; 169 like($@, qr/is valid object key/, "get xattr from non-existant nebulous key"); 170 171 Test::Nebulous->setup; 172 173 eval { 174 $neb->create('foo'); 175 176 $neb->getxattr('foo', 'luser.bar'); 177 }; 178 like($@, qr/xattr is in user. namespace/, "user. namespace"); 179 180 Test::Nebulous->setup; 181 182 eval { 183 $neb->create('foo'); 184 $neb->getxattr('foo', 'user.bar'); 185 }; 186 like($@, qr|xattr neb:///foo:user.bar does not exist|, 187 "get xattr from non-existant xattr key"); 188 189 Test::Nebulous->setup; 190 191 eval { 192 $neb->getxattr(); 193 }; 194 like($@, qr/2 were expected/, "no params"); 195 196 Test::Nebulous->setup; 197 198 eval { 199 $neb->create('foo'); 200 201 $neb->getxattr('foo'); 202 }; 203 like($@, qr/2 were expected/, "too few params"); 204 205 Test::Nebulous->setup; 206 207 eval { 208 $neb->create('foo'); 209 210 $neb->getxattr('foo', 'user.bar', 'baz'); 211 }; 212 like($@, qr/2 were expected/, "too many params"); 213 166 214 # listxattr 167 215 … … 169 217 170 218 eval { 171 my $neb = Nebulous::Client->new(172 proxy => "http://$hostport/nebulous",173 );174 175 219 $neb->create('foo'); 176 220 … … 182 226 183 227 eval { 184 my $neb = Nebulous::Client->new(185 proxy => "http://$hostport/nebulous",186 );187 188 228 $neb->create('foo'); 189 229 … … 192 232 like($@, qr/1 was expected/, "too many params"); 193 233 194 # getxattr 195 196 Test::Nebulous->setup; 197 198 eval { 199 my $neb = Nebulous::Client->new( 200 proxy => "http://$hostport/nebulous", 201 ); 202 203 $neb->getxattr(); 234 # removexattr 235 236 Test::Nebulous->setup; 237 238 eval { 239 $neb->removexattr('foo', 'user.bar'); 240 }; 241 like($@, qr/is valid object key/, "remove xattr from non-existant nebulous key"); 242 243 Test::Nebulous->setup; 244 245 eval { 246 $neb->create('foo'); 247 248 $neb->getxattr('foo', 'luser.bar'); 249 }; 250 like($@, qr/xattr is in user. namespace/, "user. namespace"); 251 252 Test::Nebulous->setup; 253 254 eval { 255 $neb->create('foo'); 256 $neb->removexattr('foo', 'user.bar'); 257 }; 258 like($@, qr|xattr neb:///foo:user.bar does not exist|, 259 "remove xattr from non-existant xattr key"); 260 261 Test::Nebulous->setup; 262 263 eval { 264 $neb->removexattr(); 204 265 }; 205 266 like($@, qr/2 were expected/, "no params"); … … 208 269 209 270 eval { 210 my $neb = Nebulous::Client->new( 211 proxy => "http://$hostport/nebulous", 212 ); 213 214 $neb->create('foo'); 215 216 $neb->getxattr('foo'); 271 $neb->create('foo'); 272 273 $neb->removexattr('foo'); 217 274 }; 218 275 like($@, qr/2 were expected/, "too few params"); … … 221 278 222 279 eval { 223 my $neb = Nebulous::Client->new( 224 proxy => "http://$hostport/nebulous", 225 ); 226 227 $neb->create('foo'); 228 229 $neb->getxattr('foo', 'bar', 'baz'); 280 $neb->create('foo'); 281 282 $neb->removexattr('foo', 'user.bar', 'baz'); 230 283 }; 231 284 like($@, qr/2 were expected/, "too many params"); -
branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t
r23934 r24557 38 38 39 39 # NEB_SERVER env var not set 40 undef $ENV{'NEB_SERVER'} if defined $ENV{'NEB_SERVER'}; 40 41 Test::Nebulous->setup; 41 42 … … 82 83 83 84 is($? >> 8, 0, "exit code"); 84 like($test->stdout, qr/^foo bar$/, "stdout");85 like($test->stdout, qr/^foo\nbar$/, "stdout"); 85 86 like($test->stderr, qr/^$/, "stderr"); 86 87 } … … 160 161 161 162 is($? >> 8, 0, "exit code"); 162 like($test->stdout, qr|^a/foo a/bar$|, "stdout");163 like($test->stdout, qr|^a/foo\na/bar$|, "stdout"); 163 164 like($test->stderr, qr/^$/, "stderr"); 164 165 } -
branches/eam_branches/20090522/Nebulous/t/conf/startup.pl.in
r23934 r24557 18 18 my $config = Nebulous::Server::Config->new( 19 19 trace => 'all', 20 memcached_servers => ['127.0.0.1:11211'], 20 21 ); 21 22 $config->add_db(
Note:
See TracChangeset
for help on using the changeset viewer.
