From 6296360079bbac46267fa43ed3f815fbd9356e5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 16 Aug 2017 23:46:31 +0200 Subject: [PATCH] updated jar(s) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- lib/juser-core.jar | Bin 66710 -> 66710 bytes .../JobsUserActivityWebApplicationBean.java | 190 ++++++++++-------- ...sUserActivityWebApplicationController.java | 47 ----- 3 files changed, 109 insertions(+), 128 deletions(-) diff --git a/lib/juser-core.jar b/lib/juser-core.jar index 47124fbd731e4d580c450ed628e41034bfbce6da..a215338d6eb209b93504d153752fbbac917e5236 100644 GIT binary patch delta 1241 zcmZ9LZ%9*N6vp@7d%OP6DLSf^B8F`e_$Q<3(o9NI(b7!IEy1vqmX?*7X3B^{32pk4 zi-^h(S(0UFAcc`&DIrpQ2*mmj_$A$R)2W*}UAyNDOF#Xd^PKaZ`|R$%tqojj1Lt!r zo#i}5B6pEU`OL4`N5;lEp=f1=>U%K2A`?J^NHp*`i3Q#x3BYe83E0NVsMyV$>KL9L zWjw)CGa0~67wt?k)QxNmbxeDB{r7Cz$R2j}_R=>d_jSD;T*}(HrbM^(sc9D%4_y69l5NJqdq&U+3g@a5}!+#^X^Vy}sZWel_7t&G;)gPIns=!na9_4F`k? z+F^(Q{&f06EivL}s4}KP{oIIuq0N{Lb;eW7m-A8eM=(doD~ z9clWf>s|V@DbLkE0UUPjX))vV7&0FL&wmE@X=YBlX7DOVXA7XNnau}gOiAh7EMBQd ziw3;MmI|O`t_s*PcMG^>9(~<>9n}5{7l7J@Yrv(2OTbcVHE_~;5vaCR!6$U`PMwaL ztP*Om<$$5eyKAI{HVHkuh^Yn_ufU1@OE-aiOILw=mTQ4;m$g8Jy%N}MF9U|IVA3Zm zI4@bnq)n?O&|h4|BpL@M9&?ln{{2jH88|>-k3NPFSfGDNh+63AJsAQoTVKSuoB@VF UNPR3zAcek%CGg_(Asngr3*Z*9G5`Po delta 1241 zcmZ9LZAepL6vy}6dzLxapI*ndF|2>;Fv4`EgJ@k#qb4_nMm$G`UIniTnYTC`kL)XN~ zfeuDWH6?-Trc~fc*16rBls*ghS?99COxTnoOarzH5AoFf5q4|<(c)W0K=^EIWX5FAD5d*bQZoc=I1{wqz4h@$;6A>A1sNJTP# zIv!oF`xIv8V8UzpM;3KP@)J9BBAFC7DI)qXkv&q4PF?gUI;ZwFp))BTLuW9d1)coF zM<{FuC$Tk=l833|(+W9=)}ATD)FW9-=nUt^fapIGtZ^Kv-U4o(Ltisj4|Tx&1)zHV8qhv}30P*U0Z!R20#ysu@Clu~Q?H>W zo0wV`a==jL-8Im{1u;Flh^Yn_ufU1@_M5;y`&HoXr8?l-B{fj)r~>vl%7J0anDpr~ z&Wl$tY4b`6^cPn!NvRVPk2x!N|3N0X3>+Y^M;l8BEYQ9rM8$Ws-VA}4tu12Q&HzIo Uq&AKvkV30t3A{LMC`T&)0y^OHpa1{> diff --git a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java index b4b5bec4..50efcbe3 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java @@ -94,88 +94,10 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple */ @SuppressWarnings ("CollectionWithoutInitialCapacity") public JobsUserActivityWebApplicationBean () { - // Try to get EJB instance - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup - this.userActivityBean = (UserActivityLogSessionBeanRemote) context.lookup("java:global/jjobs-ejb/userActivity!org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw again - throw new FaceletException(e); - } - // Init cache this.usersActivity = new LinkedHashMap<>(); } - @Override - public void addUserActivity (final User user, final String activityType) { - // Better re-validate - if (null == user) { - // Throw NPE - throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() == null) { - // Throw again - throw new NullPointerException("user.userId is null"); //NOI18N - } else if (user.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N - } else if (null == activityType) { - // Throw NPE again - throw new NullPointerException("activityType is null"); //NOI18N - } else if (activityType.isEmpty()) { - // Is empty - throw new IllegalArgumentException("activityType is empty"); //NOI18N - } - - // Create new activity object - LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName()); - - // Call bean to add it - this.userActivityBean.addUserActivityLog(userActivity); - - // Add to cache, too - this.addUserActivityToCache(userActivity); - } - - @Override - public void addUserActivity (final User user, final String activityType, final String message) { - // Better re-validate - if (null == user) { - // Throw NPE - throw new NullPointerException("user is null"); //NOI18N - } else if (user.getUserId() == null) { - // Throw again - throw new NullPointerException("user.userId is null"); //NOI18N - } else if (user.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N - } else if (null == activityType) { - // Throw NPE again - throw new NullPointerException("activityType is null"); //NOI18N - } else if (activityType.isEmpty()) { - // Is empty - throw new IllegalArgumentException("activityType is empty"); //NOI18N - } else if (null == message) { - // Throw NPE again - throw new NullPointerException("message is null"); //NOI18N - } else if (message.isEmpty()) { - // Is empty - throw new IllegalArgumentException("message is empty"); //NOI18N - } - - // Create new activity object - LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName()); - - // Call bean to add it - this.userActivityBean.addUserActivityLog(userActivity); - - // Add to cache, too - this.addUserActivityToCache(userActivity); - } - /** * Event observer for newly added users by administrator *

