01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.tools.common.toolspec;
19:
20: import java.io.*;
21: import org.w3c.dom.Document;
22: import org.apache.cxf.tools.common.ToolException;
23:
24: public interface ToolContext {
25:
26: /**
27: * Request an input stream.
28: * @param id the id of the stream in the streams sections of the tool's definition document.
29: */
30: InputStream getInputStream(String id) throws ToolException;
31:
32: /**
33: * Request the standard input stream.
34: */
35: InputStream getInputStream() throws ToolException;
36:
37: /**
38: * Request a document based on the input stream.
39: * This is only returned if the mime type of incoming stream is xml.
40: */
41: Document getInputDocument(String id) throws ToolException;
42:
43: /**
44: * Request a document based on the standard input stream.
45: * This is only returned if the mime type of incoming stream is xml.
46: */
47: Document getInputDocument() throws ToolException;
48:
49: OutputStream getOutputStream(String id) throws ToolException;
50:
51: OutputStream getOutputStream() throws ToolException;
52:
53: String getParameter(String name) throws ToolException;
54:
55: String[] getParameters(String name) throws ToolException;
56:
57: boolean hasParameter(String name) throws ToolException;
58:
59: void sendDocument(String id, Document doc);
60:
61: void sendDocument(Document doc);
62:
63: void executePipeline();
64:
65: void setUserObject(String key, Object o);
66:
67: Object getUserObject(String key);
68:
69: }
|