smart refresh implemented (need actual testing), fix for support ticket #580
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@73014 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b496c36a5a
commit
8461589fe7
|
@ -30,7 +30,7 @@ public interface NewsService extends RemoteService {
|
||||||
|
|
||||||
boolean deleteFeed(String feedid);
|
boolean deleteFeed(String feedid);
|
||||||
|
|
||||||
Comment comment(String feedid, String text, String feedOwnerId);
|
Comment comment(String feedid, String text, String feedOwnerId, boolean isAppFeed);
|
||||||
|
|
||||||
Comment editComment(Comment toEdit);
|
Comment editComment(Comment toEdit);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public interface NewsServiceAsync {
|
||||||
void getUserSettings(AsyncCallback<UserSettings> callback);
|
void getUserSettings(AsyncCallback<UserSettings> callback);
|
||||||
|
|
||||||
void comment(String feedid, String text, String feedOwnerId,
|
void comment(String feedid, String text, String feedOwnerId,
|
||||||
AsyncCallback<Comment> callback);
|
boolean isAppFeed, AsyncCallback<Comment> callback);
|
||||||
|
|
||||||
void getAllCommentsByFeed(String feedid,
|
void getAllCommentsByFeed(String feedid,
|
||||||
AsyncCallback<ArrayList<Comment>> callback);
|
AsyncCallback<ArrayList<Comment>> callback);
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package org.gcube.portlets.user.newsfeed.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class ShowNewUpdatesEvent extends GwtEvent<ShowNewUpdatesEventHandler> {
|
||||||
|
public static Type<ShowNewUpdatesEventHandler> TYPE = new Type<ShowNewUpdatesEventHandler>();
|
||||||
|
|
||||||
|
public ShowNewUpdatesEvent() { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<ShowNewUpdatesEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ShowNewUpdatesEventHandler handler) {
|
||||||
|
handler.onShowNewUpdatesClick(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.gcube.portlets.user.newsfeed.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
public interface ShowNewUpdatesEventHandler extends EventHandler {
|
||||||
|
void onShowNewUpdatesClick(ShowNewUpdatesEvent event);
|
||||||
|
}
|
|
@ -27,6 +27,8 @@ import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEvent;
|
||||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEventHandler;
|
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEventHandler;
|
||||||
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
||||||
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEventHandler;
|
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEventHandler;
|
||||||
|
import org.gcube.portlets.user.newsfeed.client.event.ShowNewUpdatesEvent;
|
||||||
|
import org.gcube.portlets.user.newsfeed.client.event.ShowNewUpdatesEventHandler;
|
||||||
import org.gcube.portlets.user.newsfeed.client.event.StopTimerEvent;
|
import org.gcube.portlets.user.newsfeed.client.event.StopTimerEvent;
|
||||||
import org.gcube.portlets.user.newsfeed.client.event.StopTimerEventHandler;
|
import org.gcube.portlets.user.newsfeed.client.event.StopTimerEventHandler;
|
||||||
import org.gcube.portlets.user.newsfeed.client.panels.dialog.LikesDialog;
|
import org.gcube.portlets.user.newsfeed.client.panels.dialog.LikesDialog;
|
||||||
|
@ -69,6 +71,8 @@ public class NewsFeedPanel extends Composite {
|
||||||
private SimplePanel newUpdatesPanel = new SimplePanel();
|
private SimplePanel newUpdatesPanel = new SimplePanel();
|
||||||
private VerticalPanel newsPanel = new VerticalPanel();
|
private VerticalPanel newsPanel = new VerticalPanel();
|
||||||
|
|
||||||
|
private NewFeedsAvailable newsFeedAlert;
|
||||||
|
|
||||||
private static final String warning = GWT.getModuleBaseURL() + "../images/warning_blue.png";
|
private static final String warning = GWT.getModuleBaseURL() + "../images/warning_blue.png";
|
||||||
private static final String spacer = GWT.getModuleBaseURL() + "../images/feeds-spacer.gif";
|
private static final String spacer = GWT.getModuleBaseURL() + "../images/feeds-spacer.gif";
|
||||||
public static final String loading = GWT.getModuleBaseURL() + "../images/feeds-loader.gif";
|
public static final String loading = GWT.getModuleBaseURL() + "../images/feeds-loader.gif";
|
||||||
|
@ -98,6 +102,14 @@ public class NewsFeedPanel extends Composite {
|
||||||
*/
|
*/
|
||||||
private void bind() {
|
private void bind() {
|
||||||
|
|
||||||
|
eventBus.addHandler(ShowNewUpdatesEvent.TYPE, new ShowNewUpdatesEventHandler() {
|
||||||
|
@Override
|
||||||
|
public void onShowNewUpdatesClick(ShowNewUpdatesEvent event) {
|
||||||
|
doShowCachedNewUpdates();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
eventBus.addHandler(StopTimerEvent.TYPE, new StopTimerEventHandler() {
|
eventBus.addHandler(StopTimerEvent.TYPE, new StopTimerEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onStopTimer(StopTimerEvent event) {
|
public void onStopTimer(StopTimerEvent event) {
|
||||||
|
@ -248,7 +260,7 @@ public class NewsFeedPanel extends Composite {
|
||||||
|
|
||||||
Date myLastUpdateTime = allUpdates.get(0).getFeed().getTime(); //this is the last update in the View
|
Date myLastUpdateTime = allUpdates.get(0).getFeed().getTime(); //this is the last update in the View
|
||||||
|
|
||||||
tempCacheNewUpdates = new ArrayList<EnhancedFeed>(); //need to reset it everytime i check (in case someone deleted the updated in the meanwhile)
|
tempCacheNewUpdates = new ArrayList<EnhancedFeed>(); //need to clear it everytime i check (in case someone deleted the updated in the meanwhile)
|
||||||
|
|
||||||
//check if there are new updates (enter the while) and put them in a temporary cache for displaying on user click
|
//check if there are new updates (enter the while) and put them in a temporary cache for displaying on user click
|
||||||
|
|
||||||
|
@ -263,8 +275,14 @@ public class NewsFeedPanel extends Composite {
|
||||||
* if they differ you got to refresh the updates to show the new number
|
* if they differ you got to refresh the updates to show the new number
|
||||||
*/
|
*/
|
||||||
if (currNewUpdatesNo < i) {
|
if (currNewUpdatesNo < i) {
|
||||||
newUpdatesPanel.clear(); //remove the current show update button if present
|
//add the current "show new updates" alert panel if not present
|
||||||
newUpdatesPanel.add(new NewFeedsAvailable(i));
|
if (newsFeedAlert == null) {
|
||||||
|
newsFeedAlert = new NewFeedsAvailable(i, eventBus);
|
||||||
|
newUpdatesPanel.add(newsFeedAlert);
|
||||||
|
}
|
||||||
|
else //update it otherwise
|
||||||
|
newsFeedAlert.updateNewUpdatesNo(i);
|
||||||
|
|
||||||
currNewUpdatesNo = i;
|
currNewUpdatesNo = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,6 +293,22 @@ public class NewsFeedPanel extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void doShowCachedNewUpdates() {
|
||||||
|
newUpdatesPanel.clear(); //remove the aler panel
|
||||||
|
for (EnhancedFeed feed : tempCacheNewUpdates) {
|
||||||
|
final TweetTemplate tt = new TweetTemplate(myUserInfo, feed, eventBus, true);
|
||||||
|
newsPanel.insert(tt, 0); //insert in the view
|
||||||
|
allUpdates.add(0, feed); //insert in the model
|
||||||
|
//timer for the transition
|
||||||
|
Timer t = new Timer() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
tt.setcontentAreaStyle("visible");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
t.schedule(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All Updates
|
* All Updates
|
||||||
|
@ -530,7 +564,7 @@ public class NewsFeedPanel extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doAddComment(final TweetTemplate owner, String text) {
|
private void doAddComment(final TweetTemplate owner, String text) {
|
||||||
newsService.comment(owner.getFeedKey(), text, owner.getMyFeedUserId(), new AsyncCallback<Comment>() {
|
newsService.comment(owner.getFeedKey(), text, owner.getMyFeedUserId(), owner.isAppFeed(), new AsyncCallback<Comment>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Window.alert("Could not deliver this comment: " + caught.getMessage());
|
Window.alert("Could not deliver this comment: " + caught.getMessage());
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
package org.gcube.portlets.user.newsfeed.client.templates;
|
package org.gcube.portlets.user.newsfeed.client.templates;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.newsfeed.client.event.ShowNewUpdatesEvent;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class NewFeedsAvailable extends Composite {
|
public class NewFeedsAvailable extends Composite {
|
||||||
|
@ -14,12 +21,19 @@ public class NewFeedsAvailable extends Composite {
|
||||||
.create(NewFeedsAvailableUiBinder.class);
|
.create(NewFeedsAvailableUiBinder.class);
|
||||||
|
|
||||||
interface NewFeedsAvailableUiBinder extends
|
interface NewFeedsAvailableUiBinder extends
|
||||||
|
|
||||||
UiBinder<Widget, NewFeedsAvailable> {
|
UiBinder<Widget, NewFeedsAvailable> {
|
||||||
}
|
}
|
||||||
@UiField HTML caption;
|
|
||||||
|
|
||||||
public NewFeedsAvailable(int newUpdatesNo) {
|
private HandlerManager eventBus;
|
||||||
|
|
||||||
|
@UiField HTML caption;
|
||||||
|
@UiField HTMLPanel panel;
|
||||||
|
|
||||||
|
|
||||||
|
public NewFeedsAvailable(int newUpdatesNo, HandlerManager eventBus) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
this.eventBus = eventBus;
|
||||||
if (newUpdatesNo > 0) {
|
if (newUpdatesNo > 0) {
|
||||||
caption.setHTML(newUpdatesNo > 1 ? "See " + newUpdatesNo + " new Updates" : "See 1 new Update");
|
caption.setHTML(newUpdatesNo > 1 ? "See " + newUpdatesNo + " new Updates" : "See 1 new Update");
|
||||||
//create the fade transition effect
|
//create the fade transition effect
|
||||||
|
@ -33,4 +47,13 @@ public class NewFeedsAvailable extends Composite {
|
||||||
}
|
}
|
||||||
else throw new IllegalArgumentException("newUpdatesNo must be greater than 0");
|
else throw new IllegalArgumentException("newUpdatesNo must be greater than 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateNewUpdatesNo(int newUpdatesNo) {
|
||||||
|
caption.setHTML(newUpdatesNo > 1 ? "See " + newUpdatesNo + " new Updates" : "See 1 new Update");
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiHandler("caption")
|
||||||
|
void onClick(ClickEvent e) {
|
||||||
|
eventBus.fireEvent(new ShowNewUpdatesEvent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
<g:HTMLPanel styleName="new-feeds-container">
|
<g:HTMLPanel ui:field="panel" styleName="new-feeds-container">
|
||||||
<g:HTML ui:field="caption" styleName="new-feeds-available" />
|
<g:HTML ui:field="caption" styleName="new-feeds-available" />
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -70,6 +70,7 @@ public class TweetTemplate extends Composite {
|
||||||
private int totalComments = 0;
|
private int totalComments = 0;
|
||||||
private HTML showAllComments = new HTML();
|
private HTML showAllComments = new HTML();
|
||||||
private boolean isAppFeed = false;
|
private boolean isAppFeed = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tell if this tweet is belonging to the current user
|
* tell if this tweet is belonging to the current user
|
||||||
*/
|
*/
|
||||||
|
@ -396,4 +397,8 @@ public class TweetTemplate extends Composite {
|
||||||
public String getMyFeedText() {
|
public String getMyFeedText() {
|
||||||
return myFeed.getFeed().getDescription();
|
return myFeed.getFeed().getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAppFeed() {
|
||||||
|
return isAppFeed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
||||||
//user = "test.user";
|
user = "test.user";
|
||||||
user = "massimiliano.assante";
|
//user = "massimiliano.assante";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
withinPortal = true;
|
withinPortal = true;
|
||||||
|
@ -243,28 +243,28 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
ArrayList<Feed> toMerge = new ArrayList<Feed>();
|
ArrayList<Feed> toMerge = new ArrayList<Feed>();
|
||||||
HashMap<String, Feed> feedsMap = new HashMap<String, Feed>();
|
HashMap<String, Feed> feedsMap = new HashMap<String, Feed>();
|
||||||
|
|
||||||
ArrayList<Feed> OrganizationFeeds = (ArrayList<Feed>) store.getRecentFeedsByVRE("/gcube/devsec/devVRE", 5);
|
ArrayList<Feed> OrganizationFeeds = (ArrayList<Feed>) store.getRecentFeedsByVRE("/gcube/devsec/devVRE", 15);
|
||||||
for (Feed feed : OrganizationFeeds) {
|
for (Feed feed : OrganizationFeeds) {
|
||||||
feedsMap.put(feed.getKey(), feed);
|
feedsMap.put(feed.getKey(), feed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (! onlyConnections) {
|
if (! onlyConnections) {
|
||||||
// //User Own Feeds
|
//User Own Feeds
|
||||||
// ArrayList<Feed> userFeeds = (ArrayList<Feed>) store.getRecentFeedsByUser(userName, 10);
|
ArrayList<Feed> userFeeds = (ArrayList<Feed>) store.getRecentFeedsByUser(userName, 10);
|
||||||
// for (Feed feed : userFeeds)
|
for (Feed feed : userFeeds)
|
||||||
// feedsMap.put(feed.getKey(), feed);
|
feedsMap.put(feed.getKey(), feed);
|
||||||
// // //Portal Feeds
|
// //Portal Feeds
|
||||||
// ArrayList<Feed> portalFeeds = (ArrayList<Feed>) store.getAllPortalPrivacyLevelFeeds();
|
ArrayList<Feed> portalFeeds = (ArrayList<Feed>) store.getAllPortalPrivacyLevelFeeds();
|
||||||
// for (Feed feed : portalFeeds)
|
for (Feed feed : portalFeeds)
|
||||||
// feedsMap.put(feed.getKey(), feed);
|
feedsMap.put(feed.getKey(), feed);
|
||||||
// }
|
}
|
||||||
// //UserFriends Feeds
|
//UserFriends Feeds
|
||||||
// ArrayList<String> userFriendsIds = (ArrayList<String>)store.getFriends(userName);
|
ArrayList<String> userFriendsIds = (ArrayList<String>)store.getFriends(userName);
|
||||||
// for (String userid : userFriendsIds) {
|
for (String userid : userFriendsIds) {
|
||||||
// for (Feed feed : store.getRecentFeedsByUser(userid, 10)) {
|
for (Feed feed : store.getRecentFeedsByUser(userid, 10)) {
|
||||||
// feedsMap.put(feed.getKey(), feed);
|
feedsMap.put(feed.getKey(), feed);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
for (String key: feedsMap.keySet()) {
|
for (String key: feedsMap.keySet()) {
|
||||||
toMerge.add(feedsMap.get(key));
|
toMerge.add(feedsMap.get(key));
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
* @param feedOwnerId the username of the user who created the post that was commented
|
* @param feedOwnerId the username of the user who created the post that was commented
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Comment comment(String feedid, String commentText, String feedOwnerId) {
|
public Comment comment(String feedid, String commentText, String feedOwnerId, boolean isAppFeed) {
|
||||||
boolean commentCommitResult = false;
|
boolean commentCommitResult = false;
|
||||||
_log.trace("Trying to add this comment " + commentText);
|
_log.trace("Trying to add this comment " + commentText);
|
||||||
UserInfo user = getUserSettings().getUserInfo();
|
UserInfo user = getUserSettings().getUserInfo();
|
||||||
|
@ -345,11 +345,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//if the comment was correctly delivered notify users involved
|
//if the comment was correctly delivered && is not an app feed notify users involved
|
||||||
if (commentCommitResult) {
|
if (commentCommitResult) {
|
||||||
//if the user who commented this post is not the user who posted it notify the poster user (Feed owner)
|
//if the user who commented this post is not the user who posted it notify the poster user (Feed owner)
|
||||||
NotificationsManager nm = new ApplicationNotificationsManager(getASLSession());
|
NotificationsManager nm = new ApplicationNotificationsManager(getASLSession());
|
||||||
if (! user.getUsername().equals(feedOwnerId)) {
|
if (! user.getUsername().equals(feedOwnerId) && (!isAppFeed)) {
|
||||||
boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapeHtml(commentText));
|
boolean result = nm.notifyOwnCommentReply(feedOwnerId, feedid, escapeHtml(commentText));
|
||||||
_log.trace("Comment Notification to post owner added? " + result);
|
_log.trace("Comment Notification to post owner added? " + result);
|
||||||
}
|
}
|
||||||
|
@ -636,34 +636,34 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
* @return the refreshingTime in milliseconds
|
* @return the refreshingTime in milliseconds
|
||||||
*/
|
*/
|
||||||
private int getFeedsRefreshTimeInMillis() {
|
private int getFeedsRefreshTimeInMillis() {
|
||||||
return 15000;
|
//return 20000; //for testing
|
||||||
//TODO:
|
|
||||||
// Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
// int toReturn = 0;
|
int toReturn = 0;
|
||||||
// int minutes = 0;
|
int minutes = 0;
|
||||||
// String propertyfile = "";
|
String propertyfile = "";
|
||||||
// try {
|
try {
|
||||||
// propertyfile = this.getThreadLocalRequest().getContextPath()+"conf/settings.properties";
|
propertyfile = this.getThreadLocalRequest().getContextPath()+"conf/settings.properties";
|
||||||
// File propsFile = new File(propertyfile);
|
File propsFile = new File(propertyfile);
|
||||||
// FileInputStream fis = new FileInputStream(propsFile);
|
FileInputStream fis = new FileInputStream(propsFile);
|
||||||
// props.load( fis);
|
props.load( fis);
|
||||||
//
|
|
||||||
// minutes = Integer.parseInt(props.getProperty("REFRESH_TIME"));
|
minutes = Integer.parseInt(props.getProperty("REFRESH_TIME"));
|
||||||
// toReturn = minutes*60*1000;
|
toReturn = minutes*60*1000;
|
||||||
// }
|
}
|
||||||
// //catch exception in case properties file does not exist
|
//catch exception in case properties file does not exist
|
||||||
// catch(IOException e) {
|
catch(IOException e) {
|
||||||
// toReturn = 300000; //5 minutes
|
toReturn = 300000; //5 minutes
|
||||||
// _log.error("settings.properties file not found under " + propertyfile +", returning 5 minutes");
|
_log.error("settings.properties file not found under " + propertyfile +", returning 5 minutes");
|
||||||
// return toReturn;
|
return toReturn;
|
||||||
// }
|
}
|
||||||
// //catch exception in case the property value isNot a Number
|
//catch exception in case the property value isNot a Number
|
||||||
// catch (ClassCastException ex) {
|
catch (ClassCastException ex) {
|
||||||
// toReturn = 300000; //5 minutes
|
toReturn = 300000; //5 minutes
|
||||||
// _log.error("REFRESH_TIME must be a number (in minutes) returning 5 minutes");
|
_log.error("REFRESH_TIME must be a number (in minutes) returning 5 minutes");
|
||||||
// return toReturn;
|
return toReturn;
|
||||||
// }
|
}
|
||||||
// _log.debug("Returning REFRESH_TIME in millis: " + toReturn + ", (" + minutes + " minutes)");
|
_log.debug("Returning REFRESH_TIME in millis: " + toReturn + ", (" + minutes + " minutes)");
|
||||||
// return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue