001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.api.ldap.extras.extended.storedProcedure; 021 022 023import java.util.List; 024 025import org.apache.directory.api.ldap.model.message.ExtendedRequest; 026 027 028/** 029 * An extended operation requesting the server to execute a stored procedure. 030 * 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 */ 033public interface StoredProcedureRequest extends ExtendedRequest 034{ 035 /** The OID for the stored procedure extended operation request. */ 036 String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.6"; 037 038 039 /** 040 * Gets the language. 041 * 042 * @return the language 043 */ 044 String getLanguage(); 045 046 047 /** 048 * Sets the language. 049 * 050 * @param language the new language 051 */ 052 void setLanguage( String language ); 053 054 055 /** 056 * @return The byte[] containing the procedure's bytecode 057 */ 058 byte[] getProcedure(); 059 060 061 /** 062 * @param procedure The procedure's bytecode 063 */ 064 void setProcedure( byte[] procedure ); 065 066 067 /** 068 * Gets the procedure specification. 069 * 070 * @return the procedure specification 071 */ 072 String getProcedureSpecification(); 073 074 075 /** 076 * Size. 077 * 078 * @return the procedure's bytcode size 079 */ 080 int size(); 081 082 083 /** 084 * Gets the parameter type. 085 * 086 * @param index the index 087 * @return the parameter type 088 */ 089 Object getParameterType( int index ); 090 091 092 /** 093 * Gets the java parameter type. 094 * 095 * @param index the index 096 * @return the java parameter type 097 */ 098 Class<?> getJavaParameterType( int index ); 099 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 /** 129 * Adds a parameter 130 * 131 * @param parameter The parameter to add 132 */ 133 void addParameter( StoredProcedureParameter parameter ); 134 135 136 /** 137 * @return The list of parameters for this stored procedure 138 */ 139 List<StoredProcedureParameter> getParameters(); 140}