diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2017-08-16 09:21:24 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-08-16 07:56:39 +0000 |
commit | 130c716105017c7b20b4779973b915968b3dc322 (patch) | |
tree | 50b28ac5691928dcff03fcf8cb57bec651a270c1 /samples/interfaces/mapping | |
parent | c643983450d5fd56db40ad2718877ec2289e6e6f (diff) |
HONEYCOMB-386 - Make update optional
If customizer does not support update directly,
updates for its handled nodes are broken up to delete + create pairs.
Change-Id: I2929109e8c9a1db0bef108367cf7d839135ce173
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'samples/interfaces/mapping')
-rw-r--r-- | samples/interfaces/mapping/src/main/java/io/fd/honeycomb/samples/interfaces/mapping/config/InterfaceWriterCustomizer.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/samples/interfaces/mapping/src/main/java/io/fd/honeycomb/samples/interfaces/mapping/config/InterfaceWriterCustomizer.java b/samples/interfaces/mapping/src/main/java/io/fd/honeycomb/samples/interfaces/mapping/config/InterfaceWriterCustomizer.java index af185d8b0..01d29003f 100644 --- a/samples/interfaces/mapping/src/main/java/io/fd/honeycomb/samples/interfaces/mapping/config/InterfaceWriterCustomizer.java +++ b/samples/interfaces/mapping/src/main/java/io/fd/honeycomb/samples/interfaces/mapping/config/InterfaceWriterCustomizer.java @@ -54,15 +54,15 @@ public class InterfaceWriterCustomizer implements ListWriterCustomizer<Interface } } + /* + * For nodes that does not have support for update operation directly, there's no need to override + * updateCurrentAttributes method. Updates will be handlers as combination of delete + create. If you want to + * implement update directly, override method updateCurrentAttributes @Override public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Interface> id, @Nonnull final Interface dataBefore, @Nonnull final Interface dataAfter, @Nonnull final WriteContext writeContext) throws WriteFailedException { - // There are cases when lower layer does not support all of the CRUD operations, in which case, the handler - // should look like this (This will reject configuration from upper layers, returning error/rpc-error): - throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter, - new UnsupportedOperationException("Unable to update interface data, unsupported at lower layer")); - } + }*/ @Override public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Interface> id, |