org.marketcetera.ors
Class OrderInfoBase<T extends OrderInfoCache>

java.lang.Object
  extended by org.marketcetera.ors.OrderInfoBase<T>
All Implemented Interfaces:
OrderInfo
Direct Known Subclasses:
SimpleOrderInfo

public class OrderInfoBase<T extends OrderInfoCache>
extends Object
implements OrderInfo

A foundation order information class for entries in an OrderInfoCache cache.

Since:
2.1.0
Version:
$Id: OrderInfoBase.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
OrderInfoBase(T cache, OrderID orderID, OrderID origOrderID, UserID actorID)
          Creates a new cache entry of the given cache for an order with the given self and parent IDs, and the given actor ID.
 
Method Summary
 UserID getActorID()
          Returns the actor ID of the receiver's order.
protected  T getCache()
          Returns the receiver's cache.
 OrderID getOrderID()
          Returns the ID of the receiver's order.
 OrderID getOrigOrderID()
          Returns the parent order ID of the receiver's order.
 UserID getViewerID()
          Returns the viewer ID of the receiver's order.
 boolean isViewerIDSet()
          Checks whether the viewer ID of the receiver's order has been set.
 void setAckExpected(boolean ackExpected)
          Sets to the given value a flag indicating whether the ORS is expected to issue an ack for the receiver's order.
 void setAckProcessed(boolean ackProcessed)
          Sets to the given value a flag indicating whether the ORS has retrieved the ack principals for the receiver's order.
 void setERPersisted(boolean erPersisted)
          Sets to the given value a flag indicating whether an execution report (ack, or broker response) for the receiver's order has been persisted.
 void setMessageProcessed(Message msg)
          Notifies the receiver that the given message has been processed.
 void setResponseExpected(boolean responseExpected)
          Sets to the given value a flag indicating whether the ORS is expected to receive a response to the receiver's order.
 void setResponseProcessed(boolean responseProcessed)
          Sets to the given value a flag indicating whether the ORS has retrieved the response principals for the receiver's order.
 void setViewerID(UserID viewerID)
          Sets the viewer ID of the receiver's order to the given one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderInfoBase

public OrderInfoBase(T cache,
                     OrderID orderID,
                     OrderID origOrderID,
                     UserID actorID)
Creates a new cache entry of the given cache for an order with the given self and parent IDs, and the given actor ID. The viewer ID of the new entry is either marked unknown-at-present (if this order is a child of an earlier one), or set to the actor ID (if it's the root of a chain).

Parameters:
cache - The cache.
orderID - The order ID.
origOrderID - The parent order ID. It may be null for orders that are chain roots.
actorID - The actor ID.
Method Detail

getCache

protected T getCache()
Returns the receiver's cache.

Returns:
The cache.

getOrderID

public OrderID getOrderID()
Description copied from interface: OrderInfo
Returns the ID of the receiver's order.

Specified by:
getOrderID in interface OrderInfo
Returns:
The ID.

getOrigOrderID

public OrderID getOrigOrderID()
Description copied from interface: OrderInfo
Returns the parent order ID of the receiver's order.

Specified by:
getOrigOrderID in interface OrderInfo
Returns:
The ID. It may be null if the receiver's order is a chain root.

getActorID

public UserID getActorID()
Description copied from interface: OrderInfo
Returns the actor ID of the receiver's order.

Specified by:
getActorID in interface OrderInfo
Returns:
The ID.

isViewerIDSet

public boolean isViewerIDSet()
Description copied from interface: OrderInfo
Checks whether the viewer ID of the receiver's order has been set. Specifically, false indicates unknown-at-present (to be lazily researched when needed) and, until that time, OrderInfo.getViewerID() should not be used; true indicates that OrderInfo.getViewerID() can be used.

Specified by:
isViewerIDSet in interface OrderInfo
Returns:
True if so.

getViewerID

public UserID getViewerID()
Description copied from interface: OrderInfo
Returns the viewer ID of the receiver's order. It should only be called after a call to OrderInfo.setViewerID(UserID) (which may take place implicitly, in the constructor); accordingly, it is best to guard calls to this method with a call to OrderInfo.isViewerIDSet().

Specified by:
getViewerID in interface OrderInfo
Returns:
The ID. It may be null if we could not deduce a viewer.

setViewerID

public void setViewerID(UserID viewerID)
Description copied from interface: OrderInfo
Sets the viewer ID of the receiver's order to the given one.

Specified by:
setViewerID in interface OrderInfo
Parameters:
viewerID - The ID. It may be null if we could not deduce a viewer.

setERPersisted

public void setERPersisted(boolean erPersisted)
Description copied from interface: OrderInfo
Sets to the given value a flag indicating whether an execution report (ack, or broker response) for the receiver's order has been persisted.

Specified by:
setERPersisted in interface OrderInfo

setAckExpected

public void setAckExpected(boolean ackExpected)
Description copied from interface: OrderInfo
Sets to the given value a flag indicating whether the ORS is expected to issue an ack for the receiver's order.

Specified by:
setAckExpected in interface OrderInfo
Parameters:
ackExpected - The flag.

setAckProcessed

public void setAckProcessed(boolean ackProcessed)
Description copied from interface: OrderInfo
Sets to the given value a flag indicating whether the ORS has retrieved the ack principals for the receiver's order.

Specified by:
setAckProcessed in interface OrderInfo
Parameters:
ackProcessed - The flag.

setResponseExpected

public void setResponseExpected(boolean responseExpected)
Description copied from interface: OrderInfo
Sets to the given value a flag indicating whether the ORS is expected to receive a response to the receiver's order.

Specified by:
setResponseExpected in interface OrderInfo
Parameters:
responseExpected - The flag.

setResponseProcessed

public void setResponseProcessed(boolean responseProcessed)
Description copied from interface: OrderInfo
Sets to the given value a flag indicating whether the ORS has retrieved the response principals for the receiver's order.

Specified by:
setResponseProcessed in interface OrderInfo
Parameters:
responseProcessed - The flag.

setMessageProcessed

public void setMessageProcessed(Message msg)
Description copied from interface: OrderInfo
Notifies the receiver that the given message has been processed.

Specified by:
setMessageProcessed in interface OrderInfo
Parameters:
msg - The message.


Copyright © 2012. All Rights Reserved.