Difference between revisions of "VCLDequeueOperation"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "Interface: '''it.greenvulcano.gvesb.virtual.DequeueOperation''' <syntaxhighlight lang="java5"> public interface DequeueOperation extends Operation { public static final Stri...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Interface: '''it.greenvulcano.gvesb.virtual.DequeueOperation'''
+
Interface FQN: '''it.greenvulcano.gvesb.virtual.DequeueOperation'''
  
 +
Extends: [[VCLOperation|'''it.greenvulcano.gvesb.virtual.Operation''']]
 +
 +
<syntaxhighlight lang="java5">
 +
/**
 +
* This interface identifies operations used to perform dequeue.
 +
*
 +
* The DequeueOperation adds the acknowledge() method to the
 +
* Operation interface in order to confirm consumed messages to the
 +
* underlying MOM.
 +
*
 +
*/
 +
</syntaxhighlight>
 +
 +
==DequeueOperation constants==
 
<syntaxhighlight lang="java5">
 
<syntaxhighlight lang="java5">
public interface DequeueOperation extends Operation
+
public static final String TYPE  = "dequeue";
{
 
    public static final String TYPE  = "dequeue";
 
  
    /**
+
/**
    * Used in the <code>setTimeout()</code> in order to set an infinite
+
* Used in the setTimeout() in order to set an infinite
    * timeout.
+
* timeout.
    */
+
*/
    public static final long  TO_INDEFINITELY = 0;
+
public static final long  TO_INDEFINITELY = 0;
  
    /**
+
/**
    * Used in the <code>setTimeout()</code> in order to set a non-blocking
+
* Used in the setTimeout() in order to set a non-blocking
    * receive.
+
* receive.
    */
+
*/
    public static final long  TO_NON_BLOCKING = -1;
+
public static final long  TO_NON_BLOCKING = -1;
 +
</syntaxhighlight>
  
    /**
+
==DequeueOperation public methods==
    * Return <code>null</code> if no messages are available or timeout occurs.
+
<syntaxhighlight lang="java5">
    *
+
/**
    * @param gvBuffer
+
* Execute the operation using an GVBuffer. Usually this method
    * @return a <code>GVBuffer</code> or <code>null</code> if no messages are
+
* is used in order to retrieve data from external systems.
    *        available or timeout occurs.
+
* Returns null if no messages are available or timeout occurs.
    * @throws ConnectionException
+
*  
    * @throws DequeueException
+
* @param gvBuffer
    * @throws InvalidDataException
+
*        input data for the operation.
    */
+
*
    public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;
+
* @return an GVBuffer containing the operation result or null if  
 +
*        no messages are available or timeout occurs.
 +
* @exception ConnectionException
 +
*            if an error occurs making the connection to the external system.
 +
* @exception DequeueException
 +
*            if an error occurs performing the operation.
 +
* @exception InvalidDataException
 +
*            if the call fail because the data are invalid. GreenVulcano ESB
 +
*            should not retry to perform the operation with the same data.
 +
*/
 +
public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;
  
    /**
+
/**
    * This method acknowledge the message identified by the given Id.
+
* This method acknowledges the message identified by the given Id.
    *
+
*
    * @param id
+
* @param id
    * @throws ConnectionException
+
* @throws ConnectionException
    * @throws AcknowledgeException
+
* @throws AcknowledgeException
    */
+
*/
    public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;
+
public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method acknowledge all the messages.
+
* This method acknowledges all the messages.
    *
+
*
    * @throws ConnectionException
+
* @throws ConnectionException
    * @throws AcknowledgeException
+
* @throws AcknowledgeException
    */
+
*/
    public void acknowledgeAll() throws ConnectionException, AcknowledgeException;
+
public void acknowledgeAll() throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method roll-back the dequeue of the message identified by the given
+
* This method roll-back the dequeue of the message identified by the given
    * Id.
+
* Id.
    *
+
*
    * @param id
+
* @param id
    * @throws ConnectionException
+
* @throws ConnectionException
    * @throws AcknowledgeException
+
* @throws AcknowledgeException
    */
+
*/
    public void rollback(Id id) throws ConnectionException, AcknowledgeException;
+
public void rollback(Id id) throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method roll-back the dequeue of all the messages.
+
* This method roll-back the dequeue of all the messages.
    *
+
*
    * @throws ConnectionException
+
* @throws ConnectionException
    * @throws AcknowledgeException
+
* @throws AcknowledgeException
    */
+
*/
    public void rollbackAll() throws ConnectionException, AcknowledgeException;
+
public void rollbackAll() throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method set the filter for messages to receive. <br>
+
* This method sets the filter for messages to receive.  
    * This filter is valid only for the first perform() invocation.
+
* This filter is valid only for the first perform() invocation.
    * The filter is reset also if perform() terminate with an exception. <br>
+
* The filter is reset also if perform() terminates with an exception.  
    * Despite the GVVCL is a virtual interface, the syntax for the filter is
+
* Despite the GVVCL is a virtual interface, the syntax for the filter is
    * like the syntax for JMS selectors. The concrete implementation must
+
* like the syntax for JMS selectors. The concrete implementation must
    * adapt to the underlying MOM.
+
* adapt to the underlying MOM.
    *
+
*
    * @param filter
+
* @param filter
    * @throws FilterException
+
* @throws FilterException
    */
+
*/
    public void setFilter(String filter) throws FilterException;
+
public void setFilter(String filter) throws FilterException;
  
    /**
+
/**
    * This method set the timeout for the receive operation. <br>
+
* This method sets the timeout for the receive operation.  
    * If 0 then the receive blocks indefinitely. If <nobr>&gt;
+
* If 0 then the receive blocks indefinitely. If > 0
    * 0</nobr> then this parameter specify, in milliseconds, the time that the
+
* then this parameter specify, in milliseconds, the time that the
    * receive must wait for a message. If <nobr>&lt; 0</nobr> then executes a
+
* receive must wait for a message. If < 0 then executes a
    * non-blocking receive. <br>
+
* non-blocking receive.  
    * This parameter is valid only for the first perform() invocation.
+
* This parameter is valid only for the first perform() invocation.
    * The timeout is reset also if perform() terminate with an exception.
+
* The timeout is reset also if perform() terminate with an exception.
    *
+
*
    * @param timeout
+
* @param timeout
    *        Specify the receive timeout. If <nobr>&gt; 0</nobr> specifies the
+
*        Specifies the receive timeout. If > 0 specifies the
    *        milliseconds for timeout. It is possible to use the
+
*        milliseconds for timeout. It is possible to use the
    *        <code>TO_xxx</code> constants in order to specify a non-blocking
+
*        TO_xxx constants in order to specify a non-blocking
    *        receive operation or a indefinitely blocking receive.
+
*        receive operation or a indefinitely blocking receive.
    *
+
*
    */
+
*/
    public void setTimeout(long timeout);
+
public void setTimeout(long timeout);
}
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 17:35, 21 December 2012

