001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }