Java Doc for Transaction.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 Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.j2me.payment.Transaction

Transaction
public class Transaction (Code)
A transaction holds the state and information about payment. It's state is updated by the associated transaction processor.

There are the following predefined states:

  • ENTERED - the payment has been initiated by the application
  • UPDATE - the transaction should be updated from the update URL
  • ASSIGNED - the transaction has been assigned to the payment adapter instance associated with the user selected provider
  • SUCCESSFUL - the payment has been successfully finished
  • FAILED - the payment failed because of errors
  • REJECTED - the payment has been rejected by the user
  • DISCARDED - the transaction should be silently discarded by the payment module

The Transaction class can be extended by some adapter specific subclass, which can hold more information about payment and can define some adapter specific states. For this purpose, there is a special constructor which initiates the transaction from the information provided by the transaction given as a parameter. There is also defined the ADAPTER_SPECIFIC constant, which should be used to number adapter specific states (ADAPTER_SPECIFIC, ADAPTER_SPECIFIC + 1, ADAPTER_SPECIFIC + 2...).
version:
   1.7



Field Summary
final protected static  intADAPTER_SPECIFIC
     The starting value of adapter specific states.
final public static  intASSIGNED
     A predefined transaction state.
final public static  intDISCARDED
     A predefined transaction state.
final public static  intENTERED
     A predefined transaction state.
final public static  intFAILED
     A predefined transaction state.
final public static  intREJECTED
     A predefined transaction state.
final public static  intSUCCESSFUL
     A predefined transaction state.
final public static  intUPDATE
     A predefined transaction state.

Constructor Summary
 Transaction(TransactionProcessor processor, TransactionModuleImpl module, int featureID, String featureTitle, String featureDescription, byte[] payload)
     Creates a new instance of Transaction.
public  Transaction(Transaction templ)
     Creates a new instance of Transaction with the fields initialized from the given original transaction.

Method Summary
final public  StringgetCurrency()
     Returns the currency of the payment.
final public  StringgetFeatureDescription()
     Returns the description of the feature, which is paid for by this transaction.
final public  intgetFeatureID()
     Returns the id of the paid feature.
final public  StringgetFeatureTitle()
     Returns the title of the feature, which is paid for by this transaction.
final public  byte[]getPayload()
     Returns the payload which is a part of the payment or null if it's undefined.
final public  doublegetPrice()
     Returns the price of the feature, which is paid.
final public  StringgetProviderName()
     Returns the payload which is a part of the payment or null if it's undefined.
final public  StringgetSpecificPriceInfo()
     Returns the provider specific price information associated with the paid feature.
final public  intgetState()
     Returns the current state of the transaction.
final public  intgetTransactionID()
     Returns the transaction ID value.
final public  TransactionModuleImplgetTransactionModule()
     Returns the associated transaction module.
final public  booleanisWaiting()
     Indicates if the transaction is waiting for some event.
final public  booleanneedsUI()
     Indicates if the transaction needs or will need an user response to be finished.
final  Transactionprocess()
     Processes the transaction.
final  voidsetCurrency(String value)
     Sets the currency of the payment.
final public  voidsetNeedsUI(boolean value)
     Sets the value which indicates if the transaction needs or will need some user response to be finished.
final  voidsetPrice(double value)
     Sets the price of the paid feature.
final  voidsetProviderName(String value)
     Sets the name of the selected provider.
final  voidsetSpecificPriceInfo(String value)
     Sets the provider specific price information.
final public  voidsetState(int newState)
     Sets the state of the transaction to the new value.
final  voidsetTransactionID(int value)
     Sets the transaction ID for the transaction.
public  voidsetTransactionProcessor(TransactionProcessor processor)
     Sets the transaction processor of the transaction.
final public  voidsetWaiting(boolean value)
     Puts the transaction into or resumes it from the waiting.

Field Detail
ADAPTER_SPECIFIC
final protected static int ADAPTER_SPECIFIC(Code)
The starting value of adapter specific states.



ASSIGNED
final public static int ASSIGNED(Code)
A predefined transaction state.



DISCARDED
final public static int DISCARDED(Code)
A predefined transaction state.



ENTERED
final public static int ENTERED(Code)
A predefined transaction state.



FAILED
final public static int FAILED(Code)
A predefined transaction state.



REJECTED
final public static int REJECTED(Code)
A predefined transaction state.



