Class JavaStoredProcUtils
java.lang.Object
org.apache.directory.api.ldap.sp.JavaStoredProcUtils
A utility class for working with Java Stored Procedures at the base level.
- Author:
- Apache Directory Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcallStoredProcedure(LdapContext ctx, String procedureName, Object[] arguments) Invoke a Stored Procedurestatic byte[]getClassFileAsStream(Class<?> clazz) Returns the stream data of a Java class.static voidloadStoredProcedureClass(LdapContext ctx, Class<?> clazz) Loads a Java class's stream data as a subcontext of an LdapContext given.
-
Method Details
-
getClassFileAsStream
Returns the stream data of a Java class.- Parameters:
clazz- The class whose stream data will be retrieved.- Returns:
- Stream data of the class file as a byte array.
- Throws:
NamingException- If an IO error occurs during reading the class file.
-
loadStoredProcedureClass
Loads a Java class's stream data as a subcontext of an LdapContext given.- Parameters:
ctx- The parent context of the Java class entry to be loaded.clazz- Class to be loaded.- Throws:
NamingException- If an error occurs during creating the subcontext.
-
callStoredProcedure
public static Object callStoredProcedure(LdapContext ctx, String procedureName, Object[] arguments) throws NamingException Invoke a Stored Procedure- Parameters:
ctx- The execution contextprocedureName- The procedure to executearguments- The procedure's arguments- Returns:
- The execution resut
- Throws:
NamingException- If we have had an error whil executing the stored procedure
-