org.marketcetera.ors
Class SimpleOrderInfo

java.lang.Object
  extended by org.marketcetera.ors.OrderInfoBase<SimpleOrderInfoCache>
      extended by org.marketcetera.ors.SimpleOrderInfo
All Implemented Interfaces:
OrderInfo

public class SimpleOrderInfo
extends OrderInfoBase<SimpleOrderInfoCache>

An entry for order information in a SimpleOrderInfoCache cache.

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

Constructor Summary
SimpleOrderInfo(SimpleOrderInfoCache 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
protected  Boolean getAckExpected()
          Returns a flag indicating whether the ORS is expected to issue an ack for the receiver's order.
protected  Boolean getAckProcessed()
          Returns a flag indicating whether the ORS has retrieved the ack principals for the receiver's order.
protected  Boolean getERPersisted()
          Returns a flag indicating whether an execution report (ack, or broker response) for the receiver's order has been persisted.
protected  Boolean getResponseExpected()
          Returns a flag indicating whether the ORS is expected to receive a response to the receiver's order.
protected  Boolean getResponseProcessed()
          Returns a flag indicating whether the ORS has retrieved the response principals for the receiver's order.
protected  boolean mayRemove()
          Checks whether the receiver can be safely removed from the cache.
protected  void removeIfDesired()
          Checks whether the receiver should be removed from the cache, and, if so, effects such removal.
 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 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.
protected  boolean shouldRemove()
          Checks whether the receiver should be removed from the cache.
 
Methods inherited from class org.marketcetera.ors.OrderInfoBase
getActorID, getCache, getOrderID, getOrigOrderID, getViewerID, isViewerIDSet, setMessageProcessed, setViewerID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOrderInfo

public SimpleOrderInfo(SimpleOrderInfoCache 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

getERPersisted

protected Boolean getERPersisted()
Returns a flag indicating whether an execution report (ack, or broker response) for the receiver's order has been persisted.

Returns:
The flag. It may be null to indicate that it is yet unknown whether that condition has been met.

getAckExpected

protected Boolean getAckExpected()
Returns a flag indicating whether the ORS is expected to issue an ack for the receiver's order.

Returns:
The flag. It may be null to indicate that it is yet unknown whether that condition has been met.

getAckProcessed

protected Boolean getAckProcessed()
Returns a flag indicating whether the ORS has retrieved the ack principals for the receiver's order.

Returns:
The flag. It may be null to indicate that it is yet unknown whether that condition has been met.

getResponseExpected

protected Boolean getResponseExpected()
Returns a flag indicating whether the ORS is expected to receive a response to the receiver's order.

Returns:
The flag. It may be null to indicate that it is yet unknown whether that condition has been met.

getResponseProcessed

protected Boolean getResponseProcessed()
Returns a flag indicating whether the ORS has retrieved the response principals for the receiver's order.

Returns:
The flag. It may be null to indicate that it is yet unknown whether that condition has been met.

mayRemove

protected boolean mayRemove()
Checks whether the receiver can be safely removed from the cache. This doesn't mean that the receiver should be removed; it may remain in the cache for performance reasons.

Returns:
True if so.

shouldRemove

protected boolean shouldRemove()
Checks whether the receiver should be removed from the cache. The receiver is retained until it is both unnecessary (confirmed via mayRemove() and offers no significant performance benefits.

Returns:
True if so.

removeIfDesired

protected void removeIfDesired()
Checks whether the receiver should be removed from the cache, and, if so, effects such removal.


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
Overrides:
setERPersisted in class OrderInfoBase<SimpleOrderInfoCache>

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
Overrides:
setAckExpected in class OrderInfoBase<SimpleOrderInfoCache>
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
Overrides:
setAckProcessed in class OrderInfoBase<SimpleOrderInfoCache>
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
Overrides:
setResponseExpected in class OrderInfoBase<SimpleOrderInfoCache>
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
Overrides:
setResponseProcessed in class OrderInfoBase<SimpleOrderInfoCache>
Parameters:
responseProcessed - The flag.


Copyright © 2012. All Rights Reserved.