SUCCESSFUL
final public static int SUCCESSFUL(Code)
A predefined transaction state.



UPDATE
final public static int UPDATE(Code)
A predefined transaction state.




Constructor Detail
Transaction
Transaction(TransactionProcessor processor, TransactionModuleImpl module, int featureID, String featureTitle, String featureDescription, byte[] payload)(Code)
Creates a new instance of Transaction.
Parameters:
  processor - the initial transaction processor responsible for processing of this transaction
Parameters:
  module - the transaction module associated with the transaction
Parameters:
  featureID - the identifier of the feature to be paid for
Parameters:
  featureTitle - the title of the feature
Parameters:
  featureDescription - the description of the feature
Parameters:
  payload - the payload to be transfered as a part of the payment ornull if no such payload required



Transaction
public Transaction(Transaction templ)(Code)
Creates a new instance of Transaction with the fields initialized from the given original transaction.
Parameters:
  templ - the original transaction




Method Detail
getCurrency
final public String getCurrency()(Code)
Returns the currency of the payment. the currency of the payment



getFeatureDescription
final public String getFeatureDescription()(Code)
Returns the description of the feature, which is paid for by this transaction. the description of the feature



getFeatureID
final public int getFeatureID()(Code)
Returns the id of the paid feature. the feature id



getFeatureTitle
final public String getFeatureTitle()(Code)
Returns the title of the feature, which is paid for by this transaction. the title of the feature



getPayload
final public byte[] getPayload()(Code)
Returns the payload which is a part of the payment or null if it's undefined. the payload or null



getPrice
final public double getPrice()(Code)
Returns the price of the feature, which is paid. the price of the feature



getProviderName
final public String getProviderName()(Code)
Returns the payload which is a part of the payment or null if it's undefined. the payload or null



getSpecificPriceInfo
final public String getSpecificPriceInfo()(Code)
Returns the provider specific price information associated with the paid feature. the provider specific price information



getState
final public int getState()(Code)
Returns the current state of the transaction. the current state
See Also:   Transaction.setState



getTransactionID
final public int getTransactionID()(Code)
Returns the transaction ID value. the transaction ID



getTransactionModule
final public TransactionModuleImpl getTransactionModule()(Code)
Returns the associated transaction module. the transaction module



isWaiting
final public boolean isWaiting()(Code)
Indicates if the transaction is waiting for some event. true if the transaction is waiting



needsUI
final public boolean needsUI()(Code)
Indicates if the transaction needs or will need an user response to be finished. true if the transaction needs an user response



process
final Transaction process()(Code)
Processes the transaction. Delegates the call to the associated transaction processor. the fully or partially processed transaction.



setCurrency
final void setCurrency(String value)(Code)
Sets the currency of the payment.
Parameters:
  value - the currency



setNeedsUI
final public void setNeedsUI(boolean value)(Code)
Sets the value which indicates if the transaction needs or will need some user response to be finished. Setting this value to true can block this or other transactions that also need user response from processing (only one such transaction can be processed at a time). Initialy this value is set to true and is an adapter responsibility to set it to false at the right time.
Parameters:
  value - true if the transaction needs or will needan user response to be finished



setPrice
final void setPrice(double value)(Code)
Sets the price of the paid feature.
Parameters:
  value - the price



setProviderName
final void setProviderName(String value)(Code)
Sets the name of the selected provider.
Parameters:
  value - the new provider name



setSpecificPriceInfo
final void setSpecificPriceInfo(String value)(Code)
Sets the provider specific price information.
Parameters:
  value - the provider specific price information



setState
final public void setState(int newState)(Code)
Sets the state of the transaction to the new value.
Parameters:
  newState - the new state
See Also:   Transaction.getState



setTransactionID
final void setTransactionID(int value)(Code)
Sets the transaction ID for the transaction.
Parameters:
  value - the new transaction ID value



setTransactionProcessor
public void setTransactionProcessor(TransactionProcessor processor)(Code)
Sets the transaction processor of the transaction.
Parameters:
  processor - the new transaction processor



setWaiting
final public void setWaiting(boolean value)(Code)
Puts the transaction into or resumes it from the waiting. A transaction which is waiting is not processed by the transaction processing thread of the payment module (its state doesn't change). A transaction can wait for some user response or the end of some adapter specific thread.
Parameters:
  value - if true the transaction is entering the waiting, if false the transaction is ending its waiting



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.