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.ntlm;
016    
017    import com.liferay.portal.kernel.util.CharPool;
018    import com.liferay.portal.kernel.util.StringPool;
019    
020    /**
021     * @author Marcellus Tavares
022     */
023    public class NtlmServiceAccount {
024    
025            public NtlmServiceAccount(String account, String password) {
026                    setAccount(account);
027                    setPassword(password);
028            }
029    
030            public String getAccount() {
031                    return _account;
032            }
033    
034            public String getAccountName() {
035                    return _accountName;
036            }
037    
038            public String getComputerName() {
039                    return _computerName;
040            }
041    
042            public String getPassword() {
043                    return _password;
044            }
045    
046            public void setAccount(String account) {
047                    _account = account;
048    
049                    _accountName = _account.substring(0, _account.indexOf(CharPool.AT));
050                    _computerName = _account.substring(
051                            0, _account.indexOf(StringPool.DOLLAR));
052            }
053    
054            public void setPassword(String password) {
055                    _password = password;
056            }
057    
058            private String _account;
059            private String _accountName;
060            private String _computerName;
061            private String _password;
062    
063    }