Joaquín Reñé
2026-03-27 4ee50e257b32f6ec0f72907305d1f2b1212808a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
*/
package net.curisit.securis.db;
import net.curisit.securis.db.common.CodedEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* PackStatus
* <p>
* Enumerates possible pack lifecycle statuses. JSON representation is the short code.
* See: https://redmine.curistec.com/projects/securis/wiki/LicensesServerManagement
* @author JRA
* Last reviewed by JRA on Oct 5, 2025.
*/
public enum PackStatus implements CodedEnum {
   
   // Available status for the pack
    CREATED("CR"), ACTIVE("AC"), ON_HOLD("OH"), EXPIRED("EX"), CANCELLED("CA");
    private final String code;
    /**
     * PackStatus<p>
     * Constructor
     * 
     * @param code
     */
    PackStatus(String code) { this.code = code; }
    /** 
     * getCode<p>
     * Short code stored in DB / used in JSON. 
     * 
     * @return packCode
     */
    @Override public String getCode() { return code; }
    /** 
     * valueFromCode<p>
     * Factory method from short code. 
     * 
     * @param packCode
     * @return packStatus
     */
    @JsonCreator
    public static PackStatus valueFromCode(String code) {
        for (PackStatus ps : PackStatus.values()) {
            if (ps.code.equals(code)) return ps;
        }
        return null;
    }
    /** 
     * getName<p>
     * Expose short code as JSON value. 
     * 
     * @return name
     */
    @JsonValue
    public String getName() { return this.code; }
}