Package net.solosky.maplefetion.sipc

Examples of net.solosky.maplefetion.sipc.SipcRequest


    private class ServerKeepAliveTask extends TimerTask
    {
        @Override
        public void run()
        {
          SipcRequest request = messageFactory.createKeepAliveRequest();
          request.setResponseHandler(new KeepAliveResponseHandler(context, null, null));
          process(request);
        }
View Full Code Here


     * @param userId
     * @return
     */
    public SipcRequest createDeclineApplicationRequest(int userId)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
      String body = MessageTemplate.TMPL_APPLICATION_DECLINED;
      body = body.replace("{userId}", Integer.toString(userId));
     
      req.addHeader(SipcHeader.EVENT,"HandleContactRequestV4");
     
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

     * @param updateXML 更新的XML
     * @return
     */
    public SipcRequest createSetPersonalInfoRequest()
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
     
      NodeBuilder builder = new NodeBuilder();
      //因为用户可以改变自己的信息,这里权限改变了所以不使用BeanHelper来处理
      builder.add("nickname", StringHelper.qouteHtmlSpecialChars(user.getNickName()));
      builder.add("impresa",  StringHelper.qouteHtmlSpecialChars(user.getImpresa()));
      //用户扩展信息。.TODO ..
        //BeanHelper.toUpdateXML(BuddyExtend.class, this.client.getFetionUser(), builder);
     
      String body = MessageTemplate.TMPL_SET_PERSONAL_INFO;
      body = body.replace("{personal}", builder.toXML("personal"));
     
      req.addHeader(SipcHeader.EVENT,"SetUserInfoV4");
     
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

     * @param localName  本地显示名字
     * @return
     */
    public SipcRequest createSetBuddyLocalName(int userId, String localName)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
     
      String body = MessageTemplate.TMPL_SET_BUDDY_LOCAL_NAME;
      body = body.replace("{userId}", Integer.toString(userId));
      body = body.replace("{localName}", localName);
     
      req.addHeader(SipcHeader.EVENT,"SetContactInfoV4");
     
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

     * @param cordId
     * @return
     */
    public SipcRequest createSetBuddyCord(int userId, String cordId)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
     
      String body = MessageTemplate.TMPL_SET_BUDDY_CORD;
      body = body.replace("{userId}", Integer.toString(userId));
      body = body.replace("{cordId}", cordId!=null?cordId:"");
     
      req.addHeader(SipcHeader.EVENT,"SetContactInfoV4");
     
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

    /**
     * 建立新的分组
     */
    public SipcRequest createCreateCordRequest(String title)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
      req.addHeader(SipcHeader.EVENT,"CreateBuddyList");
     
      req.setBody(new SipcBody(MessageTemplate.TMPL_CREATE_CORD.replace("{title}", title)) );
      return req;
    }
View Full Code Here

    /**
     * 删除分组
     */
    public SipcRequest createDeleteCordRequest(int cordId)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
      req.addHeader(SipcHeader.EVENT,"DeleteBuddyList");
     
      req.setBody(new SipcBody(MessageTemplate.TMPL_DELETE_CORD.replace("{cordId}", Integer.toString(cordId))) );
      return req;
    }
View Full Code Here

    /**
     * 更新分组标题
     */
    public SipcRequest createSetCordTitleRequest(int cordId, String title)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
      req.addHeader(SipcHeader.EVENT,"SetBuddyListInfo");
     
      String body = MessageTemplate.TMPL_UPDATE_CORD;
      body = body.replace("{cordId}", Integer.toString(cordId));
      body = body.replace("{title}", title);
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

    /**
     * 设置在线状态
     */
    public SipcRequest createSetPresenceRequest(int presence)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.SERVICE);
     
      String body = MessageTemplate.TMPL_SET_PRESENCE;
      body = body.replace("{presence}", Integer.toString(presence));
     
      req.addHeader(SipcHeader.EVENT,"SetPresenceV4");
     
      req.setBody(new SipcBody(body));
      return req;
    }
View Full Code Here

    /**
     * 退出客户端
     */
    public SipcRequest createLogoutRequest(String uri)
    {
      SipcRequest req = this.createDefaultSipcRequest(SipcMethod.BYE);
     
      req.addHeader(SipcHeader.TO, uri);
      return req;
    }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.sipc.SipcRequest

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.