Examples of readFrom()


Examples of org.elasticsearch.action.search.SearchRequest.readFrom()

        searchType = SearchType.fromId(in.readByte());
        clearCaches = in.readOptionalStreamable(new ClearIndicesCacheRequest());
        final int size = in.readVInt();
        for (int i = 0; i < size; i++) {
            SearchRequest searchRequest = new SearchRequest();
            searchRequest.readFrom(in);
            searchRequests.add(searchRequest);
        }
    }

    @Override
View Full Code Here

Examples of org.elasticsearch.action.update.UpdateRequest.readFrom()

                DeleteRequest request = new DeleteRequest();
                request.readFrom(in);
                requests.add(request);
            } else if (type == 2) {
                UpdateRequest request = new UpdateRequest();
                request.readFrom(in);
                requests.add(request);
            }
        }
        refresh = in.readBoolean();
        timeout = TimeValue.readTimeValue(in);
View Full Code Here

Examples of org.elasticsearch.cluster.service.PendingClusterTask.readFrom()

        super.readFrom(in);
        int size = in.readVInt();
        pendingTasks = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            PendingClusterTask task = new PendingClusterTask();
            task.readFrom(in);
            pendingTasks.add(task);
        }
    }

    @Override
View Full Code Here

Examples of org.elasticsearch.common.io.stream.Streamable.readFrom()

    }

    private void handleResponse(StreamInput buffer, final TransportResponseHandler handler) {
        final Streamable streamable = handler.newInstance();
        try {
            streamable.readFrom(buffer);
        } catch (Exception e) {
            handleException(handler, new TransportSerializationException("Failed to deserialize response of type [" + streamable.getClass().getName() + "]", e));
            return;
        }
        try {
View Full Code Here

Examples of org.elasticsearch.transport.TransportRequest.readFrom()

            final TransportRequestHandler handler = transportServiceAdapter.handler(action);
            if (handler == null) {
                throw new ActionNotFoundTransportException(action);
            }
            final TransportRequest request = handler.newInstance();
            request.readFrom(buffer);
            if (handler.executor().equals(ThreadPool.Names.SAME)) {
                //noinspection unchecked
                handler.messageReceived(request, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, request, transportChannel, action));
View Full Code Here

Examples of org.elasticsearch.transport.TransportResponse.readFrom()

    }

    private void handleResponse(StreamInput buffer, final TransportResponseHandler handler) {
        final TransportResponse response = handler.newInstance();
        try {
            response.readFrom(buffer);
        } catch (Throwable e) {
            handleException(handler, new TransportSerializationException("Failed to deserialize response of type [" + response.getClass().getName() + "]", e));
            return;
        }
        try {
View Full Code Here

Examples of org.entando.entando.aps.system.services.api.provider.json.JSONProvider.readFrom()

      }
            Class expectedType = apiMethod.getExpectedType();
            Object bodyObject = null;
            if (MediaType.APPLICATION_JSON_TYPE.equals(mediaType)) {
                JSONProvider jsonProvider = new JSONProvider();
                bodyObject = jsonProvider.readFrom(expectedType, expectedType.getGenericSuperclass(),
                        expectedType.getAnnotations(), mediaType, null, request.getInputStream());
            } else {
                JAXBContext context = JAXBContext.newInstance(expectedType);
                Unmarshaller unmarshaller = context.createUnmarshaller();
                bodyObject = (Object) unmarshaller.unmarshal(request.getInputStream());
View Full Code Here

Examples of org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider.readFrom()

      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      entity.write(outputStream);
      String resp = outputStream.toString();
      HierarchicalPropertyEntityProvider entityProvider = new HierarchicalPropertyEntityProvider();
      HierarchicalProperty multistatus =
         entityProvider.readFrom(null, null, null, null, null, new ByteArrayInputStream(resp.getBytes()));

      assertEquals(1, multistatus.getChildren().size());

      HierarchicalProperty responseProperty = multistatus.getChild(0);
View Full Code Here

Examples of org.fusesource.hawtbuf.Buffer.readFrom()

    boolean magicRead = false;
    public Object unmarshal(DataInput dataIn) throws IOException {
        if( !magicRead ) {
            Buffer magic = new Buffer(8);
            magic.readFrom(dataIn);
            magicRead = true;
            return new AmqpHeader(magic);
        } else {
            int size = dataIn.readInt();
            if( size > maxFrameSize) {
View Full Code Here

Examples of org.glassfish.jersey.message.internal.FileProvider.readFrom()

    }

    @Test
    public void testFileRepresentation() throws IOException {
        final FileProvider fp = new FileProvider();
        final File in = fp.readFrom(File.class, File.class, null, null, null,
                new ByteArrayInputStream("CONTENT".getBytes()));

        _test(in, FileResource.class);
    }
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.