You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2005/05/22 12:00:25 UTC

cvs commit: ws-fx/sandesha/src/org/apache/sandesha IStorageManager.java

chamikara    2005/05/22 03:00:25

  Modified:    sandesha/interop/org/apache/sandesha/samples/interop
                        AsyncPingClient.java EchoClientAsyncAck.java
                        EchoClientSyncAck.java SyncPingClient.java
               sandesha/src/org/apache/sandesha IStorageManager.java
  Log:
  Java doc comments were added.
  
  Revision  Changes    Path
  1.14      +1 -1      ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/AsyncPingClient.java
  
  Index: AsyncPingClient.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/AsyncPingClient.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AsyncPingClient.java	22 May 2005 04:54:20 -0000	1.13
  +++ AsyncPingClient.java	22 May 2005 10:00:25 -0000	1.14
  @@ -59,7 +59,7 @@
   
               if (report != null) {
                   System.out.println("\n***********Printing RM Report***********");
  -                System.out.println("Were all messages add     - " + report.isAllAcked());
  +                System.out.println("Were all messages acked     - " + report.isAllAcked());
                   System.out.println(
                           "No of response messages   - " + report.getNumberOfReturnMessages());
                   System.out.println("****************************************\n");
  
  
  
  1.8       +1 -1      ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/EchoClientAsyncAck.java
  
  Index: EchoClientAsyncAck.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/EchoClientAsyncAck.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EchoClientAsyncAck.java	22 May 2005 04:54:20 -0000	1.7
  +++ EchoClientAsyncAck.java	22 May 2005 10:00:25 -0000	1.8
  @@ -77,7 +77,7 @@
   
               if (report != null) {
                   System.out.println("\n***********Printing RM Report***********");
  -                System.out.println("Were all messages add     - " + report.isAllAcked());
  +                System.out.println("Were all messages acked     - " + report.isAllAcked());
                   System.out.println(
                           "No of response messages   - " + report.getNumberOfReturnMessages());
                   System.out.println("****************************************\n");
  
  
  
  1.8       +1 -1      ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/EchoClientSyncAck.java
  
  Index: EchoClientSyncAck.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/EchoClientSyncAck.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EchoClientSyncAck.java	22 May 2005 04:54:20 -0000	1.7
  +++ EchoClientSyncAck.java	22 May 2005 10:00:25 -0000	1.8
  @@ -76,7 +76,7 @@
   
                          if (report != null) {
                              System.out.println("\n***********Printing RM Report***********");
  -                           System.out.println("Were all messages add     - " + report.isAllAcked());
  +                           System.out.println("Were all messages acked     - " + report.isAllAcked());
                              System.out.println(
                                      "No of response messages   - " + report.getNumberOfReturnMessages());
                              System.out.println("****************************************\n");
  
  
  
  1.12      +1 -1      ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/SyncPingClient.java
  
  Index: SyncPingClient.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/interop/org/apache/sandesha/samples/interop/SyncPingClient.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SyncPingClient.java	22 May 2005 04:54:20 -0000	1.11
  +++ SyncPingClient.java	22 May 2005 10:00:25 -0000	1.12
  @@ -64,7 +64,7 @@
   
               if (report != null) {
                   System.out.println("\n***********Printing RM Report***********");
  -                System.out.println("Were all messages add     - " + report.isAllAcked());
  +                System.out.println("Were all messages acked     - " + report.isAllAcked());
                   System.out.println(
                           "No of response messages   - " + report.getNumberOfReturnMessages());
                   System.out.println("****************************************\n");
  
  
  
  1.23      +158 -51   ws-fx/sandesha/src/org/apache/sandesha/IStorageManager.java
  
  Index: IStorageManager.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/sandesha/src/org/apache/sandesha/IStorageManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- IStorageManager.java	14 May 2005 06:52:31 -0000	1.22
  +++ IStorageManager.java	22 May 2005 10:00:25 -0000	1.23
  @@ -26,150 +26,257 @@
    * @author
    */
   public interface IStorageManager {
  +    
       public void init();
   
  -    //This will be used by the processors to insert a request message
  -    //Here a decision need to be made whether we use the sequence already
  -    // created or need to
  -    //create a new sequence as there are no sequence request by the client.
  -
  -    //public void insertRequestMessage(RMMessageContext rmMessageContext);
  -
  -    //This will be used by the Invoker but at the moment we don't need this
  -    // too.
  -
  -    //public void insertResponseMessage(RMMessageContext rmMessageContext);
  -
  -    //This is used by the processors.
  +    /**
  +     * Checks weather a entry for the given outgoing sequence exists in
  +     * the storage.
  +     */
       public boolean isSequenceExist(String sequenceID);
   
  +    /**
  +     * This checks weather there is a entry for the given incoming sequence in 
  +     * the storage.
  +     */
       public boolean isResponseSequenceExist(String sequenceID);
   
  -    //This for the invoker and need to be implemented.
  +    /**
  +     * This will be used by a message processing thread to get those
  +     * messages.
  +     */
       public RMMessageContext getNextMessageToProcess();
   
  -    //Remove this
  -    //public void setAcknowledged();
  -
  -    //Use this instead
  +    /**
  +     * This will be used  to set the acks.
  +     */
       public void setAcknowledged(String seqID, long msgNumber);
   
  -    //No need to change.
  +    /**
  +     * This adds a entry in the storage for holding the messages of the given outgoing 
  +     * sequence.
  +     */
       public void addSequence(String sequenceID);
   
  -    //This is used to add create sequence responses
  -    //This is dealing with the new list of messages that we have discussed.
  -    //These messages may not need to be in order.
  +    /**
  +     * This will be used to set the create sequence responses.
  +     */
       public void addCreateSequenceResponse(RMMessageContext rmMessageContext);
   
  +    /**
  +     * This will be used to add the create sequence request.
  +     */
       public void addCreateSequenceRequest(RMMessageContext rmMessageContext);
   
  -    //This is used to add addAcknowledgement
  -    //This is dealing with the new list of messages that we have discussed.
  -    //These messages may not need to be in order.
  -    //This method and the method above will do the same task at the moment.
  +    /**
  +     * This will be used to add acks to the storage.
  +     */
       public void addAcknowledgement(RMMessageContext rmMessageContext);
   
  -    //Need to implement this
  +    /**
  +     * Check the existance of a message.
  +     */
       public boolean isMessageExist(String sequenceID, long messageNumber);
   
  -    //Try to send me a sorted map as we disucssed.
  +    /**
  +     * This will give a Map containing message numbers of all the messages of the given sequence,
  +     * that are currently in the storage.
  +     */
       public Map getListOfMessageNumbers(String sequenceID);
   
  -    //This is used by the Sender to get the response messages from the response
  -    // queue;
  -    //public RMMessageContext getNextResponseMessageToSend();
  -
  -    //This is used by the Sender to get the non-application response type
  -    // messages.
  -    //e.g. CreateSequence, CreateSequenceResponse, AsynchronousAcks
  +    /**
  +     * This should be the method used by a message sender to get messages from storage.
  +     * This actually does not give any odering to the messages (e.g. create sequence messages hv no priority).
  +     * The odering should be included in the implementation.
  +     */
       public RMMessageContext getNextMessageToSend();
   
  -    //These two methods were added to deal with the out sequence.
  -    //First Server sender generates and sets a temporari out sequence to a
  -    // responseSequence.
  -    //Then it sends a CreateSequenceMessage setting this as the Message ID.
  -    //When the RMProvider receives is sets the correct outSequence ID.
  -    // (Using RelatesTo).
  +    /**
  +     * The function of this method is the set the outSequence value (sequence id) of a perticular sequence 
  +     * to a temporary value. This is necessary because the sequence id may not be present iy the time the messages
  +     * get added to the storage (e.g. sequnce id will only be available after a create. seq response.).  
  +     */
       public void setTemporaryOutSequence(String sequenceId, String outSequenceId);
   
  +    /**
  +     * When the actual outSequnce id becomes available it can be set using this.
  +     * Notice that oldOutSequnceId should be the temporary out sequence set by the method 'setTemporaryOutSequence'
  +     */
       public boolean setApprovedOutSequence(String oldOutsequenceId,
                                             String newOutSequenceId);
   
  -    //In the server side we will get the appropriate message number
  -    //In the client side this will start from 1
  -    //But the sequenceID is neglected.
  +    /**
  +     * This could be called to get the next message number expected by a perticular sequence.
  +     * This will not be very useful in the cliend side since the user may himself set the 
  +     * message no. But in the server side this will be very useful when setting the message no.
  +     */
       public long getNextMessageNumber(String sequenceID);
   
  -    //This is used by the client when storing the request messages.
  -
  -    //public void insertClientRequestMessage(RMMessageContext
  -    // rmMessageContext);
  -
  +    /**
  +     * This adds the given outgoing message to the correct sequence mentioned in its property.
  +     */
       public void insertOutgoingMessage(RMMessageContext rmMessageContext);
   
  +    /**
  +     * This adds the given incoming message to the correct sequence mentioned in its property.
  +     */
       public void insertIncomingMessage(RMMessageContext rmMessageContext);
   
  +    /**
  +     * When the messageId of the request message (e.g. from relates to) and the sequence id
  +     * is given this will give the response message.
  +     */
       public RMMessageContext checkForResponseMessage(String sequenceId, String requestMsgId);
   
  +    /**
  +     * Checks weathe a ack has been received for the given message.
  +     */
       public boolean checkForAcknowledgement(String sequenceId, String requestMsgId);
   
  -
  +    /**
  +     * Checks weather all the messages of all the sequences that have been started hv 
  +     * been acked.
  +     */
       public boolean isAckComplete(String sequenceID);
   
  +    /**
  +     * Adds a terminate sequence message to the storage.
  +     */
       public void insertTerminateSeqMessage(RMMessageContext terminateSeqMessage);
   
  +    /**
  +     * Checks weather all the work finished.
  +     * If this is true we can wind up.
  +     */
       public boolean isAllSequenceComplete();
   
  +    
       public boolean isResponseComplete(String sequenceID);
   
  +    
       public void terminateSequence(String sequenceID);
   
  +    /**
  +     * Tells to the storage that the given message of given sequence was acked.
  +     */
       public void setAckReceived(String seqId, long msgNo);
  -
  +    
       public void insertFault(RMMessageContext rmMsgCtx);
   
  +    /**
  +     * The message will be added to a sent list (the list holds the 
  +     * messages that were sent at least once)
  +     */
       public void addSendMsgNo(String seqId, long msgNo);
   
  +    /**
  +     * Checks weather the message has been sent at least once.
  +     */
       public boolean isSentMsg(String seqId, long msgNo);
   
  +    /**
  +     * Asks weather the storage has got the last message of the outgoing sequence.
  +     */
       public boolean hasLastOutgoingMsgReceived(String seqId);
   
  +    /**
  +     * Gets the message number of the last outgoing message of the given sequence.
  +     */
       public long getLastOutgoingMsgNo(String seqId);
   
  +    /**
  +     * Asks weather the storage has got the last message of the incoming sequence.
  +     */
       public boolean hasLastIncomingMsgReceived(String seqId);
   
  +    /**
  +     * Gets the message number of the last incoming message of the given sequence.
  +     */
       public long getLastIncomingMsgNo(String seqId);
   
  +    /**
  +     * This adds a entry in the storage for holding the messages of the given outgoing 
  +     * sequence.
  +     */
       public void addOutgoingSequence(String seqId);
   
  +    /**
  +     * This adds a entry in the storage for holding the messages of the given incoming 
  +     * sequence.
  +     */
       public void addIncomingSequence(String seqId);
   
  +    /**
  +     * Tries to give the sequence id of the outgoing message with the given message id
  +     */
       public String getOutgoingSeqOfMsg(String msgId);
   
  +    /**
  +     * When a server or client sends a create sequence, it will be marked from this method.
  +     * But the actual resources will be allocated only when the first message arrives.
  +     */
       public void addRequestedSequence(String seqId);
   
  +    /**
  +     * Checks weather this sequence id has been marked by the method 'addRequestedSequence'
  +     */
       public boolean isRequestedSeqPresent(String seqId);
   
  +    /**
  +     *This tries to give the outgoing sequence id relating to a given incoming message.
  +     *e.g. seqience which contains the message given by 'relatesTo'
  +     */
       public String getOutgoingSeqenceIdOfIncomingMsg(RMMessageContext msg);
   
  +    /**
  +     * Tells that the terminate sequence has been sent for a perticular outgoing sequence.
  +     */
       public void setTerminateSend(String seqId);
   
  +    /**
  +     * Tells that the terminate sequence message has been received for a perticular incoming sequence.
  +     */
       public void setTerminateReceived(String seqId);
   
  +    /**
  +     *This asks for the key used to hold messages of a perticular sequence 
  +     *given the outgoing sequece id. Remember that sequence id may not be present when the messages
  +     *first get added. So these should be a seperate key other than the sequence id.
  +     */
       public String getKeyFromOutgoingSeqId(String seqId);
       
  +    /**
  +     * Sets the acksTo property of a perticular sequence.
  +     */
       public void setAcksTo(String seqId,String acksTo);
       
  +    /**
  +     * Gets the acksTo property of a perticular sequence.
  +     */
       public String getAcksTo(String seqId);
   
  +    /**
  +     * This callback will report when messages get added to the storage.
  +     */
   	public void setCallback(Callback callBack);
   	
  +	/**
  +	 * Removes the callback added by 'setCallback' (if present)
  +	 */
   	public void removeCallback();
   
  +	/**
  +	 * Sets the offer property of a perticular sequence.
  +	 */
       void addOffer(String msgID, String offerID);
   
  +	/**
  +	 * Gets the offer property of a perticular sequence.
  +	 */
       String getOffer(String msgID);
       
  +    /**
  +     * Clears the complete storage.
  +     */
       void clearStorage();
   }
  \ No newline at end of file