1 /*
2 * Copyright 2012-2025 CodeLibs Project and the Others.
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.codelibs.fess.app.web.admin.accesstoken;
17
18 import org.lastaflute.web.validation.Required;
19 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
20
21 import jakarta.validation.constraints.Size;
22
23 /**
24 * Form class for editing access tokens in the admin interface.
25 * This form extends CreateForm to include fields necessary for updating existing access tokens,
26 * including tracking information for optimistic locking and audit trails.
27 *
28 */
29 public class EditForm extends CreateForm {
30
31 /**
32 * Creates a new EditForm instance.
33 */
34 public EditForm() {
35 super();
36 }
37
38 /**
39 * The unique identifier of the access token being edited.
40 * This is a required field for identifying which token to update.
41 */
42 @Required
43 @Size(max = 1000)
44 public String id;
45
46 /**
47 * The username of the user who last updated this access token.
48 * Used for audit trail purposes to track who made changes.
49 */
50 @Size(max = 1000)
51 public String updatedBy;
52
53 /**
54 * The timestamp when this access token was last updated.
55 * Stored as a long value representing milliseconds since epoch.
56 * Used for audit trail and concurrency control.
57 */
58 @ValidateTypeFailure
59 public Long updatedTime;
60
61 /**
62 * The version number of the access token for optimistic locking.
63 * This field is required to prevent concurrent modification conflicts
64 * by ensuring the token hasn't been modified by another process.
65 */
66 @Required
67 @ValidateTypeFailure
68 public Integer versionNo;
69
70 }