|
|
Modified:
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapSchema.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapSchema.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapSchema.java
(original)
+++
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapSchema.java
Thu Dec 11 07:32:04 2008
@@ -31,7 +31,7 @@
* @author <a href="mailto:dev@xxxxxxxxxxxxxxxxxxxx">Apache Directory
Project</a>
* @version $Rev$
*/
-public class AbstractBootstrapSchema implements BootstrapSchema
+public abstract class AbstractBootstrapSchema implements BootstrapSchema
{
protected static final String[] DEFAULT_DEPS =
ArrayUtils.EMPTY_STRING_ARRAY;
private static final String DEFAULT_OWNER =
ServerDNConstants.ADMIN_SYSTEM_DN;
@@ -194,8 +194,36 @@
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isDisabled()
{
return false;
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ return true;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void disable()
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void enable()
+ {
+ }
}
Modified:
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/Schema.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/Schema.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/Schema.java
(original)
+++
directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/schema/bootstrap/Schema.java
Thu Dec 11 07:32:04 2008
@@ -35,6 +35,27 @@
*/
boolean isDisabled();
+
+ /**
+ * Disable the schema
+ */
+ void disable();
+
+
+ /**
+ * Checks whether or not this schema is enabled or disabled.
+ *
+ * @return true if this schema is enabled, false otherwise
+ */
+ boolean isEnabled();
+
+
+ /**
+ * Enable the schema
+ */
+ void enable();
+
+
/**
* Gets the name of the owner of the schema objects within this
* Schema.
Modified:
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
(original)
+++
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
Thu Dec 11 07:32:04 2008
@@ -43,44 +43,44 @@
}
- public LinkedBinaryNode<T> getLeft() {
- return left;
- }
-
-
- public LinkedBinaryNode<T> getRight() {
- return right;
- }
-
- public T getKey() {
- return key;
- }
-
- public boolean isLeaf()
- {
- return ( right == null && left == null );
- }
-
- /**
- * This method is used for internal purpose only while pretty printing
the tree.<br>
- * @return the depth at the this node
- */
- public int getDepth() {
- return depth;
- }
+ public LinkedBinaryNode<T> getLeft() {
+ return left;
+ }
+
+
+ public LinkedBinaryNode<T> getRight() {
+ return right;
+ }
+
+ public T getKey() {
+ return key;
+ }
+
+ public boolean isLeaf()
+ {
+ return ( right == null && left == null );
+ }
+
+ /**
+ * This method is used for internal purpose only while pretty printing the
tree.<br>
+ * @return the depth at the this node
+ */
+ public int getDepth() {
+ return depth;
+ }
/**
* This method is used for internal purpose only while pretty printing the
tree.<br>
* @param depth value representing the depth of the this node
*/
- public void setDepth( int depth ) {
- this.depth = depth;
- }
-
- @Override
- public String toString() {
- return "[" + key + "]";
- }
+ public void setDepth( int depth ) {
+ this.depth = depth;
+ }
+
+ @Override
+ public String toString() {
+ return "[" + key + "]";
+ }
}
Modified:
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/SplayTree.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/SplayTree.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/SplayTree.java
(original)
+++
directory/apacheds/trunk/core-splay/src/main/java/org/apache/directory/server/core/splay/SplayTree.java
Thu Dec 11 07:32:04 2008
@@ -74,12 +74,12 @@
if( last == null )
{
first.next = n;
- n.previous = first;
+ n.previous = first;
}
else
{
- last.next = n;
- n.previous = last;
+ last.next = n;
+ n.previous = last;
}
last = n;
@@ -134,24 +134,24 @@
if( deleteNode == first )
{
- temp = first.next;
-
- if( temp != null )
- {
- first = temp;
- }
- else
- {
- first = last = null;
- }
-
+ temp = first.next;
+
+ if( temp != null )
+ {
+ first = temp;
+ }
+ else
+ {
+ first = last = null;
+ }
+
}
else if( deleteNode == last )
{
- temp = last.previous;
- temp.next = null;
-
- last = temp;
+ temp = last.previous;
+ temp.next = null;
+
+ last = temp;
}
else
{
@@ -358,61 +358,61 @@
public LinkedBinaryNode<K> getRoot() {
- return root;
- }
+ return root;
+ }
/**
* Prints the contents of splay tree in pretty format
*/
public void printTree() {
-
- if( isEmpty() )
- {
- System.out.println( "Tree is empty" );
- return;
- }
-
- getRoot().setDepth( 0 );
-
- System.out.println( getRoot() );
-
- visit( getRoot().getRight(), getRoot() );
-
- visit( getRoot().getLeft(), getRoot() );
- }
-
- private void visit( LinkedBinaryNode<K> node, LinkedBinaryNode<K>
parentNode )
- {
- if( node == null )
- {
- return;
- }
-
- if( !node.isLeaf() )
- {
- node.setDepth( parentNode.getDepth() + 1 );
- }
-
- for( int i=0; i < parentNode.getDepth(); i++ )
- {
- System.out.print( "| " );
- }
-
- System.out.println( "|--" + node );
-
- if ( node.getRight() != null )
- {
- visit( node.getRight(), node );
- }
-
- if( node.getLeft() != null )
- {
- visit( node.getLeft(), node );
- }
- }
+
+ if( isEmpty() )
+ {
+ System.out.println( "Tree is empty" );
+ return;
+ }
+
+ getRoot().setDepth( 0 );
+
+ System.out.println( getRoot() );
+
+ visit( getRoot().getRight(), getRoot() );
+
+ visit( getRoot().getLeft(), getRoot() );
+ }
+
+ private void visit( LinkedBinaryNode<K> node, LinkedBinaryNode<K>
parentNode )
+ {
+ if( node == null )
+ {
+ return;
+ }
+
+ if( !node.isLeaf() )
+ {
+ node.setDepth( parentNode.getDepth() + 1 );
+ }
+
+ for( int i=0; i < parentNode.getDepth(); i++ )
+ {
+ System.out.print( "| " );
+ }
+
+ System.out.println( "|--" + node );
+
+ if ( node.getRight() != null )
+ {
+ visit( node.getRight(), node );
+ }
+
+ if( node.getLeft() != null )
+ {
+ visit( node.getLeft(), node );
+ }
+ }
- // test code stolen from Weiss
+ // test code stolen from Weiss
public static void main( String[] args )
{
SplayTree<Integer> t = new SplayTree<Integer>( new
Comparator<Integer>()
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.java
Thu Dec 11 07:32:04 2008
@@ -305,11 +305,16 @@
*/
ClonedServerEntry lookup( LdapDN dn ) throws Exception;
+ /**
+ * Looks up an entry in the server returning all attributes: both user and
+ * operational attributes.
+ *
+ * @param dn the name of the entry to lookup
+ * @param atIds The list of attributes to return
+ * @throws Exception if there are failures while looking up the entry
+ */
ClonedServerEntry lookup( LdapDN dn, String[] atIds ) throws Exception;
- ClonedServerEntry lookup( LdapDN dn, Control[] requestControls,
ReferralHandlingMode refMode,
- LdapDN authorized ) throws Exception;
-
/**
* Modifies an entry within the server by applying a list of modifications
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
Thu Dec 11 07:32:04 2008
@@ -406,8 +406,8 @@
}
- /* (non-Javadoc)
- * @see
org.apache.directory.server.core.CoreSession#lookup(org.apache.directory.shared.ldap.name.LdapDN)
+ /**
+ * {@inheritDoc}
*/
public ClonedServerEntry lookup( LdapDN dn ) throws Exception
{
@@ -416,8 +416,8 @@
}
- /* (non-Javadoc)
- * @see
org.apache.directory.server.core.CoreSession#lookup(org.apache.directory.shared.ldap.name.LdapDN)
+ /**
+ * {@inheritDoc}
*/
public ClonedServerEntry lookup( LdapDN dn, String[] attrId ) throws
Exception
{
@@ -637,16 +637,6 @@
}
- public ClonedServerEntry lookup( LdapDN dn, Control[] requestControls,
ReferralHandlingMode refMode,
- LdapDN authorized ) throws Exception
- {
- LookupOperationContext opContext = new LookupOperationContext( this,
dn );
- opContext.addRequestControls( requestControls );
- OperationManager operationManager =
directoryService.getOperationManager();
- return operationManager.lookup( opContext );
- }
-
-
public boolean exists( LdapDN dn ) throws Exception
{
EntryOperationContext opContext = new EntryOperationContext( this, dn
);
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Thu Dec 11 07:32:04 2008
@@ -162,6 +162,9 @@
/** The referral manager */
private ReferralManager referralManager;
+
+ /** A flag to tell if the userPassword attribute's value must be hidden */
+ private boolean passwordHidden = false;
/** remove me after implementation is completed */
private static final String PARTIAL_IMPL_WARNING =
@@ -245,6 +248,10 @@
private List<? extends LdifEntry> testEntries = new
ArrayList<LdifEntry>(); // List<Attributes>
private EventService eventService;
+
+
+ /** The maximum size for an incoming PDU */
+ private int maxPDUSize = Integer.MAX_VALUE;
public void setInstanceId( String instanceId )
@@ -1536,4 +1543,47 @@
{
this.eventService = eventService;
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPasswordHidden()
+ {
+ return passwordHidden;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPassordHidden( boolean passwordHidden )
+ {
+ this.passwordHidden = passwordHidden;
+ }
+
+
+ /**
+ * @return The maximum allowed size for an incoming PDU
+ */
+ public int getMaxPDUSize()
+ {
+ return maxPDUSize;
+ }
+
+
+ /**
+ * Set the maximum allowed size for an incoming PDU
+ * @param maxPDUSize A positive number of bytes for the PDU. A negative or
+ * null value will be transformed to {@link Integer#MAX_VALUE}
+ */
+ public void setMaxPDUSize( int maxPDUSize )
+ {
+ if ( maxPDUSize <= 0 )
+ {
+ maxPDUSize = Integer.MAX_VALUE;
+ }
+
+ this.maxPDUSize = maxPDUSize;
+ }
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
Thu Dec 11 07:32:04 2008
@@ -254,6 +254,15 @@
/**
+ * Returns <tt>true</tt> if the service requires the userPassword attribute
+ * to be masked. It's an option in the server.xml file.
+ *
+ * @return true if the service requires that the userPassword is to be
hidden
+ */
+ boolean isPasswordHidden();
+
+
+ /**
* Sets whether to allow anonymous access to entries other than the
RootDSE. If the
* access control subsystem is enabled then access to some entries may not
be allowed
* even when full anonymous access is enabled.
@@ -264,6 +273,14 @@
/**
+ * Sets whether the userPassword attribute is readable, or hidden.
+ *
+ * @param passwordHidden true to enable hide the userPassword attribute,
false otherwise
+ */
+ void setPassordHidden( boolean passwordHidden );
+
+
+ /**
* Returns interceptors in the server.
*
* @return the interceptors in the server.
@@ -397,4 +414,18 @@
* Gets the operation manager.
*/
OperationManager getOperationManager();
+
+
+ /**
+ * @return The maximum allowed size for an incoming PDU
+ */
+ int getMaxPDUSize();
+
+
+ /**
+ * Set the maximum allowed size for an incoming PDU
+ * @param maxPDUSize A positive number of bytes for the PDU. A negative or
+ * null value will be transformed to {@link Integer#MAX_VALUE}
+ */
+ void setMaxPDUSize( int maxPDUSize );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -440,9 +440,9 @@
if ( level == AuthenticationLevel.UNAUTHENT )
{
- // This is a case where the Bind request contains a DN, but no
password.
- // We don't check the DN, we just return a UnwillingToPerform
error
- throw new LdapOperationNotSupportedException( "Cannot Bind for
DN " + opContext.getDn().getUpName(), ResultCodeEnum.UNWILLING_TO_PERFORM );
+ // This is a case where the Bind request contains a DN, but no
password.
+ // We don't check the DN, we just return a UnwillingToPerform error
+ throw new LdapOperationNotSupportedException( "Cannot Bind for DN
" + opContext.getDn().getUpName(), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Collection<Authenticator> authenticators = getAuthenticators(
level.getName() );
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Thu Dec 11 07:32:04 2008
@@ -566,9 +566,9 @@
if ( userEntry == null )
{
- LdapDN dn = opContext.getDn();
- String upDn = ( dn == null ? "" : dn.getUpName() );
-
+ LdapDN dn = opContext.getDn();
+ String upDn = ( dn == null ? "" : dn.getUpName() );
+
throw new LdapAuthenticationException( "Failed to lookup user
for authentication: "
+ upDn );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -1048,9 +1048,9 @@
public boolean compare( NextInterceptor next, CompareOperationContext
opContext ) throws Exception
{
- LdapDN name = opContext.getDn();
- String oid = opContext.getOid();
- Value<?> value = ( Value<?> ) opContext.getValue();
+ LdapDN name = opContext.getDn();
+ String oid = opContext.getOid();
+ Value<?> value = ( Value<?> ) opContext.getValue();
ClonedServerEntry entry = opContext.lookup( name,
ByPassConstants.LOOKUP_BYPASS );
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
Thu Dec 11 07:32:04 2008
@@ -46,9 +46,9 @@
{
public Collection<ACITuple> filter(
Registries registries,
- Collection<ACITuple> tuples,
- OperationScope scope,
- OperationContext opContext,
+ Collection<ACITuple> tuples,
+ OperationScope scope,
+ OperationContext opContext,
Collection<LdapDN> userGroupNames,
LdapDN userName,
ServerEntry userEntry,
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -47,7 +47,7 @@
import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
import org.apache.directory.shared.ldap.ldif.ChangeType;
import org.apache.directory.shared.ldap.ldif.LdifEntry;
-import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.ldif.LdifRevertor;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -126,7 +126,7 @@
forward.addAttribute( ((ServerAttribute)addEntry.get(
attributeType) ).toClientAttribute() );
}
- LdifEntry reverse = LdifUtils.reverseAdd( opContext.getDn() );
+ LdifEntry reverse = LdifRevertor.reverseAdd( opContext.getDn() );
opContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward,
reverse ) );
}
@@ -170,7 +170,7 @@
reverseEntry.add( ((ServerAttribute)attribute).toClientAttribute()
);
}
- LdifEntry reverse = LdifUtils.reverseDel( opContext.getDn(),
reverseEntry );
+ LdifEntry reverse = LdifRevertor.reverseDel( opContext.getDn(),
reverseEntry );
opContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward,
reverse ) );
}
@@ -263,7 +263,7 @@
clientEntry.add( ((ServerAttribute)attribute).toClientAttribute()
);
}
- LdifEntry reverse = LdifUtils.reverseModify(
+ LdifEntry reverse = LdifRevertor.reverseModify(
opContext.getDn(),
mods,
clientEntry );
@@ -300,8 +300,8 @@
forward.setNewRdn( renameContext.getNewRdn().getUpName() );
forward.setDeleteOldRdn( renameContext.getDelOldDn() );
- List<LdifEntry> reverses = LdifUtils.reverseModifyRdn(
ServerEntryUtils.toBasicAttributes( serverEntry ),
- null, renameContext.getDn(), new Rdn( renameContext.getNewRdn() )
);
+ List<LdifEntry> reverses = LdifRevertor.reverseRename(
+ serverEntry, renameContext.getNewRdn(),
renameContext.getDelOldDn() );
renameContext.setChangeLogEvent( changeLog.log( getPrincipal(),
forward, reverses ) );
}
@@ -332,8 +332,8 @@
forward.setNewRdn( opCtx.getNewRdn().getUpName() );
forward.setNewSuperior( opCtx.getParent().getUpName() );
- List<LdifEntry> reverses = LdifUtils.reverseModifyRdn(
ServerEntryUtils.toBasicAttributes( serverEntry ),
- opCtx.getParent(), opCtx.getDn(), new Rdn( opCtx.getNewRdn() ) );
+ List<LdifEntry> reverses = LdifRevertor.reverseMoveAndRename(
+ serverEntry, opCtx.getParent(), new Rdn( opCtx.getNewRdn() ),
false );
opCtx.setChangeLogEvent( changeLog.log( getPrincipal(), forward,
reverses ) );
}
@@ -352,7 +352,7 @@
forward.setDn( opCtx.getDn() );
forward.setNewSuperior( opCtx.getParent().getUpName() );
- LdifEntry reverse = LdifUtils.reverseModifyDn( opCtx.getParent(),
opCtx.getDn() );
+ LdifEntry reverse = LdifRevertor.reverseMove( opCtx.getParent(),
opCtx.getDn() );
opCtx.setChangeLogEvent( changeLog.log( getPrincipal(), forward,
reverse ) );
}
}
\ No newline at end of file
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -534,7 +534,7 @@
try
{
EntryFilteringCursor cursor = nextInterceptor.search( opContext );
-
+
if ( ! cursor.next() )
{
if ( !base.isEmpty() && !( subschemSubentryDn.toNormName()
).equalsIgnoreCase( base.toNormName() ) )
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Thu Dec 11 07:32:04 2008
@@ -26,6 +26,7 @@
import java.util.Map;
import java.util.Set;
+import org.apache.directory.server.core.CoreSession;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.entry.ClonedServerEntry;
import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -707,7 +708,10 @@
{
try
{
- opContext.setEntry( opContext.getSession().lookup(
opContext.getDn(), SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES_ARRAY ) );
+ // We have to use the admin session here, otherwise we may have
+ // trouble reading the entry due to insufficient access rights
+ CoreSession adminSession =
opContext.getSession().getDirectoryService().getAdminSession();
+ opContext.setEntry( adminSession.lookup( opContext.getDn(),
SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES_ARRAY ) );
}
catch ( Exception e )
{
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -109,27 +109,27 @@
{
if ( ( saslMechanism == null ) )
{
- if ( dn.isEmpty() )
- {
- if ( StringTools.isEmpty( credentials ) )
- {
- // Dn and Credentials are empty, this is an
anonymous authent
- return AuthenticationLevel.NONE;
- }
- else
- {
- // If we have a password but no DN, this is
invalid
- return AuthenticationLevel.INVALID;
- }
- }
- else if ( StringTools.isEmpty( credentials ) )
- {
- return AuthenticationLevel.UNAUTHENT;
- }
- else
- {
- return AuthenticationLevel.SIMPLE;
- }
+ if ( dn.isEmpty() )
+ {
+ if ( StringTools.isEmpty( credentials ) )
+ {
+ // Dn and Credentials are empty, this is an anonymous
authent
+ return AuthenticationLevel.NONE;
+ }
+ else
+ {
+ // If we have a password but no DN, this is invalid
+ return AuthenticationLevel.INVALID;
+ }
+ }
+ else if ( StringTools.isEmpty( credentials ) )
+ {
+ return AuthenticationLevel.UNAUTHENT;
+ }
+ else
+ {
+ return AuthenticationLevel.SIMPLE;
+ }
}
else
{
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -54,7 +54,7 @@
*/
public CompareOperationContext( CoreSession session )
{
- super( session );
+ super( session );
}
@@ -76,7 +76,7 @@
*/
public CompareOperationContext( CoreSession session, String oid )
{
- super( session );
+ super( session );
this.oid = oid;
}
@@ -88,7 +88,7 @@
*/
public CompareOperationContext( CoreSession session, LdapDN dn, String oid
)
{
- super( session, dn );
+ super( session, dn );
this.oid = oid;
}
@@ -100,7 +100,7 @@
*/
public CompareOperationContext( CoreSession session, LdapDN dn, String
oid, Value<?> value )
{
- super( session, dn );
+ super( session, dn );
this.oid = oid;
this.value = value;
}
@@ -132,7 +132,7 @@
return oid;
}
-
+
/**
* Set the compared OID
* @param oid The compared OID
@@ -142,7 +142,7 @@
this.oid = oid;
}
-
+
/**
* @return The value to compare
*/
@@ -151,7 +151,7 @@
return value;
}
-
+
/**
* Set the value to compare
* @param value The value to compare
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -56,7 +56,7 @@
*/
public LookupOperationContext( CoreSession session )
{
- super( session );
+ super( session );
}
@@ -78,7 +78,7 @@
*/
public LookupOperationContext( CoreSession session, String attrsId[] )
{
- super( session );
+ super( session );
setAttrsId( attrsId );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -47,7 +47,7 @@
*/
public MoveAndRenameOperationContext( CoreSession session )
{
- super( session );
+ super( session );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -45,7 +45,7 @@
*/
public MoveOperationContext( CoreSession session )
{
- super( session );
+ super( session );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
Thu Dec 11 07:32:04 2008
@@ -33,7 +33,7 @@
* A RenameService context used for Interceptors. It contains all the
informations
* needed for the modify DN operation, and used by all the interceptors
*
- * This is used whne the modifyDN is about changing the RDN, not the base DN.
+ * This is used when the modifyDN is about changing the RDN, not the base DN.
*
* @author <a href="mailto:dev@xxxxxxxxxxxxxxxxxxxx">Apache Directory
Project</a>
* @version $Rev$, $Date$
@@ -58,7 +58,7 @@
*/
public RenameOperationContext( CoreSession session )
{
- super( session );
+ super( session );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -317,6 +317,7 @@
filter( opContext, result );
}
+ denormalizeEntryOpAttrs( result );
return result;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Thu Dec 11 07:32:04 2008
@@ -644,21 +644,43 @@
}
+ /**
+ * {@inheritDoc}
+ */
public synchronized void removeContextPartition(
RemoveContextPartitionOperationContext removeContextPartition ) throws Exception
{
+ // Get the Partition name. It's a DN.
String key = removeContextPartition.getDn().getNormName();
+
+ // Retrieve this partition from the aprtition's table
Partition partition = partitions.get( key );
if ( partition == null )
{
- throw new NameNotFoundException( "No partition with suffix: " +
key );
+ String msg = "No partition with suffix: " + key;
+ LOG.error( msg );
+ throw new NameNotFoundException( msg );
}
+
+ String partitionSuffix = partition.getUpSuffixDn().getUpName();
+ // Retrieve the namingContexts from the RootDSE : the partition
+ // suffix must be present in those namingContexts
EntryAttribute namingContexts = rootDSE.get(
SchemaConstants.NAMING_CONTEXTS_AT );
if ( namingContexts != null )
{
- namingContexts.remove( partition.getUpSuffixDn().getUpName() );
+ if ( namingContexts.contains( partitionSuffix ) )
+ {
+ namingContexts.remove( partitionSuffix );
+ }
+ else
+ {
+ String msg = "No partition with suffix '" + key +
+ "' can be found in the NamingContexts";
+ LOG.error( msg );
+ throw new NameNotFoundException( msg );
+ }
}
// Update the partition tree
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
Thu Dec 11 07:32:04 2008
@@ -183,6 +183,12 @@
public abstract void addContextPartition(
AddContextPartitionOperationContext opContext ) throws Exception;
+ /**
+ * Remove a partition from the server.
+ *
+ * @param opContext The Remove Partition context
+ * @throws Exception If the removal can't be done
+ */
public abstract void removeContextPartition(
RemoveContextPartitionOperationContext opContext ) throws Exception;
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -32,6 +32,9 @@
import
org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
import
org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import
org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import
org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
+import
org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import
org.apache.directory.server.core.interceptor.context.RenameOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
import org.apache.directory.server.schema.registries.Registries;
@@ -148,6 +151,14 @@
static private boolean isReferral( ServerEntry entry ) throws
NamingException
{
+ // Check that the entry is not null, otherwise return FALSE.
+ // This is typically to cover the case where the entry has not
+ // been added into the context because it does not exists.
+ if ( entry == null )
+ {
+ return false;
+ }
+
EntryAttribute oc = entry.get( SchemaConstants.OBJECT_CLASS_AT );
if ( oc == null )
@@ -287,7 +298,9 @@
}
- /*
+ /**
+ *
+ **/
public void move( NextInterceptor next, MoveOperationContext opContext )
throws Exception
{
LdapDN oldName = opContext.getDn();
@@ -295,40 +308,56 @@
LdapDN newName = ( LdapDN ) opContext.getParent().clone();
newName.add( oldName.get( oldName.size() - 1 ) );
+ // Check if the entry is a referral itself
+ boolean isReferral = isReferral( opContext.getEntry() );
+
next.move( opContext );
- // Update the referralManager
- LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
-
- ServerEntry newEntry = nexus.lookup( lookupContext );
-
- referralManager.lockWrite();
- referralManager.addReferral( newEntry );
- referralManager.removeReferral( opContext.getEntry() );
-
- referralManager.unlock();
+ if ( isReferral )
+ {
+ // Update the referralManager
+ LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
+
+ ServerEntry newEntry = nexus.lookup( lookupContext );
+
+ referralManager.lockWrite();
+
+ referralManager.addReferral( newEntry );
+ referralManager.removeReferral( opContext.getEntry() );
+
+ referralManager.unlock();
+ }
}
+ /**
+ *
+ **/
public void moveAndRename( NextInterceptor next,
MoveAndRenameOperationContext opContext ) throws Exception
{
LdapDN newName = ( LdapDN ) opContext.getParent().clone();
newName.add( opContext.getNewRdn() );
+ // Check if the entry is a referral itself
+ boolean isReferral = isReferral( opContext.getEntry() );
+
next.moveAndRename( opContext );
- // Update the referralManager
- LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
-
- ServerEntry newEntry = nexus.lookup( lookupContext );
-
- referralManager.lockWrite();
-
- referralManager.addReferral( newEntry );
- referralManager.removeReferral( opContext.getEntry() );
-
- referralManager.unlock();
+ if ( isReferral )
+ {
+ // Update the referralManager
+ LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
+
+ ServerEntry newEntry = nexus.lookup( lookupContext );
+
+ referralManager.lockWrite();
+
+ referralManager.addReferral( newEntry );
+ referralManager.removeReferral( opContext.getEntry() );
+
+ referralManager.unlock();
+ }
}
@@ -341,21 +370,27 @@
newName.add( opContext.getNewRdn() );
+ // Check if the entry is a referral itself
+ boolean isReferral = isReferral( opContext.getEntry() );
+
next.rename( opContext );
- // Update the referralManager
- LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
-
- ServerEntry newEntry = nexus.lookup( lookupContext );
-
- referralManager.lockWrite();
-
- referralManager.addReferral( newEntry );
- referralManager.removeReferral( opContext.getEntry() );
-
- referralManager.unlock();
+ if ( isReferral )
+ {
+ // Update the referralManager
+ LookupOperationContext lookupContext = new LookupOperationContext(
opContext.getSession(), newName );
+
+ ServerEntry newEntry = nexus.lookup( lookupContext );
+
+ referralManager.lockWrite();
+
+ referralManager.addReferral( newEntry );
+ referralManager.removeReferral( opContext.getEntry() );
+
+ referralManager.unlock();
+ }
}
- */
+
/**
* Modify an entry in the server.
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchema.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchema.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchema.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchema.java
Thu Dec 11 07:32:04 2008
@@ -110,8 +110,38 @@
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isDisabled()
{
return disabled;
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ return !disabled;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void disable()
+ {
+ this.disabled = true;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void enable()
+ {
+ this.disabled = false;
+ }
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
Thu Dec 11 07:32:04 2008
@@ -96,21 +96,21 @@
}
- protected abstract void modify( LdapDN name, ServerEntry entry,
ServerEntry targetEntry, boolean cascade )
+ protected abstract boolean modify( LdapDN name, ServerEntry entry,
ServerEntry targetEntry, boolean cascade )
throws Exception;
- public final void modify( LdapDN name, ModificationOperation modOp,
ServerEntry mods, ServerEntry entry, ServerEntry targetEntry,
+ public final boolean modify( LdapDN name, ModificationOperation modOp,
ServerEntry mods, ServerEntry entry, ServerEntry targetEntry,
boolean cascade ) throws Exception
{
- modify( name, entry, targetEntry, cascade );
+ return modify( name, entry, targetEntry, cascade );
}
- public final void modify( LdapDN name, List<Modification> mods,
ServerEntry entry,
+ public final boolean modify( LdapDN name, List<Modification> mods,
ServerEntry entry,
ServerEntry targetEntry, boolean cascade ) throws Exception
{
- modify( name, entry, targetEntry, cascade );
+ return modify( name, entry, targetEntry, cascade );
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
Thu Dec 11 07:32:04 2008
@@ -62,7 +62,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade )
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade )
throws Exception
{
String oid = getOid( entry );
@@ -73,7 +73,11 @@
{
attributeTypeRegistry.unregister( oid );
attributeTypeRegistry.register( at );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
Thu Dec 11 07:32:04 2008
@@ -75,7 +75,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
{
String oid = getOid( entry );
Comparator comparator = factory.getComparator( targetEntry,
targetRegistries );
@@ -86,7 +86,11 @@
comparatorRegistry.unregister( oid );
ComparatorDescription description = getComparatorDescription(
schema.getSchemaName(), targetEntry );
comparatorRegistry.register( description, comparator );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
Thu Dec 11 07:32:04 2008
@@ -49,11 +49,11 @@
* @see
org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN,
javax.naming.directory.Attributes, javax.naming.directory.Attributes)
*/
@Override
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade )
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade )
throws NamingException
{
// TODO Auto-generated method stub
-
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
Thu Dec 11 07:32:04 2008
@@ -51,11 +51,11 @@
* javax.naming.directory.Attributes)
*/
@Override
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws NamingException
{
// TODO Auto-generated method stub
-
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
Thu Dec 11 07:32:04 2008
@@ -61,7 +61,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws Exception
{
String oid = getOid( entry );
@@ -72,7 +72,11 @@
{
matchingRuleRegistry.unregister( oid );
matchingRuleRegistry.register( mr );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
Thu Dec 11 07:32:04 2008
@@ -46,10 +46,12 @@
@Override
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws NamingException
{
// TODO Auto-generated method stub
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
Thu Dec 11 07:32:04 2008
@@ -51,11 +51,12 @@
* javax.naming.directory.Attributes)
*/
@Override
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws NamingException
{
// TODO Auto-generated method stub
-
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
Thu Dec 11 07:32:04 2008
@@ -104,7 +104,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
{
String oid = getOid( entry );
Normalizer normalizer = factory.getNormalizer( targetEntry,
targetRegistries );
@@ -116,7 +116,11 @@
NormalizerDescription normalizerDescription =
getNormalizerDescription( schema.getSchemaName(),
targetEntry );
normalizerRegistry.register( normalizerDescription, normalizer );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
Thu Dec 11 07:32:04 2008
@@ -61,7 +61,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws Exception
{
String oid = getOid( entry );
@@ -72,7 +72,11 @@
{
objectClassRegistry.unregister( oid );
objectClassRegistry.register( oc );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
Thu Dec 11 07:32:04 2008
@@ -87,9 +87,11 @@
* @param mods the attribute modifications as an Attributes object
* @param entry the entry after the modifications have been applied
*/
- public void modify( LdapDN name, ModificationOperation modOp, ServerEntry
mods, ServerEntry entry,
+ public boolean modify( LdapDN name, ModificationOperation modOp,
ServerEntry mods, ServerEntry entry,
ServerEntry targetEntry, boolean cascade ) throws Exception
{
+ boolean hasModification = SCHEMA_UNCHANGED;
+
EntryAttribute disabledInMods = mods.get( disabledAT );
if ( disabledInMods != null )
@@ -116,6 +118,8 @@
{
checkForDependencies( isEnabled, targetEntry );
}
+
+ return hasModification;
}
@@ -128,15 +132,19 @@
* @param mods the attribute modifications as an ModificationItem arry
* @param entry the entry after the modifications have been applied
*/
- public void modify( LdapDN name, List<Modification> mods, ServerEntry
entry,
+ public boolean modify( LdapDN name, List<Modification> mods, ServerEntry
entry,
ServerEntry targetEntry, boolean cascade ) throws Exception
{
+ boolean hasModification = SCHEMA_UNCHANGED;
+
+ // Check if the entry has a m-disabled attribute
EntryAttribute disabledInEntry = entry.get( disabledAT );
Modification disabledModification =
ServerEntryUtils.getModificationItem( mods, disabledAT );
if ( disabledModification != null )
{
- disable( name,
+ // We are trying to modify the m-disabled attribute.
+ hasModification = disable( name,
disabledModification.getOperation(),
(ServerAttribute)disabledModification.getAttribute(),
disabledInEntry );
@@ -161,6 +169,8 @@
{
checkForDependencies( isEnabled, targetEntry );
}
+
+ return hasModification;
}
@@ -380,7 +390,7 @@
// -----------------------------------------------------------------------
- private void disable( LdapDN name, ModificationOperation modOp,
EntryAttribute disabledInMods, EntryAttribute disabledInEntry )
+ private boolean disable( LdapDN name, ModificationOperation modOp,
EntryAttribute disabledInMods, EntryAttribute disabledInEntry )
throws Exception
{
switch ( modOp )
@@ -394,7 +404,7 @@
{
if ( "TRUE".equalsIgnoreCase( disabledInMods.getString() )
)
{
- disableSchema( getSchemaName( name ) );
+ return disableSchema( getSchemaName( name ) );
}
}
@@ -405,9 +415,9 @@
* disabled. If so we enable the schema.
*/
case REMOVE_ATTRIBUTE :
- if ( "TRUE".equalsIgnoreCase( disabledInEntry.getString() ) )
+ if ( ( disabledInEntry != null ) && ( "TRUE".equalsIgnoreCase(
disabledInEntry.getString() ) ) )
{
- enableSchema( getSchemaName( name ) );
+ return enableSchema( getSchemaName( name ) );
}
break;
@@ -418,18 +428,29 @@
* schema is not disabled we disable it if the mods set m-disabled
to true.
*/
case REPLACE_ATTRIBUTE :
- boolean isCurrentlyDisabled = "TRUE".equalsIgnoreCase(
disabledInEntry.getString() );
- boolean isNewStateDisabled = "TRUE".equalsIgnoreCase(
disabledInMods.getString() );
+
+ boolean isCurrentlyDisabled = false;
+
+ if ( disabledInEntry != null )
+ {
+ isCurrentlyDisabled = "TRUE".equalsIgnoreCase(
disabledInEntry.getString() );
+ }
+
+ boolean isNewStateDisabled = false;
+
+ if ( disabledInMods != null )
+ {
+ isNewStateDisabled = "TRUE".equalsIgnoreCase(
disabledInMods.getString() );
+ }
if ( isCurrentlyDisabled && !isNewStateDisabled )
{
- enableSchema( getSchemaName( name ) );
- break;
+ return enableSchema( getSchemaName( name ) );
}
if ( !isCurrentlyDisabled && isNewStateDisabled )
{
- disableSchema( getSchemaName( name ) );
+ return disableSchema( getSchemaName( name ) );
}
break;
@@ -437,6 +458,8 @@
default:
throw new IllegalArgumentException( "Unknown modify operation
type: " + modOp );
}
+
+ return SCHEMA_UNCHANGED;
}
@@ -446,17 +469,32 @@
}
- private void disableSchema( String schemaName ) throws Exception
+ private boolean disableSchema( String schemaName ) throws Exception
{
+ // First check that the schema is not already disabled
+ Map<String, Schema> schemas = globalRegistries.getLoadedSchemas();
+
+ Schema schema = schemas.get( schemaName );
+
+ if ( ( schema == null ) || schema.isDisabled() )
+ {
+ // The schema is disabled, do nothing
+ return SCHEMA_UNCHANGED;
+ }
+
Set<String> dependents = loader.listEnabledDependentSchemaNames(
schemaName );
+
if ( ! dependents.isEmpty() )
{
throw new LdapOperationNotSupportedException(
"Cannot disable schema with enabled dependents: " + dependents,
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
+ schema.disable();
globalRegistries.unload( schemaName );
+
+ return SCHEMA_MODIFIED;
}
@@ -464,16 +502,19 @@
* TODO - for now we're just going to add the schema to the global
* registries ... we may need to add it to more than that though later.
*/
- private void enableSchema( String schemaName ) throws Exception
+ private boolean enableSchema( String schemaName ) throws Exception
{
if ( globalRegistries.getLoadedSchemas().containsKey( schemaName ) )
{
// TODO log warning: schemaName + " was already loaded"
- return;
+ return SCHEMA_UNCHANGED;
}
Schema schema = loader.getSchema( schemaName );
loader.loadWithDependencies( schema, globalRegistries );
+ schema.enable();
+
+ return SCHEMA_MODIFIED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
Thu Dec 11 07:32:04 2008
@@ -103,7 +103,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry, boolean cascade ) throws Exception
{
String oid = getOid( entry );
SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry,
targetRegistries );
@@ -116,7 +116,10 @@
SyntaxCheckerDescription syntaxCheckerDescription =
getSyntaxCheckerDescription( schema.getSchemaName(),
targetEntry );
syntaxCheckerRegistry.register( syntaxCheckerDescription,
syntaxChecker );
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
Thu Dec 11 07:32:04 2008
@@ -61,7 +61,7 @@
}
- protected void modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
+ protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry
targetEntry,
boolean cascade ) throws Exception
{
String oid = getOid( entry );
@@ -72,7 +72,11 @@
{
syntaxRegistry.unregister( oid );
syntaxRegistry.register( syntax );
+
+ return SCHEMA_MODIFIED;
}
+
+ return SCHEMA_UNCHANGED;
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
Thu Dec 11 07:32:04 2008
@@ -38,16 +38,22 @@
*/
public interface SchemaChangeHandler
{
+ /** A constant to tell the caller that the schema has been modified */
+ static final boolean SCHEMA_MODIFIED = true;
+
+ /** A constant to tell the caller that the schema has not been modified */
+ static final boolean SCHEMA_UNCHANGED = false;
+
void add( LdapDN name, ServerEntry entry ) throws Exception;
void delete( LdapDN name, ServerEntry entry, boolean cascaded ) throws
Exception;
void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascaded
) throws Exception;
- void modify( LdapDN name, ModificationOperation modOp, ServerEntry mods,
ServerEntry entry, ServerEntry targetEntry, boolean cascaded )
+ boolean modify( LdapDN name, ModificationOperation modOp, ServerEntry
mods, ServerEntry entry, ServerEntry targetEntry, boolean cascaded )
throws Exception;
- void modify( LdapDN name, List<Modification> mods, ServerEntry entry,
ServerEntry targetEntry, boolean cascaded )
+ boolean modify( LdapDN name, List<Modification> mods, ServerEntry entry,
ServerEntry targetEntry, boolean cascaded )
throws Exception;
void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn, ServerEntry entry,
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Thu Dec 11 07:32:04 2008
@@ -1745,65 +1745,65 @@
private void checkOcSuperior( ServerEntry entry ) throws Exception
{
- ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();
-
+ ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();
+
// handle the m-supObjectClass meta attribute
EntryAttribute supOC = entry.get(
MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT );
if ( supOC != null )
{
- ObjectClassTypeEnum ocType = ObjectClassTypeEnum.STRUCTURAL;
-
+ ObjectClassTypeEnum ocType = ObjectClassTypeEnum.STRUCTURAL;
+
if ( entry.get( MetaSchemaConstants.M_TYPE_OBJECT_CLASS_AT ) !=
null )
{
String type = entry.get(
MetaSchemaConstants.M_TYPE_OBJECT_CLASS_AT ).getString();
ocType = ObjectClassTypeEnum.getClassType( type );
}
-
- // First check that the inheritence scheme is correct.
- // 1) If the ocType is ABSTRACT, it should not have any other
SUP not ABSTRACT
- for ( Value<?> sup:supOC )
- {
- try
- {
- String supName = (String)sup.get();
-
- ObjectClass superior = ocRegistry.lookup( supName );
-
- switch ( ocType )
- {
- case ABSTRACT :
- if ( !superior.isAbstract() )
- {
- String message = "An ABSTRACT
ObjectClass cannot inherit from an objectClass which is not ABSTRACT";
- LOG.error( message );
- throw new
LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
- }
-
- break;
-
- case AUXILIARY :
- if ( !superior.isAbstract() && !
superior.isAuxiliary() )
- {
- String message = "An AUXILiARY
ObjectClass cannot inherit from an objectClass which is not ABSTRACT or
AUXILIARY";
- LOG.error( message );
- throw new
LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
- }
-
- break;
-
- case STRUCTURAL :
- break;
- }
- }
- catch ( NamingException ne )
- {
- // The superior OC does not exist : this is an
error
- String message = "Cannot have a superior which
does not exist";
- LOG.error( message );
- throw new LdapSchemaViolationException(
message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
- }
- }
+
+ // First check that the inheritence scheme is correct.
+ // 1) If the ocType is ABSTRACT, it should not have any other SUP
not ABSTRACT
+ for ( Value<?> sup:supOC )
+ {
+ try
+ {
+ String supName = (String)sup.get();
+
+ ObjectClass superior = ocRegistry.lookup( supName );
+
+ switch ( ocType )
+ {
+ case ABSTRACT :
+ if ( !superior.isAbstract() )
+ {
+ String message = "An ABSTRACT ObjectClass
cannot inherit from an objectClass which is not ABSTRACT";
+ LOG.error( message );
+ throw new LdapSchemaViolationException(
message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ }
+
+ break;
+
+ case AUXILIARY :
+ if ( !superior.isAbstract() && !
superior.isAuxiliary() )
+ {
+ String message = "An AUXILiARY ObjectClass
cannot inherit from an objectClass which is not ABSTRACT or AUXILIARY";
+ LOG.error( message );
+ throw new LdapSchemaViolationException(
message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ }
+
+ break;
+
+ case STRUCTURAL :
+ break;
+ }
+ }
+ catch ( NamingException ne )
+ {
+ // The superior OC does not exist : this is an error
+ String message = "Cannot have a superior which does not
exist";
+ LOG.error( message );
+ throw new LdapSchemaViolationException( message,
ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ }
+ }
}
}
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
Thu Dec 11 07:32:04 2008
@@ -435,8 +435,13 @@
if ( oc.contains( MetaSchemaConstants.META_SCHEMA_OC ) )
{
- metaSchemaHandler.modify( opContext.getDn(),
opContext.getModItems(), entry, targetEntry, doCascadeModify );
- updateSchemaModificationAttributes( opContext );
+ boolean isSchemaModified = metaSchemaHandler.modify(
opContext.getDn(), opContext.getModItems(), entry, targetEntry, doCascadeModify
);
+
+ if ( isSchemaModified )
+ {
+ updateSchemaModificationAttributes( opContext );
+ }
+
return;
}
Modified:
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
(original)
+++
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Thu Dec 11 07:32:04 2008
@@ -815,6 +815,27 @@
public void setEventService( EventService eventService )
{
}
+
+ public boolean isPasswordHidden()
+ {
+ return false;
+ }
+
+ public void setPassordHidden( boolean passwordHidden )
+ {
+ }
+
+
+ public int getMaxPDUSize()
+ {
+ return Integer.MAX_VALUE;
+ }
+
+
+ public void setMaxPDUSize( int maxPDUSize )
+ {
+ // Do nothing
+ }
}
Modified:
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
(original)
+++
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
Thu Dec 11 07:32:04 2008
@@ -36,7 +36,7 @@
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.ldif.ChangeType;
import org.apache.directory.shared.ldap.ldif.LdifEntry;
-import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.ldif.LdifRevertor;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
import org.apache.directory.shared.ldap.schema.OidNormalizer;
@@ -95,7 +95,7 @@
forward.putAttribute( "objectClass", "organizationalUnit" );
forward.putAttribute( "ou", "system" );
- LdifEntry reverse = LdifUtils.reverseAdd( new LdapDN( forward.getDn()
) );
+ LdifEntry reverse = LdifRevertor.reverseAdd( new LdapDN(
forward.getDn() ) );
assertEquals( 1, store.log( new LdapPrincipal(), forward, reverse
).getRevision() );
assertEquals( 1, store.getCurrentRevision() );
}
@@ -119,7 +119,7 @@
LdapDN reverseDn = new LdapDN( forward.getDn() );
reverseDn.normalize( oidsMap );
- LdifEntry reverse = LdifUtils.reverseAdd( reverseDn );
+ LdifEntry reverse = LdifRevertor.reverseAdd( reverseDn );
String zuluTime = DateUtils.getGeneralizedTime();
long revision = 1L;
Modified:
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
(original)
+++
directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
Thu Dec 11 07:32:04 2008
@@ -622,5 +622,28 @@
// TODO Auto-generated method stub
}
+
+
+ public boolean isPasswordHidden()
+ {
+ return false;
+ }
+
+
+ public void setPassordHidden( boolean passwordHidden )
+ {
+ }
+
+
+ public int getMaxPDUSize()
+ {
+ return Integer.MAX_VALUE;
+ }
+
+
+ public void setMaxPDUSize( int maxPDUSize )
+ {
+ // Do nothing
+ }
}
}
Modified:
directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java
(original)
+++
directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java
Thu Dec 11 07:32:04 2008
@@ -327,7 +327,7 @@
{
assertTrue( table.hasLessOrEqual( 1, 2 ) );
fail( "Should never get here since no dups tables " +
- "freak when they cannot find a value comparator" );
+ "freak when they cannot find a value comparator" );
}
catch ( UnsupportedOperationException e )
{
Modified:
directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
URL:
http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
---
directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
(original)
+++
directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
Thu Dec 11 07:32:04 2008
@@ -30,7 +30,7 @@
import java.util.Collections;
import java.util.List;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
/**
@@ -66,7 +66,7 @@
*/
public static Keytab read( File file ) throws IOException
{
- ByteBuffer buffer = ByteBuffer.wrap( getBytesFromFile( file ) );
+ IoBuffer buffer = IoBuffer.wrap( getBytesFromFile( file ) );
return readKeytab( buffer );
}
@@ -92,7 +92,7 @@
public void write( File file ) throws IOException
{
KeytabEncoder writer = new KeytabEncoder();
- ByteBuffer buffer = writer.write( keytabVersion, entries );
+ IoBuffer buffer = writer.write( keytabVersion, entries );
writeFile( buffer, file );
}
@@ -141,7 +141,7 @@
*/
static Keytab read( byte[] bytes )
{
- ByteBuffer buffer = ByteBuffer.wrap( bytes );
+ IoBuffer buffer = IoBuffer.wrap( bytes );
return readKeytab( buffer );
}
@@ -150,7 +150,7 @@
* Write the keytab to a {@link ByteBuffer}.
* @return The buffer.
*/
- ByteBuffer write()
+ IoBuffer write()
{
KeytabEncoder writer = new KeytabEncoder();
return writer.write( keytabVersion, entries );
@@ -163,7 +163,7 @@
* @param buffer
* @return The keytab.
*/
- private static Keytab readKeytab( ByteBuffer buffer )
+ private static Keytab readKeytab( IoBuffer buffer )
{
KeytabDecoder reader = new KeytabDecoder();
byte[] keytabVersion = reader.getKeytabVersion( buffer );
@@ -227,7 +227,7 @@
* @param file
* @throws IOException
*/
- protected void writeFile( ByteBuffer buffer, File file ) throws IOException
+ protected void writeFile( IoBuffer buffer, File file ) throws IOException
{
// Set append false to replace existing.
FileChannel wChannel = new FileOutputStream( file, false
).getChannel();
|
|