~ubuntu-branches/ubuntu/raring/eucalyptus/raring

« back to all changes in this revision

Viewing changes to clc/modules/authentication/src/main/java/com/eucalyptus/auth/ldap/authentication/LdapAuthenticatorFactory.java

  • Committer: Package Import Robot
  • Author(s): Brian Thomason
  • Date: 2011-11-29 13:17:52 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 185.
  • Revision ID: package-import@ubuntu.com-20111129131752-rq31al3ntutv2vvl
Tags: upstream-3.0.999beta1
ImportĀ upstreamĀ versionĀ 3.0.999beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.eucalyptus.auth.ldap.authentication;
 
2
 
 
3
import com.eucalyptus.auth.LdapException;
 
4
import com.eucalyptus.auth.ldap.LdapIntegrationConfiguration;
 
5
import com.eucalyptus.auth.ldap.LicParser;
 
6
 
 
7
public class LdapAuthenticatorFactory {
 
8
 
 
9
  public static LdapAuthenticator getLdapAuthenticator( String authMethod ) throws LdapException {
 
10
    if ( authMethod == null ) {
 
11
      throw new LdapException( "Can not find LDAP authenticator for empty authentication method" );
 
12
    }
 
13
    if ( LicParser.LDAP_AUTH_METHOD_SASL_GSSAPI.equals( authMethod ) ) {
 
14
      return new GssapiKrb5Authenticator( );
 
15
    } else {
 
16
      return new DefaultAuthenticator( );
 
17
    }
 
18
  }
 
19
  
 
20
}