Examples of RequestHeader


Examples of org.apache.zookeeper.proto.RequestHeader

            }
        }

        private void sendPing() {
            lastPingSentNs = System.nanoTime();
            RequestHeader h = new RequestHeader(-2, OpCode.ping);
            queuePacket(h, null, null, null, null, null, null, null);
        }
View Full Code Here

Examples of org.apache.zookeeper.proto.RequestHeader

                if (!disableAutoWatchReset) {
                    SetWatches sw = new SetWatches(lastZxid,
                            zooKeeper.getDataWatches(),
                            zooKeeper.getExistWatches(),
                            zooKeeper.getChildWatches());
                    RequestHeader h = new RequestHeader();
                    h.setType(ZooDefs.OpCode.setWatches);
                    h.setXid(-8);
                    Packet packet = new Packet(h, new ReplyHeader(), sw, null, null,
                                null);
                    outgoingQueue.addFirst(packet);
                }

                for (AuthData id : authInfo) {
                    outgoingQueue.addFirst(new Packet(new RequestHeader(-4,
                            OpCode.auth), null, new AuthPacket(0, id.scheme,
                            id.data), null, null, null));
                }
                outgoingQueue.addFirst((new Packet(null, null, null, null, bb,
                        null)));
View Full Code Here

Examples of org.apache.zookeeper_voltpatches.proto.RequestHeader

    private void readRequest() throws IOException {
        // We have the request, now process and setup for next
        InputStream bais = new ByteBufferInputStream(incomingBuffer);
        BinaryInputArchive bia = BinaryInputArchive.getArchive(bais);
        RequestHeader h = new RequestHeader();
        h.deserialize(bia, "header");
        // Through the magic of byte buffers, txn will not be
        // pointing
        // to the start of the txn
        incomingBuffer = incomingBuffer.slice();
        if (h.getType() == OpCode.auth) {
            AuthPacket authPacket = new AuthPacket();
            ZooKeeperServer.byteBuffer2Record(incomingBuffer, authPacket);
            String scheme = authPacket.getScheme();
            AuthenticationProvider ap = ProviderRegistry.getProvider(scheme);
            if (ap == null
                    || (ap.handleAuthentication(this, authPacket.getAuth())
                            != KeeperException.Code.OK)) {
                if (ap == null) {
                    LOG.warn("No authentication provider for scheme: "
                            + scheme + " has "
                            + ProviderRegistry.listProviders());
                } else {
                    LOG.warn("Authentication failed for scheme: " + scheme);
                }
                // send a response...
                ReplyHeader rh = new ReplyHeader(h.getXid(), 0,
                        KeeperException.Code.AUTHFAILED.intValue());
                sendResponse(rh, null, null);
                // ... and close connection
                sendCloseSession();
                disableRecv();
            } else {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Authentication succeeded for scheme: "
                              + scheme);
                }
                ReplyHeader rh = new ReplyHeader(h.getXid(), 0,
                        KeeperException.Code.OK.intValue());
                sendResponse(rh, null, null);
            }
            return;
        } else {
            Request si = new Request(this, sessionId, h.getXid(), h.getType(), incomingBuffer, authInfo);
            si.setOwner(ServerCnxn.me);
            zk.submitRequest(si);
        }
        if (h.getXid() >= 0) {
            synchronized (this) {
                outstandingRequests++;
            }
            synchronized (this.factory) {
                // check throttling
View Full Code Here

Examples of org.codelibs.robot.client.http.RequestHeader

                                "name", null);
                        final String value = SettingsUtils.get(headerObj,
                                "value", null);
                        if (name != null && value != null) {
                            requestHeaderList
                                    .add(new RequestHeader(name, value));
                        }
                    }
                    paramMap.put(
                            HcHttpClient.REQUERT_HEADERS_PROPERTY,
                            requestHeaderList
View Full Code Here

Examples of org.jboss.arquillian.ajocado.request.RequestHeader

     * @param password Password to be encoded in header
     *
     * @return Header which corresponds to HTTP Basic authorization for given credentials
     */
    public static RequestHeader createBasicAuthorization(String username, String password) {
        return new RequestHeader("Authorization", "Basic " + URLUtils.encodeBase64Credentials(username, password));
    }
View Full Code Here

Examples of org.jwebsocket.kit.RequestHeader

    super(null);
    request = aRequest;
    response = aResponse;
    // TODO: Overhaul this hardcoded reference! See TokenServer class!
    setBoolean("org.jWebSocket.tokenserver.isTS", true);
    RequestHeader lHeader = new RequestHeader();
    lHeader.put("prot", "json");
    setHeader(lHeader);
  }
View Full Code Here

Examples of org.springframework.web.bind.annotation.RequestHeader

        && !Map.class.isAssignableFrom(parameter.getParameterType());
  }

  @Override
  protected NamedValueInfo createNamedValueInfo(MethodParameter parameter) {
    RequestHeader annotation = parameter.getParameterAnnotation(RequestHeader.class);
    return new RequestHeaderNamedValueInfo(annotation);
  }
View Full Code Here

Examples of org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC.RPCHeader.RequestHeader

        }
    }
       
    public void handleRequest(RPCServerRequest rq) {
               
        final RequestHeader rqHdr = rq.getHeader().getRequestHeader();
       
        Operation op = operations.get(rqHdr.getProcId());
        if (op == null) {
            rq.sendError(ErrorType.INVALID_PROC_ID, POSIX_ERROR_NONE,
                    "requested operation (" + rqHdr.getProcId() +
                    ") is not available");
            return;
        }
       
        Logging.logMessage(Logging.LEVEL_DEBUG, this,
View Full Code Here

Examples of play.api.mvc.RequestHeader

     * @param env the environment
     * @param executor an ExecutionContext
     * @return the current user object or null if there isn't one available
     */
    public static F.Promise<Object> currentUser(RuntimeEnvironment env, ExecutionContext executor) {
        RequestHeader requestHeader = Http.Context.current()._requestHeader();
        if (requestHeader == null || env == null) {
            return F.Promise.promise(null);
        } else {
            scala.concurrent.Future scalaFuture = SecureSocial$.MODULE$.currentUser(requestHeader, env, executor);
            F.Function<Option<Object>, Object> mapFunction = new F.Function<Option<Object>, Object>() {
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.