Statistics
| Branch: | Revision:

m2u-upass-core / src / my / com / upass / services / DeleteTokenService.java @ 41:758ee93c26ca

History | View | Annotate | Download (1.33 KB)

1
/**
2
 * Copyright (c) 2010 Penril Datability (M) Sdn Bhd All rights reserved.
3
 *
4
 * This software is copyrighted. Under the copyright laws, this software
5
 * may not be copied, in whole or in part, without prior written consent
6
 * of Penril Datability (M) Sdn Bhd or its assignees. This software is
7
 * provided under the terms of a license between Penril Datability (M)
8
 * Sdn Bhd and the recipient, and its use is subject to the terms of that
9
 * license.
10
 */
11

    
12
package my.com.upass.services;
13

    
14
import my.com.upass.Constants;
15
import my.com.upass.dao.DAOFactoryProvider;
16
import my.com.upass.dao.UserTokenDAO;
17
import my.com.upass.factory.UPassFactory;
18

    
19
/**
20
 * PROGRAMMER: Danniell
21
 * CHANGE-NO:
22
 * TASK-NO:
23
 * DATE CREATED: Dec 28, 2011
24
 * TAG AS:
25
 * REASON(S):
26
 * MODIFICATION:
27
 */
28

    
29
/**
30
 * <Class description>
31
 */
32
public class DeleteTokenService
33
{
34
        public int deleteTokenFromStore (String serialNumber)
35
        {
36
                UserTokenDAO tokenDao;
37
                boolean lrc = false;
38
                
39
                try
40
                {
41
                        tokenDao = DAOFactoryProvider.getDAOFactory ().getUserTokenDAO (UPassFactory.getTokenMode ());
42

    
43
                        lrc = tokenDao.deleteTokenFromStoreBySerialNumber (serialNumber);
44

    
45
                }
46
                catch (Exception e)
47
                {
48
                        e.printStackTrace ();
49
                }
50

    
51
                if (lrc)
52
                {
53
                        return Constants.ERR_SUCCESS;
54
                }
55
                else
56
                {
57
                        return Constants.ERR_TOKEN_NOT_EXIST;
58
                }
59
        }
60
}