Debian Codegraph @

src/main/java/net/sf/antcontrib/antserver/Command.java

raw symbols SCIP
1 /*
2 * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.antcontrib.antserver;
17
18 import java.io.IOException;
19 import java.io.InputStream;
20 import java.io.Serializable;
21
22 import org.apache.tools.ant.Project;
23
24
25 /****************************************************************************
26 * Place class description here.
27 *
28 * @author <a href='mailto:[email protected]'>Matthew Inger</a>
29 * @author <additional author>
30 *
31 * @since
32 *
33 ****************************************************************************/
34
35
36 public interface Command
37 extends Serializable
38 {
39 /***
40 * This should throw a build exception if the parameters
41 * are invalid.
42 */
43 public void validate(Project project);
44
45 /***
46 * Is there additional content being sent from the local
47 * machine to the remote server
48 */
49 public long getContentLength();
50
51 /***
52 * Gets the content's input stream. Should be called only on the
53 * client side for sending the content over the connection
54 * @return the content's input stream.
55 */
56 public InputStream getContentStream() throws IOException;
57
58
59 public long getResponseContentLength();
60
61 public InputStream getReponseContentStream() throws IOException;
62
63 /***
64 * Execute the command.
65 * @param project The project which is being executed
66 * @return If true, the connection will be closed
67 * @throws Throwable
68 */
69 public boolean execute(Project project,
70 long contentLength,
71 InputStream contentStream)
72 throws Throwable;
73
74 /***
75 * Process any additional data from a response.
76 */
77 public boolean respond(Project project,
78 long contentLength,
79 InputStream contentStream)
80 throws IOException;
81
82 }