Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.commerce.ebusiness.discount.association
Interface DiscountAssociationMgr

public interface DiscountAssociationMgr
extends javax.ejb.EJBObject

This interface defines the public interface of the `DiscountAssociationMgr` service. This service is responsible for associating `Customer`s, using thier `CustomerPK`, with discounts. Once the association has been made the number of times the customer has used the discount is tracked. The user can only use the discount up to the number of time specified in the discount's `allowedUses`field. There is a minor difference in the way user's become associated with discounts depending on whether the discount is global or not. For non-global discounts the user must be associated with the discount, prior to attempting to use it, using either of this class's `add` methods. The discount can then be used, which from the point of view of this service means calling this class's `updateUses` method. This method is called by the pricing service. In the case of global discounts, which by definition are available to all customers the pricing serivce simply calls `updateUsesGlobal`. This method call will create the association, setting the use count to 1, if one does not already exist or attempt to the use count if the association already exists. In either case if a call to `updateUses` or `updateUsesGlobal` would cause the association's use count to exceed the discount's allowed uses limit those methods will throw a `UseCountLimitException` and not update the association's use count.``

Method Summary
`void` | `add(CustomerPk user, QualificationDiscountId discountId, java.lang.String description)` Creates an association between the `Customer` specified by the `user` parameter and the discount specified by the `discountId` parameter.
`void` | `add(CustomerPk user, java.lang.String applicationName, java.lang.String discountName, java.lang.String description)` Creates an association between the `Customer` specified by the `user` parameter and the discount specified by the `setName` and `discountName` parameters.
`int` | `archive()` Not currently implemented, throws UnsupportedOperationException if called
`DeleteResults` | `delete(QualificationDiscountId discountId)` Delete the associations for the given discount ID.
`DeleteResults` | `delete(java.lang.String applicationName, java.lang.String discountName)` Delete the associations for the given discount described by set name and discount name
`int` | `prune()` Not currently implemented, throws UnsupportedOperationException if called
`int` | `prune(QualificationDiscountId discountId)` Not currently implemented, throws UnsupportedOperationException if called
`java.util.Set` | `queryGlobal(CustomerPk user, java.util.Set idSet)` Gets all of the `user`'s discount associations where the discount in the association is global
`java.util.Set` | `queryUser(CustomerPk user, java.util.Set idSet)` Gets all of the `user`'s discount associations where the discount in the association is non-global
`void` | `updateUses(CustomerPk user, java.util.Set discountIds)` Updates the use count for each of the associations for this `user` whose discount id is in the `Set` specified by `discountIds`.
`void` | `updateUsesGlobal(CustomerPk user, java.util.Set discountIds)` Updates the use count for each of the associations for this `user` whose discount id is in the `Set` specified by `discountIds`.

Methods inherited from interface javax.ejb.EJBObject
`getEJBHome, getHandle, getPrimaryKey, isIdentical, remove`

Method Detail

### add

    public void add(CustomerPk user,
                    QualificationDiscountId discountId,
                    java.lang.String description)
             throws java.rmi.RemoteException,
                    DiscountNotFoundException,
                    InvalidAssociationException,
                    AssociationCreationException

  Creates an association between the `Customer` specified by the `user` parameter and the discount specified by the `discountId` parameter. An optional `description` may also be supplied that should indicate how or why the association was created. Only non-global discounts can be associated with a user through this method call. Any attempt to specify a global discount will result in an InvalidAssociationException being thrown.

  Parameters:
    `user` - the `CustomerPk` of the customer being associated with the discount specified by `discountId`
    `discountId` - the `QualificationDiscountId` of the discount being associated with the customer specified by `user`
    `description` - a `String` describing how or why the association is being created
  Throws:
    AssociationCreationException - if the association could not be created due to a system level failure
    InvalidAssociationException - if the discount specified is global
    DiscountNotFoundException - if the specified discount cannot be found.
    java.rmi.RemoteException - on a communication error or other system level failure

### add

    public void add(CustomerPk user,
                    java.lang.String applicationName,
                    java.lang.String discountName,
                    java.lang.String description)
             throws java.rmi.RemoteException,
                    DiscountNotFoundException,
                    InvalidAssociationException,
                    AssociationCreationException

  Creates an association between the `Customer` specified by the `user` parameter and the discount specified by the `setName` and `discountName` parameters. An optional `description` may also be supplied that should indicate how or why the association was created. Only non-global discounts can be associated with a user through this method call. Any attempt to specify a global discount will result in an InvalidAssociationException being thrown.

  Parameters:
    `user` - the `CustomerPk` of the customer being associated with the discount specified by `setName` and `discountName`
    `applicationName` - the current J2EE application name
    `discountName` - the discount name of the discount being associated with the customer specified by `user`
    `description` - a `String` describing how or why the association is being created
  Throws:
    AssociationCreationException - if the association coul not be created due to a system level failure
    InvalidAssociationException - if the discount specified is global
    DiscountNotFoundException - if the specified discount cannot be found.
    java.rmi.RemoteException - on a communication error or other system level failure

### queryUser

    public java.util.Set queryUser(CustomerPk user,
                                   java.util.Set idSet)
                            throws java.rmi.RemoteException

  Gets all of the `user`'s discount associations where the discount in the association is non-global

  Parameters:
    `user` - the `CustomerPk` of the customer whose discount associations are being fetched
    `idSet` - an empty `Set` into which the results of this method call are placed. Anything previously in the set is deleted.
  Returns:
    a `Set`, the one passed in the `idSet`paramter, of `DiscountAssociation` objects that have the specified `user` as an element. The set will be empty if there are no discount associations for the `user```
  Throws:
    java.rmi.RemoteException - on a communication error or other system level failure

