org.apache.synapse.endpoints
Class EndpointView

java.lang.Object
  extended by org.apache.synapse.endpoints.EndpointView
All Implemented Interfaces:
org.apache.axis2.transport.base.MessageLevelMetricsCollector, EndpointViewMBean

public class EndpointView
extends Object
implements EndpointViewMBean, org.apache.axis2.transport.base.MessageLevelMetricsCollector

This class is the metrics collector and JMX control point for Endpoints


Constructor Summary
EndpointView(String endpointName, Endpoint endpoint)
          Create a new MBean to manage the given endpoint
 
Method Summary
 void destroy()
           
 int getActiveChildren()
          Return the number of active children for this endpoint
 double getAvgSizeReceived()
           
 double getAvgSizeSent()
           
 long getBytesReceived()
          Number of bytes received, receiving replies
 long getBytesSent()
          Number of bytes sent
 int getConsecutiveEndpointSuspensions()
           
 int getConsecutiveEndpointTimeouts()
           
 long getFaultsReceiving()
          Number of faults, receiving replies
 long getFaultsSending()
          Number of faults sending
 int getLast15MinuteEndpointSuspensions()
           
 int getLast15MinuteEndpointTimeouts()
           
 int getLast5MinuteEndpointSuspensions()
           
 int getLast5MinuteEndpointTimeouts()
           
 int getLastMinuteEndpointSuspensions()
           
 int getLastMinuteEndpointTimeouts()
           
 long getLastResetTime()
          Time when statistics was last reset for this leaf endpoint
 long getMaxSizeReceived()
           
 long getMaxSizeSent()
           
 long getMessagesReceived()
          Number of messages (ie replies) received
 long getMessagesSent()
          Number of messages sent
 long getMetricsWindow()
          Time since statistics was last reset for this leaf endpoint
 long getMinSizeReceived()
           
 long getMinSizeSent()
           
 int getReadyChildren()
          Return the number of ready children for this endpoint
 Map<Integer,Long> getReceivingFaultTable()
          A Map of receive faults with the error code and count
 Map<Integer,Long> getResponseCodeTable()
          A Map of response codes and counts
 Map<Integer,Long> getSendingFaultTable()
          A Map of send faults with the error code and count
 Date getSuspendedAt()
           
 Date getTimedoutAt()
           
 long getTimeoutsReceiving()
          Number of timeouts, receiving replies
 long getTimeoutsSending()
          Number of timeouts, sending
 int getTotalChildren()
          Return number of children for this endpoint
 int getTotalEndpointSuspensions()
           
 int getTotalEndpointTimeouts()
           
 void incrementBytesReceived(long size)
           
 void incrementBytesSent(long size)
           
 void incrementFaultsReceiving(int errorCode)
           
 void incrementFaultsSending(int errorCode)
           
 void incrementMessagesReceived()
           
 void incrementMessagesSent()
           
 void incrementSuspensions()
           
 void incrementTimeouts()
           
 void incrementTimeoutsReceiving()
           
 void incrementTimeoutsSending()
           
 boolean isActive()
          Is a leaf level endpoint active? For a group endpoint this means at least one is active
 boolean isEndpointInState(int state)
          Is the endpoint considered to be in the given state?
 boolean isSuspended()
          Is this leaf level endpoint in suspend state?
 boolean isSwitchedOff()
          Is this leaf level endpoint switched off?
 boolean isTimedout()
          Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?
 void notifyReceivedMessageSize(long size)
           
 void notifySentMessageSize(long size)
           
 void reportReceivingFault(int errorCode)
          Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault count
 void reportResponseCode(int respCode)
          Collect response code statistics
 void reportSendingFault(int errorCode)
          Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g.
 void resetConsecutiveSuspensions()
           
 void resetConsecutiveTimeouts()
           
 void resetStatistics()
           
 void setSuspendedAt(Date suspendedAt)
           
 void setTimedoutAt(Date timedoutAt)
           
 void switchOff()
          Switch off a leaf endpoint, or all endpoints of a group - for maintenence
 void switchOn()
          Switch on a leaf endpoint, or all endpoints on a group - from maintenence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndpointView

public EndpointView(String endpointName,
                    Endpoint endpoint)
Create a new MBean to manage the given endpoint

Parameters:
endpointName - the name of the endpoint
endpoint - the actual endpoint
Method Detail

destroy

public void destroy()

switchOn

public void switchOn()
              throws Exception
Switch on a leaf endpoint, or all endpoints on a group - from maintenence

Specified by:
switchOn in interface EndpointViewMBean
Throws:
Exception

switchOff

public void switchOff()
               throws Exception
Switch off a leaf endpoint, or all endpoints of a group - for maintenence

Specified by:
switchOff in interface EndpointViewMBean
Throws:
Exception

isActive

public boolean isActive()
                 throws Exception
