View Javadoc
1   package com.srv4pos.server.api.infrastructure.credentials;
2   
3   import com.srv4pos.server.api.infrastructure.http.HttpHelper;
4   
5   /**
6    * This credentials doesn't have any authentication info.
7    * {@code SellerCredentials} introduces override of {@code getSellerId}.
8    * Created by fasth on 27.08.2014.
9    */
10  public class SellerCredentials implements Credentials {
11  
12      //CHECKSTYLE:OFF Variable must be private and have accessor methods.
13      protected String country;
14      protected String corporateId;
15      //CHECKSTYLE:ON Variable must be private and have accessor methods.
16  
17      public SellerCredentials(String country, String corporateId) {
18          this.country = country;
19          this.corporateId = corporateId;
20      }
21  
22      /**
23       * Doesn't have any authentication info.
24        * @return {@code} null.
25       */
26      public String toAuthentication() {
27          return null;
28      }
29  
30      /**
31       * Returns sellerId. SellerId is concatenate of seller's country and seller's corporate ID.
32       * @return {@code String} of format {sellerCountry}{sellerCorporateID}.
33       */
34      public String getSellerId() {
35          return HttpHelper.getSellerId(country, corporateId);
36      }
37  
38      public String getCountry() {
39          return country;
40      }
41  
42      public String getCorporateId() {
43          return corporateId;
44      }
45  }