1 # Dobrica Pavlinusic, <dpavlin@rot13.org> 10/26/07 21:37:12 CEST
2 package CWMP::Store::DBMDeep;
8 use Data::Dump qw/dump/;
13 CWMP::Store::DBMDeep - use DBM::Deep as storage
30 $debug = $args->{debug};
31 my $path = $args->{path} || confess "no path?";
33 warn "open ",dump( $args ) if $debug;
35 $path = "$path/state.db" if ( -d $args->{path} );
41 ) || confess "can't open $path: $!";
45 =head2 update_uid_state
47 $store->update_uid_state( $uid, $state );
51 sub update_uid_state {
52 my ( $self, $uid, $state ) = @_;
54 if ( my $o = $db->get( $uid ) ) {
55 warn "## update state of $uid\n" if $debug;
56 return $o->import( $state );
58 warn "## create new state for $uid\n" if $debug;
59 return $db->put( $uid => $state );
65 $store->get_state( $uid );
70 my ( $self, $uid ) = @_;
72 if ( my $state = $db->get( $uid ) ) {
73 return $state->export;
81 my @uids = $store->all_uids;