Is a leaf level endpoint active? For a group endpoint this means at least one is active

Specified by:
isActive in interface EndpointViewMBean
Returns:
true if at least one is active in a group endpoint; for a leaf - if it is currently active
Throws:
Exception

isTimedout

public boolean isTimedout()
                   throws Exception
Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?

Specified by:
isTimedout in interface EndpointViewMBean
Returns:
true if a leaf level endpoint has timedout, For a group, has all endpoints timed out?
Throws:
Exception

isSuspended

public boolean isSuspended()
                    throws Exception
Is this leaf level endpoint in suspend state?

Specified by:
isSuspended in interface EndpointViewMBean
Returns:
true if a leaf level endpoint is suspended, false for group endpoints and non-suspend
Throws:
Exception

isSwitchedOff

public boolean isSwitchedOff()
                      throws Exception
Is this leaf level endpoint switched off?

Specified by:
isSwitchedOff in interface EndpointViewMBean
Returns:
true if a leaf level endpoint is off, false for group endpoints and non-off
Throws:
Exception

getTotalChildren

public int getTotalChildren()
                     throws Exception
Return number of children for this endpoint

Specified by:
getTotalChildren in interface EndpointViewMBean
Returns:
the number of children for this endpoint
Throws:
Exception

getActiveChildren

public int getActiveChildren()
                      throws Exception
Return the number of active children for this endpoint

Specified by:
getActiveChildren in interface EndpointViewMBean
Returns:
the number of active children for this endpoint
Throws:
Exception

getReadyChildren

public int getReadyChildren()
                     throws Exception
Return the number of ready children for this endpoint

Specified by:
getReadyChildren in interface EndpointViewMBean
Returns:
the number of ready children for this endpoint
Throws:
Exception

getLastResetTime

public long getLastResetTime()
Time when statistics was last reset for this leaf endpoint

Specified by:
getLastResetTime in interface EndpointViewMBean
Returns:
the time when statistics was last reset for this leaf endpoint, or -1 for group endpoints

getMetricsWindow

public long getMetricsWindow()
Time since statistics was last reset for this leaf endpoint

Specified by:
getMetricsWindow in interface EndpointViewMBean
Returns:
the time since statistics was last reset for this leaf endpoint, or -1 for group endpoints

getReceivingFaultTable

public Map<Integer,Long> getReceivingFaultTable()
A Map of receive faults with the error code and count

Specified by:
getReceivingFaultTable in interface EndpointViewMBean
Returns:
a Map of receive faults

getSendingFaultTable

public Map<Integer,Long> getSendingFaultTable()
A Map of send faults with the error code and count

Specified by:
getSendingFaultTable in interface EndpointViewMBean
Returns:
a Map of send faults

getResponseCodeTable

public Map<Integer,Long> getResponseCodeTable()
A Map of response codes and counts

Specified by:
getResponseCodeTable in interface EndpointViewMBean
Returns:
a Map of response codes and counts

getSuspendedAt

public Date getSuspendedAt()
Specified by:
getSuspendedAt in interface EndpointViewMBean

setSuspendedAt

public void setSuspendedAt(Date suspendedAt)

getTimedoutAt

public Date getTimedoutAt()
Specified by:
getTimedoutAt in interface EndpointViewMBean

setTimedoutAt

public void setTimedoutAt(Date timedoutAt)

getConsecutiveEndpointSuspensions

public int getConsecutiveEndpointSuspensions()
Specified by:
getConsecutiveEndpointSuspensions in interface EndpointViewMBean

incrementSuspensions

public void incrementSuspensions()

resetConsecutiveSuspensions

public void resetConsecutiveSuspensions()

getConsecutiveEndpointTimeouts

public int getConsecutiveEndpointTimeouts()
Specified by:
getConsecutiveEndpointTimeouts in interface EndpointViewMBean

incrementTimeouts

public void incrementTimeouts()

resetConsecutiveTimeouts

public void resetConsecutiveTimeouts()

getTotalEndpointSuspensions

public int getTotalEndpointSuspensions()
Specified by:
getTotalEndpointSuspensions in interface EndpointViewMBean

getTotalEndpointTimeouts

public int getTotalEndpointTimeouts()
Specified by:
getTotalEndpointTimeouts in interface EndpointViewMBean

getLastMinuteEndpointSuspensions

public int getLastMinuteEndpointSuspensions()
Specified by:
getLastMinuteEndpointSuspensions in interface EndpointViewMBean

getLast5MinuteEndpointSuspensions

public int getLast5MinuteEndpointSuspensions()
Specified by:
getLast5MinuteEndpointSuspensions in interface EndpointViewMBean

getLast15MinuteEndpointSuspensions

public int getLast15MinuteEndpointSuspensions()
Specified by:
getLast15MinuteEndpointSuspensions in interface EndpointViewMBean

