Examples of GetChildrenResponse


Examples of org.apache.zookeeper.proto.GetChildrenResponse

                                    cb.processResult(rc, path, p.ctx, null,
                                            null);
                                }
                            } else if (p.response instanceof GetChildrenResponse) {
                                ChildrenCallback cb = (ChildrenCallback) p.cb;
                                GetChildrenResponse rsp = (GetChildrenResponse) p.response;
                                if (rc == 0) {
                                    cb.processResult(rc, path, p.ctx, rsp
                                            .getChildren());
                                } else {
                                    cb.processResult(rc, path, p.ctx, null);
                                }
                            } else if (p.response instanceof CreateResponse) {
                                StringCallback cb = (StringCallback) p.cb;
                                CreateResponse rsp = (CreateResponse) p.response;
                                if (rc == 0) {
                                    cb.processResult(rc, path, p.ctx, rsp
                                            .getPath());
                                } else {
                                    cb.processResult(rc, path, p.ctx, null);
                                }
                            } else if (p.cb instanceof VoidCallback) {
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.getChildren);
        GetChildrenRequest request = new GetChildrenRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        GetChildrenResponse response = new GetChildrenResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ChildWatchRegistration(watcher, path);
        }
        ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
        if (r.getErr() != 0) {
            throw KeeperException.create(r.getErr());
        }
        return response.getChildren();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.getChildren);
        GetChildrenRequest request = new GetChildrenRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        GetChildrenResponse response = new GetChildrenResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ChildWatchRegistration(watcher, path);
        }
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, path,
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

                        ZooDefs.Perms.READ,
                        request.authInfo);
                List<String> children = zks.dataTree.getChildren(
                        getChildrenRequest.getPath(), stat, getChildrenRequest
                                .getWatch() ? request.cnxn : null);
                rsp = new GetChildrenResponse(children);
                break;
            }
        } catch (KeeperException e) {
            err = e.code();
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

                                    cb.processResult(rc, path, p.ctx, null,
                                            null);
                                }
                            } else if (p.response instanceof GetChildrenResponse) {
                                ChildrenCallback cb = (ChildrenCallback) p.cb;
                                GetChildrenResponse rsp = (GetChildrenResponse) p.response;
                                if (rc == 0) {
                                    cb.processResult(rc, path, p.ctx, rsp
                                            .getChildren());
                                } else {
                                    cb.processResult(rc, path, p.ctx, null);
                                }
                            } else if (p.response instanceof CreateResponse) {
                                StringCallback cb = (StringCallback) p.cb;
                                CreateResponse rsp = (CreateResponse) p.response;
                                if (rc == 0) {
                                    cb.processResult(rc, path, p.ctx, rsp
                                            .getPath());
                                } else {
                                    cb.processResult(rc, path, p.ctx, null);
                                }
                            } else if (p.cb instanceof VoidCallback) {
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.getChildren);
        GetChildrenRequest request = new GetChildrenRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        GetChildrenResponse response = new GetChildrenResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ChildWatchRegistration(watcher, path);
        }
        ReplyHeader r = cnxn.submitRequest(h, request, response, wcb);
        if (r.getErr() != 0) {
            throw KeeperException.create(KeeperException.Code.get(r.getErr()),
                    path);
        }
        return response.getChildren();
    }
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.getChildren);
        GetChildrenRequest request = new GetChildrenRequest();
        request.setPath(path);
        request.setWatch(watcher != null);
        GetChildrenResponse response = new GetChildrenResponse();
        WatchRegistration wcb = null;
        if (watcher != null) {
            wcb = new ChildWatchRegistration(watcher, path);
        }
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb, path,
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

                          cb.processResult(rc, clientPath, p.ctx, null,
                                  null);
                      }
                  } else if (p.response instanceof GetChildrenResponse) {
                      ChildrenCallback cb = (ChildrenCallback) p.cb;
                      GetChildrenResponse rsp = (GetChildrenResponse) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx, rsp
                                  .getChildren());
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null);
                      }
                  } else if (p.response instanceof GetChildren2Response) {
                      Children2Callback cb = (Children2Callback) p.cb;
                      GetChildren2Response rsp = (GetChildren2Response) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx, rsp
                                  .getChildren(), rsp.getStat());
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null, null);
                      }
                  } else if (p.response instanceof CreateResponse) {
                      StringCallback cb = (StringCallback) p.cb;
                      CreateResponse rsp = (CreateResponse) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx,
                                  (chrootPath == null
                                          ? rsp.getPath()
                                          : rsp.getPath()
                                    .substring(chrootPath.length())));
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null);
                      }
                  } else if (p.cb instanceof VoidCallback) {
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

                          cb.processResult(rc, clientPath, p.ctx, null,
                                  null);
                      }
                  } else if (p.response instanceof GetChildrenResponse) {
                      ChildrenCallback cb = (ChildrenCallback) p.cb;
                      GetChildrenResponse rsp = (GetChildrenResponse) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx, rsp
                                  .getChildren());
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null);
                      }
                  } else if (p.response instanceof GetChildren2Response) {
                      Children2Callback cb = (Children2Callback) p.cb;
                      GetChildren2Response rsp = (GetChildren2Response) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx, rsp
                                  .getChildren(), rsp.getStat());
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null, null);
                      }
                  } else if (p.response instanceof CreateResponse) {
                      StringCallback cb = (StringCallback) p.cb;
                      CreateResponse rsp = (CreateResponse) p.response;
                      if (rc == 0) {
                          cb.processResult(rc, clientPath, p.ctx,
                                  (chrootPath == null
                                          ? rsp.getPath()
                                          : rsp.getPath()
                                    .substring(chrootPath.length())));
                      } else {
                          cb.processResult(rc, clientPath, p.ctx, null);
                      }
                  } else if (p.cb instanceof VoidCallback) {
View Full Code Here

Examples of org.apache.zookeeper.proto.GetChildrenResponse

                        ZooDefs.Perms.READ,
                        request.authInfo);
                List<String> children = zks.getZKDatabase().getChildren(
                        getChildrenRequest.getPath(), null, getChildrenRequest
                                .getWatch() ? cnxn : null);
                rsp = new GetChildrenResponse(children);
                break;
            }
            case OpCode.getChildren2: {
                lastOp = "GETC";
                GetChildren2Request getChildren2Request = new GetChildren2Request();
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.