2 * Copyright 2016-2017, Nokia Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core;
18 import static com.google.common.hash.Hashing.sha512;
21 * Describes the VNFM credentials
23 public class VnfmCredentials {
24 private final String username;
25 private final String password;
26 private final String clientId;
27 private final String clientSecret;
30 * @param username the username for the VNFM
31 * @param password the password for the VNFM
32 * @param clientId the client identifier
33 * @param clientSecret the client secret
35 VnfmCredentials(String username, String password, String clientId, String clientSecret) {
36 this.username = username;
37 this.password = password;
38 this.clientId = clientId;
39 this.clientSecret = clientSecret;
43 * @return the username for the VNFM
45 public String getUsername() {
50 * @return the password for the VNFM
52 public String getPassword() {
57 * @return the client identifier
59 public String getClientId() {
64 * @return the client secret
66 public String getClientSecret() {
71 public String toString() {
72 return "VnfmCredentials{" +
73 "username='" + username + '\'' +
74 ", password='" + sha512().hashBytes(password.getBytes()).toString() + '\'' +
75 ", clientId='" + clientId + '\'' +
76 ", clientSecret='" + sha512().hashBytes(clientSecret.getBytes()).toString() + '\'' +