Interface FQN: it.greenvulcano.gvesb.virtual.DequeueOperation

Extends: it.greenvulcano.gvesb.virtual.Operation

/**
* This interface identifies operations used to perform dequeue.
*
* The DequeueOperation adds the acknowledge() method to the
* Operation interface in order to confirm consumed messages to the
* underlying MOM.
*
*/

DequeueOperation constants

public static final String TYPE  = "dequeue";

/**
* Used in the setTimeout() in order to set an infinite
* timeout.
*/
public static final long   TO_INDEFINITELY = 0;

/**
* Used in the setTimeout() in order to set a non-blocking
* receive.
*/
public static final long   TO_NON_BLOCKING = -1;

DequeueOperation public methods

/**
 * Execute the operation using an GVBuffer. Usually this method
 * is used in order to retrieve data from external systems.
 * Returns null if no messages are available or timeout occurs.
 * 
 * @param gvBuffer
 *        input data for the operation.
 *
 * @return an GVBuffer containing the operation result or null if 
 *         no messages are available or timeout occurs.
 * @exception ConnectionException
 *            if an error occurs making the connection to the external system.
 * @exception DequeueException
 *            if an error occurs performing the operation.
 * @exception InvalidDataException
 *            if the call fail because the data are invalid. GreenVulcano ESB 
 *            should not retry to perform the operation with the same data.
 */
public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;

/**
* This method acknowledges the message identified by the given Id.
*
* @param id
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;

/**
* This method acknowledges all the messages.
*
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void acknowledgeAll() throws ConnectionException, AcknowledgeException;

/**
* This method roll-back the dequeue of the message identified by the given
* Id.
*
* @param id
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void rollback(Id id) throws ConnectionException, AcknowledgeException;

/**
* This method roll-back the dequeue of all the messages.
*
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void rollbackAll() throws ConnectionException, AcknowledgeException;

/**
* This method sets the filter for messages to receive. 
* This filter is valid only for the first perform() invocation.
* The filter is reset also if perform() terminates with an exception. 
* Despite the GVVCL is a virtual interface, the syntax for the filter is
* like the syntax for JMS selectors. The concrete implementation must
* adapt to the underlying MOM.
*
* @param filter
* @throws FilterException
*/
public void setFilter(String filter) throws FilterException;

/**
* This method sets the timeout for the receive operation. 
* If 0 then the receive blocks indefinitely. If > 0
* then this parameter specify, in milliseconds, the time that the
* receive must wait for a message. If < 0 then executes a
* non-blocking receive. 
* This parameter is valid only for the first perform() invocation.
* The timeout is reset also if perform() terminate with an exception.
*
* @param timeout
*        Specifies the receive timeout. If > 0 specifies the
*        milliseconds for timeout. It is possible to use the
*        TO_xxx constants in order to specify a non-blocking
*        receive operation or a indefinitely blocking receive.
*
*/
public void setTimeout(long timeout);