1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
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 *
19 */
20 package org.apache.directory.api.ldap.extras.extended.storedProcedure;
21
22
23 import java.util.List;
24
25 import org.apache.directory.api.ldap.model.message.ExtendedRequest;
26
27
28 /**
29 * An extended operation requesting the server to execute a stored procedure.
30 *
31 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
32 */
33 public interface StoredProcedureRequest extends ExtendedRequest
34 {
35 /** The OID for the stored procedure extended operation request. */
36 static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.6";
37
38
39 /**
40 * Gets the language.
41 *
42 * @return the language
43 */
44 String getLanguage();
45
46
47 /**
48 * Sets the language.
49 *
50 * @param language the new language
51 */
52 void setLanguage( String language );
53
54
55 /**
56 * @return The byte[] containing the procedure's bytecode
57 */
58 byte[] getProcedure();
59
60
61 /**
62 * @param procedure The procedure's bytecode
63 */
64 void setProcedure( byte[] procedure );
65
66
67 /**
68 * Gets the procedure specification.
69 *
70 * @return the procedure specification
71 */
72 String getProcedureSpecification();
73
74
75 /**
76 * Size.
77 *
78 * @return the procedure's bytcode size
79 */
80 int size();
81
82
83 /**
84 * Gets the parameter type.
85 *
86 * @param index the index
87 * @return the parameter type
88 */
89 Object getParameterType( int index );
90
91
92 /**
93 * Gets the java parameter type.
94 *
95 * @param index the index
96 * @return the java parameter type
97 */
98 Class<?> getJavaParameterType( int index );
99
100
101 /**
102 * Gets the parameter value.
103 *
104 * @param index the index
105 * @return the parameter value
106 */
107 Object getParameterValue( int index );
108
109
110 /**
111 * Gets the java parameter value.
112 *
113 * @param index the index
114 * @return the java parameter value
115 */
116 Object getJavaParameterValue( int index );
117
118
119 /**
120 * Adds the parameter.
121 *
122 * @param type the type
123 * @param value the value
124 */
125 void addParameter( Object type, Object value );
126
127
128 void addParameter( StoredProcedureParameter parameter );
129
130
131 List<StoredProcedureParameter> getParameters();
132 }