### queryGlobal

    public java.util.Set queryGlobal(CustomerPk user,
                                     java.util.Set idSet)
                              throws java.rmi.RemoteException

  Gets all of the `user`'s discount associations where the discount in the association is global

  Parameters:
    `user` - the `CustomerPk` of the customer whose discount associations are being fetched
    `idSet` - an empty `Set` into which the results of this method call are placed. Anything previously in the set is deleted.
  Returns:
    a `Set`, the one passed in the `idSet`paramter, of `DiscountAssociation` objects that have the specified `user` as an element. The set will be empty if there are no discount associations for the `user```
  Throws:
    java.rmi.RemoteException - on a communication error or other system level failure

### updateUses

    public void updateUses(CustomerPk user,
                           java.util.Set discountIds)
                    throws java.rmi.RemoteException,
                           DiscountNotFoundException,
                           InvalidAssociationException,
                           UseCountLimitException,
                           AssociationNotFoundException

  Updates the use count for each of the associations for this `user` whose discount id is in the `Set` specified by `discountIds`. If any of the association updates results in the association's use count exceeding the discount's allowed uses a `UseCountLimitException` is thrown. This method call is intended for updating associations whose discount is non-global. If any of the discounts specified in the `discountIds` set are global an InvalidAssociationException is thrown. All of the discount associations specified must have already been created using one of this class's add methods.

  Parameters:
    `user` - the `CustomerPk` of the customer whose discount associations are being updated
    `discountIds` - a `Set` of `QualificationDiscountId`s that specifies which of the `user`'s associations to update
  Throws:
    AssociationNotFoundException - if the association specified by the `user` and any of the `QualificationDiscountId`s in `discountIds` can not be found
    UseCountLimitException - if the use count limit has been reached
    InvalidAssociationException - if any of the discounts specified in `discountIds` are global
    DiscountNotFoundException - if any of the discounts specified in `discountIds` can not be found
    java.rmi.RemoteException - on a communication error or other system level failure

### updateUsesGlobal

    public void updateUsesGlobal(CustomerPk user,
                                 java.util.Set discountIds)
                          throws java.rmi.RemoteException,
                                 DiscountNotFoundException,
                                 InvalidAssociationException,
                                 UseCountLimitException,
                                 AssociationCreationException

  Updates the use count for each of the associations for this `user` whose discount id is in the `Set` specified by `discountIds`. If any of the association updates results in the association's use count exceeding the discount's allowed uses a `UseCountLimitException` is thrown. This method call is intended for updating associations whose discount is global. If any of the discounts specified in the `discountIds` set are non-global an InvalidAssociationException is thrown. This method is slightly different from `updateUses` in that if the association specified doesn't already exists an attempt will be made to create it setting it's intial use count to 1.

  Parameters:
    `user` - the `CustomerPk` of the customer whose discount associations are being updated
    `discountIds` - a `Set` of `QualificationDiscountId`s that specifies which of the `user`'s associations to update
  Throws:
    AssociationCreationException - if a non-existant association was specified but it could not be created
    UseCountLimitException - if the use count limit has been reached
    InvalidAssociationException - if any of the discounts specified in `discountIds` are non-global
    DiscountNotFoundException - if any of the discounts specified in `discountIds` can not be found
    java.rmi.RemoteException - on a communication error or other system level failure

### delete

    public DeleteResults delete(QualificationDiscountId discountId)
                         throws java.rmi.RemoteException,
                                AssociationDeleteException

  Delete the associations for the given discount ID.

  Parameters:
    `discountId` - the discount id for which the associations should be deleted
  Returns:
    a DeleteResults object that describes the associations deleted and those failed to be deleted.
  Throws:
    AssociationDeleteException - if any failures were encountered during the delete operation. See the DeleteResults object in the exception for specifics.
  See Also:
    `DeleteResults`

### delete

    public DeleteResults delete(java.lang.String applicationName,
                                java.lang.String discountName)
                         throws java.rmi.RemoteException,
                                AssociationDeleteException

  Delete the associations for the given discount described by set name and discount name

  Parameters:
    `applicationName` - the current J2EE application name
    `discountName` - the name of the discount.
  Returns:
    a DeleteResults object that describes the associations deleted and those failed to be deleted.
  Throws:
    AssociationDeleteException - if any failures were encountered during the delete operation. See the DeleteResults object in the exception for specifics.
  See Also:
    `DeleteResults`

### prune

    public int prune()
              throws java.rmi.RemoteException

  Not currently implemented, throws UnsupportedOperationException if called

  Throws:
    java.lang.UnsupportedOperationException - always
    java.rmi.RemoteException - on a communication error or other system level failure

### prune

    public int prune(QualificationDiscountId discountId)
              throws java.rmi.RemoteException

  Not currently implemented, throws UnsupportedOperationException if called

  Throws:
    java.lang.UnsupportedOperationException - always
    java.rmi.RemoteException - on a communication error or other system level failure

### archive

    public int archive()
                throws java.rmi.RemoteException

  Not currently implemented, throws UnsupportedOperationException if called

  Throws:
    java.lang.UnsupportedOperationException - always
    java.rmi.RemoteException - on a communication error or other system level failure

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved