View Javadoc
1   package com.srv4pos.server.api.activation;
2   
3   import com.srv4pos.server.api.infrastructure.Constraints;
4   import com.srv4pos.server.api.infrastructure.Info;
5   import org.springframework.roo.addon.javabean.RooJavaBean;
6   import org.springframework.roo.addon.json.RooJson;
7   import org.springframework.roo.addon.tostring.RooToString;
8   
9   import javax.validation.Valid;
10  import javax.validation.constraints.NotNull;
11  import javax.validation.constraints.Pattern;
12  import javax.validation.constraints.Size;
13  
14  /**
15   * This data structure is serialized to ActivationOrder and sent to the device to activate it.
16   * <p>User: Kirill, Date: 05.08.13 17:59</p>
17   */
18  @RooJavaBean
19  @RooToString
20  @RooJson(deepSerialize = true)
21  public class ActivationDescriptorInfo implements Info {
22      /**
23       * Version of data structure of this class. If you change this class (or nested), increase the version.
24       * Also this version changes when public/private key for {@link ActivationCodeInfo#signature} generation is changed, or algorithm of
25       * serializing {@link ActivationCodeInfo#activationDescriptorInfo} is changed
26       */
27      public static final int VERSION = 2;
28  
29      /**
30       * Unique number of every android device.
31       */
32      @NotNull
33      @Size(max = 17, min = 1)
34      private String deviceId;
35  
36      /**
37       * Value of <a href="http://developer.android.com/reference/android/content/Context.html#getPackageName%28%29">getPackageName()</a> of android app.
38       */
39      @NotNull
40      @Size(min = 1, max = 64)
41      private String applicationPackage;
42  
43      /**
44       * <p>May be null. See <a href="https://redmine.produktpoolen.se/projects/mobilkassan-android/wiki/Activation_server">spec</a> for more info about
45       * nullability of this field.</p>
46       * <p>ProductionNumber - serial number uniquely identifies instance of the Installation. It represents production number of cash register according to
47       * Swedish regulations. It has format "MK556{number}" where MK is mobilkassan, 556 is the beginning of the Produkt Poolen corporate ID,
48       * {number} - unique number within entire world</p>
49       * <p>According to swedish regulation, the definition is: Each cash register must have a production number. Production number is a globally unique
50       * serial number on physical cash registers. Production number has to be unique for each cash register from one vendor and should also indicate vendor
51       * as a part of the field.</p>
52       */
53      @NotNull
54      @Size(max = 25)
55      private String productionNumber;
56  
57      /**
58       * Country where seller with given {@link #corporateId} is registered.
59       */
60      @NotNull
61      @Size(max = 2, min = 2)
62      private String country;
63  
64      @NotNull
65      @Size(max = 96)
66      @Pattern(regexp = Constraints.WINDOWS_FILENAME_REGEX)
67      private String corporateId;
68  
69      /**
70       * Described in swedish regulations as "cash register designation".
71       * See <a href="https://redmine.produktpoolen.se/projects/mobilkassan-android/wiki/Activation_server">wiki</a> for more info.
72       */
73      @NotNull
74      @Size(max = 16)
75      private String cashRegisterName;
76  
77  
78      /**
79       * Information about activation period (when and which features are activated, per which period).
80       */
81      @NotNull
82      @Valid
83      private ActivationDetailsInfo activationDetailsInfo;
84  }