/** * Store the procedure's name * * @param procedure The procedure's name */ public void setProcedure( String procedure ) { this.procedure = Strings.getBytesUtf8( procedure ); }
/** * Sets the credentials. * * @param credentials the credentials */ public void setCredentials( String credentials ) { this.credentials = Strings.getBytesUtf8( credentials ); }
/** * Sets the credentials. * * @param credentials the credentials */ public void setCredentials( String credentials ) { this.credentials = Strings.getBytesUtf8( credentials ); }
/** * Sets the credentials. * * @param credentials the credentials */ public void setCredentials( String credentials ) { this.credentials = Strings.getBytesUtf8( credentials ); }
/** * Store the procedure's name * * @param procedure The procedure's name */ public void setProcedure( String procedure ) { this.procedure = Strings.getBytesUtf8( procedure ); }
/** * Store the procedure's name * * @param procedure The procedure's name */ public void setProcedure( String procedure ) { this.procedure = Strings.getBytesUtf8( procedure ); }
/** * {@inheritDoc} */ @Override public void dumpIndex( PartitionTxn partitionTxn, OutputStream stream, String name ) throws IOException { stream.write( Strings.getBytesUtf8( "Nothing to dump for index " + name ) ); }
public byte[] getHistoryValue() { StringBuilder sb = new StringBuilder(); sb.append( time ).append( DELIMITER ); sb.append( syntaxOID ).append( DELIMITER ); sb.append( length ).append( DELIMITER ); sb.append( data ); return Strings.getBytesUtf8( sb.toString() ); }
/** * Base64 encode a String * * @param str The string to encode * @return the base 64 encoded string */ private static String encodeBase64( String str ) { // force encoding using UTF-8 charset, as required in RFC2849 note 7 return new String( Base64.encode( Strings.getBytesUtf8( str ) ) ); }
/** * {@inheritDoc} */ @Override public BindRequest setCredentials( String credentials ) { return setCredentials( Strings.getBytesUtf8( credentials ) ); }
/** * {@inheritDoc} */ @Override public BindRequest setCredentials( String credentials ) { return setCredentials( Strings.getBytesUtf8( credentials ) ); }
/** * @see #createStoragePassword(byte[], LdapSecurityConstants) * * @param credentials The password * @param algorithm The algorithm to use * @return The resulting byte[] containing the paswword */ public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm ) { return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm ); }
/** * @see #createStoragePassword(byte[], LdapSecurityConstants) * * @param credentials The password * @param algorithm The algorithm to use * @return The resulting byte[] containing the paswword */ public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm ) { return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm ); }
/** * @see #createStoragePassword(byte[], LdapSecurityConstants) * * @param credentials The password * @param algorithm The algorithm to use * @return The resulting byte[] containing the paswword */ public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm ) { return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm ); }
/** * Base64 encode a String * * @param str The string to encode * @return the base 64 encoded string */ private static String encodeBase64( String str ) { // force encoding using UTF-8 charset, as required in RFC2849 note 7 return new String( Base64.encode( Strings.getBytesUtf8( str ) ) ); }
public static byte[] createCookie( int replicaId, String csn ) { // the syncrepl cookie format (compatible with OpenLDAP) // rid=nn,csn=xxxz String replicaIdStr = StringUtils.leftPad( Integer.toString( replicaId ), 3, '0' ); return Strings.getBytesUtf8( REPLICA_ID_PREFIX + replicaIdStr + COOKIE_DELIM + CSN_PREFIX + csn ); }
/** * {@inheritDoc} */ @Override public BindRequest setCredentials( String credentials ) { return setCredentials( Strings.getBytesUtf8( credentials ) ); }
/** * Base64 encode a String * * @param str The string to encode * @return the base 64 encoded string */ private static String encodeBase64( String str ) { // force encoding using UTF-8 charset, as required in RFC2849 note 7 return new String( Base64.encode( Strings.getBytesUtf8( str ) ) ); }
/** * {@inheritDoc} */ @Override public void bind( Dn name, String credentials ) throws LdapException { byte[] credBytes = credentials == null ? Strings.EMPTY_BYTES : Strings.getBytesUtf8( credentials ); BindRequest bindRequest = new BindRequestImpl(); bindRequest.setDn( name ); bindRequest.setCredentials( credBytes ); BindResponse bindResponse = bind( bindRequest ); processResponse( bindResponse ); }
/** * Try to authenticate the usr against the underlying LDAP server. */ private CoreSession authenticate( String user, String password ) throws InvalidNameException, Exception { BindOperationContext bindContext = new BindOperationContext( getLdapSession().getCoreSession() ); bindContext.setDn( new Dn( user ) ); bindContext.setCredentials( Strings.getBytesUtf8( password ) ); getAdminSession().getDirectoryService().getOperationManager().bind( bindContext ); return bindContext.getSession(); }