public abstract class Delegate extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Delegate.DelegateEntry
Entry in the list of CASes pending reply.
|
Modifier and Type | Field and Description |
---|---|
protected String |
delegateKey |
static int |
DISABLED_STATE |
static int |
OK_STATE |
static int |
TIMEOUT_STATE |
Constructor and Description |
---|
Delegate() |
Modifier and Type | Method and Description |
---|---|
void |
addCasToOutstandingList(String aCasReferenceId)
Adds a given Cas ID to the list of CASes pending reply.
|
int |
addCasToPendingDispatchList(String aCasReferenceId)
Adds given CAS ID to the list of CASes pending dispatch.
|
void |
addNewCasToOutstandingList(String aCasReferenceId) |
void |
addNewCasToOutstandingList(String aCasReferenceId,
boolean isCasGeneratingChildren) |
void |
cancelDelegateTimer()
Cancels current timer
|
void |
cleanup()
Cancels timer and clears a list of CASes pending reply
|
int |
getCasPendingDispatchListSize() |
int |
getCasPendingReplyListSize() |
long |
getCasProcessTimeout() |
abstract String |
getComponentName() |
long |
getCpcTimeout() |
List<Delegate.DelegateEntry> |
getDelegateCasesPendingDispatch() |
List<Delegate.DelegateEntry> |
getDelegateCasesPendingReply() |
Endpoint |
getEndpoint()
Returns an
Endpoint object |
long |
getGetMetaTimeout() |
String |
getKey()
Returns delegate key
|
Endpoint |
getNotificationEndpoint() |
String |
getOldestCasIdFromOutstandingList() |
int |
getState() |
abstract void |
handleError(Exception e,
ErrorContext errorContext) |
boolean |
hasConcurrentConsumersOnReplyQueue() |
void |
incrementRetryCount(String aCasReferenceId)
Increments retry count
|
boolean |
isAwaitingPingReply() |
boolean |
isGeneratingChildrenFrom(String aCasReferenceId) |
boolean |
removeCasFromOutstandingList(String aCasReferenceId)
Removes
Delegate.DelegateEntry from the list of CASes pending reply. |
boolean |
removeCasFromPendingDispatchList(String aCasReferenceId)
Removes an entry from the list of CASes pending dispatch that matches a given CAS Id.A CAS is
delayed and placed on this list when the delegate status changes to TIMED_OUT and a PING
message is sent to test delegate availability.
|
String |
removeOldestCasFromOutstandingList()
Removes
Delegate.DelegateEntry from the list of CASes pending reply. |
String |
removeOldestFromPendingDispatchList()
Removes the oldest entry from the list of CASes pending dispatch.
|
void |
resetAwaitingPingReply() |
void |
restartTimerForOldestCasInOutstandingList()
Forces Timer restart for the oldest CAS sitting in the list of CASes pending reply.
|
void |
setAwaitingPingReply() |
void |
setCasProcessTimeout(long casProcessTimeout) |
void |
setConcurrentConsumersOnReplyQueue() |
void |
setCpcTimeout(long cpcTimeout) |
void |
setEndpoint(Endpoint anEndpoint)
Sets an
Endpoint object |
void |
setGeneratingChildrenFrom(String aCasReferenceId,
boolean tOf) |
void |
setGetMetaTimeout(long getMetaTimeout) |
void |
setNotificationEndpoint(Endpoint notificationEndpoint) |
void |
setState(int aState) |
void |
startGetMetaRequestTimer()
Starts GetMeta Request timer
|
String |
toString() |
public static final int OK_STATE
public static final int TIMEOUT_STATE
public static final int DISABLED_STATE
protected String delegateKey
public Endpoint getNotificationEndpoint()
public void setNotificationEndpoint(Endpoint notificationEndpoint)
public boolean isAwaitingPingReply()
public void setAwaitingPingReply()
public void resetAwaitingPingReply()
public String getKey()
public void setEndpoint(Endpoint anEndpoint)
Endpoint
objectanEndpoint
- - an endpoint objectpublic void restartTimerForOldestCasInOutstandingList()
public List<Delegate.DelegateEntry> getDelegateCasesPendingReply()
public List<Delegate.DelegateEntry> getDelegateCasesPendingDispatch()
public void addNewCasToOutstandingList(String aCasReferenceId)
public void addNewCasToOutstandingList(String aCasReferenceId, boolean isCasGeneratingChildren)
public void addCasToOutstandingList(String aCasReferenceId)
aCasReferenceId
- - CAS ID to add to pending list if not already therepublic int addCasToPendingDispatchList(String aCasReferenceId)
aCasReferenceId
- - CAS ID to add to the delayed listpublic void incrementRetryCount(String aCasReferenceId)
aCasReferenceId
- public String removeOldestFromPendingDispatchList()
public boolean removeCasFromPendingDispatchList(String aCasReferenceId)
public boolean removeCasFromOutstandingList(String aCasReferenceId)
Delegate.DelegateEntry
from the list of CASes pending reply. The entry is removed when
either: 1) reply is received from the delegate before the timeout 2) the timeout occurs with no
retry 3) an error occurs and the CAS is dropped as part of Error HandlingaCasReferenceId
- - id of the CAS to remove from the listpublic String removeOldestCasFromOutstandingList()
Delegate.DelegateEntry
from the list of CASes pending reply. The entry is removed when
either: 1) reply is received from the delegate before the timeout 2) the timeout occurs with no
retry 3) an error occurs and the CAS is dropped as part of Error HandlingaCasReferenceId
- - id of the CAS to remove from the listpublic String getOldestCasIdFromOutstandingList()
public void cleanup()
public int getCasPendingReplyListSize()
public int getCasPendingDispatchListSize()
public void cancelDelegateTimer()
public void startGetMetaRequestTimer()
public long getCasProcessTimeout()
public void setCasProcessTimeout(long casProcessTimeout)
public long getGetMetaTimeout()
public void setGetMetaTimeout(long getMetaTimeout)
public long getCpcTimeout()
public void setCpcTimeout(long cpcTimeout)
public int getState()
public void setState(int aState)
public void setConcurrentConsumersOnReplyQueue()
public boolean hasConcurrentConsumersOnReplyQueue()
public boolean isGeneratingChildrenFrom(String aCasReferenceId)
public void setGeneratingChildrenFrom(String aCasReferenceId, boolean tOf)
public abstract void handleError(Exception e, ErrorContext errorContext)
public abstract String getComponentName()
Copyright © 2016. All rights reserved.