Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 32389 invoked from network); 4 Sep 2006 11:51:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Sep 2006 11:51:10 -0000 Received: (qmail 30225 invoked by uid 500); 4 Sep 2006 11:51:10 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 30192 invoked by uid 500); 4 Sep 2006 11:51:09 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 30181 invoked by uid 99); 4 Sep 2006 11:51:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2006 04:51:09 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2006 04:51:08 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 58BD01A981A; Mon, 4 Sep 2006 04:50:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440035 - in /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp: JavaStoredProcedureUtils.java LdapContextParameter.java Date: Mon, 04 Sep 2006 11:50:47 -0000 To: commits@directory.apache.org From: ersiner@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060904115047.58BD01A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ersiner Date: Mon Sep 4 04:50:46 2006 New Revision: 440035 URL: http://svn.apache.org/viewvc?view=rev&rev=440035 Log: Added support for special SP parameter: $ldapContext. Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/LdapContextParameter.java Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java?view=diff&rev=440035&r1=440034&r2=440035 ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java Mon Sep 4 04:50:46 2006 @@ -138,8 +138,20 @@ */ for ( int i = 0; i < arguments.length; i++ ) { - byte[] type = arguments[i].getClass().getName().getBytes( "UTF-8" ); - byte[] value = SerializationUtils.serialize( ( Serializable ) arguments[i] ); + byte[] type; + byte[] value; + if ( arguments[i] instanceof LdapContextParameter ) + { + LdapContextParameter lcp = ( LdapContextParameter ) arguments[i]; + type = lcp.getType().getBytes( "UTF-8" ); + value = SerializationUtils.serialize( ( Serializable ) lcp.getValue() ); + } + else + { + type = arguments[i].getClass().getName().getBytes( "UTF-8" ); + value = SerializationUtils.serialize( ( Serializable ) arguments[i] ); + } + req.addParameter( type, value ); } Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/LdapContextParameter.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/LdapContextParameter.java?view=auto&rev=440035 ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/LdapContextParameter.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/LdapContextParameter.java Mon Sep 4 04:50:46 2006 @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.directory.shared.ldap.sp; + + + +/** + * A class for representing the special SP parameter: $ldapContext. + * + * @author Apache Directory Project + * @version $Rev:$ + */ +public class LdapContextParameter +{ + private String name; + + public LdapContextParameter( String name ) + { + this.name = name; + } + + public String getType() + { + return "$ldapContext"; + } + + public Object getValue() + { + return name; + } +}