webfunds.token
Class Factory

java.lang.Object
  |
  +--webfunds.token.Factory

public final class Factory
extends java.lang.Object


Field Summary
static java.lang.String[] base64Type
          A short string that can be used in an encoding.
static int CHAUM_TOKEN
          Each Token technology type gets a number.
static int END_EXPERIMENTAL
          Each Token technology type gets a number.
static int NONE
          Each Token technology type gets a number.
static int RANDOM_TOKEN
          Each Token technology type gets a number.
static int SOX_CHEQUE
          Each Token technology type gets a number.
static int START_EXPERIMENTAL
          Each Token technology type gets a number.
static java.lang.String[] typeNames
           
static int WAGNER_TOKEN
          Each Token technology type gets a number.
 
Constructor Summary
protected Factory()
           
 
Method Summary
static ParamsPair createPair(int typ)
          Get me a PairParams for some token series.
static ParamsPair createPair(java.security.SecureRandom sr, int typ, byte[] item, byte[] series, long expiry, byte log)
          Get me a ParamsPair for some token series.
static Token decode(byte[] buf)
           
static Token example()
           
static Token example(int type)
           
static int exampleType()
           
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 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
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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.

START_EXPERIMENTAL

public static final int START_EXPERIMENTAL
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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.

END_EXPERIMENTAL

public static final int END_EXPERIMENTAL
Each Token technology type gets a number. 0 and 1 are not Tokens, just there to make it compatible with the Payment types. May have to change when new Payment types are added. 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
A short string that can be used in an encoding. Used to generate Float account names.
Constructor Detail

Factory

protected Factory()
Method Detail

isTokenPayment

public static boolean isTokenPayment(int i)

decode

public static Token decode(byte[] buf)
                    throws TokenPacketException

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

createPair

public static ParamsPair createPair(int typ)
Get me a PairParams for some token series.

createPair

public static ParamsPair createPair(java.security.SecureRandom sr,
                                    int typ,
                                    byte[] item,
                                    byte[] series,
                                    long expiry,
                                    byte log)
                             throws TokenKeyException
Get me a ParamsPair for some token series.

getProtoTokens

public static Token[] getProtoTokens(int typ,
                                     long amount)
                              throws java.lang.IllegalArgumentException
Get me a list of proto Tokens for a particular type. This is the first step in withdrawing coins.
Throws:
java.lang.IllegalArgumentException - if typ unknown or amount

exampleType

public static int exampleType()

example

public static Token example()

example

public static Token example(int type)