org.onebusaway.siri.core
Class SiriClientRequest

java.lang.Object
  extended by org.onebusaway.siri.core.SiriClientRequest

public class SiriClientRequest
extends Object


Constructor Summary
SiriClientRequest()
           
SiriClientRequest(SiriClientRequest request)
           
 
Method Summary
 void decrementRemainingReconnctionAttempts()
           
 Object getChannelContext()
          See setChannelContext(Object).
 int getCheckStatusInterval()
           
 String getCheckStatusUrl()
          If set, this url should be used for check status requets, in lieu of the normal getTargetUrl().
 int getConnectionErrorCount()
           
 int getHeartbeatInterval()
           
 long getInitialTerminationDuration()
           
 String getManageSubscriptionUrl()
          If set, this url should be used for subscription management requests (ex TerminateSubscriptionRequest), in lieu of the normal getTargetUrl().
 Siri getPayload()
           
 int getPollInterval()
          When isSubscribe() is false, indicates how often we should poll the SIRI endpoint with request-response, in seconds.
 int getReconnectionAttempts()
          The number of times to attempt to reconnect when a client request fails.
 int getReconnectionInterval()
           
 int getRemainingReconnectionAttempts()
           
 String getTargetUrl()
           
 ESiriVersion getTargetVersion()
           
 void incrementConnectionErrorCount()
           
 boolean isSubscribe()
          If true, indicates that the client request is a publish-subscribe request.
 void resetConnectionErrorCount()
           
 void resetConnectionStatistics()
          Resets the values of getConnectionErrorCount() and getRemainingReconnectionAttempts() to their default initial values.
 void setChannelContext(Object channelContext)
          If you wish to associate some channel-specific data with this subscription, you can supply it with this method.
 void setCheckStatusInterval(int checkStatusInterval)
           
 void setCheckStatusUrl(String checkStatusUrl)
           
 void setHeartbeatInterval(int heartbeatInterval)
           
 void setInitialTerminationDuration(long initialTerminationDuration)
           
 void setManageSubscriptionUrl(String manageSubscriptionUrl)
           
 void setPayload(Siri payload)
           
 void setPollInterval(int pollInterval)
          When isSubscribe() is false, indicates how often we should poll the SIRI endpoint with request-response, in seconds.
 void setReconnectionAttempts(int reconnectionAttempts)
          Set the number of times to attempt to reconnect when a client request fails.
 void setReconnectionInterval(int reconnectionInterval)
           
 void setSubscribe(boolean subscribe)
           
 void setTargetUrl(String targetUrl)
           
 void setTargetVersion(ESiriVersion targetVersion)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SiriClientRequest

public SiriClientRequest()

SiriClientRequest

public SiriClientRequest(SiriClientRequest request)
Method Detail

getTargetUrl

public String getTargetUrl()

setTargetUrl

public void setTargetUrl(String targetUrl)

getManageSubscriptionUrl

public String getManageSubscriptionUrl()
If set, this url should be used for subscription management requests (ex TerminateSubscriptionRequest), in lieu of the normal getTargetUrl().

Returns:

setManageSubscriptionUrl

public void setManageSubscriptionUrl(String manageSubscriptionUrl)

getCheckStatusUrl

public String getCheckStatusUrl()
If set, this url should be used for check status requets, in lieu of the normal getTargetUrl().

Returns:

setCheckStatusUrl

public void setCheckStatusUrl(String checkStatusUrl)

getTargetVersion

public ESiriVersion getTargetVersion()

setTargetVersion

public void setTargetVersion(ESiriVersion targetVersion)

isSubscribe

public boolean isSubscribe()
If true, indicates that the client request is a publish-subscribe request. If false, indicates that we should instead periodically poll the SIRI endpoint using request-response instead.


setSubscribe

public void setSubscribe(boolean subscribe)
Parameters:
subscribe - if true, indicates that the client request is a publish-subscribe request. If false, indicates that we should instead periodically poll the SIRI endpoint using request-response instead.

getPollInterval

public int getPollInterval()
When isSubscribe() is false, indicates how often we should poll the SIRI endpoint with request-response, in seconds. A value of zero (the default) indicates that request should only be sent once and never polled again.


setPollInterval

public void setPollInterval(int pollInterval)
When isSubscribe() is false, indicates how often we should poll the SIRI endpoint with request-response, in seconds. A value of zero indicates that request should only be sent once and never polled again.


getReconnectionAttempts

public int getReconnectionAttempts()
The number of times to attempt to reconnect when a client request fails. Zero indicates that no reconnection attempts will be made while -1 indicates that an indefinite number of reconnection attempts will be made.

Returns:
the number of reconnection attempts

setReconnectionAttempts

public void setReconnectionAttempts(int reconnectionAttempts)
Set the number of times to attempt to reconnect when a client request fails. Zero indicates that no reconnection attempts will be made while -1 indicates that an indefinite number of reconnection attempts will be made.

Parameters:
reconnectionAttempts - - the number of reconnection attempts

getReconnectionInterval

public int getReconnectionInterval()
Returns:
time, in seconds, to wait between reconnection attempts

setReconnectionInterval

public void setReconnectionInterval(int reconnectionInterval)
Parameters:
reconnectionInterval - time in seconds

getRemainingReconnectionAttempts

public int getRemainingReconnectionAttempts()

decrementRemainingReconnctionAttempts

public void decrementRemainingReconnctionAttempts()

getConnectionErrorCount

public int getConnectionErrorCount()

incrementConnectionErrorCount

public void incrementConnectionErrorCount()

resetConnectionErrorCount

public void resetConnectionErrorCount()

resetConnectionStatistics

public void resetConnectionStatistics()
Resets the values of getConnectionErrorCount() and getRemainingReconnectionAttempts() to their default initial values.


getCheckStatusInterval

public int getCheckStatusInterval()

setCheckStatusInterval

public void setCheckStatusInterval(int checkStatusInterval)

getHeartbeatInterval

public int getHeartbeatInterval()

setHeartbeatInterval

public void setHeartbeatInterval(int heartbeatInterval)

getInitialTerminationDuration

public long getInitialTerminationDuration()
Returns:
time, in milliseconds

setInitialTerminationDuration

public void setInitialTerminationDuration(long initialTerminationDuration)
Parameters:
initialTerminationDuration - time, in milliseconds

getChannelContext

public Object getChannelContext()
See setChannelContext(Object).

Returns:
channel-specific callback data to be associated with the subscription.

setChannelContext

public void setChannelContext(Object channelContext)
If you wish to associate some channel-specific data with this subscription, you can supply it with this method. Think of this as supplying callback data. The context data will be included in SiriChannelInfo.getContext() when the siri client notifies you of a new service delivery in a SiriServiceDeliveryHandler.

Parameters:
channelContext -

getPayload

public Siri getPayload()

setPayload

public void setPayload(Siri payload)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 OneBusAway. All Rights Reserved.