/** * OLAT - Online Learning and Training
* http://www.olat.org *

* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at *

* http://www.apache.org/licenses/LICENSE-2.0 *

* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. *

* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),
* University of Zurich, Switzerland. *

*/ package org.olat.instantMessaging; import org.olat.instantMessaging.syncservice.InstantMessagingSessionCount; /** * Description:
* decouples the lookup of the session count from the main login/logout flow to improve performace and to * * *

* Initial Date: 29.07.2010
* @author guido */ public class CountSessionsOnServerTask implements Runnable { private SmackInstantMessagingImpl InstantMessaging; private InstantMessagingSessionCount sessionCountService; public CountSessionsOnServerTask(InstantMessagingSessionCount sessionCountService, SmackInstantMessagingImpl InstantMessaging) { this.InstantMessaging = InstantMessaging; this.sessionCountService = sessionCountService; } /** * @see java.lang.Runnable#run() */ @Override public void run() { int count = sessionCountService.countSessions(); InstantMessaging.setSessionCount(count); } }