brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bostko <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #285: Adding HttpExecutor to be used for interc...
Date Mon, 29 Aug 2016 11:27:42 GMT
Github user bostko commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/285#discussion_r76591742
  
    --- Diff: utils/common/src/main/java/org/apache/brooklyn/util/http/executor/HttpRequest.java
---
    @@ -0,0 +1,128 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.brooklyn.util.http.executor;
    +
    +import static com.google.common.base.Preconditions.checkNotNull;
    +
    +import java.net.URI;
    +import java.util.Map;
    +
    +import javax.annotation.Nullable;
    +
    +import com.google.common.annotations.Beta;
    +import com.google.common.collect.ArrayListMultimap;
    +import com.google.common.collect.Multimap;
    +
    +@Beta
    +public interface HttpRequest {
    +    
    +    // TODO Should we use InputStream for body (rather than byte[]). That would mean
we don't have
    +    // to hold the entire body in-memory, which might be important for really big payloads!
    --- End diff --
    
    I think the end consumer who is using HttpResponse and HttpRequest should take care for
closing the Stream.
    Please check `org.apache.http.HttpEntity`.
    In essence HttpExecutor is a pattern for providing external httpClients.
    For deciding what to return in HttpRequest and HttpResponse Stream or byte[], I think
we should better take a look at exposing it in a way which is implemented in most of the httpClients
like Apache Http Client.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message