cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From du...@apache.org
Subject [1/2] Fix codestyle/formatting within plugins/userauthenticators/ldap
Date Wed, 20 Nov 2013 13:00:20 GMT
Updated Branches:
  refs/heads/master 917ea33ba -> 31758ed8d


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUser.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUser.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUser.java
index 592459e..af718cd 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUser.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUser.java
@@ -17,65 +17,65 @@
 package org.apache.cloudstack.ldap;
 
 public class LdapUser implements Comparable<LdapUser> {
-	private final String email;
-	private final String principal;
-	private final String firstname;
-	private final String lastname;
-	private final String username;
+    private final String email;
+    private final String principal;
+    private final String firstname;
+    private final String lastname;
+    private final String username;
     private final String domain;
 
-	public LdapUser(final String username, final String email, final String firstname, final
String lastname, final String principal, String domain) {
-		this.username = username;
-		this.email = email;
-		this.firstname = firstname;
-		this.lastname = lastname;
-		this.principal = principal;
-	this.domain = domain;
-	}
+    public LdapUser(final String username, final String email, final String firstname, final
String lastname, final String principal, String domain) {
+        this.username = username;
+        this.email = email;
+        this.firstname = firstname;
+        this.lastname = lastname;
+        this.principal = principal;
+        this.domain = domain;
+    }
 
-	@Override
-	public int compareTo(final LdapUser other) {
-		return getUsername().compareTo(other.getUsername());
-	}
+    @Override
+    public int compareTo(final LdapUser other) {
+        return getUsername().compareTo(other.getUsername());
+    }
 
-	@Override
-	public boolean equals(final Object other) {
-		if (this == other) {
-			return true;
-		}
-		if (other instanceof LdapUser) {
-			final LdapUser otherLdapUser = (LdapUser) other;
-			return getUsername().equals(otherLdapUser.getUsername());
-		}
-		return false;
-	}
+    @Override
+    public boolean equals(final Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (other instanceof LdapUser) {
+            final LdapUser otherLdapUser = (LdapUser) other;
+            return getUsername().equals(otherLdapUser.getUsername());
+        }
+        return false;
+    }
 
-	public String getEmail() {
-		return email;
-	}
+    public String getEmail() {
+        return email;
+    }
 
-	public String getFirstname() {
-		return firstname;
-	}
+    public String getFirstname() {
+        return firstname;
+    }
 
-	public String getLastname() {
-		return lastname;
-	}
+    public String getLastname() {
+        return lastname;
+    }
 
-	public String getPrincipal() {
-		return principal;
-	}
+    public String getPrincipal() {
+        return principal;
+    }
 
-	public String getUsername() {
-		return username;
-	}
+    public String getUsername() {
+        return username;
+    }
 
     public String getDomain() {
-	return domain;
+        return domain;
     }
 
     @Override
-	public int hashCode() {
-		return getUsername().hashCode();
-	}
+    public int hashCode() {
+        return getUsername().hashCode();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManager.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManager.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManager.java
index 59a41de..e84c904 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManager.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUserManager.java
@@ -34,153 +34,153 @@ public class LdapUserManager {
     }
 
     public LdapUserManager(final LdapConfiguration ldapConfiguration) {
-	_ldapConfiguration = ldapConfiguration;
+        _ldapConfiguration = ldapConfiguration;
     }
 
     private LdapUser createUser(final SearchResult result) throws NamingException {
-	final Attributes attributes = result.getAttributes();
+        final Attributes attributes = result.getAttributes();
 
-	final String username = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getUsernameAttribute());
-	final String email = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getEmailAttribute());
-	final String firstname = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getFirstnameAttribute());
-	final String lastname = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getLastnameAttribute());
-	final String principal = result.getNameInNamespace();
+        final String username = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getUsernameAttribute());
+        final String email = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getEmailAttribute());
+        final String firstname = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getFirstnameAttribute());
+        final String lastname = LdapUtils.getAttributeValue(attributes, _ldapConfiguration.getLastnameAttribute());
+        final String principal = result.getNameInNamespace();
 
-	String domain = principal.replace("cn="+LdapUtils.getAttributeValue(attributes,_ldapConfiguration.getCommonNameAttribute())+",",
"");
-	domain = domain.replace(","+_ldapConfiguration.getBaseDn(), "");
-	domain = domain.replace("ou=","");
+        String domain = principal.replace("cn="+LdapUtils.getAttributeValue(attributes,_ldapConfiguration.getCommonNameAttribute())+",",
"");
+        domain = domain.replace(","+_ldapConfiguration.getBaseDn(), "");
+        domain = domain.replace("ou=","");
 
