You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ad...@apache.org on 2009/11/23 08:07:16 UTC
svn commit: r883261 [2/2] - in /mina/sandbox/adc/ahc: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/ahc/ src/main/java/org/apache/ahc/api/
src/main/java/org/apache/ahc/api/listeners/ src/main/jav...
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeReadChannel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeReadChannel.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeReadChannel.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,31 @@
+/**
+ * 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.ahc.api;
+
+import java.io.IOException;
+import java.nio.channels.GatheringByteChannel;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface MimeWriteChannel extends MimeContent
+{
+ boolean writeChannelReady(Provisionable owner, GatheringByteChannel channel) throws IOException;
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/MimeWriteChannel.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,27 @@
+/**
+ * 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.ahc.api;
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface Provisionable
+{
+ Object getEquip(String key);
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/Provisionable.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpResponse;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface AcceptedListener extends SuccessfulListener
+{
+ void accepted(HttpResponse response);
+}
\ No newline at end of file
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/AcceptedListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpResponse;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface CreatedListener extends SuccessfulListener
+{
+ void created(HttpResponse response);
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/CreatedListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpResponse;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface FoundListener extends RedirectListener
+{
+ boolean found(HttpResponse response, String url);
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/FoundListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,31 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpResponse;
+import org.apache.ahc.api.MimeContent;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface MimeContentListener
+{
+ void found(HttpResponse response, MimeContent mimeContent);
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/MimeContentListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpResponse;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface OkListener extends SuccessfulListener
+{
+ void ok(HttpResponse response);
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/OkListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,29 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpListener;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface RedirectListener extends HttpListener
+{
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/RedirectListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,29 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpListener;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface SslCertificateListener extends HttpListener
+{
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SslCertificateListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,29 @@
+/**
+ * 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.ahc.api.listeners;
+
+import org.apache.ahc.api.HttpListener;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface SuccessfulListener extends HttpListener
+{
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/api/listeners/SuccessfulListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,117 @@
+/**
+ * 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.ahc.client;
+
+import java.net.InetAddress;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.ahc.api.HttpBatch;
+import org.apache.ahc.api.HttpClient;
+import org.apache.ahc.api.HttpClientFuture;
+import org.apache.ahc.api.HttpConfig;
+import org.apache.ahc.api.HttpConnection;
+import org.apache.ahc.api.HttpListener;
+import org.apache.ahc.api.HttpRequest;
+import org.apache.ahc.api.HttpResponse;
+import org.apache.ahc.api.MimeContent;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class AsyncHttpClient implements HttpClient
+{
+ public AsyncHttpClient(Executor executor, ScheduledThreadPoolExecutor scheduledThreadPoolExecutor)
+ {
+ //Todo change body of created methods use File | Settings | File Templates.
+ }
+
+ public Object getEquip(String key)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addConfig(HttpConfig config)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> send(HttpRequest request)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> get(String url)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> post(String url, Map<String, String> map, MimeContent... content)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> put(String url, Map<String, String> map, MimeContent... content)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> delete(String url)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpBatch batch()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpBatch batch(int duration, TimeUnit timeUnit)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpConnection open(InetAddress address, int port)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient equipWith(String key, Object value)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient equipWith(HttpListener listener)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient push()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient pop()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpClient.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,40 @@
+/**
+ * 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.ahc.client;
+
+import org.apache.ahc.api.HttpConfig;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class AsyncHttpConfig implements HttpConfig
+{
+ private boolean TcpNoDelay;
+
+ public boolean isTcpNoDelay()
+ {
+ return TcpNoDelay;
+ }
+
+ public void setTcpNoDelay(boolean tcpNoDelay)
+ {
+ TcpNoDelay = tcpNoDelay;
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/AsyncHttpConfig.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,75 @@
+/**
+ * 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.ahc.client;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.GatheringByteChannel;
+
+import org.apache.ahc.api.MimeWriteChannel;
+import org.apache.ahc.api.Provisionable;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class ByteArrayBasedMimeContent implements MimeWriteChannel
+{
+ private final String name;
+ private final String fileName;
+ private final String contentType;
+ private final ByteBuffer byteBuffer;
+
+ public ByteArrayBasedMimeContent(String name, String fileName, String contentType, byte[] bytes)
+ {
+ if (bytes == null) throw new IllegalArgumentException("byte array cannot be null");
+
+ this.name = name;
+ this.fileName = fileName;
+ this.contentType = contentType;
+ this.byteBuffer = ByteBuffer.wrap(bytes);
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getFileName()
+ {
+ return fileName;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public int getContentSize()
+ {
+ return byteBuffer.capacity();
+ }
+
+ public boolean writeChannelReady(Provisionable owner, GatheringByteChannel channel) throws IOException
+ {
+ channel.write(byteBuffer);
+
+ return byteBuffer.hasRemaining();
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/ByteArrayBasedMimeContent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java (added)
+++ mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,72 @@
+/**
+ * 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.ahc.client;
+
+import java.io.InputStream;
+
+import org.apache.ahc.api.MimeInputStream;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class InputStreamBasedMimeContent implements MimeInputStream
+{
+ private final String name;
+ private final String fileName;
+ private final String contentType;
+ private final int contentSize;
+ private final InputStream inputStream;
+
+ public InputStreamBasedMimeContent(String name, String fileName, String contentType, int contentSize, InputStream inputStream)
+ {
+ if (inputStream == null) throw new IllegalArgumentException("input stream cannot be null");
+
+ this.name = name;
+ this.fileName = fileName;
+ this.contentType = contentType;
+ this.contentSize = contentSize;
+ this.inputStream = inputStream;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getFileName()
+ {
+ return fileName;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public int getContentSize()
+ {
+ return contentSize;
+ }
+
+ public InputStream getInputStream()
+ {
+ return inputStream;
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/main/java/org/apache/ahc/client/InputStreamBasedMimeContent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,110 @@
+/**
+ * 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 com.acme.ahc;
+
+import java.net.InetAddress;
+import java.util.concurrent.TimeUnit;
+import java.util.Map;
+
+import org.apache.ahc.api.HttpClientFuture;
+import org.apache.ahc.api.HttpBatch;
+import org.apache.ahc.api.HttpClient;
+import org.apache.ahc.api.HttpConfig;
+import org.apache.ahc.api.HttpConnection;
+import org.apache.ahc.api.HttpListener;
+import org.apache.ahc.api.HttpRequest;
+import org.apache.ahc.api.HttpResponse;
+import org.apache.ahc.api.MimeContent;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class AcmeHttpClient implements HttpClient
+{
+ public Object getEquip(String key)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addConfig(HttpConfig config)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> send(HttpRequest request)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> get(String url)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> post(String url, Map<String, String> map, MimeContent... content)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> put(String url, Map<String, String> map, MimeContent... content)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClientFuture<HttpResponse> delete(String url)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpBatch batch()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpBatch batch(int duration, TimeUnit timeUnit)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpConnection open(InetAddress address, int port)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient equipWith(String key, Object value)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient equipWith(HttpListener listener)
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient push()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public HttpClient pop()
+ {
+ return null; //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpClient.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,15 @@
+package com.acme.ahc;
+
+import org.apache.ahc.api.HttpRequest;
+
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: acabrera
+ * Date: Nov 22, 2009
+ * Time: 9:21:24 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class AcmeHttpRequest extends HttpRequest
+{
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeHttpRequest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,26 @@
+/**
+ * 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 com.acme.ahc;
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class AcmeMockHandle
+{
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/AcmeMockHandle.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,58 @@
+/**
+ * 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 com.acme.ahc.listeners;
+
+import org.apache.ahc.api.HttpConnection;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class AcmeSslBenchmarkListener implements SslBenchmarkListener
+{
+ public void start(HttpConnection connection)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void obtainedDNS(HttpConnection connection)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void connectionEstablished(HttpConnection connection)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void receivedFirstByte(HttpConnection connection)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void receivedLastByte(HttpConnection connection)
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void sslNegotiationCompleted()
+ {
+ //Todo change body of implemented methods use File | Settings | File Templates.
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslBenchmarkListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,29 @@
+/**
+ * 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 com.acme.ahc.listeners;
+
+import org.apache.ahc.api.listeners.SslCertificateListener;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class AcmeSslCertificatManager implements SslCertificateListener
+{
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/AcmeSslCertificatManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,39 @@
+/**
+ * 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 com.acme.ahc.listeners;
+
+import org.apache.ahc.api.HttpListener;
+import org.apache.ahc.api.HttpConnection;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public interface BenchmarkListener extends HttpListener
+{
+ void start(HttpConnection connection);
+
+ void obtainedDNS(HttpConnection connection);
+
+ void connectionEstablished(HttpConnection connection);
+
+ void receivedFirstByte(HttpConnection connection);
+
+ void receivedLastByte(HttpConnection connection);
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/BenchmarkListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/SslBenchmarkListener.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/SslBenchmarkListener.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/SslBenchmarkListener.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/com/acme/ahc/listeners/SslBenchmarkListener.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,27 @@
+/**
+ * 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 com.acme.ahc.listeners;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface SslBenchmarkListener extends BenchmarkListener
+{
+ void sslNegotiationCompleted();
+}
Added: mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java
URL: http://svn.apache.org/viewvc/mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java?rev=883261&view=auto
==============================================================================
--- mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java (added)
+++ mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java Mon Nov 23 07:07:13 2009
@@ -0,0 +1,249 @@
+/**
+ * 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.ahc.api;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+
+import com.acme.ahc.AcmeHttpClient;
+import com.acme.ahc.AcmeHttpRequest;
+import com.acme.ahc.AcmeMockHandle;
+import com.acme.ahc.listeners.AcmeSslBenchmarkListener;
+import com.acme.ahc.listeners.AcmeSslCertificatManager;
+import org.apache.ahc.api.listeners.MimeContentListener;
+import org.junit.Test;
+
+
+/**
+ * @version $Revision$ $Date: $
+ */
+public class ClientTest
+{
+ @Test
+ void testBatch() throws Exception
+ {
+ HttpClient client = new AcmeHttpClient();
+ client.equipWith(new AcmeSslCertificatManager());
+ client.equipWith("CLIENT_ID", "92341");
+
+ Map<String, String> map = new HashMap<String, String>();
+ HttpBatchFuture future = client
+ .batch(50, TimeUnit.MILLISECONDS)
+
+ .get("http://rest.acme.com/rest/student/324525?token=dFWEGV8ss63dmcs0245c")
+
+ .push()
+ .equipWith(new AcmeSslBenchmarkListener())
+ .equipWith("OBJECT_HANDLE", new AcmeMockHandle())
+ .get("https://rest.acme.com/rest/student/5246?token=dFWEGV8ss63dmcs0245c")
+ .pop()
+
+ .get("http://rest.acme.com/rest/student/1245?token=dFWEGV8ss63dmcs0245c")
+
+ .post("http://rest.acme.com/rest/student/1245", map)
+
+ .get("http://rest.acme.com/rest/student/41134?token=dFWEGV8ss63dmcs0245c")
+
+ .submit();
+
+ List<HttpResponse> responses = future.get();
+ for (HttpResponse response : responses)
+ {
+ AcmeMockHandle handle = (AcmeMockHandle)response.getEquip("OBJECT_HANDLE");
+ }
+ }
+
+ @Test
+ void testSend() throws Exception
+ {
+ HttpClient client = new AcmeHttpClient();
+
+ HttpResponse response = client.get("http://rest.acme.com/rest/student/41134?token=dFWEGV8ss63dmcs0245c")
+ .register(new FutureListener<HttpResponse>()
+ {
+ public void exception(Throwable t)
+ {
+ // asynchronously wait for error
+ }
+
+ public void completed(HttpResponse result)
+ {
+ // asynchronously wait for response
+ }
+ })
+ .get();
+ }
+
+ @Test
+ void testSendMultipleAttachments() throws Exception
+ {
+ HttpClient client = new AcmeHttpClient();
+
+ HttpRequest request = new AcmeHttpRequest();
+
+ request.setUrl(new URL("http://rest.acme.com/rest/student/41134?token=dFWEGV8ss63dmcs0245"))
+ .addMimeContent(generateXml())
+ .addMimeContent(generateDmg(), generateRandom());
+
+ HttpResponse response = client.send(request).get();
+ }
+
+ @Test
+ void testReceiveMultipleAttachments() throws Exception
+ {
+ HttpClient client = new AcmeHttpClient();
+
+ HttpRequest request = new AcmeHttpRequest();
+
+ request.setUrl(new URL("http://rest.acme.com/rest/student/41134?token=dFWEGV8ss63dmcs0245"))
+ .addMimeContentListener(new MimeContentListener()
+ {
+ public void found(HttpResponse response, MimeContent mimeContent)
+ {
+ // asynchronous calls when content is found
+ }
+ });
+
+ HttpResponse response = client.send(request).get();
+ }
+
+ private MimeContent generateXml()
+ {
+ return new MimeInputStream()
+ {
+ private final String xml = "<foo>bar</foo>";
+
+ public InputStream getInputStream()
+ {
+ return new ByteArrayInputStream(xml.getBytes());
+ }
+
+ public String getName()
+ {
+ return "foo-config";
+ }
+
+ public String getFileName()
+ {
+ return null;
+ }
+
+ public String getContentType()
+ {
+ return "text/xml";
+ }
+
+ public int getContentSize()
+ {
+ return xml.length();
+ }
+ };
+ }
+
+ private MimeContent generateDmg()
+ {
+ return new MimeInputStream()
+ {
+ private final File file = new File("test/resources/application.dmg");
+
+ public InputStream getInputStream()
+ {
+ try
+ {
+ return new FileInputStream(file);
+ }
+ catch (FileNotFoundException e)
+ {
+ return null;
+ }
+ }
+
+ public String getName()
+ {
+ return "install-application";
+ }
+
+ public String getFileName()
+ {
+ return file.getName();
+ }
+
+ public String getContentType()
+ {
+ return "application/x-apple-diskimage";
+ }
+
+ public int getContentSize()
+ {
+ return (int)file.length();
+ }
+ };
+ }
+
+ private MimeContent generateRandom()
+ {
+ return new MimeInputStream()
+ {
+ private final Random file = new SecureRandom();
+
+ public InputStream getInputStream()
+ {
+ return new InputStream()
+ {
+ public int read() throws IOException
+ {
+ int test = file.nextInt(257);
+ return test == 256 ? -1 : test;
+ }
+ };
+ }
+
+ public String getName()
+ {
+ return "random-bytes";
+ }
+
+ public String getFileName()
+ {
+ return null;
+ }
+
+ public String getContentType()
+ {
+ return "application/x-random-bytes";
+ }
+
+ public int getContentSize()
+ {
+ return -1; // Don't know the ultimate size of this stream
+ }
+ };
+ }
+}
Propchange: mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java
------------------------------------------------------------------------------
svn:keywords = "Date Revision Id Author"
Propchange: mina/sandbox/adc/ahc/src/test/java/org/apache/ahc/api/ClientTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain