[ 
https://issues.apache.org/jira/browse/CAMEL-6655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13749450#comment-13749450
 ] 

Christian Müller edited comment on CAMEL-6655 at 8/25/13 2:33 PM:
------------------------------------------------------------------

Your proposed solution looks a bit clumsy to me. ;-)

I'm working on a solution where you can do something like this:

{code}
Map<Short, Object> optionalParameters = new LinkedHashMap<Short, Object>();
// standard optional parameter
optionalParameters.put(Short.valueOf((short) 0x0202), "1292".getBytes("UTF-8"));
optionalParameters.put(Short.valueOf((short) 0x001D), "urgent");
optionalParameters.put(Short.valueOf((short) 0x0005), Byte.valueOf("4"));
optionalParameters.put(Short.valueOf((short) 0x0008), Short.valueOf((short) 2));
optionalParameters.put(Short.valueOf((short) 0x0017), Integer.valueOf(3600000));
optionalParameters.put(Short.valueOf((short) 0x130C), null);
// vendor specific optional parameter
optionalParameters.put(Short.valueOf((short) 0x2150), "0815".getBytes("UTF-8"));
optionalParameters.put(Short.valueOf((short) 0x2151), "0816");
optionalParameters.put(Short.valueOf((short) 0x2152), Byte.valueOf("6"));
optionalParameters.put(Short.valueOf((short) 0x2153), Short.valueOf((short) 9));
optionalParameters.put(Short.valueOf((short) 0x2154), Integer.valueOf(7400000));
optionalParameters.put(Short.valueOf((short) 0x2155), null);
exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETER, 
optionalParameters);
{code}

There is a convention for the transformation:
byte[]  -> OctetString
String  -> COctetString
Byte    -> Byte
Short   -> Short
Integer -> Int
Null    -> Null

My plan is to deprecate the current solution (providing the name instead of a 
short) and remove it in Camel 2.13.0/3.0.0.

What do you think? 
                
      was (Author: muellerc):
    Your proposed solution looks a bit clumsy to me. ;-)

I'm working on a solution where you can do something like this:

{code}
Map<Short, Object> optionalParameters = new LinkedHashMap<Short, Object>();
// standard optional parameter
optionalParameters.put(Short.valueOf((short) 0x0202), "1292".getBytes("UTF-8"));
optionalParameters.put(Short.valueOf((short) 0x001D), "urgent");
optionalParameters.put(Short.valueOf((short) 0x0005), Byte.valueOf("4"));
optionalParameters.put(Short.valueOf((short) 0x0008), Short.valueOf((short) 2));
optionalParameters.put(Short.valueOf((short) 0x0017), Integer.valueOf(3600000));
optionalParameters.put(Short.valueOf((short) 0x130C), null);
// vendor specific optional parameter
optionalParameters.put(Short.valueOf((short) 0x2150), "0815".getBytes("UTF-8"));
optionalParameters.put(Short.valueOf((short) 0x2151), "0816");
optionalParameters.put(Short.valueOf((short) 0x2152), Byte.valueOf("6"));
optionalParameters.put(Short.valueOf((short) 0x2153), Short.valueOf((short) 9));
optionalParameters.put(Short.valueOf((short) 0x2154), Integer.valueOf(7400000));
optionalParameters.put(Short.valueOf((short) 0x2155), null);
exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETERS, 
optionalParameters);
{code}

There is a convention for the transformation:
byte[]  -> OctetString
String  -> COctetString
Byte    -> Byte
Short   -> Short
Integer -> Int
Null    -> Null

My plan is to deprecate the current solution (providing the name instead of a 
short) and remove it in Camel 2.13.0/3.0.0.

What do you think? 
                  
> SMPP - add support of Vendor Specific Optional Parameter 
> ---------------------------------------------------------
>
>                 Key: CAMEL-6655
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6655
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-smpp
>    Affects Versions: 2.11.1
>            Reporter: Peter Li
>            Assignee: Christian Müller
>             Fix For: 2.10.7, 2.11.2, 2.12.0
>
>
> SMPP v3.4 specification has reserved a range of identifiers from 0x1400 to 
> 0x3FFF as vendor specific optional parameter.  There are increasing demand of 
> using this optional parameter from SMSC.  However, Camel SMPP component only 
> support other static defined optional parameters, so hereby request an 
> enhancement of smpp component to support user input of vendor specific 
> optional parameter.   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to