diff options
author | Jon Robertson <jonrober@stanford.edu> | 2015-02-18 15:17:51 -0800 |
---|---|---|
committer | Jon Robertson <jonrober@stanford.edu> | 2015-06-08 15:24:34 -0700 |
commit | 000b338694fae87996220336678fe990a1c3e3e1 (patch) | |
tree | 5266498e6c4024d56c8afc0afc5677de590fad8e /perl/lib/Wallet/Object/Base.pm | |
parent | 1575e25c9e9edc8d577a0f1118732c98871984e0 (diff) |
Added new method for wallet-backend, update
update will work generally like get, but only for objects that have a
concept of updating content automatically, like keytabs and passwords.
For these, the content will be updated before sending to the client.
In a later release get for keytabs will be modified to never update the
kvno before sending to the user, and so the unchanging flag will be
phased out in lieu of explicitly using the method that does what you
want.
Change-Id: I96a84416c5e50278eb29fe07052dde6e063bc071
Diffstat (limited to 'perl/lib/Wallet/Object/Base.pm')
-rw-r--r-- | perl/lib/Wallet/Object/Base.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/perl/lib/Wallet/Object/Base.pm b/perl/lib/Wallet/Object/Base.pm index bdd61fb..97e6127 100644 --- a/perl/lib/Wallet/Object/Base.pm +++ b/perl/lib/Wallet/Object/Base.pm @@ -609,6 +609,15 @@ sub history { # The get methods must always be overridden by the subclass. sub get { die "Do not instantiate Wallet::Object::Base directly\n"; } +# The update method should only work if a subclass supports it as something +# different from get. That makes it explicit about whether the subclass has +# a meaningful update. +sub update { + my ($self) = @_; + $self->error ("update is not supported for this type, use get instead"); + return; +} + # Provide a default store implementation that returns an immutable object # error so that auto-generated types don't have to provide their own. sub store { |