getLastMinuteEndpointTimeouts

public int getLastMinuteEndpointTimeouts()
Specified by:
getLastMinuteEndpointTimeouts in interface EndpointViewMBean

getLast5MinuteEndpointTimeouts

public int getLast5MinuteEndpointTimeouts()
Specified by:
getLast5MinuteEndpointTimeouts in interface EndpointViewMBean

getLast15MinuteEndpointTimeouts

public int getLast15MinuteEndpointTimeouts()
Specified by:
getLast15MinuteEndpointTimeouts in interface EndpointViewMBean

getMessagesReceived

public long getMessagesReceived()
Number of messages (ie replies) received

Specified by:
getMessagesReceived in interface EndpointViewMBean
Returns:
# of messages (replies) received

getFaultsReceiving

public long getFaultsReceiving()
Number of faults, receiving replies

Specified by:
getFaultsReceiving in interface EndpointViewMBean
Returns:
# of faults, receiving replies

getTimeoutsReceiving

public long getTimeoutsReceiving()
Number of timeouts, receiving replies

Specified by:
getTimeoutsReceiving in interface EndpointViewMBean
Returns:
# of timeouts, receiving replies

getBytesReceived

public long getBytesReceived()
Number of bytes received, receiving replies

Specified by:
getBytesReceived in interface EndpointViewMBean
Returns:
# of byted received, receiving replies

getMessagesSent

public long getMessagesSent()
Number of messages sent

Specified by:
getMessagesSent in interface EndpointViewMBean
Returns:
# of messages sent

getFaultsSending

public long getFaultsSending()
Number of faults sending

Specified by:
getFaultsSending in interface EndpointViewMBean
Returns:
# of faults sending

getTimeoutsSending

public long getTimeoutsSending()
Number of timeouts, sending

Specified by:
getTimeoutsSending in interface EndpointViewMBean
Returns:
# of timeouts, sending

getBytesSent

public long getBytesSent()
Number of bytes sent

Specified by:
getBytesSent in interface EndpointViewMBean
Returns:
# of bytes sent

getMinSizeReceived

public long getMinSizeReceived()
Specified by:
getMinSizeReceived in interface EndpointViewMBean

getMaxSizeReceived

public long getMaxSizeReceived()
Specified by:
getMaxSizeReceived in interface EndpointViewMBean

getMinSizeSent

public long getMinSizeSent()
Specified by:
getMinSizeSent in interface EndpointViewMBean

getMaxSizeSent

public long getMaxSizeSent()
Specified by:
getMaxSizeSent in interface EndpointViewMBean

getAvgSizeReceived

public double getAvgSizeReceived()
Specified by:
getAvgSizeReceived in interface EndpointViewMBean

getAvgSizeSent

public double getAvgSizeSent()
Specified by:
getAvgSizeSent in interface EndpointViewMBean

resetStatistics

public void resetStatistics()
Specified by:
resetStatistics in interface EndpointViewMBean

incrementMessagesReceived

public void incrementMessagesReceived()
Specified by:
incrementMessagesReceived in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementFaultsReceiving

public void incrementFaultsReceiving(int errorCode)
Specified by:
incrementFaultsReceiving in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementTimeoutsReceiving

public void incrementTimeoutsReceiving()
Specified by:
incrementTimeoutsReceiving in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementBytesReceived

public void incrementBytesReceived(long size)
Specified by:
incrementBytesReceived in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementMessagesSent

public void incrementMessagesSent()
Specified by:
incrementMessagesSent in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementFaultsSending

public void incrementFaultsSending(int errorCode)
Specified by:
incrementFaultsSending in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementTimeoutsSending

public void incrementTimeoutsSending()
Specified by:
incrementTimeoutsSending in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

incrementBytesSent

public void incrementBytesSent(long size)
Specified by:
incrementBytesSent in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

notifyReceivedMessageSize

public void notifyReceivedMessageSize(long size)
Specified by:
notifyReceivedMessageSize in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

notifySentMessageSize

public void notifySentMessageSize(long size)
Specified by:
notifySentMessageSize in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector

reportSendingFault

public void reportSendingFault(int errorCode)
Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g. to report a successful fail-over etc

Specified by:
reportSendingFault in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
Parameters:
errorCode - the code to report

reportReceivingFault

public void reportReceivingFault(int errorCode)
Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault count

Specified by:
reportReceivingFault in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
Parameters:
errorCode - the code to report

reportResponseCode

public void reportResponseCode(int respCode)
Collect response code statistics

Specified by:
reportResponseCode in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
Parameters:
respCode - response code

isEndpointInState

public boolean isEndpointInState(int state)
Is the endpoint considered to be in the given state?

Parameters:
state - the state to consider
Returns:
true if all endpoints in a group are of the given state, or if a leaf endpoint is in the given state


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.