Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 58440 invoked from network); 16 Sep 2008 17:20:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 17:20:42 -0000 Received: (qmail 11861 invoked by uid 500); 16 Sep 2008 17:20:39 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 11823 invoked by uid 500); 16 Sep 2008 17:20:39 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 11814 invoked by uid 99); 16 Sep 2008 17:20:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 10:20:39 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 17:19:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ED08D2388A22; Tue, 16 Sep 2008 10:20:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r695982 [3/5] - in /directory/studio/trunk/apacheds-configuration/src/main: java/org/apache/directory/studio/apacheds/configuration/editor/v154/ java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/ java/org/apache/di... Date: Tue, 16 Sep 2008 17:20:18 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916172019.ED08D2388A22@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/IndexedAttributeDialog.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/IndexedAttributeDialog.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/IndexedAttributeDialog.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/IndexedAttributeDialog.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.editor.v154.dialogs; + + +import org.apache.directory.studio.apacheds.configuration.model.v154.IndexedAttribute; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.VerifyEvent; +import org.eclipse.swt.events.VerifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; + + +/** + * This class implements the Dialog for Indexed Attribute. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class IndexedAttributeDialog extends Dialog +{ + /** The Indexed Attribute */ + private IndexedAttribute indexedAttribute; + + /** The dirty flag */ + private boolean dirty = false; + + // UI Fields + private Text attributeIdText; + private Text cacheSizeText; + + + /** + * Creates a new instance of IndexedAttributeDialog. + */ + public IndexedAttributeDialog( IndexedAttribute indexedAttribute ) + { + super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); + this.indexedAttribute = indexedAttribute; + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell( Shell newShell ) + { + super.configureShell( newShell ); + newShell.setText( "Indexed Attribute Dialog" ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea( Composite parent ) + { + Composite composite = new Composite( parent, SWT.NONE ); + GridLayout layout = new GridLayout( 2, false ); + composite.setLayout( layout ); + composite.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) ); + + Label attributeIdLabel = new Label( composite, SWT.NONE ); + attributeIdLabel.setText( "Attribute ID:" ); + + attributeIdText = new Text( composite, SWT.BORDER ); + attributeIdText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); + + Label cacheSizeLabel = new Label( composite, SWT.NONE ); + cacheSizeLabel.setText( "Cache Size:" ); + + cacheSizeText = new Text( composite, SWT.BORDER ); + cacheSizeText.addVerifyListener( new VerifyListener() + { + public void verifyText( VerifyEvent e ) + { + if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$ + { + e.doit = false; + } + } + } ); + cacheSizeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); + + initFromInput(); + addListeners(); + + return composite; + } + + + /** + * Initializes the UI from the input. + */ + private void initFromInput() + { + String attributeId = indexedAttribute.getAttributeId(); + attributeIdText.setText( ( attributeId == null ) ? "" : attributeId ); + cacheSizeText.setText( "" + indexedAttribute.getCacheSize() ); + } + + + /** + * Adds listeners to the UI Fields. + */ + private void addListeners() + { + attributeIdText.addModifyListener( new ModifyListener() + { + public void modifyText( ModifyEvent e ) + { + dirty = true; + } + } ); + + cacheSizeText.addModifyListener( new ModifyListener() + { + public void modifyText( ModifyEvent e ) + { + dirty = true; + } + } ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + protected void okPressed() + { + indexedAttribute.setAttributeId( attributeIdText.getText() ); + try + { + indexedAttribute.setCacheSize( Integer.parseInt( cacheSizeText.getText() ) ); + } + catch ( NumberFormatException e ) + { + // Nothing to do, it won't happen + } + + super.okPressed(); + } + + + /** + * Gets the Indexed Attribute. + * + * @return + * the Indexed Attribute + */ + public IndexedAttribute getIndexedAttribute() + { + return indexedAttribute; + } + + + /** + * Returns the dirty flag of the dialog. + * + * @return + * the dirty flag of the dialog + */ + public boolean isDirty() + { + return dirty; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/InterceptorDialog.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/InterceptorDialog.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/InterceptorDialog.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/InterceptorDialog.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,281 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.editor.v154.dialogs; + + +import java.util.ArrayList; +import java.util.List; + +import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin; +import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginConstants; +import org.apache.directory.studio.apacheds.configuration.model.v154.InterceptorEnum; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; +import org.eclipse.ui.PlatformUI; + + +/** + * This class implements the Dialog for Interceptor. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class InterceptorDialog extends Dialog +{ + /** The initial interceptors list */ + private List initialInterceptors; + + /** The available interceptors list */ + private List availableInterceptors; + + /** The selected interceptor */ + private InterceptorEnum selectedInterceptor; + + // UI Fields + private Table interceptorsTable; + private TableViewer interceptorsTableViewer; + private Button addButton; + + + /** + * Creates a new instance of InterceptorDialog. + */ + public InterceptorDialog( List interceptors ) + { + super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); + this.initialInterceptors = interceptors; + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell( Shell newShell ) + { + super.configureShell( newShell ); + newShell.setText( "Add An Interceptor" ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea( Composite parent ) + { + Composite composite = new Composite( parent, SWT.NONE ); + composite.setLayout( new GridLayout() ); + composite.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) ); + + // Choose Label + Label chooseLabel = new Label( composite, SWT.NONE ); + chooseLabel.setText( "Choose an interceptor:" ); + chooseLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); + + // Interceptors Table Viewer + interceptorsTable = new Table( composite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL + | SWT.FULL_SELECTION | SWT.HIDE_SELECTION ); + GridData gridData = new GridData( SWT.FILL, SWT.FILL, true, true ); + gridData.heightHint = 148; + gridData.minimumHeight = 148; + gridData.widthHint = 350; + gridData.minimumWidth = 350; + interceptorsTable.setLayoutData( gridData ); + interceptorsTable.addMouseListener( new MouseAdapter() + { + public void mouseDoubleClick( MouseEvent e ) + { + if ( interceptorsTable.getSelectionIndex() != -1 ) + { + okPressed(); + } + } + } ); + + interceptorsTableViewer = new TableViewer( interceptorsTable ); + interceptorsTableViewer.setContentProvider( new ArrayContentProvider() ); + interceptorsTableViewer.setLabelProvider( new LabelProvider() + { + public Image getImage( Object element ) + { + return ApacheDSConfigurationPlugin.getDefault().getImage( + ApacheDSConfigurationPluginConstants.IMG_INTERCEPTOR ); + } + + + public String getText( Object element ) + { + if ( element instanceof InterceptorEnum ) + { + return ( ( InterceptorEnum ) element ).getName(); + + } + + return super.getText( element ); + } + } ); + interceptorsTableViewer.addSelectionChangedListener( new ISelectionChangedListener() + { + public void selectionChanged( SelectionChangedEvent event ) + { + StructuredSelection selection = ( StructuredSelection ) interceptorsTableViewer.getSelection(); + if ( selection.isEmpty() ) + { + if ( ( addButton != null ) && ( !addButton.isDisposed() ) ) + { + addButton.setEnabled( false ); + } + } + else + { + if ( ( addButton != null ) && ( !addButton.isDisposed() ) ) + { + addButton.setEnabled( true ); + } + } + } + } ); + + initFromInput(); + + return composite; + } + + + /** + * Initializes the UI from the input. + */ + private void initFromInput() + { + // Creating the available interceptors list + availableInterceptors = new ArrayList(); + if ( !initialInterceptors.contains( InterceptorEnum.NORMALIZATION ) ) + { + availableInterceptors.add( InterceptorEnum.NORMALIZATION ); + } + if ( !initialInterceptors.contains( InterceptorEnum.AUTHENTICATION ) ) + { + availableInterceptors.add( InterceptorEnum.AUTHENTICATION ); + } + if ( !initialInterceptors.contains( InterceptorEnum.REFERRAL ) ) + { + availableInterceptors.add( InterceptorEnum.REFERRAL ); + } + if ( !initialInterceptors.contains( InterceptorEnum.ACI_AUTHORIZATION ) ) + { + availableInterceptors.add( InterceptorEnum.ACI_AUTHORIZATION ); + } + if ( !initialInterceptors.contains( InterceptorEnum.DEFAULT_AUTHORIZATION ) ) + { + availableInterceptors.add( InterceptorEnum.DEFAULT_AUTHORIZATION ); + } + if ( !initialInterceptors.contains( InterceptorEnum.EXCEPTION ) ) + { + availableInterceptors.add( InterceptorEnum.EXCEPTION ); + } + if ( !initialInterceptors.contains( InterceptorEnum.OPERATIONAL_ATTRIBUTE ) ) + { + availableInterceptors.add( InterceptorEnum.OPERATIONAL_ATTRIBUTE ); + } + if ( !initialInterceptors.contains( InterceptorEnum.SCHEMA ) ) + { + availableInterceptors.add( InterceptorEnum.SCHEMA ); + } + if ( !initialInterceptors.contains( InterceptorEnum.SUBENTRY ) ) + { + availableInterceptors.add( InterceptorEnum.SUBENTRY ); + } + if ( !initialInterceptors.contains( InterceptorEnum.COLLECTIVE_ATTRIBUTE ) ) + { + availableInterceptors.add( InterceptorEnum.COLLECTIVE_ATTRIBUTE ); + } + if ( !initialInterceptors.contains( InterceptorEnum.EVENT ) ) + { + availableInterceptors.add( InterceptorEnum.EVENT ); + } + if ( !initialInterceptors.contains( InterceptorEnum.TRIGGER ) ) + { + availableInterceptors.add( InterceptorEnum.TRIGGER ); + } + if ( !initialInterceptors.contains( InterceptorEnum.REPLICATION ) ) + { + availableInterceptors.add( InterceptorEnum.REPLICATION ); + } + + // Setting the input + interceptorsTableViewer.setInput( availableInterceptors ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) + */ + protected void createButtonsForButtonBar( Composite parent ) + { + addButton = createButton( parent, IDialogConstants.OK_ID, "Add", true ); //$NON-NLS-1$ + createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false ); + + addButton.setEnabled( false ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + protected void okPressed() + { + StructuredSelection selection = ( StructuredSelection ) interceptorsTableViewer.getSelection(); + if ( !selection.isEmpty() ) + { + selectedInterceptor = ( InterceptorEnum ) selection.getFirstElement(); + } + + super.okPressed(); + } + + + /** + * Gets the interceptor. + * + * @return + * the interceptor + */ + public InterceptorEnum getInterceptor() + { + return selectedInterceptor; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/NtlmProviderDialog.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/NtlmProviderDialog.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/NtlmProviderDialog.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/NtlmProviderDialog.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,158 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.editor.v154.dialogs; + + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; + + +/** + * This class implements the Dialog for NTML Provider. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class NtlmProviderDialog extends Dialog +{ + /** The initial value */ + private String initialValue; + + /** The return value */ + private String returnValue; + + /** The dirty flag */ + private boolean dirty = false; + + // UI Fields + private Text ntlmProviderText; + + + /** + * Creates a new instance of SaslRealmDialog. + */ + public NtlmProviderDialog( String initialValue ) + { + super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); + this.initialValue = initialValue; + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell( Shell newShell ) + { + super.configureShell( newShell ); + newShell.setText( "NTLM Provider Dialog" ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea( Composite parent ) + { + Composite composite = new Composite( parent, SWT.NONE ); + GridLayout layout = new GridLayout( 2, false ); + composite.setLayout( layout ); + composite.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) ); + + Label ntlmProviderLabel = new Label( composite, SWT.NONE ); + ntlmProviderLabel.setText( "NTLM Provider:" ); + + ntlmProviderText = new Text( composite, SWT.BORDER ); + ntlmProviderText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); + + initFromInput(); + addListeners(); + + return composite; + } + + + /** + * Initializes the UI from the input. + */ + private void initFromInput() + { + ntlmProviderText.setText( ( initialValue == null ) ? "" : initialValue ); + } + + + /** + * Adds listeners to the UI Fields. + */ + private void addListeners() + { + ntlmProviderText.addModifyListener( new ModifyListener() + { + public void modifyText( ModifyEvent e ) + { + dirty = true; + } + } ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + protected void okPressed() + { + returnValue = ntlmProviderText.getText(); + + super.okPressed(); + } + + + /** + * Gets the NTLM Provider. + * + * @return + * the NTLM Provider + */ + public String getNtlmProvider() + { + return returnValue; + } + + + /** + * Returns the dirty flag of the dialog. + * + * @return + * the dirty flag of the dialog + */ + public boolean isDirty() + { + return dirty; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/SaslRealmDialog.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/SaslRealmDialog.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/SaslRealmDialog.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v154/dialogs/SaslRealmDialog.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,158 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.editor.v154.dialogs; + + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; + + +/** + * This class implements the Dialog for SASL Realm. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class SaslRealmDialog extends Dialog +{ + /** The initial value */ + private String initialValue; + + /** The return value */ + private String returnValue; + + /** The dirty flag */ + private boolean dirty = false; + + // UI Fields + private Text saslRealmText; + + + /** + * Creates a new instance of SaslRealmDialog. + */ + public SaslRealmDialog( String initialValue ) + { + super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); + this.initialValue = initialValue; + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell( Shell newShell ) + { + super.configureShell( newShell ); + newShell.setText( "SASL Realm Dialog" ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + protected Control createDialogArea( Composite parent ) + { + Composite composite = new Composite( parent, SWT.NONE ); + GridLayout layout = new GridLayout( 2, false ); + composite.setLayout( layout ); + composite.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) ); + + Label saslRealmLabel = new Label( composite, SWT.NONE ); + saslRealmLabel.setText( "SASL Realm:" ); + + saslRealmText = new Text( composite, SWT.BORDER ); + saslRealmText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) ); + + initFromInput(); + addListeners(); + + return composite; + } + + + /** + * Initializes the UI from the input. + */ + private void initFromInput() + { + saslRealmText.setText( ( initialValue == null ) ? "" : initialValue ); + } + + + /** + * Adds listeners to the UI Fields. + */ + private void addListeners() + { + saslRealmText.addModifyListener( new ModifyListener() + { + public void modifyText( ModifyEvent e ) + { + dirty = true; + } + } ); + } + + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + protected void okPressed() + { + returnValue = saslRealmText.getText(); + + super.okPressed(); + } + + + /** + * Gets the SASL Realm. + * + * @return + * the SASL Realm + */ + public String getSaslRealm() + { + return returnValue; + } + + + /** + * Returns the dirty flag of the dialog. + * + * @return + * the dirty flag of the dialog + */ + public boolean isDirty() + { + return dirty; + } +} Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationVersionEnum.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationVersionEnum.java?rev=695982&r1=695981&r2=695982&view=diff ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationVersionEnum.java (original) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfigurationVersionEnum.java Tue Sep 16 10:20:16 2008 @@ -28,7 +28,19 @@ */ public enum ServerConfigurationVersionEnum { - /** Version 1.5.2 */ + /** Version 1.5.4 */ + VERSION_1_5_4 + { + /* (non-Javadoc) + * @see java.lang.Enum#toString() + */ + public String toString() + { + return "Version 1.5.4"; + } + }, + + /** Version 1.5.3 */ VERSION_1_5_3 { /* (non-Javadoc) Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java?rev=695982&r1=695981&r2=695982&view=diff ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java (original) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java Tue Sep 16 10:20:16 2008 @@ -46,7 +46,7 @@ /** * This class implements a parser and a writer for the 'server.xml' file of - * Apache Directory Server version 1.5.2. + * Apache Directory Server version 1.5.3. * * @author Apache Directory Project * @version $Rev$, $Date$ Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ExtendedOperationEnum.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ExtendedOperationEnum.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ExtendedOperationEnum.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ExtendedOperationEnum.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +/** + * This enum contains all the extended operations. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public enum ExtendedOperationEnum +{ + /** The Start TLS Extended Operation */ + START_TLS("Start TLS", "The Start TLS extended operation allows an application to serialize secure and " + + "plain requests against an LDAP server on a single connection."), + + /** The Graceful Shutdown Extended Operation */ + GRACEFUL_SHUTDOWN("Graceful Shutdown", "The Graceful Shutdown TLS extended operation allows an application to " + + "gracefully manage server's that must go offline or shutdown with proper notification to bound clients."), + + /** The Launch Diagnostic UI Extended Operation */ + LAUNCH_DIAGNOSTIC_UI("Launch Diagnostic UI", + "The Launch Diagnostic UI extended operation allows an application to " + + "launch the diagnostic user interface which can be used to look at " + + "the master table and the indices."); + + /** The name */ + private String name; + + /** The description */ + private String description; + + + /** + * Creates a new instance of InterceptorEnum. + * + * @param name + * the name + * @param description + * the description + */ + private ExtendedOperationEnum( String name, String description ) + { + this.name = name; + this.description = description; + } + + + /** + * Gets the name. + * + * @return + * the name + */ + public String getName() + { + return name; + } + + + /** + * Sets the name. + * + * @param name + * the name + */ + public void setName( String name ) + { + this.name = name; + } + + + /** + * Gets the description. + * + * @return + * the description + */ + public String getDescription() + { + return description; + } + + + /** + * Sets the description. + * + * @param description + * the description + */ + public void setDescription( String description ) + { + this.description = description; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/IndexedAttribute.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/IndexedAttribute.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/IndexedAttribute.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/IndexedAttribute.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +/** + * This class represents an Indexed Attribute. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class IndexedAttribute +{ + /** The attribute id */ + private String attributeId; + + /** The cache size */ + private int cacheSize; + + + /** + * Creates a new instance of IndexedAttribute. + * + * @param attributeId + * the attribute id + * @param cacheSize + * the cache size + */ + public IndexedAttribute( String attributeId, int cacheSize ) + { + this.attributeId = attributeId; + this.cacheSize = cacheSize; + } + + + /** + * Gets the attribute id. + * + * @return + * the attribute id + */ + public String getAttributeId() + { + return attributeId; + } + + + /** + * Sets the attribute id. + * + * @param attributeId + * the new attribute id + */ + public void setAttributeId( String attributeId ) + { + this.attributeId = attributeId; + } + + + /** + * Gets the cache size. + * + * @return + * the cache size + */ + public int getCacheSize() + { + return cacheSize; + } + + + /** + * Gets the cache size. + * + * @param cacheSize + * the new cache size + */ + public void setCacheSize( int cacheSize ) + { + this.cacheSize = cacheSize; + } + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() + { + return attributeId + " [" + cacheSize + "]"; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorConfiguration.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorConfiguration.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorConfiguration.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorConfiguration.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +/** + * This interface defines an interceptor configuration. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public interface InterceptorConfiguration +{ +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorEnum.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorEnum.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorEnum.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/InterceptorEnum.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + + + +/** + * This enum contains all the interceptors. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public enum InterceptorEnum +{ + /** The Normalization Interceptor */ + NORMALIZATION("Normalization", "A name normalization interceptor. This interceptor makes sure all relative " + + "and distinguished names are normalized before calls are made against " + + "the respective interface methods on PartitionNexus."), + + /** The Authentication Interceptor */ + AUTHENTICATION("Authentication", "An interceptor that authenticates users."), + + /** The Referral Interceptor */ + REFERRAL("Referral", "An interceptor which is responsible referral handling behaviors. It " + + "manages referral handling behavior when the Context#REFERRAL " + + "is implicitly or explicitly set to \"ignore\", when set to \"throw\" " + "and when set to \"follow\"."), + + /** The ACI Authorization Interceptor */ + ACI_AUTHORIZATION("ACI Authorization", "An ACI based authorization interceptor."), + + /** The Default Authorization Interceptor */ + DEFAULT_AUTHORIZATION("Default Authorization", "An interceptor that controls access to PartitionNexus. If a user " + + "tries to perform any operations that requires permission he or she " + + "doesn't have, NoPermissionException will be thrown and therefore the " + + "current invocation chain will terminate."), + + /** The Exception Interceptor */ + EXCEPTION("Exception", "An interceptor that detects any operations that breaks integrity of " + + "Partition and terminates the current invocation chain by throwing a " + + "NamingException. Those operations include when an entry already " + + "exists at a DN and is added once again to the same DN."), + + /** The Operational Attribute Interceptor */ + OPERATIONAL_ATTRIBUTE("Operational Attribute", "An interceptor that adds or modifies the default attributes of " + + "entries. There are four default attributes for now; 'creatorsName', " + + "'createTimestamp', 'modifiersName', 'modifyTimestamp'."), + + /** The Schema Interceptor */ + SCHEMA("Schema", "An interceptor that manages and enforces schemas."), + + /** The Sub-Entry Interceptor */ + SUBENTRY("Sub-Entry", "The sub-entry interceptor service which is responsible for filtering " + + "out sub-entries on search operations and injecting operational attributes"), + + /** The Collective Attribute Interceptor */ + COLLECTIVE_ATTRIBUTE("Collective Attribute", "An interceptor based service dealing with collective attribute " + + "management. This service intercepts read operations on entries to " + + "inject collective attribute value pairs into the response based on " + + "the entires inclusion within collectiveAttributeSpecificAreas and collectiveAttributeInnerAreas."), + + /** The Event Interceptor */ + EVENT("Event", "An interceptor based serivice for notifying NamingListeners of " + + "EventContext and EventDirContext changes."), + + /** The Trigger Interceptor */ + TRIGGER("Trigger", "The trigger interceptor based on the Trigger Specification."), + + /** The Replication Interceptor */ + REPLICATION("Replication", "An interceptor that intercepts LDAP operations and propagates the " + + "changes occurred by the operations into other ReplicaIds so the DIT " + + "of each ReplicaId in the cluster has the same content without any conflict.", + new ReplicationInterceptorConfiguration()); + + /** The name */ + private String name; + + /** The description */ + private String description; + + /** The interceptor configuration */ + private InterceptorConfiguration configuration; + + + /** + * Creates a new instance of InterceptorEnum. + * + * @param name + * the name + * @param description + * the description + */ + private InterceptorEnum( String name, String description ) + { + this.name = name; + this.description = description; + } + + + /** + * Creates a new instance of InterceptorEnum. + * + * @param name + * the name + * @param description + * the description + */ + private InterceptorEnum( String name, String description, InterceptorConfiguration configuration ) + { + this.name = name; + this.description = description; + this.configuration = configuration; + } + + + /** + * Gets the name. + * + * @return + * the name + */ + public String getName() + { + return name; + } + + + /** + * Sets the name. + * + * @param name + * the name + */ + public void setName( String name ) + { + this.name = name; + } + + + /** + * Gets the description. + * + * @return + * the description + */ + public String getDescription() + { + return description; + } + + + /** + * Sets the description. + * + * @param description + * the description + */ + public void setDescription( String description ) + { + this.description = description; + } + + + /** + * Gets the configuration. + * + * @return + * the configuration + */ + public InterceptorConfiguration getConfiguration() + { + return configuration; + } + + + /** + * Sets the configuration + * + * @param configuration + * the configuration + */ + public void setConfiguration( InterceptorConfiguration configuration ) + { + this.configuration = configuration; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/Partition.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/Partition.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/Partition.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/Partition.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,314 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +import java.util.ArrayList; +import java.util.List; + +import javax.naming.directory.Attributes; +import javax.naming.directory.BasicAttributes; + + +/** + * This class represents a Partition. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class Partition +{ + /** The ID of the partition */ + private String id; + + /** The cache size of the partition */ + private int cacheSize; + + /** The suffix of the partition */ + private String suffix; + + /** The Enable Optimizer flag */ + private boolean enableOptimizer; + + /** The Synchronization On Write flag */ + private boolean synchronizationOnWrite; + + /** The Context Entry */ + private Attributes contextEntry; + + /** The indexed attributes */ + private List indexedAttributes; + + /** The System Partition flag */ + private boolean systemPartition = false; + + + /** + * Creates a new instance of Partition. + */ + public Partition() + { + indexedAttributes = new ArrayList(); + contextEntry = new BasicAttributes( true ); + } + + + /** + * Creates a new instance of Partition. + * + * @param id + * the id of the partition + */ + public Partition( String id ) + { + indexedAttributes = new ArrayList(); + contextEntry = new BasicAttributes( true ); + this.id = id; + } + + + /** + * Gets the ID of the partition. + * + * @return + * the ID of the partition + */ + public String getId() + { + return this.id; + } + + + /** + * Sets the ID of the partition. + * + * @param id + * the new ID to set + */ + public void setId( String id ) + { + this.id = id; + } + + + /** + * Gets the cache size. + * + * @return + * the cache size + */ + public int getCacheSize() + { + return cacheSize; + } + + + /** + * Sets the cache size. + * + * @param cacheSize + * the new cache size + */ + public void setCacheSize( int cacheSize ) + { + this.cacheSize = cacheSize; + } + + + /** + * Gets the Context Entry. + * + * @return + * the Content Entry + */ + public Attributes getContextEntry() + { + return contextEntry; + } + + + /** + * Sets the Context Entry + * + * @param contextEntry + * the new Context Entry + */ + public void setContextEntry( Attributes contextEntry ) + { + this.contextEntry = contextEntry; + } + + + /** + * Gets the Enable Optimizer flag. + * + * @return + * the Enable Optimizer flag + */ + public boolean isEnableOptimizer() + { + return enableOptimizer; + } + + + /** + * Sets the Enable Optimizer flag. + * + * @param enableOptimizer + * the new value for the Enable Optimizer flag + */ + public void setEnableOptimizer( boolean enableOptimizer ) + { + this.enableOptimizer = enableOptimizer; + } + + + /** + * Get the Indexed Attributes List. + * + * @return + * the Indexed Attributes List + */ + public List getIndexedAttributes() + { + return indexedAttributes; + } + + + /** + * Set the Indexed Attributes List. + * + * @param indexedAttributes + * the new Indexed Attributes List + */ + public void setIndexedAttributes( List indexedAttributes ) + { + this.indexedAttributes = indexedAttributes; + } + + + /** + * Adds an Indexed Attribute. + * + * @param indexedAttribute + * the Indexed Attribute to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addIndexedAttribute( IndexedAttribute indexedAttribute ) + { + return indexedAttributes.add( indexedAttribute ); + } + + + /** + * Removes a Indexed Attribute. + * + * @param indexedAttribute + * the Indexed Attribute to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeIndexedAttribute( IndexedAttribute indexedAttribute ) + { + return indexedAttributes.remove( indexedAttribute ); + } + + + /** + * Gets the suffix. + * + * @return + * the suffix + */ + public String getSuffix() + { + return suffix; + } + + + /** + * Sets the suffix. + * + * @param suffix + * the new suffix + */ + public void setSuffix( String suffix ) + { + this.suffix = suffix; + } + + + /** + * Gets the Synchronization On Write flag. + * + * @return + * the Synchronization On Write flag + */ + public boolean isSynchronizationOnWrite() + { + return synchronizationOnWrite; + } + + + /** + * Sets the Synchronization On Write flag. + * + * @param synchronizationOnWrite + * the Synchronization On Write flag + */ + public void setSynchronizationOnWrite( boolean synchronizationOnWrite ) + { + this.synchronizationOnWrite = synchronizationOnWrite; + } + + + /** + * Returns the System Partition flag. + * + * @return + * true if the partition is the System Partition + */ + public boolean isSystemPartition() + { + return systemPartition; + } + + + /** + * Sets the System Partition flag. + * + * @param systemPartition + * the System Partition flag + */ + public void setSystemPartition( boolean systemPartition ) + { + this.systemPartition = systemPartition; + } + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() + { + return id; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ReplicationInterceptorConfiguration.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ReplicationInterceptorConfiguration.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ReplicationInterceptorConfiguration.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ReplicationInterceptorConfiguration.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + +/** + * This class implements a interceptor configuration for the replication interceptor. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class ReplicationInterceptorConfiguration implements InterceptorConfiguration +{ +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/SaslQualityOfProtectionEnum.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/SaslQualityOfProtectionEnum.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/SaslQualityOfProtectionEnum.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/SaslQualityOfProtectionEnum.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +/** + * This enum contains all the SASL qualities of protection. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public enum SaslQualityOfProtectionEnum +{ + /** The auth QoP */ + AUTH("auth (Authentication only)"), + + /** The auth-int QoP */ + AUTH_INT("auth-int (Authentication with integrity protection)"), + + /** The auth-conf QoP */ + AUTH_CONF("auth-conf (Authentication with integrity and privacy protection)"); + + /** The name */ + private String name; + + + /** + * Creates a new instance of SaslQualityOfProtectionEnum. + * + * @param name + * the name + */ + private SaslQualityOfProtectionEnum( String name ) + { + this.name = name; + } + + + /** + * Gets the name. + * + * @return + * the name + */ + public String getName() + { + return name; + } + + + /** + * Sets the name. + * + * @param name + * the name + */ + public void setName( String name ) + { + this.name = name; + } + + + public String toString() + { + return name; + } +} Added: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ServerConfigurationV154.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ServerConfigurationV154.java?rev=695982&view=auto ============================================================================== --- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ServerConfigurationV154.java (added) +++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v154/ServerConfigurationV154.java Tue Sep 16 10:20:16 2008 @@ -0,0 +1,1015 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.studio.apacheds.configuration.model.v154; + + +import java.util.ArrayList; +import java.util.List; + +import org.apache.directory.studio.apacheds.configuration.model.AbstractServerConfiguration; +import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration; +import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationVersionEnum; + + +/** + * This class represents a Server Configuration. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ +public class ServerConfigurationV154 extends AbstractServerConfiguration implements ServerConfiguration +{ + // LDAP Configuration + + /** The port */ + private int ldapPort; + + /** The flag for Enable LDAP */ + private boolean enableLdap; + + // Limits + + /** The Max Time Limit */ + private int maxTimeLimit; + + /** the Max Size Limit */ + private int maxSizeLimit; + + /** The Synchronization Period */ + private long synchronizationPeriod; + + /** The Maximum number of Threads */ + private int maxThreads; + + /** The Supported Mechanisms */ + private List supportedMechanisms; + + // SASL Properties + + /** The SASL Host */ + private String saslHost; + + /** The SASL Principal */ + private String saslPrincipal; + + /** The SASL QOP */ + private List saslQops; + + /** The SASL Realms */ + private List saslRealms; + + /** The Search Base DN */ + private String searchBaseDn; + + // Protocols + + /** The flag for Enable Access Control */ + private boolean enableAccessControl; + + /** The flag for Enable Kerberos */ + private boolean enableKerberos; + + /** The port for Kerberos */ + private int kerberosPort; + + /** The flag for Enable NTP */ + private boolean enableNtp; + + /** The port for NTP */ + private int ntpPort; + + /** The flag for Enable DNS */ + private boolean enableDns; + + /** The port for DNS */ + private int dnsPort; + + /** The flag for Enable LDAPS */ + private boolean enableLdaps; + + /** The port for LDAPS */ + private int ldapsPort; + + /** The flag for Enable Change Password */ + private boolean enableChangePassword; + + /** The port for Change Password */ + private int changePasswordPort; + + // Options + + /** The flag for Denormalize Operational Attributes */ + private boolean denormalizeOpAttr; + + /** The flag for Allow Anonymous Access */ + private boolean allowAnonymousAccess; + + // Other configuration elements + + /** The Partitions */ + private List partitions; + + /** The Interceptors */ + private List interceptors; + + /** The Extended Operations */ + private List extendedOperations; + + + /** + * Creates a new instance of ServerConfiguration. + */ + public ServerConfigurationV154() + { + super( ServerConfigurationVersionEnum.VERSION_1_5_3 ); + + supportedMechanisms = new ArrayList(); + saslQops = new ArrayList(); + saslRealms = new ArrayList(); + partitions = new ArrayList(); + interceptors = new ArrayList(); + extendedOperations = new ArrayList(); + } + + + /** + * Adds an Extended Operation. + * + * @param extendedOperation + * the Extended Operation to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addExtendedOperation( ExtendedOperationEnum extendedOperation ) + { + return extendedOperations.add( extendedOperation ); + } + + + /** + * Adds an Interceptor. + * + * @param interceptor + * the Interceptor to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addInterceptor( InterceptorEnum interceptor ) + { + return interceptors.add( interceptor ); + } + + + /** + * Adds a Partition. + * + * @param partition + * the Partition to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addPartition( Partition partition ) + { + return partitions.add( partition ); + } + + + /** + * Adds a SASL Quality Of Protection. + * + * @param saslQop + * the SASL Quality Of Protection to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addSaslQop( SaslQualityOfProtectionEnum saslQop ) + { + return saslQops.add( saslQop ); + } + + + /** + * Adds a SASL Realm. + * + * @param qop + * the SASL Realm to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addSaslRealm( String saslRealm ) + { + return saslRealms.add( saslRealm ); + } + + + /** + * Adds a Supported Mechanism. + * + * @param supportedMechanism + * the Supported Mechanism to add + * @return + * true (as per the general contract of the Collection.add method). + */ + public boolean addSupportedMechanism( SupportedMechanismEnum supportedMechanism ) + { + return supportedMechanisms.add( supportedMechanism ); + } + + + /** + * Removes all ExtendedOperations. + */ + public void clearExtendedOperations() + { + extendedOperations.clear(); + } + + + /** + * Removes all interceptors. + */ + public void clearInterceptors() + { + interceptors.clear(); + } + + + /** + * Removes all partitions. + */ + public void clearPartitions() + { + partitions.clear(); + } + + + /** + * Gets the Change Password port. + * + * @return + * the Change Password port + */ + public int getChangePasswordPort() + { + return changePasswordPort; + } + + + /** + * Gets the DNS port. + * + * @return + * the DNS port + */ + public int getDnsPort() + { + return dnsPort; + } + + + /** + * Gets the Extended Operations List. + * + * @return + * the Extended Operations List + */ + public List getExtendedOperations() + { + return extendedOperations; + } + + + /** + * Gets the Interceptors List. + * + * @return + * the Interceptors List + */ + public List getInterceptors() + { + return interceptors; + } + + + /** + * Gets the Kerberos port. + * + * @return + * the Kerberos port + */ + public int getKerberosPort() + { + return kerberosPort; + } + + + /** + * Gets the LDAPS port. + * + * @return + * the LDAPS port + */ + public int getLdapsPort() + { + return ldapsPort; + } + + + /** + * Gets the Maximum Size Limit. + * + * @return + * the Maximum Size Limit + */ + public int getMaxSizeLimit() + { + return maxSizeLimit; + } + + + /** + * Gets the Maximum number of Threads. + * + * @return + * the Maximum number of Threads + */ + public int getMaxThreads() + { + return maxThreads; + } + + + /** + * Gets the Maximum Time Limit. + * + * @return + * the Maximum Time Limit + */ + public int getMaxTimeLimit() + { + return maxTimeLimit; + } + + + /** + * Gets the NTP port. + * + * @return + * the NTP port + */ + public int getNtpPort() + { + return ntpPort; + } + + + /** + * Gets the Partitions List. + * + * @return + * the Partitions List + */ + public List getPartitions() + { + return partitions; + } + + + /** + * Gets the LDAP Port. + * + * @return + * the LDAP Port + */ + public int getLdapPort() + { + return ldapPort; + } + + + /** + * Gets the SASL Host. + * + * @return + * the SASL Host + */ + public String getSaslHost() + { + return saslHost; + } + + + /** + * Gets the SASL Principal. + * + * @return + * the SASL Principal + */ + public String getSaslPrincipal() + { + return saslPrincipal; + } + + + /** + * Gets the SASL Quality Of Protection List + * + * @return + * the SASL Quality Of Protection List + */ + public List getSaslQops() + { + return saslQops; + } + + + /** + * Gets the SASL Realms List. + * + * @return + * the SASL Realms List + */ + public List getSaslRealms() + { + return saslRealms; + } + + + /** + * Gets the Search Base DN. + * + * @return + * the Search Base DN + */ + public String getSearchBaseDn() + { + return searchBaseDn; + } + + + /** + * Gets the Supported Mechanisms List. + * + * @return + * the Supported Mechanisms List + */ + public List getSupportedMechanisms() + { + return supportedMechanisms; + } + + + /** + * Gets the Synchronization Period. + * + * @return + * the Synchronization Period + */ + public long getSynchronizationPeriod() + { + return synchronizationPeriod; + } + + + /** + * Gets the Allow Anonymous flag. + * + * @return + * true if the server configuration allows Anonymous Access + */ + public boolean isAllowAnonymousAccess() + { + return allowAnonymousAccess; + } + + + /** + * Gets the Denormalize Operational Attributes flag. + * + * @return + * the Denormalize Operational Attributes flag + */ + public boolean isDenormalizeOpAttr() + { + return denormalizeOpAttr; + } + + + /** + * Gets the Enable Access Control flag. + * + * @return + * true if Access Control is enabled + */ + public boolean isEnableAccessControl() + { + return enableAccessControl; + } + + + /** + * Gets the Enable Change Password flag. + * + * @return + * true if Change Password is enabled + */ + public boolean isEnableChangePassword() + { + return enableChangePassword; + } + + + /** + * Gets the Enable DNS flag. + * + * @return + * true if DNS is enabled + */ + public boolean isEnableDns() + { + return enableDns; + } + + + /** + * Gets the Enable Kerberos flag. + * + * @return + * true if Kerberos is enabled + */ + public boolean isEnableKerberos() + { + return enableKerberos; + } + + /** + * Gets the Enable LDAP flag. + * + * @return + * true if LDAP is enabled + */ + public boolean isEnableLdap() + { + return enableLdap; + } + + + /** + * Gets the Enable LDAPS flag. + * + * @return + * true if LDAPS is enabled + */ + public boolean isEnableLdaps() + { + return enableLdaps; + } + + + /** + * Gets the Enable NTP flag. + * + * @return + * true if NTP is enabled + */ + public boolean isEnableNtp() + { + return enableNtp; + } + + + /** + * Removes an Extended Operation. + * + * @param extendedOperation + * the Extended Operation to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeExtendedOperation( ExtendedOperationEnum extendedOperation ) + { + return extendedOperations.remove( extendedOperation ); + } + + + /** + * Removes an Supported Mechanism. + * + * @param supportedMechanism + * the Supported Mechanism to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeExtendedOperation( String supportedMechanism ) + { + return supportedMechanisms.remove( supportedMechanism ); + } + + + /** + * Removes an Interceptor. + * + * @param interceptor + * the Interceptor to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeInterceptor( InterceptorEnum interceptor ) + { + return interceptors.remove( interceptor ); + } + + + /** + * Removes a Partition. + * + * @param partition + * the partition to remove + * @return + * true if this list contained the specified element. + */ + public boolean removePartition( Partition partition ) + { + return partitions.remove( partition ); + } + + + /** + * Removes a SASL Quality Of Protection. + * + * @param saslQop + * the SASL Quality Of Protection to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeSaslQop( String saslQop ) + { + return saslQops.remove( saslQop ); + } + + + /** + * Removes a SASL Realm. + * + * @param saslRealm + * the SASL Realm to remove + * @return + * true if this list contained the specified element. + */ + public boolean removeSaslRealm( String saslRealm ) + { + return saslRealms.remove( saslRealm ); + } + + + /** + * Sets the Allow Anonymous flag. + * + * @param allowAnonymousAccess + * the new value + */ + public void setAllowAnonymousAccess( boolean allowAnonymousAccess ) + { + this.allowAnonymousAccess = allowAnonymousAccess; + } + + + /** + * Sets the Change Password port. + * + * @param changePasswordPort + * the Change Password port + */ + public void setChangePasswordPort( int changePasswordPort ) + { + this.changePasswordPort = changePasswordPort; + } + + + /** + * Sets the Denormalize Operational Attributes flag. + * + * @param denormalizeOpAttr + * the new Denormalize Operational Attributes flag + */ + public void setDenormalizeOpAttr( boolean denormalizeOpAttr ) + { + this.denormalizeOpAttr = denormalizeOpAttr; + } + + + /** + * Sets the DNS port. + * + * @param dnsPort + * the DNS port + */ + public void setDnsPort( int dnsPort ) + { + this.dnsPort = dnsPort; + } + + + /** + * Sets the Enable Access Control flag. + * + * @param enableAccessControl + * the new value + */ + public void setEnableAccessControl( boolean enableAccessControl ) + { + this.enableAccessControl = enableAccessControl; + } + + + /** + * Sets the Enable Change Password flag. + * + * @param enableChangePassword + * the new value + */ + public void setEnableChangePassword( boolean enableChangePassword ) + { + this.enableChangePassword = enableChangePassword; + } + + + /** + * Sets Enable DNS flag. + * + * @param enableDns + * the new value + */ + public void setEnableDns( boolean enableDns ) + { + this.enableDns = enableDns; + } + + + /** + * Sets the Enable Kerberos flag. + * + * @param enableKerberos + * the new value + */ + public void setEnableKerberos( boolean enableKerberos ) + { + this.enableKerberos = enableKerberos; + } + + + /** + * Sets the Enable LDAPS flag. + * + * @param enableLdaps + * the new value + */ + public void setEnableLdaps( boolean enableLdaps ) + { + this.enableLdaps = enableLdaps; + } + + + /** + * Sets the Enable LDAP flag. + * + * @param enableLdap + * the new value + */ + public void setEnableLdap( boolean enableLdap ) + { + this.enableLdap = enableLdap; + } + + + /** + * Sets the Enable NTP flag. + * + * @param enableNtp + * the new value + */ + public void setEnableNtp( boolean enableNtp ) + { + this.enableNtp = enableNtp; + } + + + /** + * Sets the Extended Operations List. + * + * @param extendedOperations + * the new value + */ + public void setExtendedOperations( List extendedOperations ) + { + this.extendedOperations = extendedOperations; + } + + + /** + * Sets the Interceptors List. + * + * @param interceptors + * the new value + */ + public void setInterceptors( List interceptors ) + { + this.interceptors = interceptors; + } + + + /** + * Sets the Kerberos port. + * + * @param kerberosPort + * the new value + */ + public void setKerberosPort( int kerberosPort ) + { + this.kerberosPort = kerberosPort; + } + + + /** + * Sets The LDAPS port. + * + * @param ldapsPort + */ + public void setLdapsPort( int ldapsPort ) + { + this.ldapsPort = ldapsPort; + } + + + /** + * Sets the Maximum Size Limit. + * + * @param maxSizeLimit + * the new value + */ + public void setMaxSizeLimit( int maxSizeLimit ) + { + this.maxSizeLimit = maxSizeLimit; + } + + + /** + * Sets the Maximum number of Threads + * + * @param maxThreads + * the new value + */ + public void setMaxThreads( int maxThreads ) + { + this.maxThreads = maxThreads; + } + + + /** + * Sets the Maximum Time Limit. + * + * @param maxTimeLimit + * the new value + */ + public void setMaxTimeLimit( int maxTimeLimit ) + { + this.maxTimeLimit = maxTimeLimit; + } + + + /** + * Sets the NTP port. + * + * @param ntpPort + * the new value + */ + public void setNtpPort( int ntpPort ) + { + this.ntpPort = ntpPort; + } + + + /** + * Sets the Partitions List. + * + * @param partitions + * the new value + */ + public void setPartitions( List partitions ) + { + this.partitions = partitions; + } + + + /** + * Sets the LDAP Port + * + * @param ldapPort + * the new value + */ + public void setLdapPort( int ldapPort ) + { + this.ldapPort = ldapPort; + } + + + /** + * Sets the SASL Host. + * + * @param saslHost + * the new value + */ + public void setSaslHost( String saslHost ) + { + this.saslHost = saslHost; + } + + + /** + * Sets the SASL Principal. + * + * @param saslPrincipal + * the new value + */ + public void setSaslPrincipal( String saslPrincipal ) + { + this.saslPrincipal = saslPrincipal; + } + + + /** + * Sets the SASL Quality Of Protection List. + * + * @param saslQops + * the new value + */ + public void setSaslQops( List saslQops ) + { + this.saslQops = saslQops; + } + + + /** + * Sets the SASL Realms List. + * + * @param saslRealms + * the new value + */ + public void setSaslRealms( List saslRealms ) + { + this.saslRealms = saslRealms; + } + + + /** + * Sets the Search Base DN + * + * @param searchBaseDn + * the new value + */ + public void setSearchBaseDn( String searchBaseDn ) + { + this.searchBaseDn = searchBaseDn; + } + + + /** + * Sets the Supported Mechanisms List. + * + * @param supportedMechanisms + * the new value + */ + public void setSupportedMechanisms( List supportedMechanisms ) + { + this.supportedMechanisms = supportedMechanisms; + } + + + /** + * Sets the Synchonization Period. + * + * @param synchronizationPeriod + * the new value + */ + public void setSynchronizationPeriod( long synchronizationPeriod ) + { + this.synchronizationPeriod = synchronizationPeriod; + } +}