From 54bc92d46597cd678e9512cbc56fc1d5cd020bc7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 5 Aug 2016 12:54:46 +0200 Subject: [PATCH] Continued with splitting remote interface: - splitted user remote interface into general (old) and administrative user interface. This allows more distribution and not centralization of all business methods on one (then later even monolithic) EJB - requires juser-lib.jar to be updated --- .../user/AdminUserSessionBeanRemote.java | 60 +++++++++++++++++++ .../model/user/UserSessionBeanRemote.java | 34 ----------- 2 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java diff --git a/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java new file mode 100644 index 0000000..1b2a926 --- /dev/null +++ b/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jusercore.model.user; + +import java.io.Serializable; +import javax.ejb.Remote; +import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; +import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; + +/** + * An interface for administrative user beans + *

+ * @author Roland Haeder + */ +@Remote +public interface AdminUserSessionBeanRemote extends Serializable { + + /** + * Creates the user instance and links it with the set contact instance + *

+ * @param user User instance to + *

+ * @return Updated user instance + *

+ * @throws UserNameAlreadyRegisteredException When the user name is already + * used + * @throws EmailAddressAlreadyRegisteredException When the email address is + * already used + */ + User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException; + + /** + * Adds given user to database, if not found by user name or email address. + *

+ * @param user User instance to add + *

+ * @return Updated user instance + *

+ * @throws UserNameAlreadyRegisteredException When the user name is already + * used + * @throws EmailAddressAlreadyRegisteredException When the email address is + * already used + */ + User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException; + +} diff --git a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java index 42a4267..8509e4a 100644 --- a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java +++ b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java @@ -19,8 +19,6 @@ package org.mxchange.jusercore.model.user; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; -import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; @@ -70,22 +68,6 @@ public interface UserSessionBeanRemote extends Serializable { */ String generateRandomUserName (); - /** - * Creates the user instance and links it with the set contact instance - *

- * @param user User instance to - *

- * @return Updated user instance - *

- * @throws - * org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException When - * the user name is already used - * @throws - * org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException - * When the email address is already used - */ - User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException; - /** * Updates entiity from given user instance and returns updated instance. *

@@ -108,22 +90,6 @@ public interface UserSessionBeanRemote extends Serializable { */ User findUserById (final Long userId) throws UserNotFoundException; - /** - * Adds given user to database, if not found by user name or email address. - *

- * @param user User instance to add - *

- * @return Updated user instance - *

- * @throws - * org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException When - * the user name is already used - * @throws - * org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException - * When the email address is already used - */ - User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException; - /** * Returns a list of all users. This is mostly suitable for administrative * interfaces. -- 2.39.5