PageRenderTime 102ms CodeModel.GetById 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/mpv5/db/objects/User.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 828 lines | 499 code | 91 blank | 238 comment | 53 complexity | 5d3207a4053cdccf54a0d89f8a4c088f MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. /*
  2. * This file is part of YaBS.
  3. *
  4. * YaBS is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * YaBS is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with YaBS. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. package mpv5.db.objects;
  18. import mpv5.usermanagement.*;
  19. import java.awt.Font;
  20. import java.io.File;
  21. import java.util.ArrayList;
  22. import java.util.Date;
  23. import java.util.HashMap;
  24. import java.util.Iterator;
  25. import java.util.List;
  26. import java.util.Locale;
  27. import java.util.Map.Entry;
  28. import java.util.Vector;
  29. import javax.swing.JComponent;
  30. import mpv5.Main;
  31. import mpv5.data.PropertyStore;
  32. import mpv5.db.common.Context;
  33. import mpv5.db.common.DatabaseObject;
  34. import mpv5.db.common.DatabaseObjectLock;
  35. import mpv5.db.common.NodataFoundException;
  36. import mpv5.db.common.QueryCriteria;
  37. import mpv5.db.common.QueryHandler;
  38. import mpv5.globals.LocalSettings;
  39. import mpv5.globals.Messages;
  40. import mpv5.handler.VariablesHandler;
  41. import mpv5.i18n.LanguageManager;
  42. import mpv5.logging.Log;
  43. import mpv5.mail.MailConfiguration;
  44. import mpv5.pluginhandling.YabsPluginLoader;
  45. import mpv5.ui.dialogs.Popup;
  46. import mpv5.ui.dialogs.subcomponents.ControlPanel_Fonts;
  47. import dtaus.Konto;
  48. import javax.swing.UIManager;
  49. import mpv5.YabsViewProxy;
  50. import mpv5.db.common.QueryCriteria2;
  51. import mpv5.db.common.QueryParameter;
  52. import mpv5.pluginhandling.YabsPlugin;
  53. import mpv5.ui.dialogs.DialogForFile;
  54. import mpv5.utils.text.TypeConversion;
  55. /**
  56. *
  57. *
  58. */
  59. public class User extends DatabaseObject {
  60. private static User currentUser;
  61. private static final long serialVersionUID = 1L;
  62. public static User getCurrentUser() {
  63. if (currentUser == null) {
  64. Log.Debug(User.class, "There is no user logged in here, using default user.");
  65. try {
  66. currentUser = User.DEFAULT;
  67. return currentUser;
  68. } catch (Exception ex) {
  69. Log.Debug(User.class, "Default user is missing.");
  70. return new User();
  71. }
  72. } else {
  73. return currentUser;
  74. }
  75. }
  76. /**
  77. * Set the current logged in user
  78. * @param usern
  79. */
  80. public static void _setUser(User usern) {
  81. currentUser = usern;
  82. // predefTitle = (" (" + usern.getName() + ")");
  83. }
  84. /**
  85. *
  86. * @param ford
  87. * @return The Users default save directory, if defined in the user properties. User.home instead.
  88. */
  89. public static File getSaveDir(DatabaseObject ford) {
  90. String s = mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("saveformat");
  91. String s2 = LocalSettings.getProperty(LocalSettings.BASE_DIR);
  92. File basedir = null;
  93. if (s2 != null && !s2.equals("null")) {
  94. basedir = new File(s2);
  95. } else {
  96. basedir = DialogForFile.CURRENT_DIR;
  97. }
  98. File subdirs = null;
  99. if (s != null) {
  100. if (s.contains("/")) {
  101. subdirs = new File(s.substring(0, s.lastIndexOf("/")));
  102. }
  103. }
  104. File savedir = basedir;
  105. if (subdirs != null) {
  106. savedir = new File(VariablesHandler.parse(basedir.getPath() + File.separator + subdirs.getPath(), ford));
  107. }
  108. savedir.mkdirs();
  109. return savedir;
  110. }
  111. private String password = "";
  112. private String fullname = "";
  113. private String laf = "";
  114. private String locale = "en_UK";
  115. private String defcountry = "";
  116. private String mail = "";
  117. private String language = "buildin_en";
  118. private int inthighestright = 4;
  119. private int intdefaultaccount = 1;
  120. private int intdefaultstatus = 1;
  121. private int compsids = 0;
  122. private boolean isenabled = true;
  123. private boolean isloggedin = true;
  124. private boolean isrgrouped = false;
  125. public static int ADMIN_ID = 1;
  126. private Date datelastlog = new Date();
  127. public static User DEFAULT = new User("Default User", "nobody", MPSecurityManager.RIGHT_TO_VIEW, 4343);
  128. public static HashMap<String, String> userCache = new HashMap<String, String>();
  129. public static HashMap<String, String> userCache2 = new HashMap<String, String>();
  130. private PropertyStore properties = new PropertyStore();
  131. /**
  132. * Properties added to this store will override the users properties stored in the database upon login
  133. */
  134. public static PropertyStore PROPERTIES_OVERRIDE = new PropertyStore();
  135. private MailConfiguration mailConfiguration;
  136. private DTAConfig dtaconf;
  137. /**
  138. * Caches all available usernames and IDs, no logins performed
  139. */
  140. public static void cacheUser() {
  141. userCache.clear();
  142. userCache.put(Integer.toBinaryString(DEFAULT.__getIDS()), DEFAULT.__getCname());
  143. userCache2.clear();
  144. userCache2.put(Integer.toBinaryString(DEFAULT.__getIDS()), DEFAULT.fullname);
  145. try {
  146. ArrayList<DatabaseObject> data = DatabaseObject.getObjects(Context.getUser());
  147. for (int i = 0; i < data.size(); i++) {
  148. DatabaseObject databaseObject = data.get(i);
  149. userCache.put(Integer.toBinaryString(databaseObject.__getIDS()), databaseObject.__getCname());
  150. userCache2.put(Integer.toBinaryString(databaseObject.__getIDS()), ((User) databaseObject).__getFullname());
  151. }
  152. } catch (NodataFoundException ex) {
  153. Log.Debug(User.class, ex.getMessage());
  154. }
  155. }
  156. /**
  157. * Tries to find the given ID in the DB
  158. * @param forId
  159. * @return A username if existing, else "unknown"
  160. */
  161. public static String getUsername(int forId) {
  162. if (userCache.containsKey(Integer.toBinaryString(forId))) {
  163. return userCache.get(Integer.toBinaryString(forId));
  164. } else {
  165. Log.Debug(User.class, "User not found in cache: " + Integer.toBinaryString(forId));
  166. return "unknown";
  167. }
  168. }
  169. /**
  170. * Tries to find the given ID in the DB
  171. * @param forId
  172. * @return A Fullname if existing, else "unknown"
  173. */
  174. public static String getFullName(int forId) {
  175. if (userCache2.containsKey(Integer.toBinaryString(forId))) {
  176. return userCache2.get(Integer.toBinaryString(forId));
  177. } else {
  178. Log.Debug(User.class, "User not found in cache: " + Integer.toBinaryString(forId));
  179. return "unknown";
  180. }
  181. }
  182. /**
  183. * Tries to find an User with the given name
  184. * @param username
  185. * @return
  186. */
  187. public static int getUserId(String username) {
  188. if (userCache.containsValue(username)) {
  189. Iterator<Entry<String, String>> data = userCache.entrySet().iterator();
  190. while (data.hasNext()) {
  191. Entry<String, String> entry = data.next();
  192. if (entry.getValue().equals(username)) {
  193. Log.Debug(User.class, "Cached user id found: " + Integer.parseInt(entry.getKey(), 2));
  194. return Integer.parseInt(entry.getKey(), 2);
  195. }
  196. }
  197. } else {
  198. cacheUser();
  199. if (userCache.containsValue(username)) {
  200. Iterator<Entry<String, String>> data = userCache.entrySet().iterator();
  201. while (data.hasNext()) {
  202. Entry<String, String> entry = data.next();
  203. if (entry.getValue().equals(username)) {
  204. Log.Debug(User.class, "Cached user id found: " + Integer.parseInt(entry.getKey(), 2));
  205. return Integer.parseInt(entry.getKey(), 2);
  206. }
  207. }
  208. }
  209. }
  210. return DEFAULT.ids;
  211. }
  212. /**
  213. * Tries to find the given ID in the DB
  214. * @param userid
  215. * @throws mpv5.db.common.NodataFoundException
  216. */
  217. public User(int userid) throws NodataFoundException {
  218. this();
  219. this.fetchDataOf(userid);
  220. setProperties();
  221. }
  222. public User() {
  223. setContext(Context.getUser());
  224. }
  225. private User(String fullname, String userid, int highright, int IDS) {
  226. this();
  227. this.fullname = fullname;
  228. setCname(userid);
  229. this.inthighestright = highright;
  230. this.setIDS(IDS);
  231. }
  232. public Integer getID() {
  233. return __getIDS();
  234. }
  235. public String getName() {
  236. return getCname();
  237. }
  238. /**
  239. * Return this users plugins
  240. * @return
  241. */
  242. public YabsPlugin[] getPlugins() {
  243. return YabsPluginLoader.getPlugins();
  244. }
  245. /**
  246. *
  247. * @return True if this user IS User.DEFAULT
  248. */
  249. public boolean isDefault() {
  250. if (getName().equals(DEFAULT.__getCname()) && __getIDS().intValue() == DEFAULT.__getIDS().intValue()) {
  251. return true;
  252. } else {
  253. return false;
  254. }
  255. }
  256. private boolean isAdmin() {
  257. if (__getIDS().intValue() == 1) {
  258. return true;
  259. } else {
  260. return false;
  261. }
  262. }
  263. /**
  264. * Logs in this user into yabs (sets user defined properties etc); does not check the authentication. Use
  265. * {@link mpv5.usermanagement.MPSecurityManager#checkAuth(java.lang.String, java.lang.String) }
  266. * before logging in the User.
  267. */
  268. public void login() {
  269. Log.Debug(this, "releaseAllObjectsFor: " + this);
  270. DatabaseObjectLock.releaseAllObjectsFor(this);
  271. if (isenabled) {
  272. _setUser(this);
  273. setProperties();
  274. try {
  275. Locale.setDefault(TypeConversion.stringToLocale(__getLocale()));
  276. Log.Debug(this, "Locale.setDefault() for: " + Locale.getDefault());
  277. ControlPanel_Fonts.applyFont(Font.decode(LocalSettings.getProperty(LocalSettings.DEFAULT_FONT)));
  278. if (UIManager.getLookAndFeel().getName() == null ? __getLaf() != null : !UIManager.getLookAndFeel().getName().equals(__getLaf())) {
  279. Main.setLaF(__getLaf());
  280. }
  281. defineMailConfig();
  282. defineDTAConfig();
  283. Log.Debug(this, "LanguageManager.getBundle() for: " + this);
  284. LanguageManager.getBundle();
  285. } catch (Exception e) {
  286. Log.Debug(e);
  287. }
  288. final User t = this;
  289. Runnable runnable = new Runnable() {
  290. @Override
  291. public void run() {
  292. // setTitle();
  293. setDatelastlog(new Date());
  294. setIsloggedin(true);
  295. save();
  296. DatabaseObject.cacheObjects();//re-cache for user
  297. YabsViewProxy.instance().addMessage(Messages.CACHED_OBJECTS);
  298. try {
  299. layoutinfo.putAll(ValueProperty.getProperty(t, "layoutinfo").getValue(new HashMap<String, String>()));
  300. } catch (Exception ex) {
  301. Log.Debug(this, ex.getMessage());
  302. }
  303. }
  304. };
  305. new Thread(runnable).start();
  306. } else {
  307. Popup.warn(Messages.NOT_POSSIBLE.toString() + Messages.USER_DISABLED);
  308. }
  309. }
  310. /**
  311. * Logs out this user
  312. */
  313. public void logout() {
  314. DatabaseObjectLock.releaseAllObjectsFor(this);
  315. saveProperties();
  316. _setUser(DEFAULT);
  317. if (!isDefault()) {
  318. setIsloggedin(false);
  319. save();
  320. }
  321. }
  322. @Override
  323. public boolean save() {
  324. if (!isDefault()) {
  325. return super.save();
  326. } else {
  327. Popup.notice(Messages.DEFAULT_USER);
  328. return false;
  329. }
  330. }
  331. @Override
  332. public boolean delete() {
  333. if (!isAdmin()) {
  334. return super.delete();
  335. } else {
  336. Popup.notice(Messages.ADMIN_USER);
  337. return false;
  338. }
  339. }
  340. /**
  341. * @return the password
  342. */
  343. public String __getPassword() {
  344. return password;
  345. }
  346. /**
  347. * @param password the password to set
  348. */
  349. public void setPassword(String password) {
  350. this.password = password;
  351. }
  352. /**
  353. * @return the laf
  354. */
  355. public String __getLaf() {
  356. return laf;
  357. }
  358. /**
  359. * @param laf the laf to set
  360. */
  361. public void setLaf(String laf) {
  362. this.laf = laf;
  363. }
  364. /**
  365. * @return the locale
  366. */
  367. public String __getLocale() {
  368. return locale;
  369. }
  370. /**
  371. * @param locale the locale to set
  372. */
  373. public void setLocale(String locale) {
  374. this.locale = locale;
  375. }
  376. /**
  377. * @return the mail
  378. */
  379. public String __getMail() {
  380. return mail;
  381. }
  382. /**
  383. * @param mail the mail to set
  384. */
  385. public void setMail(String mail) {
  386. this.mail = mail;
  387. }
  388. /**
  389. * @return the language
  390. */
  391. public String __getLanguage() {
  392. return language;
  393. }
  394. /**
  395. * @param language the language to set
  396. */
  397. public void setLanguage(String language) {
  398. this.language = language;
  399. }
  400. /**
  401. * @return the isenabled
  402. */
  403. public boolean __getIsenabled() {
  404. return isenabled;
  405. }
  406. /**
  407. * @param isenabled the isenabled to set
  408. */
  409. public void setIsenabled(boolean isenabled) {
  410. this.isenabled = isenabled;
  411. }
  412. @Override
  413. public String toString() {
  414. return getCname();
  415. }
  416. /**
  417. * @return the lastlogdate
  418. */
  419. public Date __getDatelastlog() {
  420. return datelastlog;
  421. }
  422. /**
  423. * @param lastlogdate the lastlogdate to set
  424. */
  425. public void setDatelastlog(Date lastlogdate) {
  426. this.datelastlog = lastlogdate;
  427. }
  428. /**
  429. * @return the isloggedin
  430. */
  431. public boolean __getIsloggedin() {
  432. return isloggedin;
  433. }
  434. /**
  435. * @param isloggedin the isloggedin to set
  436. */
  437. public void setIsloggedin(boolean isloggedin) {
  438. this.isloggedin = isloggedin;
  439. }
  440. /**
  441. * @return the fullname
  442. */
  443. public String __getFullname() {
  444. return fullname;
  445. }
  446. /**
  447. * @param fullname the fullname to set
  448. */
  449. public void setFullname(String fullname) {
  450. this.fullname = fullname;
  451. }
  452. /**
  453. * @return the defcountry
  454. */
  455. public String __getDefcountry() {
  456. return defcountry;
  457. }
  458. /**
  459. * @param defcountry the defcountry to set
  460. */
  461. public void setDefcountry(String defcountry) {
  462. this.defcountry = defcountry;
  463. }
  464. /**
  465. * If the usernames & ids match, return true
  466. * @param n
  467. * @return
  468. */
  469. public boolean equalTo(User n) {
  470. if ((n).__getCname().equals(this.__getCname()) && (n).__getIDS().intValue() == this.__getIDS().intValue()) {
  471. return true;
  472. } else {
  473. return false;
  474. }
  475. }
  476. @Override
  477. public JComponent getView() {
  478. return new mpv5.ui.dialogs.subcomponents.ControlPanel_Users(this);
  479. }
  480. /**
  481. * Set a property for this user
  482. * @param key
  483. * @param value
  484. */
  485. public void changeProperty(String key, String value) {
  486. properties.changeProperty(key, value);
  487. }
  488. /**
  489. * Retrieve all properties from this user
  490. * @return
  491. */
  492. public PropertyStore getProperties() {
  493. return properties;
  494. }
  495. /**
  496. * Saves the user properties
  497. */
  498. public void saveProperties() {
  499. synchronized (properties) {
  500. List<String[]> l = properties.getList();
  501. for (int i = 0; i < l.size(); i++) {
  502. String[] d = l.get(i);
  503. UserProperty p = new UserProperty();
  504. p.setValue(d[1]);
  505. p.setCname(d[0]);
  506. p.setUsersids(getID());
  507. p.setGroupsids(__getGroupsids());
  508. p.save();
  509. }
  510. }
  511. }
  512. /**
  513. * Delete the users properties
  514. */
  515. public void deleteProperties() {
  516. QueryCriteria c = new QueryCriteria("usersids", __getIDS());
  517. QueryHandler.instanceOf().clone(Context.getUserProperties()).delete(c);
  518. }
  519. /**
  520. * Apply the user settings to this user (usually called during the login process)
  521. */
  522. public void setProperties() {
  523. QueryCriteria2 criteria = new QueryCriteria2();
  524. criteria.and(new QueryParameter(Context.getUserProperties(), "usersids", ids, QueryParameter.EQUALS),
  525. new QueryParameter(Context.getUserProperties(), "groupsids", __getGroupsids(), QueryParameter.EQUALS));
  526. properties = new PropertyStore();
  527. try {
  528. properties.addAll(QueryHandler.instanceOf().clone(Context.getUserProperties()).select("cname, value", criteria).getData());
  529. properties.addAll(PROPERTIES_OVERRIDE);
  530. properties.setChanged(false);
  531. } catch (NodataFoundException ex) {
  532. Log.Debug(this, ex.getMessage());
  533. }
  534. }
  535. @Override
  536. public HashMap<String, Object> resolveReferences(HashMap<String, Object> map) {
  537. super.resolveReferences(map);
  538. List<Company> data;
  539. try {
  540. data = DatabaseObject.getReferencedObjects(this, Context.getCompany(), new Company());
  541. //Presumably 0 or 1
  542. for (int i = 0; i < data.size(); i++) {
  543. map.put("company", data.get(i));
  544. }
  545. } catch (Exception ex) {
  546. Log.Debug(this, ex.getMessage());
  547. }
  548. //TODO check for usage
  549. return map;
  550. }
  551. /**
  552. * @return the isrgrouped
  553. */
  554. public boolean __getIsrgrouped() {
  555. return isrgrouped;
  556. }
  557. /**
  558. * @param isrgrouped the isrgrouped to set
  559. */
  560. public void setIsrgrouped(boolean isrgrouped) {
  561. this.isrgrouped = isrgrouped;
  562. }
  563. /**
  564. * @return the inthighestright
  565. */
  566. public int __getInthighestright() {
  567. return inthighestright;
  568. }
  569. /**
  570. * @param inthighestright the inthighestright to set
  571. */
  572. public void setInthighestright(int inthighestright) {
  573. this.inthighestright = inthighestright;
  574. }
  575. /**
  576. * @return the intdefaultaccount
  577. */
  578. public int __getIntdefaultaccount() {
  579. return intdefaultaccount;
  580. }
  581. /**
  582. * @param intdefaultaccount the intdefaultaccount to set
  583. */
  584. public void setIntdefaultaccount(int intdefaultaccount) {
  585. this.intdefaultaccount = intdefaultaccount;
  586. }
  587. @Override
  588. public mpv5.utils.images.MPIcon getIcon() {
  589. return null;
  590. }
  591. /**
  592. * If this returns true, the User is only allowed to see, and use, data which belongs to the same Group as him
  593. * <br/><b> and data from the Group with the ID 1.</b><br/><br/>
  594. * Use this method to implement multi-client capability.
  595. * @return
  596. */
  597. public boolean isGroupRestricted() {
  598. return __getIsrgrouped();
  599. }
  600. /**
  601. * @return the intdefaultstatus
  602. */
  603. public int __getIntdefaultstatus() {
  604. return intdefaultstatus;
  605. }
  606. /**
  607. * @param intdefaultstatus the intdefaultstatus to set
  608. */
  609. public void setIntdefaultstatus(int intdefaultstatus) {
  610. this.intdefaultstatus = intdefaultstatus;
  611. }
  612. /**
  613. * @return the compsids
  614. */
  615. public int __getCompsids() {
  616. return compsids;
  617. }
  618. /**
  619. * @param compsids the compsids to set
  620. */
  621. public void setCompsids(int compsids) {
  622. this.compsids = compsids;
  623. }
  624. /**
  625. * Define the mail config
  626. */
  627. public void defineMailConfig() {
  628. if (getProperties().hasProperty("smtp.host")) {
  629. defineMailConfiguration(new MailConfiguration());
  630. mailConfiguration.setSmtpHost(getProperties().getProperty("smtp.host"));
  631. mailConfiguration.setSenderAddress(mail);
  632. mailConfiguration.setUsername(getProperties().getProperty("smtp.host.user"));
  633. mailConfiguration.setPassword(getProperties().getProperty("smtp.host.password"));
  634. mailConfiguration.setUseTls(Boolean.valueOf(getProperties().getProperty("smtp.host.usetls")));
  635. mailConfiguration.setUseSmtps(Boolean.valueOf(getProperties().getProperty("smtp.host.usesmpts")));
  636. } else {
  637. Log.Debug(this, "Mail configuration not set.");
  638. }
  639. }
  640. /**
  641. * @return the mailConfiguration
  642. */
  643. public MailConfiguration getMailConfiguration() {
  644. if (mailConfiguration.getSmtpHost() == null || mailConfiguration.getSmtpHost().length() == 0) {
  645. mpv5.YabsViewProxy.instance().addMessage(Messages.NO_MAIL_CONFIG);
  646. Log.Debug(this, "SMTP host configuration not set: " + mailConfiguration.getSmtpHost());
  647. }
  648. return mailConfiguration;
  649. }
  650. /**
  651. * @param mailConfiguration the mailConfiguration to set
  652. */
  653. public void defineMailConfiguration(MailConfiguration mailConfiguration) {
  654. this.mailConfiguration = mailConfiguration;
  655. }
  656. /**
  657. * The configured banking account
  658. * @return
  659. */
  660. public Konto getDTAAccount() {
  661. return dtaconf.getBankAccount();
  662. }
  663. /**
  664. * The configured banking account
  665. * @return
  666. */
  667. public List<String> getDTAUsages() {
  668. return dtaconf.getUsages();
  669. }
  670. public void defineDTAConfig() {
  671. try {
  672. Konto acc = new Konto(getProperties().getProperty("dtabankid"),
  673. getProperties().getProperty("dtabankaccount"),
  674. getProperties().getProperty("dtabankname"));
  675. acc.name = __getFullname();
  676. dtaconf = new DTAConfig();
  677. dtaconf.setBankAccount(acc);
  678. dtaconf.getUsages().add(getProperties().getProperty("dtausage0"));
  679. } catch (Exception e) {
  680. Log.Debug(this, "Unable to create DTA info");
  681. dtaconf = null;
  682. }
  683. }
  684. private HashMap<String, String> layoutinfo = new HashMap<String, String>();
  685. /**
  686. *
  687. * @return
  688. */
  689. public HashMap<String, String> getLayoutProperties() {
  690. return layoutinfo;
  691. }
  692. /**
  693. * Delegates to getproperties().getproperty
  694. * @param typ
  695. * @param name
  696. * @return
  697. */
  698. public boolean getProperty(String typ, String name) {
  699. return getProperties().getProperty(typ, name);
  700. }
  701. /** Delegates to getproperties().getproperty
  702. * @param name
  703. * @return
  704. */
  705. public String getProperty(String name) {
  706. return getProperties().getProperty(name);
  707. }
  708. /** Delegates to getproperties().setproperty
  709. * @param name
  710. * @return
  711. */
  712. public void setProperty(String key, String value) {
  713. getProperties().changeProperty(key, value);
  714. }
  715. }
  716. class DTAConfig {
  717. private Konto bankAccount;
  718. private List<String> usages = new Vector<String>();
  719. /**
  720. * @return the bankAccount
  721. */
  722. public Konto getBankAccount() {
  723. return bankAccount;
  724. }
  725. /**
  726. * @param bankAccount the bankAccount to set
  727. */
  728. public void setBankAccount(Konto bankAccount) {
  729. this.bankAccount = bankAccount;
  730. }
  731. /**
  732. * @return the usages
  733. */
  734. public List<String> getUsages() {
  735. return usages;
  736. }
  737. }