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 Davanum Srinivas <da...@gmail.com> on 2004/05/06 18:10:52 UTC

Re: Sandesha code format

looks ok. PLEASE from next time, make incremental changes and make
them directly to CVS. PLEASE don't work off-line like you did this
time. I fixed a lot of loose ends as well, for example you were
swallowing exceptions, and i changed them to "throw
AxisFault.makeFault()" etc...i'll have start all over again. If you
are doing massive changes, then it's your responsibility to merge any
and every change in CVS with your copy. We all are co-owners of the
code and should work collectively.

thanks,
dims

On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
<sn...@opensource.lk> wrote:
> 
> Hi Dims,
> 
> We have finalized all development work relating to classes with basic
> functionality for WSRM. So, our next commit will make lot of changes to
> the existing classes . To keep your formatting in existing classes, we
> were going through the formatting you did and formatted the new classes
> accordingly.
> We have concerned on the following aspects of formatting.
> 1.      Licenses
> 2.      Author
> 3.      Fields Comments
> 4.      Method Comments
> 
> Please glance through sample class as shown below and send let us know
> whether it is ok to commit as mentioned.
> 
> Regards
> Sandesha Team
> 
>  ---------------------------------------------------------------------------
> /*
>  * Copyright  1999-2004 The Apache Software Foundation.
>  *
>  *  Licensed under the Apache License, Version 2.0 (the "License");
>  *  you may not use this file except in compliance with the License.
>  *  You may obtain a copy of the License at
>  *
>  *      http://www.apache.org/licenses/LICENSE-2.0
>  *
>  *  Unless required by applicable law or agreed to in writing, software
>  *  distributed under the License is distributed on an "AS IS" BASIS,
>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  *  See the License for the specific language governing permissions and
>  *  limitations under the License.
>  *
>  */
> 
> package org.apache.sandesha.client;
> 
> import org.apache.axis.message.addressing.MessageID;
> 
> import org.apache.sandesha.RMMessage;
> import org.apache.sandesha.RMSequence;
> import org.apache.sandesha.ws.utility.Identifier;
> 
> import java.util.HashMap;
> import java.util.Map;
> 
> /**
>  * @author
>  * Amila Navarathna<br>
>  * Jaliya Ekanayaka<br>
>  * Sudar Nimalan<br>
>  * (Apache Sandesha Project)
>  *
>  */
> public class ClientMessageController {
>         /**
>          * Field instance
>          */
>     private static ClientMessageController instance;
>         /**
>          * Field messageMap
>          */
>     private Map messageMap;
>         /**
>          * Field sequenceMap
>          */
>     private Map sequenceMap;
>         /**
>          * Field seqAck
>          */
> 
>     private Identifier sequenceIdentifier;
> 
>         /**
>          * Constructor ClientMessageController
>          */
>     private ClientMessageController() {
>         sequenceMap = new HashMap();
>         messageMap = new HashMap();
>     }
> 
>         /**
>          * Method getInstance
>          *
>          * @return ClientMessageController
>          */
>      public static ClientMessageController getInstance() {
> 
>         if (instance == null) {
>             instance = new ClientMessageController();
>         }
> 
>         return instance;
>     }
> 
>         /**
>          * Method retrieveIfMessageExists
>          *
>          * returns a RMMessage if a message for the message id exists.
>          * else return a null value
>          * <b>developer must handle the null value returned</b>
>          *
>          * @param messageID
>          * @return RMMessage
>          *
>          *
>          */
> 
>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
>         RMMessage rmMessage = (RMMessage)messageMap.get(messageID.toString());
>         if (rmMessage!= null) {
>             return rmMessage;
>         } else {
>             return null;
>         }
>     }
> 
>     /**
>      * Method storeSequence
>      *
>      * stores a sequence object in the map. Each of these sequence objects
>      * consists of one or more message objects.
>      * The sequences are stored as the sequenceIdentifier as a key
>      *
>      * @param sequence
>      *
>      *
>      */
>     public void storeSequence(RMSequence sequence) {
>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>         sequenceMap.put(sequence.getSequenceIdetifer().toString(), sequence);
>     }
> 
>         /**
>          * Method storeMessage
>          *
>          * stores a message object in the map.
>          * The message are stored as the message id as a key
>          *
>          * @param message
>          *
>          *
>          */
> 
>     public void storeMessage(RMMessage message) {
>         messageMap.put(message.getMessageID().toString(), message);
>     }
> 
>     /**
>      * Method retrieveIfSequenceExists
>      *
>      * returns a RMSequence if a sequence for the identifier exists.
>      * else return a null value
>      * <b>developer must handle the null value returned</b>
>      * @param identifier
>      *
>      * @return RMSequence
>      *
>      *
>      */
>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>         RMSequence rmSequence =
> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>         if (rmSequence != null) {
>             return rmSequence;
>         } else {
>             return null;
>         }
>     }
> 
>         /**
>          * Method removeIfSequenceExists
>          *
>          * Search for a sequence and if it exists(means it is in the map),
>          * remove it from the map
>          *
>          * @param identifier
>          *
>          *
>          */
>         public void removeIfSequenceExists(Identifier identifier) {
>                 if (sequenceMap.get(identifier.toString()) != null) {
>                         sequenceMap.remove(identifier.toString());
>                 }
>         }
>         /**
>          * Method getSequenceIdentifier
>          *
>          * @return Identifier
>          */
>         public Identifier getSequenceIdentifier() {
>                 return sequenceIdentifier;
>         }
> 
>         /**
>          * Method setSequenceIdentifier
>          *
>          * @param  identifier
>          *
>          */
>         public void setSequenceIdentifier(Identifier identifier) {
>                 sequenceIdentifier = identifier;
>         }
> 
> }
> 
> ----------------------------------------
> 
>

Re: Sandesha Exception Handling

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
command 'cvs diff' will work too - here is good documentation about it
http://cvsbook.red-bean.com/cvsbook.html#Finding_Out_What_You__And_Others__Did_--_update_And_diff 


alek

Davanum Srinivas wrote:

>Nimalan,
>
>Please do a compare with existing code in cvs (use a tool like windiff
>or equivalent). I don't remember from the top of my head.
>
>thanks,
>dims
>
>On Thu, 6 May 2004 13:29:39 -0400 (EDT), snimalan@opensource.lk
><sn...@opensource.lk> wrote:
>  
>
>>Hi Dims,
>>Now we are having catch blocks only in follwing classes.
>>1. RMSequence
>>2. RMClientService
>>3. MessageInserter
>>4. RMClientRequestHandler
>>5. RMClientResponseHandler
>>6. RMServerRequestHandler
>>
>>When we are handling the exception for 1,2 and 3 we are using log.error(e)
>>and for 4,5 and 6 we are using AxisFault.makeFault(e).
>>
>>Are we right?
>>Nimalan
>>
>>    
>>
>>>looks ok. PLEASE from next time, make incremental changes and make
>>>them directly to CVS. PLEASE don't work off-line like you did this
>>>time. I fixed a lot of loose ends as well, for example you were
>>>swallowing exceptions, and i changed them to "throw
>>>AxisFault.makeFault()" etc...i'll have start all over again. If you
>>>are doing massive changes, then it's your responsibility to merge any
>>>and every change in CVS with your copy. We all are co-owners of the
>>>code and should work collectively.
>>>
>>>thanks,
>>>dims
>>>
>>>On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
>>><sn...@opensource.lk> wrote:
>>>      
>>>
>>>>Hi Dims,
>>>>
>>>>We have finalized all development work relating to classes with basic
>>>>functionality for WSRM. So, our next commit will make lot of changes to
>>>>the existing classes . To keep your formatting in existing classes, we
>>>>were going through the formatting you did and formatted the new classes
>>>>accordingly.
>>>>We have concerned on the following aspects of formatting.
>>>>1.      Licenses
>>>>2.      Author
>>>>3.      Fields Comments
>>>>4.      Method Comments
>>>>
>>>>Please glance through sample class as shown below and send let us know
>>>>whether it is ok to commit as mentioned.
>>>>
>>>>Regards
>>>>Sandesha Team
>>>>
>>>> ---------------------------------------------------------------------------
>>>>/*
>>>> * Copyright  1999-2004 The Apache Software Foundation.
>>>> *
>>>> *  Licensed under the Apache License, Version 2.0 (the "License");
>>>> *  you may not use this file except in compliance with the License.
>>>> *  You may obtain a copy of the License at
>>>> *
>>>> *      http://www.apache.org/licenses/LICENSE-2.0
>>>> *
>>>> *  Unless required by applicable law or agreed to in writing, software
>>>> *  distributed under the License is distributed on an "AS IS" BASIS,
>>>> *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>>implied.
>>>> *  See the License for the specific language governing permissions and
>>>> *  limitations under the License.
>>>> *
>>>> */
>>>>
>>>>package org.apache.sandesha.client;
>>>>
>>>>import org.apache.axis.message.addressing.MessageID;
>>>>
>>>>import org.apache.sandesha.RMMessage;
>>>>import org.apache.sandesha.RMSequence;
>>>>import org.apache.sandesha.ws.utility.Identifier;
>>>>
>>>>import java.util.HashMap;
>>>>import java.util.Map;
>>>>
>>>>/**
>>>> * @author
>>>> * Amila Navarathna<br>
>>>> * Jaliya Ekanayaka<br>
>>>> * Sudar Nimalan<br>
>>>> * (Apache Sandesha Project)
>>>> *
>>>> */
>>>>public class ClientMessageController {
>>>>        /**
>>>>         * Field instance
>>>>         */
>>>>    private static ClientMessageController instance;
>>>>        /**
>>>>         * Field messageMap
>>>>         */
>>>>    private Map messageMap;
>>>>        /**
>>>>         * Field sequenceMap
>>>>         */
>>>>    private Map sequenceMap;
>>>>        /**
>>>>         * Field seqAck
>>>>         */
>>>>
>>>>    private Identifier sequenceIdentifier;
>>>>
>>>>        /**
>>>>         * Constructor ClientMessageController
>>>>         */
>>>>    private ClientMessageController() {
>>>>        sequenceMap = new HashMap();
>>>>        messageMap = new HashMap();
>>>>    }
>>>>
>>>>        /**
>>>>         * Method getInstance
>>>>         *
>>>>         * @return ClientMessageController
>>>>         */
>>>>     public static ClientMessageController getInstance() {
>>>>
>>>>        if (instance == null) {
>>>>            instance = new ClientMessageController();
>>>>        }
>>>>
>>>>        return instance;
>>>>    }
>>>>
>>>>        /**
>>>>         * Method retrieveIfMessageExists
>>>>         *
>>>>         * returns a RMMessage if a message for the message id exists.
>>>>         * else return a null value
>>>>         * <b>developer must handle the null value returned</b>
>>>>         *
>>>>         * @param messageID
>>>>         * @return RMMessage
>>>>         *
>>>>         *
>>>>         */
>>>>
>>>>    public RMMessage retrieveIfMessageExists(MessageID messageID) {
>>>>        RMMessage rmMessage =
>>>>(RMMessage)messageMap.get(messageID.toString());
>>>>        if (rmMessage!= null) {
>>>>            return rmMessage;
>>>>        } else {
>>>>            return null;
>>>>        }
>>>>    }
>>>>
>>>>    /**
>>>>     * Method storeSequence
>>>>     *
>>>>     * stores a sequence object in the map. Each of these sequence
>>>>objects
>>>>     * consists of one or more message objects.
>>>>     * The sequences are stored as the sequenceIdentifier as a key
>>>>     *
>>>>     * @param sequence
>>>>     *
>>>>     *
>>>>     */
>>>>    public void storeSequence(RMSequence sequence) {
>>>>        //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>>>>        sequenceMap.put(sequence.getSequenceIdetifer().toString(),
>>>>sequence);
>>>>    }
>>>>
>>>>        /**
>>>>         * Method storeMessage
>>>>         *
>>>>         * stores a message object in the map.
>>>>         * The message are stored as the message id as a key
>>>>         *
>>>>         * @param message
>>>>         *
>>>>         *
>>>>         */
>>>>
>>>>    public void storeMessage(RMMessage message) {
>>>>        messageMap.put(message.getMessageID().toString(), message);
>>>>    }
>>>>
>>>>    /**
>>>>     * Method retrieveIfSequenceExists
>>>>     *
>>>>     * returns a RMSequence if a sequence for the identifier exists.
>>>>     * else return a null value
>>>>     * <b>developer must handle the null value returned</b>
>>>>     * @param identifier
>>>>     *
>>>>     * @return RMSequence
>>>>     *
>>>>     *
>>>>     */
>>>>    public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>>>>        RMSequence rmSequence =
>>>>(RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>>>>        if (rmSequence != null) {
>>>>            return rmSequence;
>>>>        } else {
>>>>            return null;
>>>>        }
>>>>    }
>>>>
>>>>        /**
>>>>         * Method removeIfSequenceExists
>>>>         *
>>>>         * Search for a sequence and if it exists(means it is in the
>>>>map),
>>>>         * remove it from the map
>>>>         *
>>>>         * @param identifier
>>>>         *
>>>>         *
>>>>         */
>>>>        public void removeIfSequenceExists(Identifier identifier) {
>>>>                if (sequenceMap.get(identifier.toString()) != null) {
>>>>                        sequenceMap.remove(identifier.toString());
>>>>                }
>>>>        }
>>>>        /**
>>>>         * Method getSequenceIdentifier
>>>>         *
>>>>         * @return Identifier
>>>>         */
>>>>        public Identifier getSequenceIdentifier() {
>>>>                return sequenceIdentifier;
>>>>        }
>>>>
>>>>        /**
>>>>         * Method setSequenceIdentifier
>>>>         *
>>>>         * @param  identifier
>>>>         *
>>>>         */
>>>>        public void setSequenceIdentifier(Identifier identifier) {
>>>>                sequenceIdentifier = identifier;
>>>>        }
>>>>
>>>>}
>>>>
>>>>----------------------------------------
>>>>
>>>>
>>>>        
>>>>
>>>      
>>>
>>    
>>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: Sandesha Exception Handling

Posted by Davanum Srinivas <da...@gmail.com>.
Nimalan,

Please do a compare with existing code in cvs (use a tool like windiff
or equivalent). I don't remember from the top of my head.

thanks,
dims

On Thu, 6 May 2004 13:29:39 -0400 (EDT), snimalan@opensource.lk
<sn...@opensource.lk> wrote:
> 
> Hi Dims,
> Now we are having catch blocks only in follwing classes.
> 1. RMSequence
> 2. RMClientService
> 3. MessageInserter
> 4. RMClientRequestHandler
> 5. RMClientResponseHandler
> 6. RMServerRequestHandler
> 
> When we are handling the exception for 1,2 and 3 we are using log.error(e)
> and for 4,5 and 6 we are using AxisFault.makeFault(e).
> 
> Are we right?
> Nimalan
> 
> > looks ok. PLEASE from next time, make incremental changes and make
> > them directly to CVS. PLEASE don't work off-line like you did this
> > time. I fixed a lot of loose ends as well, for example you were
> > swallowing exceptions, and i changed them to "throw
> > AxisFault.makeFault()" etc...i'll have start all over again. If you
> > are doing massive changes, then it's your responsibility to merge any
> > and every change in CVS with your copy. We all are co-owners of the
> > code and should work collectively.
> >
> > thanks,
> > dims
> >
> > On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
> > <sn...@opensource.lk> wrote:
> >>
> >> Hi Dims,
> >>
> >> We have finalized all development work relating to classes with basic
> >> functionality for WSRM. So, our next commit will make lot of changes to
> >> the existing classes . To keep your formatting in existing classes, we
> >> were going through the formatting you did and formatted the new classes
> >> accordingly.
> >> We have concerned on the following aspects of formatting.
> >> 1.      Licenses
> >> 2.      Author
> >> 3.      Fields Comments
> >> 4.      Method Comments
> >>
> >> Please glance through sample class as shown below and send let us know
> >> whether it is ok to commit as mentioned.
> >>
> >> Regards
> >> Sandesha Team
> >>
> >>  ---------------------------------------------------------------------------
> >> /*
> >>  * Copyright  1999-2004 The Apache Software Foundation.
> >>  *
> >>  *  Licensed under the Apache License, Version 2.0 (the "License");
> >>  *  you may not use this file except in compliance with the License.
> >>  *  You may obtain a copy of the License at
> >>  *
> >>  *      http://www.apache.org/licenses/LICENSE-2.0
> >>  *
> >>  *  Unless required by applicable law or agreed to in writing, software
> >>  *  distributed under the License is distributed on an "AS IS" BASIS,
> >>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> >> implied.
> >>  *  See the License for the specific language governing permissions and
> >>  *  limitations under the License.
> >>  *
> >>  */
> >>
> >> package org.apache.sandesha.client;
> >>
> >> import org.apache.axis.message.addressing.MessageID;
> >>
> >> import org.apache.sandesha.RMMessage;
> >> import org.apache.sandesha.RMSequence;
> >> import org.apache.sandesha.ws.utility.Identifier;
> >>
> >> import java.util.HashMap;
> >> import java.util.Map;
> >>
> >> /**
> >>  * @author
> >>  * Amila Navarathna<br>
> >>  * Jaliya Ekanayaka<br>
> >>  * Sudar Nimalan<br>
> >>  * (Apache Sandesha Project)
> >>  *
> >>  */
> >> public class ClientMessageController {
> >>         /**
> >>          * Field instance
> >>          */
> >>     private static ClientMessageController instance;
> >>         /**
> >>          * Field messageMap
> >>          */
> >>     private Map messageMap;
> >>         /**
> >>          * Field sequenceMap
> >>          */
> >>     private Map sequenceMap;
> >>         /**
> >>          * Field seqAck
> >>          */
> >>
> >>     private Identifier sequenceIdentifier;
> >>
> >>         /**
> >>          * Constructor ClientMessageController
> >>          */
> >>     private ClientMessageController() {
> >>         sequenceMap = new HashMap();
> >>         messageMap = new HashMap();
> >>     }
> >>
> >>         /**
> >>          * Method getInstance
> >>          *
> >>          * @return ClientMessageController
> >>          */
> >>      public static ClientMessageController getInstance() {
> >>
> >>         if (instance == null) {
> >>             instance = new ClientMessageController();
> >>         }
> >>
> >>         return instance;
> >>     }
> >>
> >>         /**
> >>          * Method retrieveIfMessageExists
> >>          *
> >>          * returns a RMMessage if a message for the message id exists.
> >>          * else return a null value
> >>          * <b>developer must handle the null value returned</b>
> >>          *
> >>          * @param messageID
> >>          * @return RMMessage
> >>          *
> >>          *
> >>          */
> >>
> >>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
> >>         RMMessage rmMessage =
> >> (RMMessage)messageMap.get(messageID.toString());
> >>         if (rmMessage!= null) {
> >>             return rmMessage;
> >>         } else {
> >>             return null;
> >>         }
> >>     }
> >>
> >>     /**
> >>      * Method storeSequence
> >>      *
> >>      * stores a sequence object in the map. Each of these sequence
> >> objects
> >>      * consists of one or more message objects.
> >>      * The sequences are stored as the sequenceIdentifier as a key
> >>      *
> >>      * @param sequence
> >>      *
> >>      *
> >>      */
> >>     public void storeSequence(RMSequence sequence) {
> >>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
> >>         sequenceMap.put(sequence.getSequenceIdetifer().toString(),
> >> sequence);
> >>     }
> >>
> >>         /**
> >>          * Method storeMessage
> >>          *
> >>          * stores a message object in the map.
> >>          * The message are stored as the message id as a key
> >>          *
> >>          * @param message
> >>          *
> >>          *
> >>          */
> >>
> >>     public void storeMessage(RMMessage message) {
> >>         messageMap.put(message.getMessageID().toString(), message);
> >>     }
> >>
> >>     /**
> >>      * Method retrieveIfSequenceExists
> >>      *
> >>      * returns a RMSequence if a sequence for the identifier exists.
> >>      * else return a null value
> >>      * <b>developer must handle the null value returned</b>
> >>      * @param identifier
> >>      *
> >>      * @return RMSequence
> >>      *
> >>      *
> >>      */
> >>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
> >>         RMSequence rmSequence =
> >> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
> >>         if (rmSequence != null) {
> >>             return rmSequence;
> >>         } else {
> >>             return null;
> >>         }
> >>     }
> >>
> >>         /**
> >>          * Method removeIfSequenceExists
> >>          *
> >>          * Search for a sequence and if it exists(means it is in the
> >> map),
> >>          * remove it from the map
> >>          *
> >>          * @param identifier
> >>          *
> >>          *
> >>          */
> >>         public void removeIfSequenceExists(Identifier identifier) {
> >>                 if (sequenceMap.get(identifier.toString()) != null) {
> >>                         sequenceMap.remove(identifier.toString());
> >>                 }
> >>         }
> >>         /**
> >>          * Method getSequenceIdentifier
> >>          *
> >>          * @return Identifier
> >>          */
> >>         public Identifier getSequenceIdentifier() {
> >>                 return sequenceIdentifier;
> >>         }
> >>
> >>         /**
> >>          * Method setSequenceIdentifier
> >>          *
> >>          * @param  identifier
> >>          *
> >>          */
> >>         public void setSequenceIdentifier(Identifier identifier) {
> >>                 sequenceIdentifier = identifier;
> >>         }
> >>
> >> }
> >>
> >> ----------------------------------------
> >>
> >>
> >
> >
> 
>

