public class ActivationService extends Object
User: Kirill, Date: 01.10.13 11:21
.Modifier and Type | Field and Description |
---|---|
private Credentials |
credentials |
private Transport |
transport |
private URL |
url |
Constructor and Description |
---|
ActivationService(URL url,
Credentials credentials,
Transport transport)
Constructs the service.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cashRegisterNameExists(CashRegisterNameExistsInfo cashRegisterNameExistsInfo)
Checks that cash register name is unique for particular seller.
|
ActivationSecurityInfo |
claim(String country,
String corporateId,
String cashRegisterName,
String applicationPackage,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment,
String controlUnitSerial,
ControlUnitLocation controlUnitLocation,
GeolocationInfo controlUnitGeolocation,
String deviceId,
Map<String,String> buildInfo,
String gcmRegistrationId)
If current application does not have Activation the app uses this method to request (order) new one.
|
ActivationSecurityInfo |
claim(String country,
String corporateId,
String cashRegisterName,
String applicationPackage,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment,
String deviceId,
Map<String,String> buildInfo)
If current application does not have Activation, the app uses this method to request (order) new one.
|
ActivationSecurityInfo |
connect(ActivationConnectInfo activationConnectInfo)
Creates an activation.
|
ActivationSecurityInfo |
create(ActivationCreationInfo activationCreationInfo)
Creates activation.
|
ActivationCodeInfo |
getActivationCode(Credentials credentials)
This method requires credentials and returns
ActivationCodeInfo for provided credentials. |
Collection<FullActivationAdvancedInfo> |
listFull()
Returns list of activations with tokens and descriptor info.
|
static ActivationCreationInfo |
newActivationCreationInfo(String country,
String corporateId,
String cashRegisterName,
String applicationPackage,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment,
String controlUnitSerial,
ControlUnitLocation controlUnitLocation,
GeolocationInfo controlUnitGeolocation,
String deviceId,
Map<String,String> buildInfo,
String gcmRegistrationId,
GeolocationInfo registrationLocation) |
static ActivationCreationInfo |
newActivationCreationInfo(String country,
String corporateId,
String cashRegisterName,
String applicationPackage,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment,
String controlUnitSerial,
ControlUnitLocation controlUnitLocation,
GeolocationInfo controlUnitGeolocation,
String deviceId,
Map<String,String> buildInfo,
String gcmRegistrationId,
GeolocationInfo registrationLocation,
String programVersion) |
ActivationSecurityInfo |
up(String country,
String corporateId,
String cashRegisterName,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment)
Prolongation for the activation, which is identified by country, corporateId, cashRegisterName.
|
ActivationSecurityInfo |
up(String country,
String corporateId,
String cashRegisterName,
Set<Feature> features,
Date validFrom,
Date validTo,
ContactInfo contactInfo,
String comment,
String controlUnitSerial,
ControlUnitLocation controlUnitLocation,
GeolocationInfo controlUnitGeolocation)
Prolongation for the activation, which is identified by country, corporateId, cashRegisterName.
|
private URL url
private Credentials credentials
private Transport transport
public ActivationService(URL url, Credentials credentials, Transport transport)
url
- of the servercredentials
- to work with the servertransport
- to know the method to reach the serverpublic boolean cashRegisterNameExists(CashRegisterNameExistsInfo cashRegisterNameExistsInfo)
cashRegisterNameExistsInfo
- see javadoc of members of this type for more infopublic ActivationCodeInfo getActivationCode(Credentials credentials)
ActivationCodeInfo
for provided credentials.
It must be authenticated by credentials initialized by Credentials#(String, String, String, String)
credentials
- to authenticate to pass activationSecurityToken as Credentials#(String, String, String, String)
ActivationDescriptorInfo
, it's signature and it's version (to correctly check digital signature)ForbiddenJsonException
- see:
ForbiddenErrorType.ACTIVATION_STILL_ISSUED
,
ForbiddenErrorType.WRONG_USERNAME_OR_PASSWORD
public ActivationSecurityInfo connect(ActivationConnectInfo activationConnectInfo)
activationConnectInfo
- information about Activation connection neededReferenceNotFoundJsonException
- if Activation not found by codeInconsistentDataJsonException
- see:
InconsistentDataErrorType.ACTIVATION_CODE_WRONG_LENGTH
,
InconsistentDataErrorType.PRODUCTION_NUMBER_AND_CONNECTION_MISMATCH
,
InconsistentDataErrorType.PRODUCTION_NUMBER_AND_DEVICE_ID_MISMATCH
UnprocessableEntityJsonException
- see:
UnprocessableEntityErrorType.APPLICATION_PACKAGES_MISMATCH
public Collection<FullActivationAdvancedInfo> listFull()
public ActivationSecurityInfo create(ActivationCreationInfo activationCreationInfo)
activationCreationInfo
- information about activationReferenceNotFoundJsonException
- if installation, application package or control unit are not foundNonUniqueJsonException
- if cash register name is not unique within a sellerInconsistentDataJsonException
- see:
InconsistentDataErrorType.ACTIVATION_CODE_ALREADY_EXISTS
,
InconsistentDataErrorType.VALID_FROM_AND_VALID_TO_INCONSISTENCY
,
InconsistentDataErrorType.SV_MISMATCH_IN_APP_DESC_AND_CU
InconsistentDataErrorType.REGISTRATION_EXISTS_FOR_SELLER_AND_INSTALLATION
InconsistentDataErrorType.ACTIVATION_APPLICATION_PACKAGE_MUST_BE_NULL_OR_EQUAL
InconsistentDataErrorType.ACTIVATION_PRODUCTION_NUMBER_SHOULD_BE_NULL
InconsistentDataErrorType.ACTIVATION_PRODUCTION_NUMBER_SHOULD_BE_NULL_OR_EQUAL
UnprocessableEntityJsonException
- see:
UnprocessableEntityErrorType.CU_LOCATION_MUST_BE_SET
UnprocessableEntityErrorType.CU_IS_MISSING_FOR_ACTIVATION
UnprocessableEntityErrorType.PRODUCTION_NUMBER_IS_OUT_OF_DATE
public ActivationSecurityInfo claim(String country, String corporateId, String cashRegisterName, String applicationPackage, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment, String controlUnitSerial, ControlUnitLocation controlUnitLocation, GeolocationInfo controlUnitGeolocation, String deviceId, Map<String,String> buildInfo, String gcmRegistrationId)
country
- where seller is locatedcorporateId
- of the sellercashRegisterName
- the name for the cash registerapplicationPackage
- identifies the application descriptionfeatures
- the featuresvalidFrom
- the start date for activation intervalvalidTo
- the end date for activation intervalcontactInfo
- contact information, can be nullcomment
- the comment for the activation, can be nullcontrolUnitSerial
- the control unit serial, can be nullcontrolUnitLocation
- the control unit location, can be nullcontrolUnitGeolocation
- the control unit geolocation, can be nulldeviceId
- id of devicebuildInfo
- information about android buildgcmRegistrationId
- the gcm registration id, can be nullReferenceNotFoundJsonException
- if application package or control unit are not foundNonUniqueJsonException
- if cash register name is not unique within a sellerInconsistentDataJsonException
- see:
InconsistentDataErrorType.VALID_FROM_AND_VALID_TO_INCONSISTENCY
,
InconsistentDataErrorType.REGISTRATION_EXISTS_FOR_SELLER_AND_INSTALLATION
InconsistentDataErrorType.SV_MISMATCH_IN_APP_DESC_AND_CU
UnprocessableEntityJsonException
- see:
UnprocessableEntityErrorType.CU_LOCATION_MUST_BE_SET
UnprocessableEntityErrorType.CU_IS_MISSING_FOR_ACTIVATION
public ActivationSecurityInfo claim(String country, String corporateId, String cashRegisterName, String applicationPackage, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment, String deviceId, Map<String,String> buildInfo)
country
- where seller is locatedcorporateId
- of the sellercashRegisterName
- the name for the cash registerapplicationPackage
- identifies the application descriptionfeatures
- the featuresvalidFrom
- the start date for activation intervalvalidTo
- the end date for activation intervalcontactInfo
- contact information, can be nullcomment
- the comment for the activation, can be nulldeviceId
- id of devicebuildInfo
- information about android buildReferenceNotFoundJsonException
- if application package is not foundNonUniqueJsonException
- if cash register name is not unique within a sellerInconsistentDataJsonException
- see:
InconsistentDataErrorType.VALID_FROM_AND_VALID_TO_INCONSISTENCY
,
InconsistentDataErrorType.REGISTRATION_EXISTS_FOR_SELLER_AND_INSTALLATION
public ActivationSecurityInfo up(String country, String corporateId, String cashRegisterName, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment, String controlUnitSerial, ControlUnitLocation controlUnitLocation, GeolocationInfo controlUnitGeolocation)
country
- where seller is locatedcorporateId
- of the sellercashRegisterName
- the name for the cash registerfeatures
- the featuresvalidFrom
- the start date for activation intervalvalidTo
- the end date for activation intervalcontactInfo
- contact information, can be nullcomment
- the comment for the activation, can be nullcontrolUnitSerial
- the control unit serial, can be nullcontrolUnitLocation
- the control unit location, can be nullcontrolUnitGeolocation
- the control unit geolocation, can be nullReferenceNotFoundJsonException
- if installation or control unit are not foundNonUniqueJsonException
- if cash register name is not unique within a sellerInconsistentDataJsonException
- see:
InconsistentDataErrorType.VALID_FROM_AND_VALID_TO_INCONSISTENCY
,
InconsistentDataErrorType.SV_MISMATCH_IN_APP_DESC_AND_CU
UnprocessableEntityJsonException
- see:
UnprocessableEntityErrorType.CU_LOCATION_MUST_BE_SET
UnprocessableEntityErrorType.CU_IS_MISSING_FOR_ACTIVATION
UnprocessableEntityErrorType.PRODUCTION_NUMBER_IS_OUT_OF_DATE
public ActivationSecurityInfo up(String country, String corporateId, String cashRegisterName, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment)
country
- where seller is locatedcorporateId
- of the sellercashRegisterName
- the name for the cash registerfeatures
- the featuresvalidFrom
- the start date for activation intervalvalidTo
- the end date for activation intervalcontactInfo
- contact information, can be nullcomment
- the comment for the activation, can be nullReferenceNotFoundJsonException
- if installation is not foundNonUniqueJsonException
- if cash register name is not unique within a sellerInconsistentDataJsonException
- see:
InconsistentDataErrorType.VALID_FROM_AND_VALID_TO_INCONSISTENCY
,UnprocessableEntityJsonException
- see:
UnprocessableEntityErrorType.PRODUCTION_NUMBER_IS_OUT_OF_DATE
public static ActivationCreationInfo newActivationCreationInfo(String country, String corporateId, String cashRegisterName, String applicationPackage, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment, String controlUnitSerial, ControlUnitLocation controlUnitLocation, GeolocationInfo controlUnitGeolocation, String deviceId, Map<String,String> buildInfo, String gcmRegistrationId, GeolocationInfo registrationLocation)
public static ActivationCreationInfo newActivationCreationInfo(String country, String corporateId, String cashRegisterName, String applicationPackage, Set<Feature> features, Date validFrom, Date validTo, ContactInfo contactInfo, String comment, String controlUnitSerial, ControlUnitLocation controlUnitLocation, GeolocationInfo controlUnitGeolocation, String deviceId, Map<String,String> buildInfo, String gcmRegistrationId, GeolocationInfo registrationLocation, String programVersion)
Copyright © 2018. All rights reserved.