Agent System POND 1.2 (28.2.2002)

FIM.payment
Class NamedInvoice

java.lang.Object
  |
  +--FIM.payment.AnonymousInvoice
        |
        +--FIM.payment.NamedInvoice
All Implemented Interfaces:
Invoice, Serializable, XMLEncodeable

public class NamedInvoice
extends AnonymousInvoice

An invoice for a certain entity (addressee, not issuer!), which is described as a string or a certificate (or both).

Version:
1.0
Author:
Michael Sonntag
See Also:
Serialized Form

Constructor Summary
protected NamedInvoice()
          Creates a new empty invoice.
  NamedInvoice(Element elem)
          Create a new invoice from an XML element.
  NamedInvoice(String issuer, Certificate issuerCert, Date date, String title, InvoiceItem[] items, String addressee, Certificate addresseeCert)
          Create a new invoice.
 
Method Summary
 void decodeXMLElement(Element elem)
          Parse back the invoice from an XML element.
 String getAddressee()
          Retrieve the addressee of the invoice as a string.
 Certificate getAddresseeCertificate()
          Retrieve the addressee of the invoice as a certificate (might be null).
 Element getAsXMLElement(Document doc)
          Retrieve the invoice as an XML element.
 byte[] getEncoded()
          Retrieve the invoice in encoded form to be used for signing.
 String toString()
          Retrieve the invoice as a string, suitable for presenting to the user in a very simple form.
 
Methods inherited from class FIM.payment.AnonymousInvoice
getAsSerializable, getCertificate, getDate, getIssuer, getIssuerCertificate, getItems, getTitle, getTotalPrice, isSigned, sign, verifySignature, verifySignature
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedInvoice

public NamedInvoice(String issuer,
                    Certificate issuerCert,
                    Date date,
                    String title,
                    InvoiceItem[] items,
                    String addressee,
                    Certificate addresseeCert)
Create a new invoice. The currencies of the items must all be the same. Not both addressee and addresseeCert may be null.
Parameters:
issuer - the issuer of the invoice
issuerCert - the certificate of the issuer of the invoice
data - the date for the invoice
title - the title of the invoice
item - an array of items for the invoice. At least one required
addressee - the addressee of the invoice
addresseeCert - the certificate of the addressee of the invoice

NamedInvoice

public NamedInvoice(Element elem)
Create a new invoice from an XML element.
Parameters:
elem - the XML element containing the encoded form

NamedInvoice

protected NamedInvoice()
Creates a new empty invoice. Necessary so subclasses can create an empty object and then parse in the values from XML. Subclasses doing this must call decodeXMLElement.
Method Detail

getAddressee

public String getAddressee()
Retrieve the addressee of the invoice as a string.
Returns:
the addressee of the invoice

getAddresseeCertificate

public Certificate getAddresseeCertificate()
Retrieve the addressee of the invoice as a certificate (might be null).
Returns:
the addressee of the invoice or null

getEncoded

public byte[] getEncoded()
Retrieve the invoice in encoded form to be used for signing. Does NOT include the signing information itself (which will be created based on the result!). Must be exactly the same on all calls and if the content is the same.
Overrides:
getEncoded in class AnonymousInvoice
Returns:
the invoice in encoded form

toString

public String toString()
Retrieve the invoice as a string, suitable for presenting to the user in a very simple form.
Overrides:
toString in class AnonymousInvoice
Returns:
the invoice encoded as a string

getAsXMLElement

public Element getAsXMLElement(Document doc)
Retrieve the invoice as an XML element.
Overrides:
getAsXMLElement in class AnonymousInvoice
Parameters:
doc - the document within which to create the element
Returns:
the price as an element

decodeXMLElement

public void decodeXMLElement(Element elem)
                      throws IllegalArgumentException
Parse back the invoice from an XML element.
Overrides:
decodeXMLElement in class AnonymousInvoice
Parameters:
elem - the element containing the price to parse back
Throws:
IllegalArgumentException - if the element is incorrect (e. g. wrong tag name)

Agent System POND 1.2 (28.2.2002)

Submit a bug

Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.