Package com.labs64.netlicensing.service
Class TokenService
- java.lang.Object
-
- com.labs64.netlicensing.service.TokenService
-
public class TokenService extends Object
Provides token entity handling routines.
-
-
Constructor Summary
Constructors Constructor Description TokenService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Token
create(Context context, Token token)
Creates new token.static void
delete(Context context, String number)
Delete token by its number.static Token
get(Context context, String number)
Gets token by its number.static Page<Token>
list(Context context, String filter)
Returns tokens of a vendor.
-
-
-
Method Detail
-
get
public static Token get(Context context, String number) throws NetLicensingException
Gets token by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the token number- Returns:
- the token
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
list
public static Page<Token> list(Context context, String filter) throws NetLicensingException
Returns tokens of a vendor.- Parameters:
context
- determines the vendor on whose behalf the call is performedfilter
- additional criteria to filter type of tokens to return, if NULL return tokens of all types- Returns:
- collection of token entities or null/empty list if nothing found.
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
create
public static Token create(Context context, Token token) throws NetLicensingException
Creates new token.- Parameters:
context
- determines the vendor on whose behalf the call is performedtoken
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- created token
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
delete
public static void delete(Context context, String number) throws NetLicensingException
Delete token by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the token number- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
-