Package com.gemalto.mfs.mwsdk.dcm
Class DigitalizedCardManager
- java.lang.Object
-
- com.gemalto.mfs.mwsdk.dcm.DigitalizedCardManager
-
public final class DigitalizedCardManager extends java.lang.Object
This serves as the entry point to the Digitalized Card Manager Module. All methods here are asynchronous. Callback methods are defined by the parameter AbstractAsyncHandler. This parameter defines the data type that is expected to be returned by each of the methods. The return value AsyncToken has a method call that waits in the calling thread until the operation has finished. This method will return the corresponding AsyncResult that will contain the expected returned output of each of the methods. It is important to note that this wait blocks the calling thread. The AsyncHandler parameter is optional. If this is not defined, the caller of the operation is expected to callAsyncToken.waitToComplete()
to be able to be notified of the result of the operation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AsyncToken<java.lang.String[]>
getAllCards(AbstractAsyncHandler<java.lang.String[]> handler)
Retrieves all digitalized cards' tokenized Id.static AsyncToken<java.lang.String>
getDefault(PaymentType type, AbstractAsyncHandler<java.lang.String> handler)
Retrieves the default card's tokenized id, if any.static java.lang.String
getDigitalCardId(java.lang.String tokenizedCardId)
Retrieve the digital card ID from storage base on the tokenized card id provided.static DigitalizedCard
getDigitalizedCard(java.lang.String tokenizedCardId)
Creates a DigitalizedCard instance for the given tokenized card id.static java.lang.String
getTokenizedCardId(java.lang.String digitalCardId)
Retrieves the tokenized card id from storage based on the digitalized card id provided.static long
getTokenSyncSchedule()
This API will let MPA know when is the next scheduled time slot for tokenSync.static void
invokeTokenSync(TokenSyncListener listener)
Invoke token sync processstatic boolean
isTokenSyncAllowed()
This API is to check whether token sync process is allowedstatic AsyncToken<java.lang.Void>
unsetDefaultCard(PaymentType type, AbstractAsyncHandler<java.lang.Void> handler)
Removes the current default card status.
-
-
-
Method Detail
-
getAllCards
public static AsyncToken<java.lang.String[]> getAllCards(AbstractAsyncHandler<java.lang.String[]> handler)
Retrieves all digitalized cards' tokenized Id.- Parameters:
handler
- the handler that will be responsible for processing the result of the operation- Returns:
- AsyncToken
token that my be used to wait for the result of the asynchronous operation
-
unsetDefaultCard
public static AsyncToken<java.lang.Void> unsetDefaultCard(PaymentType type, AbstractAsyncHandler<java.lang.Void> handler)
Removes the current default card status.- Parameters:
type
- the payment typePaymentType
handler
- the handler that will be responsible for processing the result of the operation- Returns:
- AsyncToken
token that my be used to wait for the result of the asynchronous operation
-
getDefault
public static AsyncToken<java.lang.String> getDefault(PaymentType type, AbstractAsyncHandler<java.lang.String> handler)
Retrieves the default card's tokenized id, if any. Otherwise, AsyncResultwill contain null as result. - Parameters:
type
- the payment typehandler
- the handler that will be responsible for processing the result of the operation- Returns:
- AsyncToken
token that my be used to wait for the result of the asynchronous operation
-
getDigitalizedCard
public static DigitalizedCard getDigitalizedCard(java.lang.String tokenizedCardId)
Creates a DigitalizedCard instance for the given tokenized card id. This call won't perform any check or database operation. It rather only creates theDigitalizedCard
object.So the best practice is developer needs to make sure the tokenized card id is valid and existing in the database.- Parameters:
tokenizedCardId
- the tokenized card id to be used when creating a DigitalizedCard instance.- Returns:
- a new DigitalizedCard instance.
-
getDigitalCardId
public static java.lang.String getDigitalCardId(java.lang.String tokenizedCardId)
Retrieve the digital card ID from storage base on the tokenized card id provided. The digital card ID is defined in card profile as dc.tokenId.- Parameters:
tokenizedCardId
- digital token(Token unique reference) of the PAN- Returns:
- digital card ID in String format. If corresponding digital card id is not found for the token id, then result will be null.
-
getTokenizedCardId
public static java.lang.String getTokenizedCardId(java.lang.String digitalCardId)
Retrieves the tokenized card id from storage based on the digitalized card id provided.- Parameters:
digitalCardId
- Digitized card ID shared by the HCE platform components (Different than token ID)- Returns:
- String of tokenized card ID. If corresponding tokenized card id is not found for the digital card id, then result will be null.
-
isTokenSyncAllowed
public static boolean isTokenSyncAllowed()
This API is to check whether token sync process is allowed- Returns:
- true, if token sync process is allowed . Otherwise, false.
- Since:
- 6.2.0
-
invokeTokenSync
public static void invokeTokenSync(TokenSyncListener listener)
Invoke token sync process- Parameters:
listener
- the listener that will be responsible for processing the result of the token sync operation- Since:
- 6.2.0
-
getTokenSyncSchedule
public static long getTokenSyncSchedule()
This API will let MPA know when is the next scheduled time slot for tokenSync.- Returns:
- timeStamp future time in milliSeconds. Returned data can be of current week or next week depends on if scheduled slot of current week is exhausted or not
- Since:
- 6.2.0
-
-