How to Use Token Formats with Java APIs and Web Services
When using the API, the token format must be included in the insert() call. The token format name (the text listed in bold below, in the example) is defined as a constant in TokenService class. That is why in Java we specify it as TokenService.LAST_FOUR_TOKEN.
For example, insert("123456789", "VAULT", TokenService.LAST_FOUR_TOKEN, true).
When using the web service and a call to the InsertToken, InsertTokenWithCustomData, InsertBatch, and InsertBatchWithCustomData APIs, the integer corresponding to the format is used.
For example:
SafeNetTokenizerStub.InsertToken insert = new SafeNetTokenizerStub.InsertToken();
insert.setNaeUser("KeyManagerUser");
insert.setNaePassword("KeyManagerUserPassword");
insert.setDbUser("DatabaseUser");
insert.setDbPswd("DatabaseUserPassword");
insert.setTableName("VAULT");
insert.setFormat(3);
insert.setValue("123456789");
insert.setCustomData("999");
insert.setLuhnCheck(false);
Note
When using the sequential token format, the token vault must be sequential.