Package net.sf.jml.protocol.msnslp

Examples of net.sf.jml.protocol.msnslp.MsnslpResponse


    public void startFileTransfer()
    {
        if(fileTransfer.isReceiver())
        {
            MsnslpMessage msnslpRequest = fileTransfer.getReqMessage().getSlpMessage();
            MsnslpResponse okSlpMessage = new MsnslpResponse();
            okSlpMessage.setTo(msnslpRequest.getFrom());
            okSlpMessage.setFrom(msnslpRequest.getTo());
            okSlpMessage.setVia(msnslpRequest.getVia());
            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;

            MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
            okMessage.setSlpMessage(okSlpMessage);
            okMessage.setIdentifier(getNextIdentifier());
View Full Code Here


    private void sendDecline()
    {
        MsnslpMessage msnslpRequest =
            fileTransfer.getReqMessage().getSlpMessage();

        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(603);
        okSlpMessage.setReasonPhrase("Decline");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        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;

        MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
        okMessage.setSlpMessage(okSlpMessage);
        okMessage.setIdentifier(getNextIdentifier());
View Full Code Here

  }

    public void sendDeny(MsnP2PSlpMessage msg)
    {
        MsnslpRequest msnslpRequest = (MsnslpRequest)msg.getSlpMessage();
        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(405);
        okSlpMessage.setReasonPhrase("Not supported");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        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;

        MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
        okMessage.setSlpMessage(okSlpMessage);
        okMessage.setIdentifier(getNextIdentifier());
View Full Code Here

          return new MsnFileByeMessage();
        }
      }
            else if (msg instanceof MsnslpResponse)
            {
                MsnslpResponse msnslpResponse =
                    (MsnslpResponse)slpMessage.getSlpMessage();

                switch(msnslpResponse.getStatusCode())
                {
                    case 200 :
                        return new MsnFileOkMessage();
                    case 603 :
                        return new MsnFileDeclineMessage();
View Full Code Here

    private static final Log logger = LogFactory.getLog(MsnFileOkMessage.class);

  @Override
  protected void messageReceived(MsnSession session, MsnContact contact)
    {
        MsnslpResponse msnslpResponse = (MsnslpResponse) getSlpMessage();
        String sessionID = msnslpResponse.getBodys().getProperty("SessionID");

        MsnFileTransferImpl ft = (MsnFileTransferImpl)session.getMessenger().
            getFileTransferManager().getFileTransfer(sessionID);
        ft.setContact(contact);
        ft.refuse();
View Full Code Here

          return new MsnFileByeMessage();
        }
      }
            else if (msg instanceof MsnslpResponse)
            {
                MsnslpResponse msnslpResponse =
                    (MsnslpResponse)slpMessage.getSlpMessage();

                switch(msnslpResponse.getStatusCode())
                {
                    case 200 :
                        return new MsnFileOkMessage();
                    case 603 :
                        return new MsnFileDeclineMessage();
View Full Code Here

  }
     
  @Override
  protected void messageReceived(MsnSession session, MsnContact contact)
    {
        MsnslpResponse msnslpResponse = (MsnslpResponse) getSlpMessage();
        String sessionID = msnslpResponse.getBodys().getProperty("SessionID");

        if(sessionID == null)
            return;

        MsnFileTransferImpl ft = (MsnFileTransferImpl)session.getMessenger().
View Full Code Here

    public void startFileTransfer()
    {
        if(fileTransfer.isReceiver())
        {
            MsnslpMessage msnslpRequest = fileTransfer.getReqMessage().getSlpMessage();
            MsnslpResponse okSlpMessage = new MsnslpResponse();
            okSlpMessage.setTo(msnslpRequest.getFrom());
            okSlpMessage.setFrom(msnslpRequest.getTo());
            okSlpMessage.setVia(msnslpRequest.getVia());
            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;

            MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
            okMessage.setSlpMessage(okSlpMessage);
            okMessage.setIdentifier(getNextIdentifier());
View Full Code Here

    private void sendDecline()
    {
        MsnslpMessage msnslpRequest =
            fileTransfer.getReqMessage().getSlpMessage();

        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(603);
        okSlpMessage.setReasonPhrase("Decline");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        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;

        MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
        okMessage.setSlpMessage(okSlpMessage);
        okMessage.setIdentifier(getNextIdentifier());
View Full Code Here

  }

    public void sendDeny(MsnP2PSlpMessage msg)
    {
        MsnslpRequest msnslpRequest = (MsnslpRequest)msg.getSlpMessage();
        MsnslpResponse okSlpMessage = new MsnslpResponse();
        okSlpMessage.setStatusCode(405);
        okSlpMessage.setReasonPhrase("Not supported");
        okSlpMessage.setTo(msnslpRequest.getFrom());
        okSlpMessage.setFrom(msnslpRequest.getTo());
        okSlpMessage.setVia(msnslpRequest.getVia());
        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;

        MsnP2PSlpMessage okMessage = new MsnP2PSlpMessage();
        okMessage.setSlpMessage(okSlpMessage);
        okMessage.setIdentifier(getNextIdentifier());
View Full Code Here

TOP

Related Classes of net.sf.jml.protocol.msnslp.MsnslpResponse

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.