1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.api.ldap.extras.extended.pwdModify;
21
22
23 import org.apache.directory.api.ldap.model.message.AbstractExtendedRequest;
24 import org.apache.directory.api.util.Strings;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 public class PasswordModifyRequestImpl extends AbstractExtendedRequest implements PasswordModifyRequest
40 {
41
42 private byte[] userIdentity;
43
44
45 private byte[] oldPassword;
46
47
48 private byte[] newPassword;
49
50
51
52
53
54 public PasswordModifyRequestImpl()
55 {
56 setRequestName( EXTENSION_OID );
57 }
58
59
60
61
62
63
64
65 public PasswordModifyRequestImpl( int messageId )
66 {
67 super( messageId );
68 setRequestName( EXTENSION_OID );
69 }
70
71
72
73
74
75 public byte[] getUserIdentity()
76 {
77 return userIdentity;
78 }
79
80
81
82
83
84 public void setUserIdentity( byte[] userIdentity )
85 {
86 this.userIdentity = userIdentity;
87 }
88
89
90
91
92
93 public byte[] getOldPassword()
94 {
95 return oldPassword;
96 }
97
98
99
100
101
102 public void setOldPassword( byte[] oldPassword )
103 {
104 this.oldPassword = oldPassword;
105 }
106
107
108
109
110
111 public byte[] getNewPassword()
112 {
113 return newPassword;
114 }
115
116
117
118
119
120 public void setNewPassword( byte[] newPassword )
121 {
122 this.newPassword = newPassword;
123 }
124
125
126
127
128
129 @Override
130 public PasswordModifyResponse getResultResponse()
131 {
132 if ( response == null )
133 {
134 response = new PasswordModifyResponseImpl( getMessageId() );
135 }
136
137 return ( PasswordModifyResponse ) response;
138 }
139
140
141
142
143
144 public String toString()
145 {
146 StringBuilder sb = new StringBuilder();
147
148 sb.append( "PwdModifyRequest :" );
149 sb.append( "\n UserIdentity : " );
150
151 if ( userIdentity != null )
152 {
153 sb.append( Strings.utf8ToString( userIdentity ) );
154 }
155 else
156 {
157 sb.append( "null" );
158 }
159
160 sb.append( "\n oldPassword : " );
161
162 if ( oldPassword != null )
163 {
164 sb.append( Strings.utf8ToString( oldPassword ) );
165 }
166 else
167 {
168 sb.append( "null" );
169 }
170
171 sb.append( "\n newPassword : " );
172
173 if ( newPassword != null )
174 {
175 sb.append( Strings.utf8ToString( newPassword ) );
176 }
177 else
178 {
179 sb.append( "null" );
180 }
181
182 return sb.toString();
183 }
184 }