I have an interface
import javax.naming.AuthenticationException;
import com.unboundid.ldap.sdk.LDAPException;
public interface AuthenticationServiceManager {
/**
* Creates the Connection for the specific user logging in, and binds the
* user's credentials to object.
*
* @param userName
* The user name to authenticate .
* @param password
* The user's password to check .
* @param args
* is an object that holds variable arguments which can be used
* to authenticate using both LDAP and OpenId
* @return boolean The connection status showing whether the user has been
* successfully authenticated or not.
* @throws AuthenticationException
* If there is an error authenticating with the passed
* parameters
**/
boolean authenticate(String username, String password, Object... args)
throws AuthenticationException, LDAPException;
/**
* Disconnects the connection.
*/
void disconnect();
}
A class that implements this interface
package com.cerner.jira.plugins.esig.servicemanagerimpl;
import javax.naming.AuthenticationException;
import com.cerner.jira.plugins.esig.servicemanager.AuthenticationServiceManager;
import com.unboundid.ldap.sdk.LDAPException;
public class AuthenticationManagerImpl implements AuthenticationServiceManager {
@Override
public boolean authenticate(String username, String password)
throws AuthenticationException, LDAPException {
return false;
}
@Override
public boolean authenticate(String username, String password, String url)
{
return false;
}
@Override
public void disconnect() {
// TODO Auto-generated method stub
}
}
I'm trying to create an interface that can be used to implement a connection class. I should be able to use this for different authentication like LDAP, OpenId etc; So I want to pass username,password(if its LDAP) and variable number of arguments(If OpenId). How do I do that? I tried this. It is throwing error. How do I initialize the object to hold variable parameters?
Error :The method authenticate(String, String) of type AuthenticationManagerImpl must override or implement a supertype method