directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r441415 - /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java
Date Fri, 08 Sep 2006 07:33:24 GMT
Author: elecharny
Date: Fri Sep  8 00:33:24 2006
New Revision: 441415

URL: http://svn.apache.org/viewvc?view=rev&rev=441415
Log:
Added the skeleton of the control Asn1Ber decorator implementation

Added:
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java

Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java?view=auto&rev=441415
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java
(added)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/ControlAsn1Ber.java
Fri Sep  8 00:33:24 2006
@@ -0,0 +1,75 @@
+/*
+ *  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.codec.asn1ber.messages;
+
+import java.nio.ByteBuffer;
+
+import org.apache.directory.shared.asn1.ber.tlv.ValueException;
+import org.apache.directory.shared.ldap.codec.Decoder;
+import org.apache.directory.shared.ldap.codec.Encoder;
+import org.apache.directory.shared.ldap.codec.EncoderException;
+import org.apache.directory.shared.ldap.messages.Control;
+import org.apache.directory.shared.ldap.messages.ControlDecorator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 
+ * This class is a ASN.1 BER codec decorator. It adds coding and decoding
+ * behavior to the Control object. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ControlAsn1Ber extends ControlDecorator implements Encoder, Decoder
+{
+    /** The logger */
+    private static Logger log = LoggerFactory.getLogger( ControlAsn1Ber.class );
+
+    /** A speedup for logger */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    
+    /**
+     * 
+     * Creates a new instance of BindRequestAsn1Ber.
+     *
+     * @param bindRequest The bindRequest object to decorate
+     */
+    public ControlAsn1Ber( Control control )
+    {
+        super( control );
+    }
+    
+    public int computeLength()
+    {
+        int length = 0;
+        
+        if ( IS_DEBUG )
+        {
+            log.debug( "Control length : {}", length );
+        }
+        
+        return length;
+    }
+    
+    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException, ValueException
+    {
+        return buffer;
+    }
+}



Mime
View raw message