001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.security.auth;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    
019    import javax.naming.ldap.Control;
020    
021    /**
022     * @author Scott Lee
023     */
024    public class LDAPAuthResult {
025    
026            public boolean isAuthenticated() {
027                    return _authenticated;
028            }
029    
030            public void setAuthenticated(boolean authenticated) {
031                    _authenticated = authenticated;
032            }
033    
034            public String getErrorMessage() {
035                    return _errorMessage;
036            }
037    
038            public void setErrorMessage(String errorMessage) {
039                    _errorMessage = errorMessage;
040            }
041    
042            public String getResponseControl() {
043                    return _responseControl;
044            }
045    
046            public void setResponseControl(Control[] response) {
047                    if ((response != null) && (response.length > 0)) {
048                            _responseControl = response[0].getID();
049                    }
050            }
051    
052            private boolean _authenticated;
053            private String _errorMessage;
054            private String _responseControl = StringPool.BLANK;
055    
056    }