-	return new LdapUser(username, email, firstname, lastname, principal, domain);
+        return new LdapUser(username, email, firstname, lastname, principal, domain);
     }
 
     private String generateSearchFilter(final String username) {
-	final StringBuilder userObjectFilter = new StringBuilder();
-	userObjectFilter.append("(objectClass=");
-	userObjectFilter.append(_ldapConfiguration.getUserObject());
-	userObjectFilter.append(")");
-
-	final StringBuilder usernameFilter = new StringBuilder();
-	usernameFilter.append("(");
-	usernameFilter.append(_ldapConfiguration.getUsernameAttribute());
-	usernameFilter.append("=");
-	usernameFilter.append((username == null ? "*" : username));
-	usernameFilter.append(")");
-
-	final StringBuilder memberOfFilter = new StringBuilder();
-	if (_ldapConfiguration.getSearchGroupPrinciple() != null) {
-	    memberOfFilter.append("(memberof=");
-	    memberOfFilter.append(_ldapConfiguration.getSearchGroupPrinciple());
-	    memberOfFilter.append(")");
-	}
-
-	final StringBuilder result = new StringBuilder();
-	result.append("(&");
-	result.append(userObjectFilter);
-	result.append(usernameFilter);
-	result.append(memberOfFilter);
-	result.append(")");
-
-	return result.toString();
+        final StringBuilder userObjectFilter = new StringBuilder();
+        userObjectFilter.append("(objectClass=");
+        userObjectFilter.append(_ldapConfiguration.getUserObject());
+        userObjectFilter.append(")");
+
+        final StringBuilder usernameFilter = new StringBuilder();
+        usernameFilter.append("(");
+        usernameFilter.append(_ldapConfiguration.getUsernameAttribute());
+        usernameFilter.append("=");
+        usernameFilter.append((username == null ? "*" : username));
+        usernameFilter.append(")");
+
+        final StringBuilder memberOfFilter = new StringBuilder();
+        if (_ldapConfiguration.getSearchGroupPrinciple() != null) {
+            memberOfFilter.append("(memberof=");
+            memberOfFilter.append(_ldapConfiguration.getSearchGroupPrinciple());
+            memberOfFilter.append(")");
+        }
+
+        final StringBuilder result = new StringBuilder();
+        result.append("(&");
+        result.append(userObjectFilter);
+        result.append(usernameFilter);
+        result.append(memberOfFilter);
+        result.append(")");
+
+        return result.toString();
     }
 
     private String generateGroupSearchFilter(final String groupName) {
-	final StringBuilder groupObjectFilter = new StringBuilder();
-	groupObjectFilter.append("(objectClass=");
-	groupObjectFilter.append(_ldapConfiguration.getGroupObject());
-	groupObjectFilter.append(")");
-
-	final StringBuilder groupNameFilter = new StringBuilder();
-	groupNameFilter.append("(");
-	groupNameFilter.append(_ldapConfiguration.getCommonNameAttribute());
-	groupNameFilter.append("=");
-	groupNameFilter.append((groupName == null ? "*" : groupName));
-	groupNameFilter.append(")");
-
-	final StringBuilder result = new StringBuilder();
-	result.append("(&");
-	result.append(groupObjectFilter);
-	result.append(groupNameFilter);
-	result.append(")");
-
-	return result.toString();
+        final StringBuilder groupObjectFilter = new StringBuilder();
+        groupObjectFilter.append("(objectClass=");
+        groupObjectFilter.append(_ldapConfiguration.getGroupObject());
+        groupObjectFilter.append(")");
+
+        final StringBuilder groupNameFilter = new StringBuilder();
+        groupNameFilter.append("(");
+        groupNameFilter.append(_ldapConfiguration.getCommonNameAttribute());
+        groupNameFilter.append("=");
+        groupNameFilter.append((groupName == null ? "*" : groupName));
+        groupNameFilter.append(")");
+
+        final StringBuilder result = new StringBuilder();
+        result.append("(&");
+        result.append(groupObjectFilter);
+        result.append(groupNameFilter);
+        result.append(")");
+
+        return result.toString();
     }
 
     public LdapUser getUser(final String username, final DirContext context) throws NamingException
{
-	final NamingEnumeration<SearchResult> result = searchUsers(username, context);
-	if (result.hasMoreElements()) {
-	    return createUser(result.nextElement());
-	} else {
-	    throw new NamingException("No user found for username " + username);
-	}
+        final NamingEnumeration<SearchResult> result = searchUsers(username, context);
+        if (result.hasMoreElements()) {
+            return createUser(result.nextElement());
+        } else {
+            throw new NamingException("No user found for username " + username);
+        }
     }
 
     public List<LdapUser> getUsers(final DirContext context) throws NamingException
{
-	return getUsers(null, context);
+        return getUsers(null, context);
     }
 
     public List<LdapUser> getUsers(final String username, final DirContext context)