@@ -529,7 +451,14 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple this.addUserActivity(event.getUpdatedUser(), "USER_UPDATED_PERSONAL_DATA"); //NOI18N } - @Override + + /** + * Expands given activity type into a i18n string for administrators + *

+ * @param activityType Activity type + *

+ * @return Expanded i18n string + */ public String expandAdminActivityType (final String activityType) { // Is it valid? if (null == activityType) { @@ -544,7 +473,13 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple return "ADMIN_ACTIVITY_" + activityType; //NOI18N } - @Override + /** + * Expands given activity type into a i18n string for users + *

+ * @param activityType Activity type + *

+ * @return Expanded i18n string + */ public String expandUserActivityType (final String activityType) { // Is it valid? if (null == activityType) { @@ -559,7 +494,11 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple return "USER_ACTIVITY_" + activityType; //NOI18N } - @Override + /** + * Returns a list of in beanHelper set user instance's activity log + *

+ * @return List of user's activity log + */ public List fetchCurrentUsersActivityLog () { // beanHelper.user should be set and valid if (this.getUser() == null) { @@ -613,6 +552,18 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple */ @PostConstruct public void init () { + // Try to get EJB instance + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.userActivityBean = (UserActivityLogSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/userActivity!org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + // Get whole list List list = this.userActivityBean.fetchAllUserActivityLog(); @@ -632,6 +583,83 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple } } + /** + * Adds user activity entry with given type + *

+ * @param user User instance + * @param activityType Activity type + */ + private void addUserActivity (final User user, final String activityType) { + // Better re-validate + if (null == user) { + // Throw NPE + throw new NullPointerException("user is null"); //NOI18N + } else if (user.getUserId() == null) { + // Throw again + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N + } else if (null == activityType) { + // Throw NPE again + throw new NullPointerException("activityType is null"); //NOI18N + } else if (activityType.isEmpty()) { + // Is empty + throw new IllegalArgumentException("activityType is empty"); //NOI18N + } + + // Create new activity object + LogableUserActivity userActivity = new UserActivityLog(activityType, user, new GregorianCalendar(), this.determinePrincipalName()); + + // Call bean to add it + this.userActivityBean.addUserActivityLog(userActivity); + + // Add to cache, too + this.addUserActivityToCache(userActivity); + } + + /** + * Adds user activity log with type and message + *

+ * @param user User instance + * @param activityType Activity type + * @param message Activity message + */ + private void addUserActivity (final User user, final String activityType, final String message) { + // Better re-validate + if (null == user) { + // Throw NPE + throw new NullPointerException("user is null"); //NOI18N + } else if (user.getUserId() == null) { + // Throw again + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N + } else if (null == activityType) { + // Throw NPE again + throw new NullPointerException("activityType is null"); //NOI18N + } else if (activityType.isEmpty()) { + // Is empty + throw new IllegalArgumentException("activityType is empty"); //NOI18N + } else if (null == message) { + // Throw NPE again + throw new NullPointerException("message is null"); //NOI18N + } else if (message.isEmpty()) { + // Is empty + throw new IllegalArgumentException("message is empty"); //NOI18N + } + + // Create new activity object + LogableUserActivity userActivity = new UserActivityLog(message, activityType, user, new GregorianCalendar(), this.determinePrincipalName()); + + // Call bean to add it + this.userActivityBean.addUserActivityLog(userActivity); + + // Add to cache, too + this.addUserActivityToCache(userActivity); + } + /** * Adds given user activity instance to "cache" (local map) *

diff --git a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java index 1a349957..e2234345 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java @@ -17,59 +17,12 @@ package org.mxchange.jjobs.beans.user.activity; import java.io.Serializable; -import java.util.List; -import javax.ejb.Local; -import org.mxchange.jusercore.model.user.User; -import org.mxchange.jusercore.model.user.activity.LogableUserActivity; /** * A controller (bean) interface for user activity log *

* @author Roland Häder */ -@Local public interface JobsUserActivityWebApplicationController extends Serializable { - /** - * Adds user activity entry with given type - *

- * @param user User instance - * @param activityType Activity type - */ - void addUserActivity (final User user, final String activityType); - - /** - * Adds user activity log with type and message - *

- * @param user User instance - * @param activityType Activity type - * @param message Activity message - */ - void addUserActivity (final User user, final String activityType, final String message); - - /** - * Returns a list of in beanHelper set user instance's activity log - *

- * @return List of user's activity log - */ - List fetchCurrentUsersActivityLog (); - - /** - * Expands given activity type into a i18n string for administrators - *

- * @param activityType Activity type - *

- * @return Expanded i18n string - */ - String expandAdminActivityType (final String activityType); - - /** - * Expands given activity type into a i18n string for users - *

- * @param activityType Activity type - *

- * @return Expanded i18n string - */ - String expandUserActivityType (final String activityType); - } -- 2.39.5