Author: akarasulu
Date: Sat Jan 7 00:25:20 2006
New Revision: 366695
URL: http://svn.apache.org/viewcvs?rev=366695&view=rev
Log:
cleaned up all Lockable interfaces/implementations and made Controls property into Map instead of a Collection
Removed:
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/AbstractLockable.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/LockException.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/Lockable.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttribute.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributes.java
Modified:
directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
directory/trunk/apacheds/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
directory/trunk/apacheds/src/main/java/org/apache/ldap/server/schema/SchemaService.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequest.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractMessage.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponseImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Control.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ControlImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResult.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResultImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributeImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributesImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Message.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/MessageDecoder.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Referral.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseEntryImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReference.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReferenceImpl.java
directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SubentryRequestControl.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractMessageTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/LdapResultImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ReferralImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseEntryImplTest.java
directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseReferenceImplTest.java
directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java
directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/BindHandler.java
directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/PersistentSearchListener.java
directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java
Modified: directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java (original)
+++ directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java Sat Jan 7 00:25:20 2006
@@ -53,7 +53,6 @@
import org.apache.ldap.common.filter.ExprNode;
import org.apache.ldap.common.filter.PresenceNode;
import org.apache.ldap.common.message.LockableAttributeImpl;
-import org.apache.ldap.common.message.LockableAttributes;
import org.apache.ldap.common.message.LockableAttributesImpl;
import org.apache.ldap.common.name.LdapName;
import org.apache.ldap.common.util.DateUtils;
@@ -307,9 +306,7 @@
public void sync() throws NamingException
{
MultiException error = null;
-
Iterator list = this.partitions.values().iterator();
-
while ( list.hasNext() )
{
DirectoryPartition partition = ( DirectoryPartition ) list.next();
@@ -321,7 +318,6 @@
catch ( NamingException e )
{
log.warn( "Failed to flush partition data out.", e );
-
if ( error == null )
{
error = new MultiException( "Grouping many exceptions on root nexus sync()" );
@@ -335,9 +331,7 @@
if ( error != null )
{
String msg = "Encountered failures while performing a sync() operation on backing stores";
-
NamingException total = new NamingException( msg );
-
total.setRootCause( error );
}
}
@@ -387,11 +381,9 @@
for ( int ii = 0; ii < attr.size(); ii++ )
{
Object attrValObj = normalizer.normalize( attr.get( ii ) );
-
if ( attrValObj instanceof String )
{
String attrVal = ( String ) attrValObj;
-
if ( ( reqVal instanceof String) && attrVal.equals( reqVal ) )
{
return true;
@@ -400,7 +392,6 @@
else
{
byte[] attrVal = (byte[])attrValObj;
-
if ( reqVal instanceof byte[] )
{
return Arrays.equals( attrVal, (byte[])reqVal );
@@ -489,7 +480,6 @@
public Name getMatchedName( Name dn, boolean normalized ) throws NamingException
{
dn = ( Name ) dn.clone();
-
while ( dn.size() > 0 )
{
if ( hasEntry( dn ) )
@@ -516,7 +506,6 @@
public Name getSuffix( Name dn, boolean normalized ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
return backend.getSuffix( normalized );
}
@@ -567,7 +556,6 @@
public void delete( Name dn ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
backend.delete( dn );
}
@@ -584,7 +572,6 @@
public void add( String updn, Name dn, Attributes an_entry ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
backend.add( updn, dn, an_entry );
}
@@ -595,7 +582,6 @@
public void modify( Name dn, int modOp, Attributes mods ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
backend.modify( dn, modOp, mods );
}
@@ -607,7 +593,6 @@
public void modify( Name dn, ModificationItem[] mods ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
backend.modify( dn, mods );
}
@@ -618,7 +603,6 @@
public NamingEnumeration list( Name base ) throws NamingException
{
DirectoryPartition backend = getBackend( base );
-
return backend.list( base );
}
@@ -688,15 +672,10 @@
{
if ( dn.size() == 0 )
{
- LockableAttributes retval = ( LockableAttributes ) rootDSE.clone();
-
- retval.setLocked( true );
-
- return retval;
+ return ( Attributes ) rootDSE.clone();
}
DirectoryPartition backend = getBackend( dn );
-
return backend.lookup( dn );
}
@@ -708,26 +687,18 @@
{
if ( dn.size() == 0 )
{
- LockableAttributes retval = new LockableAttributesImpl();
-
+ Attributes retval = new LockableAttributesImpl();
NamingEnumeration list = rootDSE.getIDs();
-
while ( list.hasMore() )
{
String id = ( String ) list.next();
-
Attribute attr = rootDSE.get( id );
-
retval.put( ( Attribute ) attr.clone() );
}
-
- retval.setLocked( true );
-
return retval;
}
DirectoryPartition backend = getBackend( dn );
-
return backend.lookup( dn, attrIds );
}
@@ -748,7 +719,6 @@
}
DirectoryPartition backend = getBackend( dn );
-
return backend.hasEntry( dn );
}
@@ -768,7 +738,6 @@
public void modifyRn( Name dn, String newRdn, boolean deleteOldRdn ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
-
backend.modifyRn( dn, newRdn, deleteOldRdn );
}
@@ -779,7 +748,6 @@
public void move( Name oriChildName, Name newParentName ) throws NamingException
{
DirectoryPartition backend = getBackend( oriChildName );
-
backend.move( oriChildName, newParentName );
}
@@ -792,7 +760,6 @@
boolean deleteOldRdn ) throws NamingException
{
DirectoryPartition backend = getBackend( oldChildDn );
-
backend.move( oldChildDn, newParentDn, newRdn, deleteOldRdn );
}
@@ -812,7 +779,6 @@
private DirectoryPartition getBackend( Name dn ) throws NamingException
{
Name clonedDn = ( Name ) dn.clone();
-
while ( clonedDn.size() > 0 )
{
if ( partitions.containsKey( clonedDn.toString() ) )
@@ -822,7 +788,6 @@
clonedDn.remove( clonedDn.size() - 1 );
}
-
throw new NameNotFoundException( dn.toString() );
}
}
Modified: directory/trunk/apacheds/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewcvs/directory/trunk/apacheds/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/apacheds/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java (original)
+++ directory/trunk/apacheds/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java Sat Jan 7 00:25:20 2006
@@ -38,7 +38,6 @@
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
-import org.apache.ldap.common.Lockable;
import org.apache.ldap.common.message.LockableAttributeImpl;
import org.apache.ldap.common.message.LockableAttributesImpl;
import org.apache.ldap.common.util.PreferencesDictionary;
@@ -127,13 +126,11 @@
public ServerSystemPreferences( ServerSystemPreferences parent, String name )
{
super( parent, name );
-
LdapContext parentCtx = parent.getLdapContext();
try
{
ctx = ( LdapContext ) parentCtx.lookup( "prefNodeName=" + name );
-
super.newNode = false;
}
catch ( NamingException e )
@@ -191,29 +188,18 @@
private void setUpNode( String name ) throws NamingException
{
Attributes attrs = new LockableAttributesImpl();
-
- Attribute attr = new LockableAttributeImpl( ( Lockable ) attrs, "objectClass" );
-
+ Attribute attr = new LockableAttributeImpl( "objectClass" );
attr.add( "top" );
-
attr.add( "prefNode" );
-
attr.add( "extensibleObject" );
-
attrs.put( attr );
-
- attr = new LockableAttributeImpl( ( Lockable ) attrs, "prefNodeName" );
-
+ attr = new LockableAttributeImpl( "prefNodeName" );
attr.add( name );
-
attrs.put( attr );
LdapContext parent = ( ( ServerSystemPreferences ) parent() ).getLdapContext();
-
parent.bind( "prefNodeName=" + name, null, attrs );
-
ctx = ( LdapContext ) parent.lookup( "prefNodeName=" + name );
-
super.newNode = false;
}
@@ -246,7 +232,6 @@
}
changes.clear();
-
keyToChange.clear();
}
@@ -263,9 +248,7 @@
}
ctx = null;
-
changes.clear();
-
keyToChange.clear();
}
@@ -293,7 +276,6 @@
}
changes.clear();
-
keyToChange.clear();
}
@@ -301,13 +283,11 @@
protected String[] childrenNamesSpi() throws BackingStoreException
{
ArrayList children = new ArrayList();
-
NamingEnumeration list = null;
try
{
list = ctx.list( "" );
-
while ( list.hasMore() )
{
NameClassPair ncp = ( NameClassPair ) list.next();
@@ -327,24 +307,19 @@
protected String[] keysSpi() throws BackingStoreException
{
Attributes attrs = null;
-
ArrayList keys = new ArrayList();
try
{
attrs = ctx.getAttributes( "" );
-
NamingEnumeration ids = attrs.getIDs();
-
while ( ids.hasMore() )
{
String id = ( String ) ids.next();
-
if ( id.equals( "objectClass" ) || id.equals( "prefNodeName" ) )
{
continue;
}
-
keys.add( id );
}
}
@@ -360,9 +335,7 @@
protected void removeSpi( String key )
{
Attribute attr = new BasicAttribute( key );
-
ModificationItem mi = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
-
addDelta( mi );
}
@@ -370,11 +343,8 @@
private void addDelta( ModificationItem mi )
{
String key = mi.getAttribute().getID();
-
List deltas = null;
-
changes.add( mi );
-
if ( keyToChange.containsKey( key ) )
{
deltas = ( List ) keyToChange.get( key );
@@ -385,7 +355,6 @@
}
deltas.add( mi );
-
keyToChange.put( key, deltas );
}
@@ -397,15 +366,12 @@
try
{
Attribute attr = ctx.getAttributes( "" ).get( key );
-
if ( keyToChange.containsKey( key ) )
{
List mods = ( List ) keyToChange.get( key );
-
for ( int ii = 0; ii < mods.size(); ii++ )
{
ModificationItem mi = ( ModificationItem ) mods.get( ii );
-
if ( mi.getModificationOp() == DirContext.REMOVE_ATTRIBUTE )
{
attr = null;
@@ -436,11 +402,8 @@
protected void putSpi( String key, String value )
{
Attribute attr = new BasicAttribute( key );
-
attr.add( value );
-
ModificationItem mi = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-
addDelta( mi );
}
Modified: directory/trunk/apacheds/src/main/java/org/apache/ldap/server/schema/SchemaService.java
URL: http://svn.apache.org/viewcvs/directory/trunk/apacheds/src/main/java/org/apache/ldap/server/schema/SchemaService.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/apacheds/src/main/java/org/apache/ldap/server/schema/SchemaService.java (original)
+++ directory/trunk/apacheds/src/main/java/org/apache/ldap/server/schema/SchemaService.java Sat Jan 7 00:25:20 2006
@@ -223,7 +223,7 @@
if ( returnAllOperationalAttributes || set.contains( "objectclasses" ) )
{
- attr = new LockableAttributeImpl( attrs, "objectClasses" );
+ attr = new LockableAttributeImpl( "objectClasses" );
Iterator list = globalRegistries.getObjectClassRegistry().list();
while ( list.hasNext() )
{
@@ -235,7 +235,7 @@
if ( returnAllOperationalAttributes || set.contains( "attributetypes" ) )
{
- attr = new LockableAttributeImpl( attrs, "attributeTypes" );
+ attr = new LockableAttributeImpl( "attributeTypes" );
Iterator list = globalRegistries.getAttributeTypeRegistry().list();
while ( list.hasNext() )
{
@@ -247,7 +247,7 @@
if ( returnAllOperationalAttributes || set.contains( "matchingrules" ) )
{
- attr = new LockableAttributeImpl( attrs, "matchingRules" );
+ attr = new LockableAttributeImpl( "matchingRules" );
Iterator list = globalRegistries.getMatchingRuleRegistry().list();
while ( list.hasNext() )
{
@@ -259,7 +259,7 @@
if ( returnAllOperationalAttributes || set.contains( "matchingruleuse" ) )
{
- attr = new LockableAttributeImpl( attrs, "matchingRuleUse" );
+ attr = new LockableAttributeImpl( "matchingRuleUse" );
Iterator list = globalRegistries.getMatchingRuleUseRegistry().list();
while ( list.hasNext() )
{
@@ -271,7 +271,7 @@
if ( returnAllOperationalAttributes || set.contains( "ldapsyntaxes" ) )
{
- attr = new LockableAttributeImpl( attrs, "ldapSyntaxes" );
+ attr = new LockableAttributeImpl( "ldapSyntaxes" );
Iterator list = globalRegistries.getSyntaxRegistry().list();
while ( list.hasNext() )
{
@@ -283,7 +283,7 @@
if ( returnAllOperationalAttributes || set.contains( "ditcontentrules" ) )
{
- attr = new LockableAttributeImpl( attrs, "dITContentRules" );
+ attr = new LockableAttributeImpl( "dITContentRules" );
Iterator list = globalRegistries.getDitContentRuleRegistry().list();
while ( list.hasNext() )
{
@@ -295,7 +295,7 @@
if ( returnAllOperationalAttributes || set.contains( "ditstructurerules" ) )
{
- attr = new LockableAttributeImpl( attrs, "dITStructureRules" );
+ attr = new LockableAttributeImpl( "dITStructureRules" );
Iterator list = globalRegistries.getDitStructureRuleRegistry().list();
while ( list.hasNext() )
{
@@ -307,7 +307,7 @@
if ( returnAllOperationalAttributes || set.contains( "nameforms" ) )
{
- attr = new LockableAttributeImpl( attrs, "nameForms" );
+ attr = new LockableAttributeImpl( "nameForms" );
Iterator list = globalRegistries.getNameFormRegistry().list();
while ( list.hasNext() )
{
@@ -323,28 +323,28 @@
if ( returnAllOperationalAttributes || set.contains( "createtimestamp" ) )
{
- attr = new LockableAttributeImpl( attrs, "createTimestamp" );
+ attr = new LockableAttributeImpl( "createTimestamp" );
attr.add( startUpTimeStamp );
attrs.put( attr );
}
if ( returnAllOperationalAttributes || set.contains( "modifytimestamp" ) )
{
- attr = new LockableAttributeImpl( attrs, "modifyTimestamp" );
+ attr = new LockableAttributeImpl( "modifyTimestamp" );
attr.add( startUpTimeStamp );
attrs.put( attr );
}
if ( returnAllOperationalAttributes || set.contains( "creatorsname" ) )
{
- attr = new LockableAttributeImpl( attrs, "creatorsName" );
+ attr = new LockableAttributeImpl( "creatorsName" );
attr.add( DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attrs.put( attr );
}
if ( returnAllOperationalAttributes || set.contains( "modifiersname" ) )
{
- attr = new LockableAttributeImpl( attrs, "modifiersName" );
+ attr = new LockableAttributeImpl( "modifiersName" );
attr.add( DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attrs.put( attr );
}
@@ -366,7 +366,7 @@
// add the objectClass attribute
if ( set.contains( "*" ) || set.contains( "objectclass" ) || set.size() == minSetSize )
{
- attr = new LockableAttributeImpl( attrs, "objectClass" );
+ attr = new LockableAttributeImpl( "objectClass" );
attr.add( "top" );
attr.add( "subschema" );
attrs.put( attr );
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java Sat Jan 7 00:25:20 2006
@@ -697,7 +697,7 @@
}
else if ( twixControl.getControlValue() instanceof byte[] )
{
- neutralControl = new ControlImpl( snickersMessage )
+ neutralControl = new ControlImpl()
{
// Just to avoid a compilation warning !!!
public static final long serialVersionUID = 1L;
@@ -1115,7 +1115,7 @@
private void transformControls( org.apache.ldap.common.codec.LdapMessage twixMessage, Message msg )
{
- Iterator list = msg.getControls().iterator();
+ Iterator list = msg.getControls().values().iterator();
while ( list.hasNext() )
{
Control control = ( Control ) list.next();
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequest.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequest.java Sat Jan 7 00:25:20 2006
@@ -14,34 +14,32 @@
* limitations under the License.
*
*/
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
/**
* Abandon protocol operation request to terminate an operation already in
* progress.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
-public interface AbandonRequest
- extends Request
+public interface AbandonRequest extends Request
{
/** Ldap abandon request type code */
- MessageTypeEnum TYPE = MessageTypeEnum.ABANDONREQUEST ;
+ MessageTypeEnum TYPE = MessageTypeEnum.ABANDONREQUEST;
/**
* Gets the id of the request operation to terminate.
*
* @return the id of the request message to abandon
*/
- int getAbandoned() ;
+ int getAbandoned();
/**
* Sets the id of the request operation to terminate.
*
* @param requestId the sequence id of the request message to abandon
*/
- void setAbandoned( int requestId ) ;
+ void setAbandoned( int requestId );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbandonRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -20,8 +20,7 @@
/**
* Lockable implementation of an AbandonRequest.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
public class AbandonRequestImpl extends AbstractRequest implements AbandonRequest
@@ -60,7 +59,6 @@
*/
public void setAbandoned( int abandonId )
{
- lockCheck( "Attempt to alter locked AbandonRequest!" ) ;
this.abandonId = abandonId ;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractMessage.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractMessage.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractMessage.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractMessage.java Sat Jan 7 00:25:20 2006
@@ -19,17 +19,14 @@
import java.util.*;
-import org.apache.ldap.common.AbstractLockable;
-
/**
* Abstract message base class.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
-public class AbstractMessage extends AbstractLockable implements Message
+public class AbstractMessage implements Message
{
static final long serialVersionUID = 7601738291101182094L;
/** Map of message controls using OID Strings for keys and Control values */
@@ -51,8 +48,6 @@
*/
protected AbstractMessage( final int id, final MessageTypeEnum type )
{
- super( true );
-
this.id = id;
this.type = type;
controls = new HashMap();
@@ -80,9 +75,9 @@
* @return Map of OID strings to Control object instances.
* @see Control
*/
- public Collection getControls()
+ public Map getControls()
{
- return Collections.unmodifiableCollection( controls.values() );
+ return Collections.unmodifiableMap( controls );
}
@@ -95,7 +90,6 @@
*/
public void add( Control control ) throws MessageException
{
- lockCheck( "Attempt to add control to locked message envelope!" );
controls.put( control.getType(), control );
}
@@ -109,7 +103,6 @@
*/
public void remove( Control control ) throws MessageException
{
- lockCheck( "Attempt to remove control from locked message envelope!" );
controls.remove( control.getType() );
}
@@ -196,16 +189,16 @@
return false;
}
- Collection controls = msg.getControls();
+ Map controls = msg.getControls();
if ( controls.size() != this.controls.size() )
{
return false;
}
- Iterator list = this.controls.values().iterator();
+ Iterator list = this.controls.keySet().iterator();
while ( list.hasNext() )
{
- if ( ! controls.contains( list.next() ) )
+ if ( ! controls.containsKey( list.next() ) )
{
return false;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java Sat Jan 7 00:25:20 2006
@@ -20,14 +20,13 @@
/**
* Abstract base for a Lockable ResultResponse message.
*
- * @author Alex Karasulu
- * @author $Author: akarasulu $
+ * @author Apache Directory Project
* @version $Revision$
*/
public abstract class AbstractResultResponse extends AbstractResponse implements ResultResponse
{
/** Response result components */
- private LdapResult result = new LdapResultImpl( this );
+ private LdapResult result = new LdapResultImpl();
// ------------------------------------------------------------------------
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -76,7 +76,6 @@
*/
public void setEntry( String entry )
{
- lockCheck( "Attempt to alter new entry name of locked AddRequest!" );
this.entry = entry;
}
@@ -100,7 +99,6 @@
*/
public void setAttributes( Attributes attributes )
{
- lockCheck( "Attempt to alter entry of locked AddRequest!" );
this.attributes = attributes;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -101,7 +101,6 @@
*/
public void setSimple( boolean isSimple )
{
- lockCheck( "Attempt to alter auth. mode of locked BindRequest!" );
this.isSimple = isSimple;
}
@@ -127,7 +126,6 @@
*/
public void setCredentials( byte [] credentials )
{
- lockCheck( "Attempt to alter auth. cred. of locked BindRequest!" );
this.credentials = credentials;
}
@@ -149,7 +147,6 @@
*/
public void setSaslMechanism( String mechanism )
{
- lockCheck( "Attempt to alter auth. cred. of locked BindRequest!" );
this.mechanism = mechanism;
}
@@ -181,7 +178,6 @@
*/
public void setName( String name )
{
- lockCheck( "Attempt to alter auth. DN of locked BindRequest!" );
this.name = name;
}
@@ -234,7 +230,6 @@
*/
public void setVersion3( boolean isVersion3 )
{
- lockCheck( "Attempt to alter proto. version of locked BindRequest!" );
this.isVersion3 = isVersion3;
}
@@ -318,7 +313,6 @@
public String toString()
{
StringBuffer sb = new StringBuffer();
-
sb.append( " BindRequest\n" );
sb.append( " Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponseImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponseImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponseImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponseImpl.java Sat Jan 7 00:25:20 2006
@@ -27,8 +27,7 @@
* Apache Directory Project
* @version $Rev$
*/
-public class BindResponseImpl
- extends AbstractResultResponse implements BindResponse
+public class BindResponseImpl extends AbstractResultResponse implements BindResponse
{
static final long serialVersionUID = -5146809476518669755L;
/** optional property holding SASL authentication response paramters */
@@ -78,7 +77,6 @@
*/
public void setServerSaslCreds( byte [] serverSaslCreds )
{
- lockCheck( "Attempt to alter serverSaslCreds on locked BindResponse!" );
this.serverSaslCreds = serverSaslCreds;
}
@@ -107,7 +105,6 @@
}
BindResponse response = ( BindResponse ) obj;
-
byte[] creds = response.getServerSaslCreds();
if ( serverSaslCreds == null && creds != null )
{
@@ -139,7 +136,6 @@
public String toString()
{
StringBuffer sb = new StringBuffer();
-
sb.append( " BindResponse\n" );
sb.append( super.toString() );
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -82,7 +82,6 @@
*/
public void setName( String name )
{
- lockCheck( "Attempt to alter entry name on locked CompareRequest!" );
this.name = name;
}
@@ -104,9 +103,6 @@
*/
public void setAssertionValue( String attrVal )
{
- super.lockCheck(
- "Attempt to alter attribute value of locked CompareRequest" );
-
this.attrVal = StringTools.getBytesUtf8( attrVal );
}
@@ -117,8 +113,6 @@
*/
public void setAssertionValue( byte[] attrVal )
{
- super.lockCheck(
- "Attempt to alter attribute value of locked CompareRequest" );
this.attrVal = attrVal;
}
@@ -140,8 +134,6 @@
*/
public void setAttributeId( String attrId )
{
- super.lockCheck(
- "Attempt to alter attribute id of locked CompareRequest" );
this.attrId = attrId;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Control.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Control.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Control.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Control.java Sat Jan 7 00:25:20 2006
@@ -17,16 +17,14 @@
package org.apache.ldap.common.message ;
-import org.apache.ldap.common.Lockable;
-
-
/**
* Protocol request and response altering control interface. Any number of
* controls may be associated with a protocol message.
*
* @author Apache Directory Project
+ * @version $Rev$
*/
-public interface Control extends Lockable, javax.naming.ldap.Control
+public interface Control extends javax.naming.ldap.Control
{
/**
* Gets the OID of the Control to identify the control type.
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ControlImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ControlImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ControlImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ControlImpl.java Sat Jan 7 00:25:20 2006
@@ -17,17 +17,13 @@
package org.apache.ldap.common.message ;
-import org.apache.ldap.common.Lockable ;
-import org.apache.ldap.common.AbstractLockable ;
-
-
/**
* Lockable Control implementation.
*
* @author Apache Directory Project
* @version $Rev$
*/
-public abstract class ControlImpl extends AbstractLockable implements Control
+public abstract class ControlImpl implements Control
{
/** Unique object identifier for this control */
private String oid ;
@@ -38,33 +34,6 @@
// ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
-
- /**
- * Creates a non-root Lockable Control implementation whose state is
- * overriden by a parent Lockable.
- *
- * @param parent the overriding parent Lockable.
- */
- public ControlImpl( final Lockable parent )
- {
- super( parent, false ) ;
- }
-
-
- /**
- * Creates a non-root Lockable Control implementation whose state is
- * overriden by a parent Lockable.
- */
- public ControlImpl()
- {
- super() ;
- }
-
-
- // ------------------------------------------------------------------------
// Control Interface Method Implementations
// ------------------------------------------------------------------------
@@ -91,7 +60,6 @@
*/
public void setCritical( boolean isCritical )
{
- lockCheck( "Attempt to alter criticality flag of locked Control!" ) ;
this.isCritical = isCritical ;
}
@@ -114,7 +82,6 @@
*/
public void setType( String oid )
{
- lockCheck( "Attempt to alter OID of locked Control!" ) ;
this.oid = oid ;
}
@@ -139,7 +106,6 @@
*/
public void setValue( byte [] value )
{
- lockCheck( "Attempt to alter encoded values of locked Control!" ) ;
this.value = value ;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -18,7 +18,7 @@
/**
- * Lockable delete request implementation.
+ * Delete request implementation.
*
* @author Apache Directory Project
* @version $Rev$
@@ -73,7 +73,6 @@
*/
public void setName( String name )
{
- lockCheck( "Attempt to alter entry name of locked DeleteRequest!" );
this.name = name;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -22,10 +22,9 @@
/**
- * Lockable ExtendedRequest implementation.
+ * ExtendedRequest implementation.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
public class ExtendedRequestImpl extends AbstractRequest implements ExtendedRequest
@@ -79,7 +78,6 @@
*/
public void setOid( String oid )
{
- lockCheck( "Attempt to alter OID of locked ExtendedRequest!" );
this.oid = oid;
}
@@ -104,7 +102,6 @@
*/
public void setPayload( byte [] payload )
{
- lockCheck( "Attempt to alter payload of locked ExtendedRequest!" );
this.payload = payload;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java Sat Jan 7 00:25:20 2006
@@ -27,8 +27,7 @@
* Apache Directory Project
* @version $Rev$
*/
-public class ExtendedResponseImpl
- extends AbstractResultResponse implements ExtendedResponse
+public class ExtendedResponseImpl extends AbstractResultResponse implements ExtendedResponse
{
static final long serialVersionUID = -6646752766410531060L;
/** Object identifier for the extended response */
@@ -76,8 +75,6 @@
*/
public void setResponse( byte [] value )
{
- lockCheck(
- "Attempt to alter response value in locked ExtendedResponse!" ) ;
this.value = value ;
}
@@ -102,8 +99,6 @@
*/
public void setResponseName( String oid )
{
- lockCheck(
- "Attempt to alter responseName in locked ExtendedResponse!" ) ;
this.oid = oid ;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResult.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResult.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResult.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResult.java Sat Jan 7 00:25:20 2006
@@ -27,9 +27,6 @@
package org.apache.ldap.common.message ;
-import org.apache.ldap.common.Lockable ;
-
-
/**
* LDAPv3 result structure embedded into Responses. See section 4.1.10 in
* RFC 2251 for a description of the LDAPResult ASN.1 structure,
@@ -42,12 +39,10 @@
* operation request.
*
*
- * @author Alex Karasulu
- * @author $Author: akarasulu $
+ * @author Apache Directory Project
* @version $Revision$
*/
public interface LdapResult
- extends Lockable
{
/**
* Gets the result code enumeration associated with the response.
@@ -56,16 +51,16 @@
*
* @return the result code enum value.
*/
- ResultCodeEnum getResultCode() ;
+ ResultCodeEnum getResultCode();
/**
* Sets the result code enumeration associated with the response.
* Corresponds to the resultCode field within the LDAPResult ASN.1
* structure.
*
- * @param a_resultCode the result code enum value.
+ * @param resultCode the result code enum value.
*/
- void setResultCode( ResultCodeEnum a_resultCode ) ;
+ void setResultCode( ResultCodeEnum resultCode );
/**
* Gets the lowest entry in the directory that was matched.
@@ -80,15 +75,15 @@
*
* @return the Dn of the lowest matched entry.
*/
- String getMatchedDn() ;
+ String getMatchedDn();
/**
* Sets the lowest entry in the directory that was matched.
*
* @see #getMatchedDn()
- * @param a_dn the Dn of the lowest matched entry.
+ * @param dn the Dn of the lowest matched entry.
*/
- void setMatchedDn( String a_dn ) ;
+ void setMatchedDn( String dn );
/**
* Gets the descriptive error message associated with the error code. May
@@ -96,15 +91,15 @@
*
* @return the descriptive error message.
*/
- String getErrorMessage() ;
+ String getErrorMessage();
/**
* Sets the descriptive error message associated with the error code. May
* be null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations.
*
- * @param a_errorMessage the descriptive error message.
+ * @param errorMessage the descriptive error message.
*/
- void setErrorMessage( String a_errorMessage ) ;
+ void setErrorMessage( String errorMessage );
/**
* Gets whether or not this result represents a Referral. For referrals the
@@ -112,7 +107,7 @@
*
* @return true if this result represents a referral.
*/
- boolean isReferral() ;
+ boolean isReferral();
/**
* Gets the Referral associated with this LdapResult if the resultCode
@@ -120,7 +115,7 @@
*
* @return the referral on REFERRAL errors, null on all others.
*/
- Referral getReferral() ;
+ Referral getReferral();
/**
* Sets the Referral associated with this LdapResult if the resultCode
@@ -128,7 +123,7 @@
* will result in a true return from isReferral and the resultCode should
* be set to REFERRAL.
*
- * @param a_referral optional referral on REFERRAL errors.
+ * @param referral optional referral on REFERRAL errors.
*/
- void setReferral( Referral a_referral ) ;
+ void setReferral( Referral referral );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResultImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResultImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResultImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LdapResultImpl.java Sat Jan 7 00:25:20 2006
@@ -27,19 +27,13 @@
package org.apache.ldap.common.message;
-import org.apache.ldap.common.Lockable;
-import org.apache.ldap.common.AbstractLockable;
-
-
/**
- * Lockable LdapResult implementation.
+ * LdapResult implementation.
*
- * @author Alex Karasulu
- * @author $Author: akarasulu $
+ * @author Apache Directory Project
* @version $Revision$
*/
-public class LdapResultImpl
- extends AbstractLockable implements LdapResult
+public class LdapResultImpl implements LdapResult
{
static final long serialVersionUID = -1446626887394613213L;
/** Lowest matched entry Dn - defaults to empty string */
@@ -53,22 +47,6 @@
// ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
-
- /**
- * Creates a non-root Lockable LdapResult using a parent for state.
- *
- * @param parent the overriding parent Lockable.
- */
- public LdapResultImpl( final Lockable parent )
- {
- super( parent, false );
- }
-
-
- // ------------------------------------------------------------------------
// LdapResult Interface Method Implementations
// ------------------------------------------------------------------------
@@ -93,7 +71,6 @@
*/
public void setErrorMessage( String errorMessage )
{
- lockCheck( "Attempt to alter error message of locked LdapResult!" );
this.errorMessage = errorMessage;
}
@@ -125,7 +102,6 @@
*/
public void setMatchedDn( String matchedDn )
{
- lockCheck( "Attempt to alter matchedDn of locked LdapResult!" );
this.matchedDn = matchedDn;
}
@@ -152,7 +128,6 @@
*/
public void setResultCode( ResultCodeEnum resultCode )
{
- lockCheck( "Attempt to alter the resultCode of a locked LdapResult!" );
this.resultCode = resultCode;
}
@@ -191,7 +166,6 @@
*/
public void setReferral( Referral referral )
{
- lockCheck( "Attempt to alter the referral of a locked LdapResult!" );
this.referral = referral;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributeImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributeImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributeImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributeImpl.java Sat Jan 7 00:25:20 2006
@@ -25,8 +25,6 @@
import javax.naming.directory.Attribute;
import javax.naming.directory.DirContext;
-import org.apache.ldap.common.AbstractLockable;
-import org.apache.ldap.common.Lockable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,8 +35,7 @@
* @author Apache Directory Project
* @version $Rev$
*/
-public class LockableAttributeImpl
- extends AbstractLockable implements LockableAttribute
+public class LockableAttributeImpl implements Attribute
{
private static final Logger log = LoggerFactory.getLogger( LockableAttributeImpl.class );
@@ -58,15 +55,11 @@
* Creates a permanently LockableAttribute on id whose locking behavoir
* is dicatated by parent.
*
- * @param parent the parent of this Lockable.
* @param id the id or name of this attribute.
*/
- public LockableAttributeImpl( final Lockable parent, final String id )
+ public LockableAttributeImpl( final String id )
{
- super( parent , false ) ;
-
this.id = id ;
-
list = new ArrayList() ;
}
@@ -79,12 +72,8 @@
*/
public LockableAttributeImpl( final String id, final Object value )
{
- super( false ) ;
-
this.id = id ;
-
list = new ArrayList() ;
-
list.add( value );
}
@@ -99,65 +88,26 @@
*/
public LockableAttributeImpl( final String id, final byte[] value )
{
- super( false ) ;
-
this.id = id ;
-
list = new ArrayList() ;
-
list.add( value );
}
/**
- * Creates a permanently LockableAttribute on id.
- *
- * @param id the id or name of this attribute.
- */
- public LockableAttributeImpl( final String id )
- {
- super( false ) ;
-
- this.id = id ;
-
- list = new ArrayList() ;
- }
-
-
- /**
* Creates a permanently LockableAttribute on id whose locking behavoir
* is dicatated by parent. Used for the clone method.
*
- * @param parent the parent of this Lockable
- * @param id the id or name of this attribute
- * @param list the list of values to start with
- */
- private LockableAttributeImpl( final Lockable parent,
- final String id, final ArrayList list )
- {
- super( parent , false ) ;
-
- this.id = id ;
- this.list = list ;
- }
-
-
- /**
- * Creates a permanently LockableAttribute on id. Used for the clone
- * method.
- *
* @param id the id or name of this attribute
* @param list the list of values to start with
*/
private LockableAttributeImpl( final String id, final ArrayList list )
{
- super( false ) ;
-
this.id = id ;
this.list = list ;
}
-
+
// ------------------------------------------------------------------------
// javax.naming.directory.Attribute Interface Method Implementations
// ------------------------------------------------------------------------
@@ -234,7 +184,6 @@
*/
public boolean add( Object attrVal )
{
- super.lockCheck( "Attempt to add value to locked Attribute!" ) ;
return list.add( attrVal ) ;
}
@@ -248,7 +197,6 @@
*/
public boolean remove( Object attrVal )
{
- super.lockCheck( "Attempt to remove value from locked Attribute!" ) ;
return list.remove( attrVal ) ;
}
@@ -258,7 +206,6 @@
*/
public void clear()
{
- super.lockCheck( "Attempt to clear values from locked Attribute!" ) ;
list.clear() ;
}
@@ -296,11 +243,6 @@
public Object clone()
{
ArrayList l_list = ( ArrayList ) list.clone() ;
- if ( getParent() != null )
- {
- return new LockableAttributeImpl( getParent(), id, l_list ) ;
- }
-
return new LockableAttributeImpl( id, l_list ) ;
}
@@ -338,7 +280,6 @@
*/
public Object remove( int index )
{
- super.lockCheck( "Attempt to remove value from locked Attribute!" ) ;
return list.remove( index ) ;
}
@@ -352,7 +293,6 @@
*/
public void add( int index, Object attrVal )
{
- super.lockCheck( "Attempt to add value to locked Attribute!" ) ;
list.add( index, attrVal ) ;
}
@@ -366,7 +306,6 @@
*/
public Object set( int index, Object attrVal )
{
- super.lockCheck( "Attempt to set value in locked Attribute!" ) ;
return list.set( index, attrVal ) ;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributesImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributesImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributesImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/LockableAttributesImpl.java Sat Jan 7 00:25:20 2006
@@ -28,18 +28,14 @@
import org.apache.ldap.common.util.ExceptionUtils;
-import org.apache.ldap.common.Lockable;
-import org.apache.ldap.common.AbstractLockable;
-
/**
* A case-insensitive Lockable JNDI Attributes implementation.
*
- * @author Apache Directory
- * Project $Rev$
+ * @author Apache Directory Project
+ * @version $Rev$
*/
-public class LockableAttributesImpl
- extends AbstractLockable implements LockableAttributes
+public class LockableAttributesImpl implements Attributes
{
static final long serialVersionUID = -69864533495992471L;
/** Map of user provided String ids to Attributes */
@@ -58,19 +54,6 @@
*/
public LockableAttributesImpl()
{
- super( false );
- keyMap = new HashMap();
- }
-
-
- /**
- * Creates a LockableAttributes with a parent Lockable.
- *
- * @param parent the parent lockable to use for overriding lock state.
- */
- public LockableAttributesImpl( Lockable parent )
- {
- super( parent, false );
keyMap = new HashMap();
}
@@ -78,14 +61,11 @@
/**
* Used by clone to create a LockableAttributes.
*
- * @param parent the parent Lockable
* @param map the primary user provided id to Attribute Map
* @param keyMap the canonical key to user provided id Map
*/
- private LockableAttributesImpl( Lockable parent, Map map, Map keyMap )
+ private LockableAttributesImpl( Map map, Map keyMap )
{
- super( parent, false );
-
this.keyMap = new HashMap();
if ( keyMap != null )
@@ -144,14 +124,14 @@
*/
public Attribute get( String attrId )
{
- String l_key = getUserProvidedId( attrId );
+ String key = getUserProvidedId( attrId );
- if ( l_key == null )
+ if ( key == null )
{
return null;
}
- return ( Attribute ) map.get( l_key );
+ return ( Attribute ) map.get( key );
}
@@ -203,14 +183,12 @@
*/
public Attribute put( String attrId, Object val )
{
- super.lockCheck( "Attempt to add value to locked Attributes" );
-
if ( get( attrId ) == null )
{
setUserProvidedId( attrId );
}
- Attribute attr = new LockableAttributeImpl( this, attrId );
+ Attribute attr = new LockableAttributeImpl( attrId );
attr.add( val );
map.put( attrId, attr );
return attr;
@@ -229,22 +207,21 @@
*/
public Attribute put( Attribute attr )
{
- super.lockCheck( "Attempt to Attribute to locked Attributes" );
- Attribute l_old = get( attr.getID() );
+ Attribute old = get( attr.getID() );
- if ( l_old != null )
+ if ( old != null )
{
- map.remove( l_old.getID() );
+ map.remove( old.getID() );
if ( keyMap != null )
{
- keyMap.remove( l_old.getID().toLowerCase() );
+ keyMap.remove( old.getID().toLowerCase() );
}
}
map.put( attr.getID(), attr );
setUserProvidedId( attr.getID() );
- return l_old;
+ return old;
}
@@ -260,21 +237,19 @@
*/
public Attribute remove( String attrId )
{
- super.lockCheck(
- "Attempt to remove Attribute from locked Attributes" );
- Attribute l_old = get( attrId );
+ Attribute old = get( attrId );
- if ( l_old != null )
+ if ( old != null )
{
- map.remove( l_old.getID() );
+ map.remove( old.getID() );
if ( keyMap != null )
{
- keyMap.remove( l_old.getID().toLowerCase() );
+ keyMap.remove( old.getID().toLowerCase() );
}
}
- return l_old;
+ return old;
}
@@ -286,7 +261,7 @@
*/
public Object clone()
{
- return new LockableAttributesImpl( getParent(), map, keyMap );
+ return new LockableAttributesImpl( map, keyMap );
}
@@ -297,12 +272,12 @@
*/
public String toString()
{
- StringBuffer l_buf = new StringBuffer();
+ StringBuffer buf = new StringBuffer();
- Iterator l_attrs = map.values().iterator();
- while ( l_attrs.hasNext() )
+ Iterator attrs = map.values().iterator();
+ while ( attrs.hasNext() )
{
- Attribute l_attr = ( Attribute ) l_attrs.next();
+ Attribute l_attr = ( Attribute ) attrs.next();
try
{
@@ -310,19 +285,19 @@
while ( l_values.hasMore() )
{
Object l_value = l_values.next();
- l_buf.append( l_attr.getID() );
- l_buf.append( ": " );
- l_buf.append( l_value );
- l_buf.append( '\n' );
+ buf.append( l_attr.getID() );
+ buf.append( ": " );
+ buf.append( l_value );
+ buf.append( '\n' );
}
}
catch ( NamingException e )
{
- l_buf.append( ExceptionUtils.getFullStackTrace( e ) );
+ buf.append( ExceptionUtils.getFullStackTrace( e ) );
}
}
- return l_buf.toString();
+ return buf.toString();
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Message.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Message.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Message.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Message.java Sat Jan 7 00:25:20 2006
@@ -14,22 +14,19 @@
* limitations under the License.
*
*/
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
-import java.util.Collection ;
-
-import org.apache.ldap.common.Lockable ;
+import java.util.Map;
/**
* Root interface for all LDAP message type interfaces.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
-public interface Message extends Lockable
+public interface Message
{
/**
* Gets the LDAP message type code associated with this Message. Each
@@ -38,7 +35,7 @@
*
* @return the message type code.
*/
- MessageTypeEnum getType() ;
+ MessageTypeEnum getType();
/**
* Gets the controls associated with this message mapped by OID.
@@ -46,27 +43,25 @@
* @return Map of OID strings to Control object instances.
* @see Control
*/
- Collection getControls() ;
+ Map getControls();
/**
* Adds a control to this Message.
*
- * @param a_control the control to add.
+ * @param control the control to add.
* @throws MessageException if controls cannot be added to this Message or
* the control is not known etc.
*/
- void add( Control a_control )
- throws MessageException ;
+ void add( Control control ) throws MessageException;
/**
* Deletes a control removing it from this Message.
*
- * @param a_control the control to remove.
+ * @param control the control to remove.
* @throws MessageException if controls cannot be added to this Message or
* the control is not known etc.
*/
- void remove( Control a_control )
- throws MessageException ;
+ void remove( Control control ) throws MessageException;
/**
* Gets the session unique message sequence id for this message. Requests
@@ -76,7 +71,7 @@
*
* @return the session unique message id.
*/
- int getMessageId() ;
+ int getMessageId();
/**
* Gets a message scope parameter. Message scope parameters are temporary
@@ -89,10 +84,10 @@
* without firing LockExceptions even when this Lockable is in the locked
* state.
*
- * @param a_key the key used to access a message parameter.
+ * @param key the key used to access a message parameter.
* @return the transient message parameter value.
*/
- Object get( Object a_key ) ;
+ Object get( Object key );
/**
* Sets a message scope parameter.
@@ -101,9 +96,9 @@
* without firing LockExceptions even when this Lockable is in the locked
* state.
*
- * @param a_key the parameter key
- * @param a_value the parameter value
+ * @param key the parameter key
+ * @param value the parameter value
* @return the old value or null
*/
- Object put( Object a_key, Object a_value ) ;
+ Object put( Object key, Object value );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/MessageDecoder.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/MessageDecoder.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/MessageDecoder.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/MessageDecoder.java Sat Jan 7 00:25:20 2006
@@ -182,10 +182,6 @@
// Call on transformer to convert stub based PDU into Message based PDU
Message message = transformer.transform( providerEnvelope );
-
- // Lock down the PDU's parameters to protect against alteration
- message.setLocked( true );
-
return message;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -87,8 +87,6 @@
*/
public void setDeleteOldRdn( boolean deleteOldRdn )
{
- lockCheck(
- "Attempt to toggle deleteOldRdn flag of locked ModifyDnRequest!" );
this.deleteOldRdn = deleteOldRdn;
}
@@ -127,7 +125,6 @@
*/
public void setName( String name )
{
- lockCheck( "Attempt to alter entry name on locked ModifyDnRequest!" );
this.name = name;
}
@@ -152,7 +149,6 @@
*/
public void setNewRdn( String newRdn )
{
- lockCheck( "Atttempt to alter the newRdn of locked ModifyDnRequest!" );
this.newRdn = newRdn;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -110,7 +110,6 @@
*/
public void setName( String name )
{
- lockCheck( "Attempt to alter object name of locked ModifyRequest!" );
this.name = name;
}
@@ -123,7 +122,6 @@
*/
public void addModification( ModificationItem mod )
{
- lockCheck( "Attempt to add modification to locked ModifyRequest!" );
mods.add( mod );
}
@@ -136,7 +134,6 @@
*/
public void removeModification( ModificationItem mod )
{
- lockCheck( "Attempt to remove modification to locked ModifyRequest!" );
mods.remove( mod );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Referral.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Referral.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Referral.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/Referral.java Sat Jan 7 00:25:20 2006
@@ -14,12 +14,10 @@
* limitations under the License.
*
*/
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
-import java.util.Collection ;
-
-import org.apache.ldap.common.Lockable ;
+import java.util.Collection;
/**
@@ -87,26 +85,25 @@
* add/remove methods.
*/
public interface Referral
- extends Lockable
{
/**
* Gets an unmodifiable set of alternative referral urls.
*
* @return the alternative url objects.
*/
- Collection getLdapUrls() ;
+ Collection getLdapUrls();
/**
* Adds an LDAPv3 URL to this Referral.
*
* @param a_url the LDAPv3 URL to add
*/
- void addLdapUrl( String a_url ) ;
+ void addLdapUrl( String a_url );
/**
* Removes an LDAPv3 URL to this Referral.
*
* @param a_url the LDAPv3 URL to remove
*/
- void removeLdapUrl( String a_url ) ;
+ void removeLdapUrl( String a_url );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java Sat Jan 7 00:25:20 2006
@@ -19,22 +19,17 @@
import java.util.*;
-import org.apache.ldap.common.Lockable;
-import org.apache.ldap.common.AbstractLockable;
-
/**
- * Lockable Referral implementation. For the time being this implementation
+ * A Referral implementation. For the time being this implementation
* uses a String representation for LDAPURLs. In the future an LdapUrl
* interface with default implementations will be used once a parser for an
* LdapUrl is created.
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
-public class ReferralImpl
- extends AbstractLockable implements Referral
+public class ReferralImpl implements Referral
{
static final long serialVersionUID = 2638820668325359096L;
/** Sequence of LDAPUrls composing this Referral */
@@ -42,23 +37,6 @@
// ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
-
- /**
- * Creates a non-root Lockable Referral implemenation dependant on a parent
- * Lockable
- *
- * @param parent the overriding parent Lockable.
- */
- public ReferralImpl( final Lockable parent )
- {
- super( parent, false );
- }
-
-
- // ------------------------------------------------------------------------
// LdapResult Interface Method Implementations
// ------------------------------------------------------------------------
@@ -81,7 +59,6 @@
*/
public void addLdapUrl( String url )
{
- lockCheck( "Atempt to add alternative url to locked Referral!" );
urls.add( url );
}
@@ -93,7 +70,6 @@
*/
public void removeLdapUrl( String url )
{
- lockCheck( "Atempt to remove alternative url from locked Referral!" );
urls.remove( url );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java Sat Jan 7 00:25:20 2006
@@ -126,7 +126,6 @@
*/
public void setBase( String base )
{
- lockCheck( "Attempt to alter search base of locked SearchRequest!" );
baseDn = base;
}
@@ -149,8 +148,6 @@
*/
public void setDerefAliases( DerefAliasesEnum derefAliases )
{
- lockCheck(
- "Attempt to alter alias dereferencing mode of locked SearchRequest!" );
this.derefAliases = derefAliases;
}
@@ -174,7 +171,6 @@
*/
public void setFilter( ExprNode filter )
{
- lockCheck( "Attempt to alter search filter of locked SearchRequest!" );
this.filter = filter;
}
@@ -209,7 +205,6 @@
*/
public void setScope( ScopeEnum scope )
{
- lockCheck( "Attempt to alter search scope of locked SearchReqest!" );
this.scope = scope;
}
@@ -238,7 +233,6 @@
*/
public void setSizeLimit( int entriesMax )
{
- lockCheck( "Attempt to alter size limit on locked SearchRequest!" );
sizeLimit = entriesMax;
}
@@ -265,7 +259,6 @@
*/
public void setTimeLimit( int secondsMax )
{
- lockCheck( "Attempt to alter time limit on locked SearchRequest!" );
timeLimit = secondsMax;
}
@@ -294,8 +287,6 @@
*/
public void setTypesOnly( boolean typesOnly )
{
- lockCheck(
- "Attempt to alter typesOnly flag of locked SearchRequest!" );
this.typesOnly = typesOnly;
}
@@ -307,8 +298,6 @@
*/
public void addAttribute( String attribute )
{
- lockCheck(
- "Attempt to add return attribute to locked SearchRequest!" );
attributes.add( attribute );
}
@@ -320,8 +309,6 @@
*/
public void removeAttribute( String attribute )
{
- lockCheck(
- "Attempt to remove return attribute from locked SearchRequest!" );
attributes.remove( attribute );
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseEntryImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseEntryImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseEntryImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseEntryImpl.java Sat Jan 7 00:25:20 2006
@@ -25,12 +25,10 @@
/**
* Lockable SearchResponseEntry implementation
*
- * @author
- * Apache Directory Project
+ * @author Apache Directory Project
* @version $Rev$
*/
-public class SearchResponseEntryImpl
- extends AbstractResponse implements SearchResponseEntry
+public class SearchResponseEntryImpl extends AbstractResponse implements SearchResponseEntry
{
static final long serialVersionUID = -8357316233060886637L;
/** Distinguished name of the search result entry returned */
@@ -79,8 +77,6 @@
*/
public void setAttributes( Attributes attributes )
{
- lockCheck(
- "Attempt to alter attributes of a locked SearchResponseEntry!" );
this.attributes = attributes;
}
@@ -103,7 +99,6 @@
*/
public void setObjectName( String objectName )
{
- lockCheck( "Attempt to alter Dn of a locked SearchResponseEntry!" );
this.objectName = objectName;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReference.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReference.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReference.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReference.java Sat Jan 7 00:25:20 2006
@@ -31,12 +31,10 @@
* Search reference protocol response message used to return referrals to the
* client in response to a search request message.
*
- * @author Alex Karasulu
- * @author $Author: akarasulu $
+ * @author Apache Directory Project
* @version $Revision$
*/
-public interface SearchResponseReference
- extends Response
+public interface SearchResponseReference extends Response
{
/** Search reference response message type enumeration value */
MessageTypeEnum TYPE = MessageTypeEnum.SEARCHRESREF ;
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReferenceImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReferenceImpl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReferenceImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchResponseReferenceImpl.java Sat Jan 7 00:25:20 2006
@@ -14,22 +14,20 @@
* limitations under the License.
*
*/
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
/**
- * Lockable SearchResponseReference implementation
+ * SearchResponseReference implementation
*
- * @author Alex Karasulu
- * @author $Author: akarasulu $
+ * @author Apache Directory Project
* @version $Revision$
*/
-public class SearchResponseReferenceImpl
- extends AbstractResponse implements SearchResponseReference
+public class SearchResponseReferenceImpl extends AbstractResponse implements SearchResponseReference
{
static final long serialVersionUID = 7423807019951309810L;
/** Referral holding the reference urls */
- private Referral m_referral ;
+ private Referral referral;
// ------------------------------------------------------------------------
@@ -41,11 +39,11 @@
* Creates a Lockable SearchResponseReference as a reply to an SearchRequest
* to indicate the end of a search operation.
*
- * @param a_id the session unique message id
+ * @param id the session unique message id
*/
- public SearchResponseReferenceImpl( final int a_id )
+ public SearchResponseReferenceImpl( final int id )
{
- super( a_id, TYPE ) ;
+ super( id, TYPE );
}
@@ -61,20 +59,18 @@
*/
public Referral getReferral()
{
- return m_referral ;
+ return this.referral;
}
/**
* Sets the sequence of LdapUrls as a Referral instance.
*
- * @param a_referral the sequence of LdapUrls
+ * @param referral the sequence of LdapUrls
*/
- public void setReferral( Referral a_referral )
+ public void setReferral( Referral referral )
{
- lockCheck(
- "Attempt to alter referrals of a locked SearchRequestReference!" ) ;
- m_referral = a_referral ;
+ this.referral = referral;
}
@@ -98,19 +94,19 @@
SearchResponseReference resp = ( SearchResponseReference ) obj;
- if ( m_referral != null && resp.getReferral() == null )
+ if ( this.referral != null && resp.getReferral() == null )
{
return false;
}
- if ( m_referral == null && resp.getReferral() != null )
+ if ( this.referral == null && resp.getReferral() != null )
{
return false;
}
- if ( m_referral != null && resp.getReferral() != null )
+ if ( this.referral != null && resp.getReferral() != null )
{
- if ( ! m_referral.equals( resp.getReferral() ) )
+ if ( ! this.referral.equals( resp.getReferral() ) )
{
return false;
}
Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SubentryRequestControl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SubentryRequestControl.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SubentryRequestControl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SubentryRequestControl.java Sat Jan 7 00:25:20 2006
@@ -17,11 +17,8 @@
package org.apache.ldap.common.message;
-import org.apache.ldap.common.Lockable;
-
-
/**
- *
+ * A subentry request control for listing subentries in a search operation.
*
* @author Apache Directory Project
* @version $Rev$
@@ -29,48 +26,21 @@
public class SubentryRequestControl extends ControlImpl
{
private static final long serialVersionUID = -8683670301958448735L;
- /** */
private final boolean subentryVisibility;
- /**
- *
- * @param subentryVisibility
- */
public SubentryRequestControl( boolean subentryVisibility )
{
- super();
- this.subentryVisibility = subentryVisibility;
- }
-
-
- /**
- *
- * @param parent
- * @param subentryVisibility
- */
- public SubentryRequestControl( Lockable parent, boolean subentryVisibility )
- {
- super( parent );
this.subentryVisibility = subentryVisibility;
}
- /**
- * @todo need to properly implement this
- *
- * @return
- */
public byte[] getEncodedValue()
{
return new byte[0];
}
- /**
- *
- * @return
- */
public boolean getSubentryVisibility()
{
return subentryVisibility;
Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractMessageTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractMessageTest.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractMessageTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractMessageTest.java Sat Jan 7 00:25:20 2006
@@ -18,8 +18,6 @@
import junit.framework.TestCase;
-import org.apache.ldap.common.Lockable;
-import org.apache.ldap.common.LockException;
/**
@@ -101,30 +99,6 @@
private static final long serialVersionUID = 1L;};
msg0.add( new Control() {
private static final long serialVersionUID = 1L;
- public Lockable getParent()
- {
- return null;
- }
-
- public boolean isLocked()
- {
- return false;
- }
-
- public boolean getLocked()
- {
- return false;
- }
-
- public void setLocked( boolean a_isLocked ) throws LockException
- {
- }
-
- public boolean isUnlockable()
- {
- return false;
- }
-
public String getType()
{
return null;
Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java?rev=366695&r1=366694&r2=366695&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java Sat Jan 7 00:25:20 2006
@@ -18,8 +18,6 @@
import junit.framework.TestCase;
-import org.apache.ldap.common.Lockable;
-import org.apache.ldap.common.LockException;
/**
@@ -64,11 +62,11 @@
r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
- Referral refs0 = new ReferralImpl( r0 );
+ Referral refs0 = new ReferralImpl();
refs0.addLdapUrl( "ldap://someserver.com" );
refs0.addLdapUrl( "ldap://anotherserver.org" );
- Referral refs1 = new ReferralImpl( r1 );
+ Referral refs1 = new ReferralImpl();
refs1.addLdapUrl( "ldap://someserver.com" );
refs1.addLdapUrl( "ldap://anotherserver.org" );
@@ -98,11 +96,11 @@
r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
- Referral refs0 = new ReferralImpl( r0 );
+ Referral refs0 = new ReferralImpl();
refs0.addLdapUrl( "ldap://someserver.com" );
refs0.addLdapUrl( "ldap://anotherserver.org" );
- Referral refs1 = new ReferralImpl( r1 );
+ Referral refs1 = new ReferralImpl();
refs1.addLdapUrl( "ldap://someserver.com" );
refs1.addLdapUrl( "ldap://anotherserver.org" );
@@ -154,30 +152,6 @@
private static final long serialVersionUID = 1L;};
msg0.add( new Control() {
private static final long serialVersionUID = 1L;
- public Lockable getParent()
- {
- return null;
- }
-
- public boolean isLocked()
- {
- return false;
- }
-
- public boolean getLocked()
- {
- return false;
- }
-
- public void setLocked( boolean a_isLocked ) throws LockException
- {
- }
-
- public boolean isUnlockable()
- {
- return false;
- }
-
public String getType()
{
return null;