throws NamingException {
-	final NamingEnumeration<SearchResult> results = searchUsers(username, context);
+        final NamingEnumeration<SearchResult> results = searchUsers(username, context);
 
-	final List<LdapUser> users = new ArrayList<LdapUser>();
+        final List<LdapUser> users = new ArrayList<LdapUser>();
 
-	while (results.hasMoreElements()) {
-	    final SearchResult result = results.nextElement();
-	    users.add(createUser(result));
-	}
+        while (results.hasMoreElements()) {
+            final SearchResult result = results.nextElement();
+            users.add(createUser(result));
+        }
 
-	Collections.sort(users);
+        Collections.sort(users);
 
-	return users;
+        return users;
     }
 
     public List<LdapUser> getUsersInGroup(String groupName, DirContext context) throws
NamingException {
-	String attributeName = _ldapConfiguration.getGroupUniqueMemeberAttribute();
-	final SearchControls controls = new SearchControls();
-	controls.setSearchScope(_ldapConfiguration.getScope());
-	controls.setReturningAttributes(new String[]{attributeName});
+        String attributeName = _ldapConfiguration.getGroupUniqueMemeberAttribute();
+        final SearchControls controls = new SearchControls();
+        controls.setSearchScope(_ldapConfiguration.getScope());
+        controls.setReturningAttributes(new String[] {attributeName});
 
-	NamingEnumeration<SearchResult> result = context.search(_ldapConfiguration.getBaseDn(),
generateGroupSearchFilter(groupName), controls);
+        NamingEnumeration<SearchResult> result = context.search(_ldapConfiguration.getBaseDn(),
generateGroupSearchFilter(groupName), controls);
 
-	final List<LdapUser> users = new ArrayList<LdapUser>();
-	//Expecting only one result which has all the users
-	if (result.hasMoreElements()) {
-	    Attribute attribute = result.nextElement().getAttributes().get(attributeName);
-	    NamingEnumeration<?> values = attribute.getAll();
+        final List<LdapUser> users = new ArrayList<LdapUser>();
+        //Expecting only one result which has all the users
+        if (result.hasMoreElements()) {
+            Attribute attribute = result.nextElement().getAttributes().get(attributeName);
+            NamingEnumeration<?> values = attribute.getAll();
 
-	    while (values.hasMoreElements()) {
-		String userdn = String.valueOf(values.nextElement());
-		users.add(getUserForDn(userdn,context));
-	    }
-	}
+            while (values.hasMoreElements()) {
+                String userdn = String.valueOf(values.nextElement());
+                users.add(getUserForDn(userdn,context));
+            }
+        }
 
-	Collections.sort(users);
+        Collections.sort(users);
 
-	return users;
+        return users;
     }
 
     private LdapUser getUserForDn(String userdn, DirContext context) throws NamingException
{
-	final SearchControls controls = new SearchControls();
-	controls.setSearchScope(_ldapConfiguration.getScope());
-	controls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
-
-	NamingEnumeration<SearchResult> result = context.search(userdn, "(objectClass="+_ldapConfiguration.getUserObject()+")",
controls);
-	if (result.hasMoreElements()) {
-	    return createUser(result.nextElement());
-	} else {
-	    throw new NamingException("No user found for dn " + userdn);
-	}
+        final SearchControls controls = new SearchControls();
+        controls.setSearchScope(_ldapConfiguration.getScope());
+        controls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
+
+        NamingEnumeration<SearchResult> result = context.search(userdn, "(objectClass="+_ldapConfiguration.getUserObject()+")",
controls);
+        if (result.hasMoreElements()) {
+            return createUser(result.nextElement());
+        } else {
+            throw new NamingException("No user found for dn " + userdn);
+        }
     }
 
     public NamingEnumeration<SearchResult> searchUsers(final DirContext context) throws
