webfunds.sox
Class PaymentFactory

java.lang.Object
  |
  +--webfunds.sox.PaymentFactory

public final class PaymentFactory
extends java.lang.Object


Field Summary
static java.lang.String[] base64Type
           
static int CHAUM_TOKEN
          Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle.
static int NONE
          Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle.
static int RANDOM_TOKEN
          Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle.
static int SOX_CHEQUE
          Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle.
static java.lang.String[] typeNames
           
static int WAGNER_TOKEN
          Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle.
 
Method Summary
static java.security.KeyPair createKeyPair(int typ, byte[] series, int log)
          Get me a KeyPair for some token series.
static AbstractPayment decode(byte[] buf)
           
static AbstractPayment example()
           
static AbstractPayment example(int type)
           
static Token[] getProtoTokens(int typ, long amount)
          Get me a list of proto Tokens for a particular type.
static int getType(java.lang.String name)
          Return a the type number for this payment name.
static java.lang.String getTypeString(int type)
          Return a diags string for this type.
static boolean isTokenPayment(int i)
           
static long log2qty(int log)
           
static void main(java.lang.String[] args)
           
static int[] qty2coins(long qty)
           
static int qty2log(long qty)
           
static boolean valid(int type)
          Is this a valid type, at least according to the ones known about here?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle. Once you are ready, ask the WebFunds team to allocate you a fixed number from the fixed blocks.

SOX_CHEQUE

public static final int SOX_CHEQUE
Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle. Once you are ready, ask the WebFunds team to allocate you a fixed number from the fixed blocks.

RANDOM_TOKEN

public static final int RANDOM_TOKEN
Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle. Once you are ready, ask the WebFunds team to allocate you a fixed number from the fixed blocks.

WAGNER_TOKEN

public static final int WAGNER_TOKEN
Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle. Once you are ready, ask the WebFunds team to allocate you a fixed number from the fixed blocks.

CHAUM_TOKEN

public static final int CHAUM_TOKEN
Use the numbers 100 - 110 for experimental methods, not to be used outside your own private circle. Once you are ready, ask the WebFunds team to allocate you a fixed number from the fixed blocks.

typeNames

public static final java.lang.String[] typeNames

base64Type

public static final java.lang.String[] base64Type
Method Detail

isTokenPayment

public static boolean isTokenPayment(int i)

decode

public static AbstractPayment decode(byte[] buf)
                              throws SOXPacketException

valid

public static boolean valid(int type)
Is this a valid type, at least according to the ones known about here?
Returns:
false if not a known type, else true

getTypeString

public static java.lang.String getTypeString(int type)
Return a diags string for this type.

getType

public static int getType(java.lang.String name)
Return a the type number for this payment name. Meant for converting user-land strings to the number.
Returns:
the type number constant or NONE, if unknown

createKeyPair

public static java.security.KeyPair createKeyPair(int typ,
                                                  byte[] series,
                                                  int log)
                                           throws SOXKeyException
Get me a KeyPair for some token series.

getProtoTokens

public static Token[] getProtoTokens(int typ,
                                     long amount)
                              throws SOXArgsException
Get me a list of proto Tokens for a particular type. This is the first step in withdrawing coins.

log2qty

public static long log2qty(int log)
Returns:
the quantity from a coin size, which is always logarithmic, if outside range, -1 is returned.

qty2log

public static int qty2log(long qty)
Returns:
a single largest coin size from a quantity.

qty2coins

public static int[] qty2coins(long qty)
Returns:
an array representing the coin sizes required for this quantity

main

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

example

public static AbstractPayment example()

example

public static AbstractPayment example(int type)