2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.impl.password.service;
10 import static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import com.google.common.annotations.Beta;
14 import com.google.common.annotations.VisibleForTesting;
15 import com.google.common.collect.ForwardingObject;
16 import java.util.Dictionary;
17 import java.util.Hashtable;
19 import org.gaul.modernizer_maven_annotations.SuppressModernizer;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.password.service.config.rev170619.PasswordServiceConfig;
21 import org.opendaylight.yangtools.yang.binding.Augmentation;
22 import org.osgi.service.component.annotations.Activate;
23 import org.osgi.service.component.annotations.Component;
24 import org.osgi.service.component.annotations.Deactivate;
27 @Component(factory = OSGiPasswordServiceConfig.FACTORY_NAME)
28 public final class OSGiPasswordServiceConfig extends ForwardingObject implements PasswordServiceConfig {
29 // OSGi DS Component Factory name
30 static final String FACTORY_NAME = "org.opendaylight.aaa.impl.password.service.OSGiPasswordServiceConfig";
32 // Keys to for activation properties
34 static final String DELEGATE = ".delegate";
36 private PasswordServiceConfig delegate;
39 public Map<Class<? extends Augmentation<PasswordServiceConfig>>, Augmentation<PasswordServiceConfig>>
41 return delegate().augmentations();
45 public String getAlgorithm() {
46 return delegate().getAlgorithm();
50 public Integer getIterations() {
51 return delegate().getIterations();
55 public String getPrivateSalt() {
56 return delegate().getPrivateSalt();
60 public int hashCode() {
61 return delegate().hashCode();
65 public boolean equals(final Object obj) {
66 return delegate().equals(obj);
70 protected PasswordServiceConfig delegate() {
71 return verifyNotNull(delegate);
75 void activate(final Map<String, ?> properties) {
76 delegate = (PasswordServiceConfig) verifyNotNull(properties.get(DELEGATE));
85 static Dictionary<String, ?> props(final PasswordServiceConfig delegate) {
86 final Dictionary<String, Object> ret = new Hashtable<>(2);
87 ret.put(DELEGATE, requireNonNull(delegate));