All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openbp.server.remote.ClientSessionServiceImpl Maven / Gradle / Ivy

There is a newer version: 0.9.11
Show newest version
/*
 *   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.
 */
package org.openbp.server.remote;

import java.util.Set;

import org.openbp.core.OpenBPException;
import org.openbp.core.remote.ClientLoginInfo;
import org.openbp.core.remote.ClientSession;
import org.openbp.core.remote.ClientSessionService;
import org.openbp.core.remote.InvalidSessionException;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * This class implements the client session service interface, thus it implements
 * the functionality to create a session ({@link ClientSession}) based on login
 * information ({@link ClientLoginInfo}).
 *
 * @author Falk Hartmann
 */
@Service("clientSessionService")
@Qualifier("exportedService")
public class ClientSessionServiceImpl
	implements ClientSessionService
{
	/**
	 * Default constructor.
	 *
	 * @throws OpenBPException never
	 */
	public ClientSessionServiceImpl()
	{
	}

	//////////////////////////////////////////////////
	// @@ Service implementation
	//////////////////////////////////////////////////

	public ClientSession createSession(ClientLoginInfo loginInfo)
	{
		return ClientSessionMgr.getInstance().createSession(loginInfo);
	}

	public Set getSessionEvents(ClientSession session)
		throws InvalidSessionException
	{
		// Make sure the session if valid.
		ClientSessionMgr.getInstance().checkSession(session);

		// Return the event set (whereby delegating to the ClientSessionMgr).
		return ClientSessionMgr.getInstance().popSessionEvents(session);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy