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.shared.ldap.extras.extended;
021
022
023import java.util.List;
024
025import org.apache.directory.shared.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<StoredProcedureResponse>
034{
035
036    /** The OID for the stored procedure extended operation request. */
037    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.6";
038
039
040    /**
041     * Gets the language.
042     *
043     * @return the language
044     */
045    String getLanguage();
046
047
048    /**
049     * Sets the language.
050     *
051     * @param language the new language
052     */
053    void setLanguage( String language );
054
055
056    byte[] getProcedure();
057    
058    
059    void setProcedure( byte[] procedure );
060
061    
062    /**
063     * Gets the procedure specification.
064     *
065     * @return the procedure specification
066     */
067    String getProcedureSpecification();
068
069
070    /**
071     * Size.
072     *
073     * @return the int
074     */
075    int size();
076
077
078    /**
079     * Gets the parameter type.
080     *
081     * @param index the index
082     * @return the parameter type
083     */
084    Object getParameterType( int index );
085
086
087    /**
088     * Gets the java parameter type.
089     *
090     * @param index the index
091     * @return the java parameter type
092     */
093    Class<?> getJavaParameterType( int index );
094
095
096    /**
097     * Gets the parameter value.
098     *
099     * @param index the index
100     * @return the parameter value
101     */
102    Object getParameterValue( int index );
103
104
105    /**
106     * Gets the java parameter value.
107     *
108     * @param index the index
109     * @return the java parameter value
110     */
111    Object getJavaParameterValue( int index );
112
113
114    /**
115     * Adds the parameter.
116     *
117     * @param type the type
118     * @param value the value
119     */
120    void addParameter( Object type, Object value );
121
122    
123    void addParameter( StoredProcedureParameter parameter );
124
125    List<StoredProcedureParameter> getParameters();
126}