public boolean isValid() { return super.isValid() && Dn.isValid( getValueAsString() ); }
try if ( Dn.isValid( s ) )
public String getInvalidString() { if ( this.getUnfoldedDnSpec().length() == 0 ) { return "Missing Dn spec 'dn'"; } else if ( this.getUnfoldedDn().length() == 0 ) { return "Missing Dn"; } else if ( !Dn.isValid( getValueAsString() ) ) { return "Invalid Dn"; } else { return super.getInvalidString(); } }
boolean result = Dn.isValid( strValue );
if ( !Dn.isValid( dn ) )
if ( !Dn.isValid( dn ) )
if ( !Dn.isValid( dn ) )
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String issuerDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08207_ISSUER_DN, issuerDN ) ); } if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) ) { if ( !Dn.isValid( issuerDN ) ) { String msg = I18n.err( I18n.ERR_08203_INVALID_ISSUER_DN, issuerDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setIssuerDN( issuerDN ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String issuerDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08207_ISSUER_DN, issuerDN ) ); } if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) ) { if ( !Dn.isValid( issuerDN ) ) { String msg = I18n.err( I18n.ERR_08203_INVALID_ISSUER_DN, issuerDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setIssuerDN( issuerDN ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String issuerDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08207_ISSUER_DN, issuerDN ) ); } if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) ) { if ( !Dn.isValid( issuerDN ) ) { String msg = I18n.err( I18n.ERR_08203_INVALID_ISSUER_DN, issuerDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setIssuerDN( issuerDN ); } } } );
if ( validateDn && !Dn.isValid( dn ) )
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String subjectDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08219_SUBJECT_DN, subjectDN ) ); } if ( ( subjectDN != null ) && ( subjectDN.trim().length() > 0 ) ) { if ( !Dn.isValid( subjectDN ) ) { String msg = I18n.err( I18n.ERR_08204_INVALID_SUBJECT_DN, subjectDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setSubjectDN( subjectDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String targetDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08215_TARGET_DN, targetDN ) ); } if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) ) { if ( !Dn.isValid( targetDN ) ) { String msg = I18n.err( I18n.ERR_08201_INVALID_TARGET_DN, targetDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setTargetDN( targetDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String targetDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08215_TARGET_DN, targetDN ) ); } if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) ) { if ( !Dn.isValid( targetDN ) ) { String msg = I18n.err( I18n.ERR_08201_INVALID_TARGET_DN, targetDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setTargetDN( targetDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String targetDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08215_TARGET_DN, targetDN ) ); } if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) ) { if ( !Dn.isValid( targetDN ) ) { String msg = I18n.err( I18n.ERR_08201_INVALID_TARGET_DN, targetDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setTargetDN( targetDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String subjectDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08219_SUBJECT_DN, subjectDN ) ); } if ( ( subjectDN != null ) && ( subjectDN.trim().length() > 0 ) ) { if ( !Dn.isValid( subjectDN ) ) { String msg = I18n.err( I18n.ERR_08204_INVALID_SUBJECT_DN, subjectDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setSubjectDN( subjectDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String subjectDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08219_SUBJECT_DN, subjectDN ) ); } if ( ( subjectDN != null ) && ( subjectDN.trim().length() > 0 ) ) { if ( !Dn.isValid( subjectDN ) ) { String msg = I18n.err( I18n.ERR_08204_INVALID_SUBJECT_DN, subjectDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setSubjectDN( subjectDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
/** * @see org.apache.directory.studio.connection.ui.AbstractConnectionParameterPage#validate() */ protected void validate() { // set enabled/disabled state of fields and buttons baseDNCombo.setEnabled( !isAutoFetchBaseDns() ); pagedSearchSizeLabel.setEnabled( isPagedSearch() ); pagedSearchSizeText.setEnabled( isPagedSearch() ); pagedSearchScrollModeButton.setEnabled( isPagedSearch() ); // validate input fields message = null; infoMessage = null; errorMessage = null; if ( !isAutoFetchBaseDns() ) { if ( !Dn.isValid( getBaseDN() ) ) { message = Messages.getString( "BrowserParameterPage.EnterValidBaseDN" ); //$NON-NLS-1$ } } }
/** * Validates the input fields. */ private void validate() { if ( wizard.isNewContextEntry() && !"".equals( contextEntryDnCombo.getText() ) //$NON-NLS-1$ && Dn.isValid( contextEntryDnCombo.getText() ) ) { setPageComplete( true ); saveState(); } else if ( !wizard.isNewContextEntry() && dnBuilderWidget.getRdn() != null && dnBuilderWidget.getParentDn() != null ) { setPageComplete( true ); saveState(); } else { setPageComplete( false ); } }
protected Object getValueEditorRawValue() { IBrowserConnection connection = getConnection(); String dn = getDn(); String description = getAttributeDescription(); Object value = getValue(); Object rawValue = null; if ( value != null ) { try { // some value editors need the real Dn (e.g. the password editor) DummyEntry dummyEntry = new DummyEntry( Dn.isValid( dn ) ? new Dn( dn ) : new Dn(), connection ); Attribute dummyAttribute = new Attribute( dummyEntry, description ); Value dummyValue = new Value( dummyAttribute, value ); rawValue = valueEditor.getRawValue( dummyValue ); } catch ( LdapInvalidDnException e ) { // should not occur, as we check with isValid() } } return rawValue; }