Sandesha Exception Handling

Posted by sn...@opensource.lk.
Hi Dims,
Now we are having catch blocks only in follwing classes.
1. RMSequence
2. RMClientService
3. MessageInserter
4. RMClientRequestHandler
5. RMClientResponseHandler
6. RMServerRequestHandler

When we are handling the exception for 1,2 and 3 we are using log.error(e)
and for 4,5 and 6 we are using AxisFault.makeFault(e).

Are we right?
Nimalan


> looks ok. PLEASE from next time, make incremental changes and make
> them directly to CVS. PLEASE don't work off-line like you did this
> time. I fixed a lot of loose ends as well, for example you were
> swallowing exceptions, and i changed them to "throw
> AxisFault.makeFault()" etc...i'll have start all over again. If you
> are doing massive changes, then it's your responsibility to merge any
> and every change in CVS with your copy. We all are co-owners of the
> code and should work collectively.
>
> thanks,
> dims
>
> On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
> <sn...@opensource.lk> wrote:
>>
>> Hi Dims,
>>
>> We have finalized all development work relating to classes with basic
>> functionality for WSRM. So, our next commit will make lot of changes to
>> the existing classes . To keep your formatting in existing classes, we
>> were going through the formatting you did and formatted the new classes
>> accordingly.
>> We have concerned on the following aspects of formatting.
>> 1.      Licenses
>> 2.      Author
>> 3.      Fields Comments
>> 4.      Method Comments
>>
>> Please glance through sample class as shown below and send let us know
>> whether it is ok to commit as mentioned.
>>
>> Regards
>> Sandesha Team
>>
>>  ---------------------------------------------------------------------------
>> /*
>>  * Copyright  1999-2004 The Apache Software Foundation.
>>  *
>>  *  Licensed under the Apache License, Version 2.0 (the "License");
>>  *  you may not use this file except in compliance with the License.
>>  *  You may obtain a copy of the License at
>>  *
>>  *      http://www.apache.org/licenses/LICENSE-2.0
>>  *
>>  *  Unless required by applicable law or agreed to in writing, software
>>  *  distributed under the License is distributed on an "AS IS" BASIS,
>>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>  *  See the License for the specific language governing permissions and
>>  *  limitations under the License.
>>  *
>>  */
>>
>> package org.apache.sandesha.client;
>>
>> import org.apache.axis.message.addressing.MessageID;
>>
>> import org.apache.sandesha.RMMessage;
>> import org.apache.sandesha.RMSequence;
>> import org.apache.sandesha.ws.utility.Identifier;
>>
>> import java.util.HashMap;
>> import java.util.Map;
>>
>> /**
>>  * @author
>>  * Amila Navarathna<br>
>>  * Jaliya Ekanayaka<br>
>>  * Sudar Nimalan<br>
>>  * (Apache Sandesha Project)
>>  *
>>  */
>> public class ClientMessageController {
>>         /**
>>          * Field instance
>>          */
>>     private static ClientMessageController instance;
>>         /**
>>          * Field messageMap
>>          */
>>     private Map messageMap;
>>         /**
>>          * Field sequenceMap
>>          */
>>     private Map sequenceMap;
>>         /**
>>          * Field seqAck
>>          */
>>
>>     private Identifier sequenceIdentifier;
>>
>>         /**
>>          * Constructor ClientMessageController
>>          */
>>     private ClientMessageController() {
>>         sequenceMap = new HashMap();
>>         messageMap = new HashMap();
>>     }
>>
>>         /**
>>          * Method getInstance
>>          *
>>          * @return ClientMessageController
>>          */
>>      public static ClientMessageController getInstance() {
>>
>>         if (instance == null) {
>>             instance = new ClientMessageController();
>>         }
>>
>>         return instance;
>>     }
>>
>>         /**
>>          * Method retrieveIfMessageExists
>>          *
>>          * returns a RMMessage if a message for the message id exists.
>>          * else return a null value
>>          * <b>developer must handle the null value returned</b>
>>          *
>>          * @param messageID
>>          * @return RMMessage
>>          *
>>          *
>>          */
>>
>>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
>>         RMMessage rmMessage =
>> (RMMessage)messageMap.get(messageID.toString());
>>         if (rmMessage!= null) {
>>             return rmMessage;
>>         } else {
>>             return null;
>>         }
>>     }
>>
>>     /**
>>      * Method storeSequence
>>      *
>>      * stores a sequence object in the map. Each of these sequence
>> objects
>>      * consists of one or more message objects.
>>      * The sequences are stored as the sequenceIdentifier as a key
>>      *
>>      * @param sequence
>>      *
>>      *
>>      */
>>     public void storeSequence(RMSequence sequence) {
>>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>>         sequenceMap.put(sequence.getSequenceIdetifer().toString(),
>> sequence);
>>     }
>>
>>         /**
>>          * Method storeMessage
>>          *
>>          * stores a message object in the map.
>>          * The message are stored as the message id as a key
>>          *
>>          * @param message
>>          *
>>          *
>>          */
>>
>>     public void storeMessage(RMMessage message) {
>>         messageMap.put(message.getMessageID().toString(), message);
>>     }
>>
>>     /**
>>      * Method retrieveIfSequenceExists
>>      *
>>      * returns a RMSequence if a sequence for the identifier exists.
>>      * else return a null value
>>      * <b>developer must handle the null value returned</b>
>>      * @param identifier
>>      *
>>      * @return RMSequence
>>      *
>>      *
>>      */
>>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>>         RMSequence rmSequence =
>> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>>         if (rmSequence != null) {
>>             return rmSequence;
>>         } else {
>>             return null;
>>         }
>>     }
>>
>>         /**
>>          * Method removeIfSequenceExists
>>          *
>>          * Search for a sequence and if it exists(means it is in the
>> map),
>>          * remove it from the map
>>          *
>>          * @param identifier
>>          *
>>          *
>>          */
>>         public void removeIfSequenceExists(Identifier identifier) {
>>                 if (sequenceMap.get(identifier.toString()) != null) {
>>                         sequenceMap.remove(identifier.toString());
>>                 }
>>         }
>>         /**
>>          * Method getSequenceIdentifier
>>          *
>>          * @return Identifier
>>          */
>>         public Identifier getSequenceIdentifier() {
>>                 return sequenceIdentifier;
>>         }
>>
>>         /**
>>          * Method setSequenceIdentifier
>>          *
>>          * @param  identifier
>>          *
>>          */
>>         public void setSequenceIdentifier(Identifier identifier) {
>>                 sequenceIdentifier = identifier;
>>         }
>>
>> }
>>
>> ----------------------------------------
>>
>>
>
>