blob: 2e677c5f999f1bd1cb4c83069c9d899e3df55ee6 [file] [log] [blame]
/*
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
* Loetz GmbH&Co.KG
*
*/
package org.eclipse.osbp.webserver.messagequeue;
import javax.jms.JMSException;
import javax.jms.MapMessage;
/**
* Dieses gesamte Package muss zum jetzigen Zeitpunkt <b>manuell</b> dupliziert und synchronisiert werden<ul>
* <li><a href="http://10.1.2.27:8100/cc360/browser/OSGI-Plugins/org.eclipse.osbp.webserver.messagequeue">cc360/OSGI-Plugins/org.eclipse.osbp.webserver.messagequeue</a></li>
* <li><a href="http://10.1.2.27:8100/kapstadt/browser/development2/3.50/src/cxj/diamond7/src/webclt-webserver/org/eclipse/osbp/webserver/messagequeue">cc3.50/development2/3.50/src/cxj/diamond7/src/webclt-webserver/org/eclipse/osbp/webserver/messagequeue</a></li>
* </ul>
* All available event types!
* TODO refer to {@link ECXMqMessageAttribute}
*/
public enum ECXMqMessageEvent {
/** ccng application wants to be authenticated via webclient. */
REQUEST_AUTHENTICATE,
/** webclient wants to authenticate its embedded ccng application. */
TRY_AUTHENTICATE,
/** ccng application sends new application/view in focus. */
FOCUS_PERSPECTIVE,
/** ccng application sends the list of available applications/views. */
LIST_OF_PERSPECTIVES,
/** the ccng application sends the icon. */
GET_ICON,
/** webclient wants to receive the icon. */
REQUEST_ICON,
/** ccng wants to call legacy programm; NO retcode. */
CALL_LEGACY_PROGRAM,
/** the ccng application will be disposed. */
DISPOSE,
/**
* the ccng application is logged out either via webclient or ccng
* application.
*/
LOGOUT,
/** fallback type for any unknown message. */
UNKNOWN;
/** The Constant EVENT. */
public final static String EVENT = "EVENT";
/**
* get the type of event from the message.
*
* @param message
* the message
* @return the event type, UNKNOWN if not inside the enumeration
*/
public static ECXMqMessageEvent getEvent(MapMessage message) {
try {
String string = message.getStringProperty(EVENT);
if (string != null) {
for (ECXMqMessageEvent step : values()) {
if (string.equals(step.toString())) {
return step;
}
}
}
} catch (JMSException e) {}
return UNKNOWN;
}
}