c96b809ff9f87ad555577f6421075dd7e9293234
[so.git] / adapters / mso-adapter-utils / src / main / java / org / openecomp / mso / cloud / authentication / models / RackspaceAuthentication.java
1 /*
2  * ============LICENSE_START==========================================
3  * ===================================================================
4  * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
5  * ===================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  * ============LICENSE_END============================================
18  *
19  * ECOMP and OpenECOMP are trademarks
20  * and service marks of AT&T Intellectual Property.
21  *
22  */
23
24 package org.openecomp.mso.cloud.authentication.models;
25
26 import org.codehaus.jackson.annotate.JsonProperty;
27 import org.codehaus.jackson.map.annotate.JsonRootName;
28 import com.woorea.openstack.keystone.model.Authentication;
29
30 @JsonRootName("auth")
31 public class RackspaceAuthentication extends Authentication {
32                 
33         private static final long serialVersionUID = 5451283386875662918L;
34
35         public static final class Token {
36                 
37                 private String username;
38                 private String apiKey;
39
40                 /**
41                  * @return the username
42                  */
43                 public String getUsername() {
44                         return username;
45                 }
46                 /**
47                  * @param username the username to set
48                  */
49                 public void setUsername(String username) {
50                         this.username = username;
51                 }
52                 /**
53                  * @return the apiKey
54                  */
55                 public String getApiKey() {
56                         return apiKey;
57                 }
58                 /**
59                  * @param apiKey the apiKey to set
60                  */
61                 public void setApiKey(String apiKey) {
62                         this.apiKey = apiKey;
63                 }
64         }
65         
66         @JsonProperty("RAX-KSKEY:apiKeyCredentials")
67         private Token token = new Token();
68         
69         public RackspaceAuthentication (String username, String apiKey) {
70                 this.token.username = username;
71                 this.token.apiKey = apiKey;
72         
73         }
74
75         /**
76          * @return the token
77          */
78         public Token getToken() {
79                 return token;
80         }
81
82         /**
83          * @param token the token to set
84          */
85         public void setToken(Token token) {
86                 this.token = token;
87         }
88         
89 }