Package net.sf.jml.util

Examples of net.sf.jml.util.StringHolder


            okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
            okSlpMessage.setCallId(msnslpRequest.getCallId());
            okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
            okSlpMessage.setContentType(msnslpRequest.getContentType());

            StringHolder body = new StringHolder();
            body.setProperty("SessionID", fileTransfer.getID());

            okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                    + "\0");

            int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                    .toString()).length;
View Full Code Here


        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");

        int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                .toString()).length;
View Full Code Here

        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");

        int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                .toString()).length;
View Full Code Here

    okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
    okSlpMessage.setCallId(msnslpRequest.getCallId());
    okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
    okSlpMessage.setContentType(msnslpRequest.getContentType());
    sessionId = msnslpRequest.getBodys().getIntProperty("SessionID", -1);
    StringHolder body = new StringHolder();
    body.setProperty("SessionID", sessionId);
    okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
        + "\0");

    int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
        .toString()).length;
View Full Code Here

* @author Roger Chen
*/
public class MsnInvitationMessageFactory {

    public static MsnInvitationMessage parseMessage(String s) {
        StringHolder properties = new StringHolder();
        properties.parseString(s);

        String command = properties
                .getProperty(InvitationConstants.KEY_INVITATION_COMMAND);
        if (command.equalsIgnoreCase(InvitationConstants.COMMAND_INVITE)) {
            return parseInviteMessage(properties);
        } else if (command.equalsIgnoreCase(InvitationConstants.COMMAND_ACCEPT)) {
            return parseAcceptMessage(properties);
View Full Code Here

            okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
            okSlpMessage.setCallId(msnslpRequest.getCallId());
            okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
            okSlpMessage.setContentType(msnslpRequest.getContentType());

            StringHolder body = new StringHolder();
            body.setProperty("SessionID", fileTransfer.getID());

            okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                    + "\0");

            int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                    .toString()).length;
View Full Code Here

        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");

        int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                .toString()).length;
View Full Code Here

        okSlpMessage.setCSeq(msnslpRequest.getCSeq() + 1);
        okSlpMessage.setCallId(msnslpRequest.getCallId());
        okSlpMessage.setMaxForwards(msnslpRequest.getMaxForwards());
        okSlpMessage.setContentType(msnslpRequest.getContentType());

        StringHolder body = new StringHolder();
        body.setProperty("SessionID", fileTransfer.getID());
        okSlpMessage.setBody(body.toString() + JmlConstants.LINE_SEPARATOR
                + "\0");

        int okSlpMessageLength = Charset.encodeAsByteArray(okSlpMessage
                .toString()).length;
View Full Code Here

        String messageId = "{" + GUID.createRandomGuid() + "}";
        for (int i = 0; i < outgoing.length; i++) {
            outgoing[i] = new OutgoingMSG(protocol);
            outgoing[i].setMsgType(OutgoingMSG.TYPE_ACKNOWLEDGE_WHEN_ERROR);

            StringHolder holder;
            if (body.length == 1)
                holder = headers;
            else {
                holder = (StringHolder) headers.clone();
                holder.setProperty(KEY_MESSAGE_ID, messageId);
                if (i == 0)
                    holder.setProperty(KEY_CHUNKS, body.length);
                else
                    holder.setProperty(KEY_CHUNK, i);

            }
            ByteBuffer header = Charset.encode(holder.toString()
                    + JmlConstants.LINE_SEPARATOR);

            byte[] b = new byte[body[i].remaining() + header.remaining()];
            ByteBuffer buffer = ByteBuffer.wrap(b);
            buffer.put(header);
View Full Code Here

        req.setCSeq(0);
        req.setCallId(generateNewCallId());
        req.setMaxForwards(0);
        req.setContentType("application/x-msnmsgr-sessionreqbody");

        StringHolder body = new StringHolder();
    body.setProperty(MsnFileInviteMessage.KEY_GUID_EUF,
                 MsnFileInviteMessage.GUID_EUF);
    body.setProperty("SessionID", lastRandomIdentifier);
    body.setProperty("AppID", 2);
        try
        {
            body.setProperty(MsnP2PInvitationMessage.KEY_CONTEXT,
                MsnFileContextParser.getEncodedContext(file));
        }
        catch (UnsupportedEncodingException ex)
        {
            logger.error("", ex);
        }

    req.setBody(body.toString() +
            JmlConstants.LINE_SEPARATOR + "\0");

        // Get the size of the message to be setted
        int slpMessageLength = Charset.encodeAsByteArray(req.toString()).length;
        invite.setTotalLength(slpMessageLength);
View Full Code Here

TOP

Related Classes of net.sf.jml.util.StringHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.