Support for defining attributes on a node_type
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / ConsumerDataDefinition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.datatypes.elements;
22
23 import lombok.EqualsAndHashCode;
24 import lombok.Getter;
25 import lombok.NoArgsConstructor;
26 import lombok.Setter;
27 import lombok.ToString;
28 import org.apache.commons.lang3.builder.HashCodeExclude;
29 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
30
31 @Getter
32 @Setter
33 @EqualsAndHashCode
34 @ToString
35 @NoArgsConstructor
36 public class ConsumerDataDefinition extends ToscaDataDefinition {
37
38     // ECOMP Consumer Name - UTF-8 string up to 255 characters containing the
39     // following characters : ( maybe to limit 4-64 chars ? )
40     // Lowercase characters {a-z}
41     // Uppercase characters {A-Z}
42     // Numbers {0-9}
43     // Dash {-}; this character is not supported as the first character in the
44     // user name
45     // Period {.}; this character is not supported as the first character in the
46     // user name
47     // Underscore {_}
48     // * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
49     // SALT + "real" password ) => maximal length 256 bytes = 32 characters
50     // Before storing/comparing please convert upper case letter to lower.
51     // The "normalized" encrypted password should match the following format :
52     // [a-z0-9]{32} = alphanumeric string
53     //
54     // * ECOMP Consumer Salt - alphanumeric string [a-z0-9] , length = 32 chars.
55     // * ECOMP Consumer Last Authentication Time ( for future use) -
56     // time when ECOMP Consumer was authenticated for the last time in
57     // milliseconds from 1970 (GMT) - should be set to "0" on creation .
58     // * ECOMP Consumer Details Last updated time - time of the last update in
59     // milliseconds from 1970 (GMT)
60     // * USER_ID - USER_ID of the last user that created/updated credentials (
61     // should be retrieved from USER_ID header)
62     private String consumerName;
63     private String consumerPassword;
64     private String consumerSalt;
65     private Long consumerLastAuthenticationTime;
66     private Long consumerDetailsLastupdatedtime;
67     private String lastModfierAtuid;
68
69     public ConsumerDataDefinition(ConsumerDataDefinition a) {
70         this.consumerName = a.consumerName;
71         this.consumerPassword = a.consumerPassword;
72         this.consumerSalt = a.consumerSalt;
73         this.consumerLastAuthenticationTime = a.consumerLastAuthenticationTime;
74         this.consumerDetailsLastupdatedtime = a.consumerDetailsLastupdatedtime;
75         this.lastModfierAtuid = a.lastModfierAtuid;
76
77     }
78
79 }