/**
* <a href=“http://www.openolat.org“>
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* 19.10.2012 by frentix GmbH, http://www.frentix.com
* <p>
**/
package org.olat.core.gui.components.util;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.ComponentRenderer;
import org.olat.core.gui.render.RenderResult;
import org.olat.core.gui.render.Renderer;
import org.olat.core.gui.render.RenderingState;
import org.olat.core.gui.render.StringOutput;
import org.olat.core.gui.render.URLBuilder;
import org.olat.core.gui.translator.Translator;
/**
* <h3>Description:</h3>
* <p>
* This renders the current concurrent user count for web users
* <p>
* Initial Date: 19.10.2012 <br>
*
* @author Florian Gnaegi, frentix GmbH, http://www.frentix.com
*/
public class UserLoggedInCounterRenderer implements ComponentRenderer {
@Override
public void render(Renderer renderer, StringOutput sb, Component source,
URLBuilder ubu, Translator translator, RenderResult renderResult,
String[] args) {
UserLoggedInCounter counter = (UserLoggedInCounter) source;
sb.append(counter.getSessionCount());
}
@Override
public void renderHeaderIncludes(Renderer renderer, StringOutput sb,
Component source, URLBuilder ubu, Translator translator,
RenderingState rstate) {
// nothing to include
}
@Override
public void renderBodyOnLoadJSFunctionCall(Renderer renderer,
StringOutput sb, Component source, RenderingState rstate) {
// no body js stuff
}
}