001    /**
002     * Copyright (c) 2000-2013 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.ArrayUtil;
018    import com.liferay.portal.kernel.util.StringPool;
019    
020    import javax.naming.ldap.Control;
021    
022    /**
023     * @author Scott Lee
024     */
025    public class LDAPAuthResult {
026    
027            public String getErrorMessage() {
028                    return _errorMessage;
029            }
030    
031            public String getResponseControl() {
032                    return _responseControl;
033            }
034    
035            public boolean isAuthenticated() {
036                    return _authenticated;
037            }
038    
039            public void setAuthenticated(boolean authenticated) {
040                    _authenticated = authenticated;
041            }
042    
043            public void setErrorMessage(String errorMessage) {
044                    _errorMessage = errorMessage;
045            }
046    
047            public void setResponseControl(Control[] response) {
048                    if (ArrayUtil.isNotEmpty(response)) {
049                            _responseControl = response[0].getID();
050                    }
051            }
052    
053            private boolean _authenticated;
054            private String _errorMessage;
055            private String _responseControl = StringPool.BLANK;
056    
057    }