namingContext = new LdapUrl((String) ctx.getEnvironment().get(Context.PROVIDER_URL)); } catch (LdapURLEncodingException e) { LOGGER.error(e.toString()); LOGGER.debug(e.toString(), e); throw new NamingException(e.getMessage());
/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
public SearchResult next() throws NamingException { try { LdapUrl url = new LdapUrl( urls.remove( 0 ) ); SearchResult searchResult = new SearchResult( url.getDn().getName(), null, new BasicAttributes(), false ); searchResult.setNameInNamespace( url.getDn().getName() ); StudioSearchResult ssr = new StudioSearchResult( searchResult, null, false, url ); return ssr; } catch ( LdapURLEncodingException e ) { throw new NamingException( e.getMessage() ); } }
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, badUrl, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, badUrl, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, badUrl, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, urlStr, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, urlStr, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
LOG.error( I18n.err( I18n.ERR_05103_INVALID_URL, urlStr, luee.getMessage() ) ); throw new DecoderException( I18n.err( I18n.ERR_05104_INVALID_URL, luee.getMessage() ), luee );
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
namingException = new NamingException( e.getMessage() );
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );
namingException = new NamingException( e.getMessage() );
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );
namingException = new NamingException( e.getMessage() );
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );