Source Code Cross Referenced for TransactionStore.java in  » 6.0-JDK-Modules » j2me » com » sun » j2me » payment » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.j2me.payment 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.j2me.payment;
028:
029:        import java.io.IOException;
030:        import javax.microedition.payment.TransactionRecord;
031:
032:        /**
033:         * This interface defines method, which a class needs to implement to act as
034:         * a transaction store. An implementation of this class must be thread safe.
035:         *
036:         * @version 1.3
037:         * @see PaymentModule#getTransactionStore
038:         */
039:        public interface TransactionStore {
040:            /**
041:             * Returns an identification number, which can be used as 
042:             * <code>applicationID</code> in the other methods. During installation
043:             * each payment supporting <code>MIDletSuite</code> should get such number 
044:             * and have it stored. From that point this number will identify that 
045:             * <code>MIDletSuite</code> to the transaction store.
046:             *
047:             * @return the payment application id
048:             * @throws IOException indicates a storage failure
049:             */
050:            public int getNextApplicationID() throws IOException;
051:
052:            /**
053:             * Reserves space for the given transaction in the store. It should be 
054:             * called before any call to the <code>addTransaction</code> method to 
055:             * ensure that the <code>addTransaction</code> method won't fail later
056:             * (when it is inappropriate) due to full store. This method can apply some 
057:             * store policies, like enforcing a maximum number of missed transactions
058:             * per <code>MIDletSuite</code>.
059:             *
060:             * @param applicationID the application id
061:             * @param transaction the transaction
062:             * @return an unique ID created for the transaction
063:             * @throws IOException indicates that the store is full or won't accept any
064:             *      further transaction records from that application
065:             */
066:            public int reserve(int applicationID, Transaction transaction)
067:                    throws IOException;
068:
069:            /**
070:             * Adds the given transaction to the store. It returns a new transaction 
071:             * record for the transaction. This transaction record must have its 
072:             * <code>wasMissed</code> flag cleared.
073:             *
074:             * @param transaction the transaction
075:             * @return the new transaction record
076:             * @throws IOException indicates a storage failure
077:             */
078:            public TransactionRecord addTransaction(Transaction transaction)
079:                    throws IOException;
080:
081:            /**
082:             * It returns <code>true</code> if the <code>setDelivered</code> method 
083:             * was called for the given transaction ID.
084:             *
085:             * @param transactionID the transaction ID
086:             * @return true if the <code>setDelivered</code> method 
087:             * was called for the given transaction ID
088:             *
089:             * @throws IOException indicates a storage failure
090:             */
091:            public boolean wasDelivered(int transactionID) throws IOException;
092:
093:            /**
094:             * This method is called after the application is successfully notified 
095:             * about the transaction with the given transaction ID.
096:             *
097:             * @param transactionID the transaction ID
098:             * @throws IOException indicates a storage failure
099:             */
100:            public void setDelivered(int transactionID) throws IOException;
101:
102:            /**
103:             * Returns an array of the missed transaction records for the given 
104:             * application ID. The transaction records are returned in the order in
105:             * which they have been added to the store. Each transaction record must
106:             * have its <code>wasMissed</code> flag set.
107:             *
108:             * @param applicationID the application ID
109:             * @return the array of the missed transaction records
110:             * @throws IOException indicates a storage failure
111:             */
112:            public TransactionRecord[] getMissedTransactions(int applicationID)
113:                    throws IOException;
114:
115:            /**
116:             * Returns an array of the past transaction records for the given 
117:             * application ID. The transaction record are returned in the reverse order
118:             * as they have been added to the store (most recent first). Each 
119:             * transaction record must have its <code>wasMissed</code> flag cleared.
120:             *
121:             * @param applicationID the application ID
122:             * @return the array of the missed transaction records
123:             * @throws IOException indicates a storage failure
124:             */
125:            public TransactionRecord[] getPassedTransactions(int applicationID)
126:                    throws IOException;
127:
128:            /**
129:             * Returns the size which is used in the store by the application of the 
130:             * given application ID. This size doesn't include the size of the passed
131:             * transactions (it includes only the part of the store which is 
132:             * removed/uninstalled by the <code>removeApplicationRecords</code> method).
133:             *
134:             * @param applicationID the application ID
135:             * @return the size used by the application
136:             * @throws IOException indicates a storage failure
137:             */
138:            public int getSizeUsedByApplication(int applicationID)
139:                    throws IOException;
140:
141:            /**
142:             * Removes the missed records used by the application of the given 
143:             * application ID. This is to be used, when the MIDlet suite is uninstalled.
144:             *
145:             * @param applicationID the application ID
146:             * @throws IOException indicates a storage failure
147:             */
148:            public void removeApplicationRecords(int applicationID)
149:                    throws IOException;
150:
151:            /**
152:             * Removes all transaction records from the store. This is a helper method
153:             * which is used in test suites to get clean state before test execution.
154:             *
155:             * @throws IOException indicates a storage failure
156:             */
157:            public void cleanUp() throws IOException;
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.