IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20988


Ignore:
Timestamp:
Dec 14, 2008, 12:48:35 PM (17 years ago)
Author:
eugene
Message:

revert to non-distributed version

Location:
trunk/Nebulous
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/lib/Nebulous/Client.pm

    r20965 r20988  
    11# Copyright (c) 2004-2008  Joshua Hoblitt
    22#
    3 # $Id: Client.pm,v 1.63 2008-12-12 21:13:41 jhoblitt Exp $
     3# $Id: Client.pm,v 1.64 2008-12-14 22:48:35 eugene Exp $
    44
    55package Nebulous::Client;
     
    243243        # if the copy failed we now have a zero length instances floating
    244244        # around that must be removed
    245         unless ($self->delete_instance($key, "$uri")) {
     245        unless ($self->delete_instance("$uri")) {
    246246            $log->logdie( "can not copy instance $uri AND FAILED TO CLEANUP EMPTY INSTANCE" );
    247247        }
     
    256256
    257257    unless ($src_md5 eq $dst_md5) {
    258         $self->delete_instance($key, "$uri");
     258        $self->delete_instance("$uri");
    259259        $log->logdie( "md5sum mismatch" );
    260260    }
     
    327327    }
    328328
    329     my $uri = $self->delete_instance($key, @$locations[0]);
     329    my $uri = $self->delete_instance( @$locations[0] );
    330330
    331331    $log->debug("leaving");
     
    813813    # a lock is implicitly removed when the last storage object is deleted
    814814    foreach my $uri ( @$locations ) {
    815         $self->delete_instance($key, $uri) or return undef;
     815        $self->delete_instance( $uri ) or return undef;
    816816    }
    817817
     
    944944    my $self = shift;
    945945
    946     my ($key, $uri) = validate_pos(@_,
    947         {
    948             type => SCALAR,
    949         },
     946    my ($uri) = validate_pos(@_,
    950947        {
    951948            type => SCALAR,
     
    964961    $log->logdie( $@ ) if $@;
    965962
    966     my $response = $self->{ 'server' }->delete_instance($key, $uri);
     963    my $response = $self->{ 'server' }->delete_instance( $uri );
    967964    if ( $response->fault ) {
    968965        $self->set_err($response->faultstring);
  • trunk/Nebulous/nebclient/nebulous.wsdl

    r20965 r20988  
    125125
    126126    <message name="delete_instanceRequest">
    127         <part name="key" type="xsd:string" />
    128127        <part name="uri" type="xsd:string" />
    129128    </message>
  • trunk/Nebulous/nebclient/src/nebclient.c

    r20965 r20988  
    44 * Copyright (C) 2005  Joshua Hoblitt
    55 *
    6  * $Id: nebclient.c,v 1.55 2008-12-12 21:13:41 jhoblitt Exp $
     6 * $Id: nebclient.c,v 1.56 2008-12-14 22:48:35 eugene Exp $
    77 */
    88
     
    253253    }
    254254
    255     if (!nebDeleteInstance(server, key, locations->URI[0])) {
     255    if (!nebDeleteInstance(server, locations->URI[0])) {
    256256        nebObjectInstancesFree(locations);
    257257
     
    539539
    540540    for (int i = 0; i < locations->n; i++) {
    541         if (!nebDeleteInstance(server, key, locations->URI[i])) {
     541        if (!nebDeleteInstance(server, locations->URI[i])) {
    542542            nebSetErr(server, "can not delete instance");
    543543            nebObjectInstancesFree(locations);
     
    655655}
    656656
    657 bool nebDeleteInstance(nebServer *server, const char *key, const char *URI)
     657bool nebDeleteInstance(nebServer *server, const char *URI)
    658658{
    659659    int             response;
     
    676676
    677677    if (soap_call_ns1__delete_USCOREinstance(server->soap, server->endpoint,
    678             NULL, (char *)key, (char *)URI, &response) != SOAP_OK) {
     678            NULL, (char *)URI, &response) != SOAP_OK) {
    679679        nebFree(filename);
    680680
  • trunk/Nebulous/nebclient/src/nebclient.h

    r20965 r20988  
    44 * Copyright (C) 2005  Joshua Hoblitt
    55 *
    6  * $Id: nebclient.h,v 1.37 2008-12-12 21:13:41 jhoblitt Exp $
     6 * $Id: nebclient.h,v 1.38 2008-12-14 22:48:35 eugene Exp $
    77 */
    88
     
    248248bool nebDeleteInstance(
    249249    nebServer *server,                  ///< nebServer object
    250     const char *key,                    ///< storage object key (name)
    251250    const char *URI                     ///< URL of instance to remove
    252251);
  • trunk/Nebulous/nebclient/src/nebulous.h

    r20965 r20988  
    11/* src/nebulous.h
    22   Generated by wsdl2h 1.2.11 from nebulous.wsdl and typemap.dat
    3    2008-12-11 21:42:13 GMT
     3   2008-10-16 23:26:37 GMT
    44   Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved.
    55   This part of the software is released under one of the following licenses:
     
    808808    NULL, // char *action = NULL selects default action for this operation
    809809    // request parameters:
    810     char*                               key,
    811810    char*                               uri,
    812811    // response parameters:
     
    820819    struct soap *soap,
    821820    // request parameters:
    822     char*                               key,
    823821    char*                               uri,
    824822    // response parameters:
     
    833831//gsoap ns1  service method-action:     delete_USCOREinstance urn:Nebulous/Server/SOAP#delete_instance
    834832int ns1__delete_USCOREinstance(
    835     char*                               key,    ///< Request parameter
    836833    char*                               uri,    ///< Request parameter
    837834    int                                *result  ///< Response parameter
  • trunk/Nebulous/nebclient/src/soapC.c

    r20965 r20988  
    1212#endif
    1313
    14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.11 2008-12-11 21:42:14 GMT")
     14SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.11 2008-10-16 23:26:39 GMT")
    1515
    1616
     
    13421342{
    13431343        (void)soap; (void)a; /* appease -Wall -Werror */
    1344         soap_default_string(soap, &a->key);
    13451344        soap_default_string(soap, &a->uri);
    13461345}
     
    13491348{
    13501349        (void)soap; (void)a; /* appease -Wall -Werror */
    1351         soap_serialize_string(soap, &a->key);
    13521350        soap_serialize_string(soap, &a->uri);
    13531351}
     
    13651363        if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__delete_USCOREinstance), type))
    13661364                return soap->error;
    1367         if (soap_out_string(soap, "key", -1, &a->key, ""))
    1368                 return soap->error;
    13691365        if (soap_out_string(soap, "uri", -1, &a->uri, ""))
    13701366                return soap->error;
     
    13821378SOAP_FMAC3 struct ns1__delete_USCOREinstance * SOAP_FMAC4 soap_in_ns1__delete_USCOREinstance(struct soap *soap, const char *tag, struct ns1__delete_USCOREinstance *a, const char *type)
    13831379{
    1384         size_t soap_flag_key = 1;
    13851380        size_t soap_flag_uri = 1;
    13861381        if (soap_element_begin_in(soap, tag, 0, type))
     
    13941389                for (;;)
    13951390                {       soap->error = SOAP_TAG_MISMATCH;
    1396                         if (soap_flag_key && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
    1397                                 if (soap_in_string(soap, "key", &a->key, "xsd:string"))
    1398                                 {       soap_flag_key--;
    1399                                         continue;
    1400                                 }
    14011391                        if (soap_flag_uri && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
    14021392                                if (soap_in_string(soap, "uri", &a->uri, "xsd:string"))
  • trunk/Nebulous/nebclient/src/soapClient.c

    r20965 r20988  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.11 2008-12-11 21:42:13 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.11 2008-10-16 23:26:38 GMT")
    1313
    1414
     
    700700}
    701701
    702 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *uri, int *result)
     702SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *uri, int *result)
    703703{       struct ns1__delete_USCOREinstance soap_tmp_ns1__delete_USCOREinstance;
    704704        struct ns1__delete_USCOREinstanceResponse *soap_tmp_ns1__delete_USCOREinstanceResponse;
     
    708708                soap_action = "urn:Nebulous/Server/SOAP#delete_instance";
    709709        soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
    710         soap_tmp_ns1__delete_USCOREinstance.key = key;
    711710        soap_tmp_ns1__delete_USCOREinstance.uri = uri;
    712711        soap_begin(soap);
  • trunk/Nebulous/nebclient/src/soapServer.c

    r20965 r20988  
    1010#endif
    1111
    12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.11 2008-12-11 21:42:13 GMT")
     12SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.11 2008-10-16 23:26:38 GMT")
    1313
    1414
     
    643643         || soap_end_recv(soap))
    644644                return soap->error;
    645         soap->error = ns1__delete_USCOREinstance(soap, soap_tmp_ns1__delete_USCOREinstance.key, soap_tmp_ns1__delete_USCOREinstance.uri, &soap_tmp_int);
     645        soap->error = ns1__delete_USCOREinstance(soap, soap_tmp_ns1__delete_USCOREinstance.uri, &soap_tmp_int);
    646646        if (soap->error)
    647647                return soap->error;
  • trunk/Nebulous/nebclient/src/soapStub.h

    r20965 r20988  
    283283struct ns1__delete_USCOREinstance
    284284{
    285         char *key;      /* optional element of type xsd:string */
    286285        char *uri;      /* optional element of type xsd:string */
    287286};
     
    433432SOAP_FMAC5 int SOAP_FMAC6 ns1__find_USCOREinstances(struct soap*, char *key, char *volume, struct ns1__find_USCOREinstancesResponse *_param_3);
    434433
    435 SOAP_FMAC5 int SOAP_FMAC6 ns1__delete_USCOREinstance(struct soap*, char *key, char *uri, int *result);
     434SOAP_FMAC5 int SOAP_FMAC6 ns1__delete_USCOREinstance(struct soap*, char *uri, int *result);
    436435
    437436SOAP_FMAC5 int SOAP_FMAC6 ns1__stat_USCOREobject(struct soap*, char *key, struct ns1__stat_USCOREobjectResponse *_param_4);
     
    468467SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__find_USCOREinstances(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *volume, struct ns1__find_USCOREinstancesResponse *_param_3);
    469468
    470 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *key, char *uri, int *result);
     469SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__delete_USCOREinstance(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *uri, int *result);
    471470
    472471SOAP_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);
  • trunk/Nebulous/t/62_client_delete_instance.t

    r20965 r20988  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 62_client_delete_instance.t,v 1.2 2008-12-12 21:13:41 jhoblitt Exp $
     5# $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 11;
     12plan tests => 9;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
     28    $neb->create( "foo" );
    2829
    29     my $key = "foo";
    30     $neb->create($key);
     30    my $locations = $neb->find_instances( "foo" );
    3131
    32     my $locations = $neb->find_instances($key);
    33 
    34     my $uri = $neb->delete_instance($key, @$locations[0]);
     32    my $uri = $neb->delete_instance( @$locations[0] );
    3533
    3634    is( $uri, @$locations[0], "delete instance" );
     
    4543        proxy => "http://$hostport/nebulous",
    4644    );
    47     my $key = "foo";
    48     $neb->create($key);
    49     $neb->replicate($key);
     45    $neb->create( "foo" );
     46    $neb->replicate( "foo" );
    5047
    5148    my $uri1 = $neb->find_instances( "foo" )->[0];
    5249
    53     ok( $neb->delete_instance($key, $uri1), "delete instance" );
     50    ok( $neb->delete_instance( $uri1 ), "delete instance" );
    5451
    5552    my $uri2 = $neb->find_instances( "foo" )->[0];
     
    5754    isnt( $uri1, $uri2, "other instance remains" );
    5855
    59     ok( $neb->delete_instance($key, $uri2), "delete instance" );
     56    ok( $neb->delete_instance( $uri2 ), "delete instance" );
    6057
    6158    my $locations = $neb->find_instances( "foo" );
    6259
    63     is( $locations, undef, "no remaining instances" );
     60    is( $locations, undef, "no remaning instances" );
    6461}
    65 
    66 Test::Nebulous->setup;
    6762
    6863{
     
    7065        proxy => "http://$hostport/nebulous",
    7166    );
    72     my $key = "foo";
    73     $neb->create($key);
    74     my $uri = $neb->delete_instance($key, "file:/foo" );
     67    my $uri = $neb->delete_instance( "file:/foo" );
    7568
    7669    is( $uri, undef, "uri does not exist" );
     
    8376        proxy => "http://$hostport/nebulous",
    8477    );
    85     my $uri = $neb->delete_instance("foo", "file:/foo" );
     78    $neb->delete_instance();
    8679};
    87 like( $@, qr/is valid object key/, "bad object key" );
     80like( $@, qr/1 was expected/, "no params" );
    8881
    8982Test::Nebulous->setup;
     
    9386        proxy => "http://$hostport/nebulous",
    9487    );
    95     my $uri = $neb->delete_instance("foo");
     88    $neb->delete_instance( "foo", 2 );
    9689};
    97 like( $@, qr/2 were expected/, "missing second param" );
    98 
    99 Test::Nebulous->setup;
    100 
    101 eval {
    102     my $neb = Nebulous::Client->new(
    103         proxy => "http://$hostport/nebulous",
    104     );
    105     $neb->delete_instance();
    106 };
    107 like( $@, qr/2 were expected/, "no params" );
    108 
    109 Test::Nebulous->setup;
    110 
    111 eval {
    112     my $neb = Nebulous::Client->new(
    113         proxy => "http://$hostport/nebulous",
    114     );
    115     $neb->delete_instance("foo", 2, 3);
    116 };
    117 like( $@, qr/2 were expected/, "too many params" );
     90like( $@, qr/1 was expected/, "too many params" );
    11891
    11992Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.