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.StringBundler;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * @author Tomas Polesovsky
024     */
025    public class AuthVerifierResult {
026    
027            public String getPassword() {
028                    return _password;
029            }
030    
031            public Map<String, Object> getSettings() {
032                    return _settings;
033            }
034    
035            public State getState() {
036                    return _state;
037            }
038    
039            public long getUserId() {
040                    return _userId;
041            }
042    
043            public void setPassword(String password) {
044                    _password = password;
045            }
046    
047            public void setSettings(Map<String, Object> settings) {
048                    _settings = settings;
049            }
050    
051            public void setState(State state) {
052                    _state = state;
053            }
054    
055            public void setUserId(long userId) {
056                    _userId = userId;
057            }
058    
059            @Override
060            public String toString() {
061                    StringBundler sb = new StringBundler(7);
062    
063                    sb.append("{settings=");
064                    sb.append(_settings);
065                    sb.append(", state=");
066                    sb.append(_state);
067                    sb.append(", userId=");
068                    sb.append(_userId);
069                    sb.append("}");
070    
071                    return sb.toString();
072            }
073    
074            public enum State {
075    
076                    NOT_APPLICABLE, INVALID_CREDENTIALS, SUCCESS
077    
078            }
079    
080            private String _password;
081            private Map<String, Object> _settings = new HashMap<String, Object>();
082            private State _state = State.NOT_APPLICABLE;
083            private long _userId;
084    
085    }