webfunds.sox
Class ArmouredPayment

java.lang.Object
  |
  +--webfunds.sox.Encodable
        |
        +--webfunds.sox.ArmouredPayment

public class ArmouredPayment
extends Encodable

I think the pattern is probably wrong here, but I need to move the armouring of the payment closer to the action (and the higher level application code doesn't so much care.) At a later time, it might be nice to set some paramaters as to how to produce the payments and decode them.

See Also:
Serialized Form

Field Summary
static java.lang.String CURRENT_VERSION
           
static java.lang.String ORIGINAL_VERSION
           
static java.lang.String SOX_MESSAGE
           
 
Constructor Summary
ArmouredPayment(AbstractPayment pay)
           
ArmouredPayment(byte[] data)
          Make a decoder from a byte array.
ArmouredPayment(java.io.InputStream is)
          Recover an ArmouredPayment from an input stream.
 
Method Summary
protected static void cycle()
           
 void decode(byte[] data)
          Decoder of SOX armoured messages.
 void decode(java.io.InputStream is)
          Decoder of SOX armoured messages.
 void encode(java.io.OutputStream os)
          Make an ASCII-armoured message from a payment, a la PGP armouring.
 boolean equals(java.lang.Object obj)
           
static ArmouredPayment example()
           
 java.lang.String getDecodeErrors()
           
 AbstractPayment getPay()
           
protected static void input()
           
static void main(java.lang.String[] args)
           
protected static void output()
           
protected static void readWrite()
           
 java.lang.String toString()
           
 
Methods inherited from class webfunds.sox.Encodable
encode, readByteArray, readCertificate, readProperties, readString, writeByteArray, writeCertificate, writeProperties, writeString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGINAL_VERSION

public static final java.lang.String ORIGINAL_VERSION

CURRENT_VERSION

public static final java.lang.String CURRENT_VERSION

SOX_MESSAGE

public static final java.lang.String SOX_MESSAGE
Constructor Detail

ArmouredPayment

public ArmouredPayment(AbstractPayment pay)

ArmouredPayment

public ArmouredPayment(byte[] data)
                throws SOXPacketException
Make a decoder from a byte array.
Parameters:
SOXPacketException - the data was bad

ArmouredPayment

public ArmouredPayment(java.io.InputStream is)
                throws SOXPacketException
Recover an ArmouredPayment from an input stream.
Parameters:
SOXPacketException - the data was bad
Method Detail

getPay

public AbstractPayment getPay()

getDecodeErrors

public java.lang.String getDecodeErrors()

encode

public void encode(java.io.OutputStream os)
            throws java.io.IOException
Make an ASCII-armoured message from a payment, a la PGP armouring.
Overrides:
encode in class Encodable
Throws:
java.lang.IllegalArgumentException - if no AbstractPayment available

decode

public void decode(java.io.InputStream is)
            throws SOXPacketException,
                   java.io.IOException
Decoder of SOX armoured messages. XXX: This is back to front, overrides normal Encodable method as de-armouring is done on byte arrays not streams.
Overrides:
decode in class Encodable
Throws:
SOXPacketException - if the payment failed to recover,

decode

public void decode(byte[] data)
            throws SOXPacketException
Decoder of SOX armoured messages. XXX: This is back to front, overrides normal Encodable method as de-armouring is done on byte arrays not streams.
Overrides:
decode in class Encodable
Throws:
SOXPacketException - if the payment failed to recover,

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

example

public static ArmouredPayment example()

main

public static void main(java.lang.String[] args)

cycle

protected static void cycle()
                     throws java.lang.Exception

output

protected static void output()
                      throws java.lang.Exception

readWrite

protected static void readWrite()
                         throws java.lang.Exception

input

protected static void input()
                     throws java.lang.Exception