LdapClientInterface.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.utils.transport.ldap;

  21. import java.net.URI;
  22. import java.util.List;

  23. import javax.naming.InvalidNameException;
  24. import javax.naming.directory.Attributes;
  25. import javax.naming.ldap.LdapName;

  26. /**
  27.  * Interfaccia del client ldap
  28.  *
  29.  * @author Tommaso Burlon (tommaso.burlon@link.it)
  30.  * @author $Author$  
  31.  * @version $Rev$, $Date$
  32.  *
  33.  */
  34. public interface LdapClientInterface {
  35.    
  36.     public List<Attributes> search(LdapQuery filter);
  37.     public LdapClientInterface base(LdapName base);
  38.     public LdapClientInterface uri(URI url);
  39.    
  40.     // autenticazione
  41.     public default LdapClientInterface username(String name) throws InvalidNameException {
  42.         return this.username(new LdapName(name));
  43.     }
  44.     public LdapClientInterface username(LdapName name);
  45.     public LdapClientInterface password(String password);
  46.    
  47.     // default method utility
  48.     public default List<Attributes> search() {
  49.         return this.search(new LdapQuery());
  50.     }
  51. }