NamingException {
-	return searchUsers(null, context);
+        return searchUsers(null, context);
     }
 
     public NamingEnumeration<SearchResult> searchUsers(final String username, final
DirContext context) throws NamingException {
-	final SearchControls controls = new SearchControls();
+        final SearchControls controls = new SearchControls();
 
-	controls.setSearchScope(_ldapConfiguration.getScope());
-	controls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
+        controls.setSearchScope(_ldapConfiguration.getScope());
+        controls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
 
-	return context.search(_ldapConfiguration.getBaseDn(), generateSearchFilter(username), controls);
+        return context.search(_ldapConfiguration.getBaseDn(), generateSearchFilter(username),
controls);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUtils.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUtils.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUtils.java
index e1f999b..983a3d3 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUtils.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapUtils.java
@@ -21,42 +21,42 @@ import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
 public final class LdapUtils {
-	public static String escapeLDAPSearchFilter(final String filter) {
-		final StringBuilder sb = new StringBuilder();
-		for (final char character : filter.toCharArray()) {
-			switch (character) {
-			case '\\':
-				sb.append("\\5c");
-				break;
-			case '*':
-				sb.append("\\2a");
-				break;
-			case '(':
-				sb.append("\\28");
-				break;
-			case ')':
-				sb.append("\\29");
-				break;
-			case '\u0000':
-				sb.append("\\00");
-				break;
-			default:
-				sb.append(character);
-			}
-		}
-		return sb.toString();
-	}
+    public static String escapeLDAPSearchFilter(final String filter) {
+        final StringBuilder sb = new StringBuilder();
+        for (final char character : filter.toCharArray()) {
+            switch (character) {
+            case '\\':
+                sb.append("\\5c");
+                break;
+            case '*':
+                sb.append("\\2a");
+                break;
+            case '(':
+                sb.append("\\28");
+                break;
+            case ')':
+                sb.append("\\29");
+                break;
+            case '\u0000':
+                sb.append("\\00");
+                break;
+            default:
+                sb.append(character);
+            }
+        }
+        return sb.toString();
+    }
 
-	public static String getAttributeValue(final Attributes attributes,
-			final String attributeName) throws NamingException {
-		final Attribute attribute = attributes.get(attributeName);
-		if (attribute != null) {
-			final Object value = attribute.get();
-			return String.valueOf(value);
-		}
-		return null;
-	}
+    public static String getAttributeValue(final Attributes attributes,
+                                           final String attributeName) throws NamingException
{
+        final Attribute attribute = attributes.get(attributeName);
+        if (attribute != null) {
+            final Object value = attribute.get();
+            return String.valueOf(value);
+        }
+        return null;
+    }
 
-	private LdapUtils() {
-	}
+    private LdapUtils() {
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoLdapUserMatchingQueryException.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoLdapUserMatchingQueryException.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoLdapUserMatchingQueryException.java
index d7a3744..0f510c3 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoLdapUserMatchingQueryException.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoLdapUserMatchingQueryException.java
@@ -17,16 +17,16 @@
 package org.apache.cloudstack.ldap;
 
 public class NoLdapUserMatchingQueryException extends Exception {
-	private static final long serialVersionUID = 7124360347208388174L;
+    private static final long serialVersionUID = 7124360347208388174L;
 
-	private final String query;
+    private final String query;
 
-	public NoLdapUserMatchingQueryException(final String query) {
-		super("No users matching: " + query);
-		this.query = query;
-	}
+    public NoLdapUserMatchingQueryException(final String query) {
+        super("No users matching: " + query);
+        this.query = query;
+    }
 
-	public String getQuery() {
-		return query;
-	}
+    public String getQuery() {
+        return query;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoSuchLdapUserException.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoSuchLdapUserException.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoSuchLdapUserException.java
index 91279ae..d9bf13f 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoSuchLdapUserException.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/NoSuchLdapUserException.java
@@ -17,15 +17,15 @@
 package org.apache.cloudstack.ldap;
 
 public class NoSuchLdapUserException extends Exception {
-	private static final long serialVersionUID = 6782938919658010900L;
-	private final String username;
+    private static final long serialVersionUID = 6782938919658010900L;
+    private final String username;
 
-	public NoSuchLdapUserException(final String username) {
-		super("No such user: " + username);
-		this.username = username;
-	}
+    public NoSuchLdapUserException(final String username) {
+        super("No such user: " + username);
+        this.username = username;
+    }
 
-	public String getUsername() {
-		return username;
-	}
+    public String getUsername() {
+        return username;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDao.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDao.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDao.java
index f74bb9c..6774ab2 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDao.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDao.java
@@ -24,9 +24,9 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.db.GenericDao;
 
 public interface LdapConfigurationDao extends
-		GenericDao<LdapConfigurationVO, Long> {
-	LdapConfigurationVO findByHostname(String hostname);
+    GenericDao<LdapConfigurationVO, Long> {
+    LdapConfigurationVO findByHostname(String hostname);
 
-	Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(
-			String hostname, int port);
+    Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(
+        String hostname, int port);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31758ed8/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDaoImpl.java
b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDaoImpl.java
index 862206d..4ed0a37 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDaoImpl.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/dao/LdapConfigurationDaoImpl.java
@@ -32,41 +32,41 @@ import com.cloud.utils.db.SearchCriteria.Op;
 @Component
 @Local(value = { LdapConfigurationDao.class })
 public class LdapConfigurationDaoImpl extends
-		GenericDaoBase<LdapConfigurationVO, Long> implements
-		LdapConfigurationDao {
-	private final SearchBuilder<LdapConfigurationVO> hostnameSearch;
-	private final SearchBuilder<LdapConfigurationVO> listAllConfigurationsSearch;
+    GenericDaoBase<LdapConfigurationVO, Long> implements
+    LdapConfigurationDao {
+    private final SearchBuilder<LdapConfigurationVO> hostnameSearch;
+    private final SearchBuilder<LdapConfigurationVO> listAllConfigurationsSearch;
 
-	public LdapConfigurationDaoImpl() {
-		super();
-		hostnameSearch = createSearchBuilder();
-		hostnameSearch.and("hostname", hostnameSearch.entity().getHostname(),
-				SearchCriteria.Op.EQ);
-		hostnameSearch.done();
+    public LdapConfigurationDaoImpl() {
+        super();
+        hostnameSearch = createSearchBuilder();
+        hostnameSearch.and("hostname", hostnameSearch.entity().getHostname(),
+                           SearchCriteria.Op.EQ);
+        hostnameSearch.done();
 
-		listAllConfigurationsSearch = createSearchBuilder();
-		listAllConfigurationsSearch.and("hostname", listAllConfigurationsSearch
-				.entity().getHostname(), Op.EQ);
-		listAllConfigurationsSearch.and("port", listAllConfigurationsSearch
-				.entity().getPort(), Op.EQ);
-		listAllConfigurationsSearch.done();
-	}
+        listAllConfigurationsSearch = createSearchBuilder();
+        listAllConfigurationsSearch.and("hostname", listAllConfigurationsSearch
+                                        .entity().getHostname(), Op.EQ);
+        listAllConfigurationsSearch.and("port", listAllConfigurationsSearch
+                                        .entity().getPort(), Op.EQ);
+        listAllConfigurationsSearch.done();
+    }
 
-	@Override
-	public LdapConfigurationVO findByHostname(final String hostname) {
-		final SearchCriteria<LdapConfigurationVO> sc = hostnameSearch.create();
-		sc.setParameters("hostname", hostname);
-		return findOneBy(sc);
-	}
+    @Override
+    public LdapConfigurationVO findByHostname(final String hostname) {
+        final SearchCriteria<LdapConfigurationVO> sc = hostnameSearch.create();
+        sc.setParameters("hostname", hostname);
+        return findOneBy(sc);
+    }
 
-	@Override
-	public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(
-			final String hostname, final int port) {
-		final SearchCriteria<LdapConfigurationVO> sc = listAllConfigurationsSearch
-				.create();
-		if (hostname != null) {
-			sc.setParameters("hostname", hostname);
-		}
-		return searchAndCount(sc, null);
-	}
+    @Override
+    public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(
+        final String hostname, final int port) {
+        final SearchCriteria<LdapConfigurationVO> sc = listAllConfigurationsSearch
+                .create();
+        if (hostname != null) {
+            sc.setParameters("hostname", hostname);
+        }
+        return searchAndCount(sc, null);
+    }
 }
\ No newline at end of file


Mime
View raw message