001    /**
002     * Copyright (c) 2000-2010 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.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    }