|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Order class collects OrderLines and provides indirect access to the Items they contain. An OrderLine is an Item and the quantity that the customer intends to by. It is the conceptual equivalent of a shopping cart or basket. The order combines the features of a list and a map. It is a list so that the positioning of the items in the order is preserved. The Order is responsible for ensuring that each item appears only once in the list and for adjusting the quantity as necessary.. When an Item is added to an Order an OrderLine is created. If an OrderLine for that Item already exists its quantity is adjusted..
Primary Key = theory.smart.ebusiness.order.OrderPk
key
[Order] <*>------> [String
] (Primary Key)
orderLine (List)
[Order] <*>------> [theory.smart.ebusiness.order.OrderLine
]
0..*
status
[Order] <*>------> [theory.smart.ebusiness.order.OrderWorkflow
]
customer
[Order] <>------> [theory.smart.ebusiness.customer.Customer
]
OrderPk
,
OrderHome
,
OrderImpl
,
OrderValue
Method Summary | |
void |
addFirstOrderLine(OrderLine orderLine)
Inserts the given orderLine at the beginning of the orderLine list. |
void |
addItem(Item item,
Quantity quantity)
Add an Item to this Order. |
void |
addItems(Order items)
Add the OrderLines from the specified order to this order. |
void |
addLastOrderLine(OrderLine orderLine)
Appends the given orderLine to the end of the orderLine list. |
void |
addOrderLine(int index,
OrderLine orderLine)
Inserts the specified orderLine at the specified position in the orderLine list. |
boolean |
addOrderLine(OrderLine orderLine)
Appends the specified orderLine to the end of the orderLine list. |
boolean |
addOrderLines(int index,
com.sun.java.util.collections.LinkedList orderLines)
Inserts all of the orderLines in the specified collection into this list, starting at the specified position. |
boolean |
addOrderLines(com.sun.java.util.collections.LinkedList orderLines)
Appends all of the orderLines in the specified collection to the end of the orderLine list, in the order that they are returned by the specified collection's iterator. |
void |
cancel()
Apply the "cancel" transition to the OrderWorkflow . |
boolean |
containsOrderLine(OrderLine orderLine)
Returns true if the orderLine list contains the specified element. |
void |
finalizePrices()
Iterate the order lines and "lockin" the price of each. |
OrderLine |
findOrderLine(Item item)
Find the order line associated with the specified Item. |
Customer |
getCustomer()
Get the remote object reference of customer |
OrderLine |
getFirstOrderLine()
Returns the first orderLine in the orderLine list. |
com.sun.java.util.collections.Collection |
getItems()
Retrieves a list of the Items that are included in this order. |
java.lang.String |
getKey()
|
OrderLine |
getLastOrderLine()
Returns the last orderLine in the orderLine list. |
int |
getNumberOfOrderLines()
Returns the number of orderLines in the orderLine list. |
Quantity |
getNumberOfUnits()
Count the total quantity of items by summing the quantity on each line. |
OrderValue |
getOrderByValue()
Get all of Order's attributes. |
OrderLine |
getOrderLine(int index)
Returns the orderLine at the specified position in the orderLine list. |
com.sun.java.util.collections.LinkedList |
getOrderLines()
Returns all of the orderLines in the orderLine list. |
com.sun.java.util.collections.LinkedList |
getOrderLines(int fromIndex,
int toIndex)
Returns a view of the portion of the orderLine list between fromIndex, inclusive, and toIndex, exclusive. |
java.lang.String |
getOrderPriceCalculationPolicyName()
Return the name of the business policy that will be used when calculating the orders total price. |
java.lang.String |
getStatus()
Returns the current state name of the theory.smart.ebusiness.order.OrderWorkflow workflow |
Price |
getTotalPrice()
Calculate the price of the order by iterating the OrderLines and summing the line prices. |
int |
indexOfOrderLine(OrderLine orderLine)
Returns the index in the orderLine list of the first occurrence of the specified element, or -1 if the orderLine list does not contain this element. |
void |
invoice()
Apply the "Invoice" transition to the OrderWorkflow . |
boolean |
isOrderLinesEmtpy()
Returns true if the orderLine list contains no orderLines. |
int |
lastIndexOfOrderLine(OrderLine orderLine)
Returns the index in the orderLine list of the last occurrence of the specified element, or -1 if the orderLine list does not contain this element. |
void |
removeAllItems()
Removes all OrderLines. |
void |
removeAllOrderLines()
Removes all of the orderLines from the orderLine list. |
OrderLine |
removeFirstOrderLine()
Removes and returns the first orderLine from the orderLine list. |
void |
removeItem(Item item)
Remove the OrderLine associated with the Item specified. |
OrderLine |
removeLastOrderLine()
Removes and returns the last orderLine from the orderLine list. |
OrderLine |
removeOrderLine(int index)
Removes the orderLine at the specified position in the orderLine list. |
boolean |
removeOrderLine(OrderLine orderLine)
Removes the first occurrence of the specified orderLine in the orderLine list. |
void |
returnOrder()
Apply the "returnOrder" transition to the OrderWorkflow . |
void |
sendToShipping()
Apply the "sendToShipping" transition to the OrderWorkflow . |
void |
setCustomer(Customer customer)
Set the remote object reference of customer |
void |
setItemQuantity(Item item,
Quantity n)
Sets the Quantity of the OrderLine associated with this Item. |
void |
setOrderByValue(OrderValue value)
Set all of Order's attributes to the passed in value. |
OrderLine |
setOrderLine(int index,
OrderLine orderLine)
Replaces the orderLine at the specified position in the orderLine list with the specified element. |
void |
ship()
Apply the "ship" transition to the OrderWorkflow . |
Methods inherited from interface javax.ejb.EJBObject |
getEJBHome,
getHandle,
getPrimaryKey,
isIdentical,
remove |
Method Detail |
public OrderValue getOrderByValue() throws java.rmi.RemoteException
public void setOrderByValue(OrderValue value) throws java.rmi.RemoteException
OrderValue
- the Order value objectpublic java.lang.String getKey() throws java.rmi.RemoteException
public void addOrderLine(int index, OrderLine orderLine) throws java.rmi.RemoteException
index
- index at which the specified orderLine is to be inserted.orderLine
- orderLine to be inserted.public boolean addOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
orderLine
- orderLine to be appended to the orderLine list.public boolean addOrderLines(int index, com.sun.java.util.collections.LinkedList orderLines) throws java.rmi.RemoteException
index
- index at which to insert first element
from the specified collection.orderLines
- orderLines to be inserted into the orderLine list.public boolean addOrderLines(com.sun.java.util.collections.LinkedList orderLines) throws java.rmi.RemoteException
orderLines
- orderLines to be inserted into the orderLine list.public void addFirstOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
public void addLastOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
public boolean containsOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
orderLine
- orderLine whose presence in the orderLine list is to be tested.public OrderLine getOrderLine(int index) throws java.rmi.RemoteException
index
- index of orderLine to return.public com.sun.java.util.collections.LinkedList getOrderLines(int fromIndex, int toIndex) throws java.rmi.RemoteException
fromIndex
- low endpoint (inclusive) of the subList.toKey
- high endpoint (exclusive) of the subList.public com.sun.java.util.collections.LinkedList getOrderLines() throws java.rmi.RemoteException
public OrderLine getFirstOrderLine() throws java.rmi.RemoteException
public OrderLine getLastOrderLine() throws java.rmi.RemoteException
public int getNumberOfOrderLines() throws java.rmi.RemoteException
public int indexOfOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
orderLine
- orderLine to search for.public boolean isOrderLinesEmtpy() throws java.rmi.RemoteException
public int lastIndexOfOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
orderLine
- orderLine to search for.public void removeAllOrderLines() throws java.rmi.RemoteException
public OrderLine removeOrderLine(int index) throws java.rmi.RemoteException
index
- the index of the orderLine to removed.public boolean removeOrderLine(OrderLine orderLine) throws java.rmi.RemoteException
orderLine
- orderLine to be removed from the orderLine list, if present.public OrderLine removeFirstOrderLine() throws java.rmi.RemoteException
public OrderLine removeLastOrderLine() throws java.rmi.RemoteException
public OrderLine setOrderLine(int index, OrderLine orderLine) throws java.rmi.RemoteException
index
- index of orderLine to replace.orderLine
- orderLine to be stored at the specified position.public java.lang.String getStatus() throws java.rmi.RemoteException
public Customer getCustomer() throws java.rmi.RemoteException
public void setCustomer(Customer customer) throws java.rmi.RemoteException
customers
- customer to be addedpublic void addItems(Order items) throws java.rmi.RemoteException
public void addItem(Item item, Quantity quantity) throws java.rmi.RemoteException
public com.sun.java.util.collections.Collection getItems() throws java.rmi.RemoteException
public Quantity getNumberOfUnits() throws java.rmi.RemoteException
public void setItemQuantity(Item item, Quantity n) throws java.rmi.RemoteException
public void removeItem(Item item) throws java.rmi.RemoteException
public void removeAllItems() throws java.rmi.RemoteException
public Price getTotalPrice() throws java.rmi.RemoteException
public OrderLine findOrderLine(Item item) throws java.rmi.RemoteException, javax.ejb.FinderException
public void invoice() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs when the order has been accepted by the customer and needs to be delivered to billing.public void sendToShipping() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs once the order has been recorded with billing.public void ship() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs once the order has been succesfully processed by shipping.public void returnOrder() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs when an item is returned to inventory.public void cancel() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This when the order has been invoiced but before it has been shipped.public void finalizePrices() throws java.rmi.RemoteException
public java.lang.String getOrderPriceCalculationPolicyName() throws java.rmi.RemoteException
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |