Examples of resource()


Examples of com.sissi.context.JID.resource()

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    return this.room.build(group).allowed(context.jid(), RoomConfig.CHANGENICK, group.resource()) ? this.writeAndReturn(context, protocol) : true;
  }

  private boolean writeAndReturn(JIDContext context, Protocol protocol) {
    context.write(protocol.parent().reply().setError(this.error));
    return false;
View Full Code Here

Examples of com.sissi.context.JID.resource()

  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    String nickname = group.resource();
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    // relation.activate(),如果已进入房间. group.resource().equals(relation.name()), 昵称未变
    return relation.activate() ? group.resource().equals(relation.name()) ? this.resend ? this.proxy.input(context, protocol) : false : this.writeAndReturn(context, group, nickname, relation) : true;
  }
View Full Code Here

Examples of com.sissi.context.JID.resource()

  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    String nickname = group.resource();
    MucRelation relation = super.ourRelation(context.jid(), group).cast(MucRelation.class);
    // relation.activate(),如果已进入房间. group.resource().equals(relation.name()), 昵称未变
    return relation.activate() ? group.resource().equals(relation.name()) ? this.resend ? this.proxy.input(context, protocol) : false : this.writeAndReturn(context, group, nickname, relation) : true;
  }

  private boolean writeAndReturn(JIDContext context, JID group, String nickname, MucRelation relation) {
    Room room = this.room.build(group);
    // 通知其他房客昵称修改
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                b.append(escapeString(key)).append("=").append(escapeString(value));
            }
        }
        String querystring = b.toString();

        Builder builder = client.resource(host + path + querystring).accept("application/json");
        for (String key : headerParams.keySet()) {
            builder.header(key, headerParams.get(key));
        }

        for (String key : defaultHeaderMap.keySet()) {
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                b.append(escapeString(key)).append("=").append(escapeString(value));
            }
        }
        String querystring = b.toString();

        Builder builder = client.resource(host + path + querystring).accept("application/json");
        for (String key : headerParams.keySet()) {
            builder.header(key, headerParams.get(key));
        }

        for (String key : defaultHeaderMap.keySet()) {
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

        }

        String locationHeaderValue =
            response.getHeaders().getFirst(HttpHeaders.LOCATION);
        Client c = Client.create();
        WebResource tmp = c.resource(locationHeaderValue);
        if (isAuthenticationEnabled()) {
          tmp = tmp.queryParam("user.name", webserviceUserName);
        }
        response = tmp.get(ClientResponse.class);
        assertEquals(Status.OK, response.getClientResponseStatus());
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

 
  protected void lookup(int duration, String fingerprint) {
    Client client = Client.create();
    client.addFilter(new LoggingFilter(System.out));
    client.addFilter(new GZIPContentEncodingFilter(true));
    WebResource webResource = client.resource(this.ACOUSTID_SERVICE_URL);
   
// DONE: convert this (parameter in url) to form encoded post
//    JSONObject object = webResource.queryParam("client", SERVICE_KEY)
//          .queryParam("duration", "341")
//          .queryParam("meta", "recordings releasegroups")
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                    c.addFilter(new HTTPBasicAuthFilter(squeezeboxServerUsername, squeezeboxServerPasswordHash));
                }
            }
            JSONObject response = null;
            if (squeezeboxServerPasswordHash != null && squeezeboxServerPasswordHash.length() > 0) {
                response = c.resource(SERVICE_URL).accept("application/json").header("X-Scanner", 1).post(JSONObject.class, request);
            } else {
                response = c.resource(SERVICE_URL).accept("application/json").post(JSONObject.class, request);
            }
            ObjectMapper mapper = new ObjectMapper();
            trackList = mapper.readValue(response.getString("result"), TrackListData.class);
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

            }
            JSONObject response = null;
            if (squeezeboxServerPasswordHash != null && squeezeboxServerPasswordHash.length() > 0) {
                response = c.resource(SERVICE_URL).accept("application/json").header("X-Scanner", 1).post(JSONObject.class, request);
            } else {
                response = c.resource(SERVICE_URL).accept("application/json").post(JSONObject.class, request);
            }
            ObjectMapper mapper = new ObjectMapper();
            trackList = mapper.readValue(response.getString("result"), TrackListData.class);

            if (trackList != null) {
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                    entityManager.getTransaction().commit();
                    if (offset + trackList.getTracks().size() < trackList.getCount()) {
                        offset = offset + trackList.getTracks().size();
                        request = createRequest(offset, CHUNK_SIZE);
                        if (squeezeboxServerPasswordHash != null && squeezeboxServerPasswordHash.length() > 0) {
                            response = c.resource(SERVICE_URL).accept("application/json").header("X-Scanner", 1).post(JSONObject.class, request);
                        } else {
                            response = c.resource(SERVICE_URL).accept("application/json").post(JSONObject.class, request);
                        }
                        trackList = mapper.readValue(response.getString("result"), TrackListData.class);
                    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.