All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.commerce.Deal

java.lang.Object
   |
   +----semper.commerce.Deal

public class Deal
extends Object
This class constitutes the top of the class hierarchy for managing commerce deals. This class cannot be instantiated directly. Instead one of its subclasses must be used.

Implementation note Access to a number of the methods defined by this class is restricted and will in the future require possession of a suitable access control capability. Access control is currently not implemented and null is considered a valid access control handle.

Version:
$Id: Deal.java,v 1.20 1998/10/02 12:20:00 semper Exp $
Author:
Rolf Michelsen, Stig Mj°lsnes
See Also:
ActiveDeal, SuspendedDeal

Method Index

 o deleteDeal(DealID, AccessControlHandle)
Deletes a given deal.
 o export(ObjectOutputStream, AccessControlHandle)
Exports a deal to a stream.
 o getCreateDate()
Returns the date and time when the deal was created.
 o getDescription()
Returns the deal description.
 o getDescriptionHTML()
Returns a HTML representation of the deal description.
 o getDirectory(AccessControlHandle)
Returns the deal directory.
 o getID()
Returns the deal identifier.
 o getMyName()
Returns the distinguished name that this participant is known by in this deal.
 o getPeerName()
Returns the distinguished name of the peer in this deal.
 o getQuality()
Returns the set of deal quality attributes.
 o getQualityHTML(boolean)
Returns a textual description of the service quality settings for the deal.
 o getQualityText(boolean)
Returns a textual description of the service quality settings for the deal.
 o getTopTransactions()
Returns an array of all top level transaction entries in the deal.
 o getTransaction(TransactionID)
Returns the transaction entry for a given transaction in the deal.
 o getTransactionDate()
Returns the date and time when the last transaction was added to this deal.
 o getUserData()
Returns the user data object stored in the deal.
 o isExternal()
Returns a value indicating whether the attached deal is stored externally or in the SEMPER archive.

Methods

 o getID
 public final DealID getID()
Returns the deal identifier. The identifier is unique for all deals. Corresponding deal objects in peer business applications have the same deal identifier.

Returns:
The deal identifier.
 o getQuality
 public final DealQuality getQuality()
Returns the set of deal quality attributes. All transactions in this deal will be subject to these quality settings. Additional transaction quality attributes may be specified for individual transactions.

Returns:
The deal quality attributes.
 o getQualityHTML
 public final String getQualityHTML(boolean shortFmt)
Returns a textual description of the service quality settings for the deal. HTML 1.0 is used for the formatting of the description, and it can be embedded in other HTML documents.

Parameters:
shortFmt - If set, a short description will be returned.
Returns:
A textual description of the deal quality settings.
See Also:
getQuality, getQualityHTML
 o getQualityText
 public final String getQualityText(boolean shortFmt)
Returns a textual description of the service quality settings for the deal. Plain text is used for the formatting of the description.

Parameters:
shortFmt - If set, a short description will be returned.
Returns:
A textual description of the deal quality settings.
See Also:
getQuality, getQualityText
 o getCreateDate
 public final Date getCreateDate()
Returns the date and time when the deal was created.

Returns:
The date and time when the deal was created.
 o getDescription
 public final String getDescription()
Returns the deal description. This is a brief one line description of the deal. The description is currently generated automatically, but in future versions it may be possible for the creator of a deal to specify a deal description.

Returns:
The deal description.
 o getTransactionDate
 public final Date getTransactionDate()
Returns the date and time when the last transaction was added to this deal.

Returns:
The date and time of the last transaction in the deal.
 o getPeerName
 public final String getPeerName()
Returns the distinguished name of the peer in this deal.

Returns:
The distinguished name of the peer.
 o getMyName
 public final String getMyName()
Returns the distinguished name that this participant is known by in this deal. In a situation where it is possible to operate under multiple personalities, it is necessary to explicitly store the personality used for a deal together with the deal itself.

Returns:
The distinguished name of this participant.
 o getTransaction
 public final Transaction getTransaction(TransactionID id) throws TransactionException
Returns the transaction entry for a given transaction in the deal. The transaction entry is identified by the transaction identifier.

Parameters:
id - The transaction identifier of the transaction entry.
Returns:
The transaction entry corresponding to the transaction identifier or null if no transaction entry with the given identifier exists in the deal.
Throws: TransactionException
Thrown if an error occurs during handling of a transaction object. This method will throw this exception if an error occurs while retrieving the transaction from persistent storage in the archive.
 o getTopTransactions
 public final Transaction[] getTopTransactions() throws TransactionException
Returns an array of all top level transaction entries in the deal.

Returns:
An array of all top level transaction entries in the deal.
Throws: TransactionException
Thrown if an error occurs during handling of a transaction object. This method will throw this exception if an error occurs while retrieving the transaction from persistent storage in the archive.
 o isExternal
 public final boolean isExternal()
Returns a value indicating whether the attached deal is stored externally or in the SEMPER archive.

Returns:
true for external deals.
 o getDirectory
 public static final DealDirectory getDirectory(AccessControlHandle ach) throws AccessException, DealException
Returns the deal directory. This directory can be used to obtain information about the deals that are kept in the archive. This service can only be used by callers that possess the required access control capability.

Parameters:
ach - Access control handle to access capabilities.
Returns:
The deal directory object.
Throws: AccessException
Thrown if the required capabilities are not associated with the passed access control handle.
Throws: DealException
Thrown if there is a problem with the archive preventing the retrieval of the deal directory object.
 o deleteDeal
 public static final void deleteDeal(DealID id,
                                     AccessControlHandle ach) throws AccessException, DealException
Deletes a given deal. This method will permanently delete a given deal from the archive. This method assumes that the deal that is about to be deleted is not opened, but this is currently not checked.

This method can only be called by applications posessing the proper access control capability. Currently access control is not implemented and any access control handle or null reference can be used.

Parameters:
id - The identifier of the deal to be deleted.
ach - Access control handle with required capability.
Throws: AccessException
Thrown if the required access capability is not associated with the access control handle.
Throws: DealException
Thrown if the deal does not exist or if problems with the archive prevent it from being deleted.
 o export
 public final void export(ObjectOutputStream stream,
                          AccessControlHandle ach) throws IOException, AccessException, DealException
Exports a deal to a stream. This method can be used if it is necessary to store a copy of a deal outside the archive. The deal can later be reconstituted by using a suitable constructor.

This method can only be called by applications that posess the required access control capability. Since access control is not yet supported, any access control handle or null reference can currently be used. This will change in a future release with full support for access control.

Parameters:
stream - The stream that will receive the deal.
ach - Handle to access control capabilities
Throws: IOException
Thrown if an error occurs while writing data to the output stream.
Throws: AccessException
Thrown if the required access control capabilities are not present in the passed access control handle.
Throws: DealException
Thrown if there is a problem with converting the deal state to a format suitable for exporting. Currently, the only possible error is a failure of the SEMPER archive.
 o getDescriptionHTML
 public final synchronized String getDescriptionHTML()
Returns a HTML representation of the deal description. This description does not contain any information about the transactions of the deal -- just the deal attributes. The formatting of the deal description is based on the specification of the deal browser in Activity Paper 321LG022.

Returns:
A HTML representation of the deal description.
 o getUserData
 public final Object getUserData()
Returns the user data object stored in the deal. An application can store application specific data in a deal, and this data can be retrieved using this method. null is returned if no user data is associated with this deal.

User data can only be set for a deal accessed in active mode. This is done by using the method setUserData in the class ActiveDeal.

Returns:
The user data object associated with the deal.
See Also:
setUserData

All Packages  Class Hierarchy  This Package  Previous  Next  Index