directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1066813 - /directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
Date Thu, 03 Feb 2011 13:33:56 GMT
Author: elecharny
Date: Thu Feb  3 13:33:56 2011
New Revision: 1066813

URL: http://svn.apache.org/viewvc?rev=1066813&view=rev
Log:
Added the hasValue, getEncodedValue, setEncodedValue methods

Modified:
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java?rev=1066813&r1=1066812&r2=1066813&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
Thu Feb  3 13:33:56 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.message.Control;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -33,6 +34,9 @@ import org.apache.directory.shared.ldap.
  */
 public class OpaqueControlImpl extends AbstractControl implements Control
 {
+	/** The opaque encoded value */
+	private byte[] value;
+	
     /**
      * Creates a Control with a specific OID.
      *
@@ -56,4 +60,32 @@ public class OpaqueControlImpl extends A
     }
 
 
+    /**
+     * @return The encoded value
+     */
+    public byte[] getEncodedValue()
+    {
+    	return value;
+    }
+    
+    
+    /**
+     * Stores an opaque value into the vontrol
+     * @param value The opaque value to store
+     */
+    public void setEncodedValue( byte[] value )
+    {
+    	this.value = Strings.copy( value );
+    }
+    
+    
+    /**
+     * Tells if the control has a stored value. Note that if the 
+     * control has an empty value, this method will return true.
+     * @return true if the control has a value
+     */
+    public boolean hasValue()
+    {
+    	return value != null;
+    }
 }



Mime
View raw message