/**
* JBoss, Home of Professional Open Source
* Copyright Red Hat, Inc., and individual contributors.
*
* 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.jboss.aerogear.simplepush.protocol;
/**
* Represents the 'messageType' of a messages in the
* <a href="https://wiki.mozilla.org/WebAPI/SimplePush/Protocol">SimplePush specification protocol</a>.
* </p>
* All messages sent between the UserAgent and the SimplePush Server identified using a field named
* 'messageType'. Note that one exception to this is the {@code Ping} message which does not have a
* messageType.
*
* @see HelloMessage
* @see HelloResponse
* @see RegisterMessage
* @see RegisterResponse
* @see NotificationMessage
* @see AckMessage
* @see UnregisterMessage
* @see UnregisterResponse
*/
public interface MessageType {
/**
* The name of the messageType JSON field.
*/
String MESSSAGE_TYPE_FIELD = "messageType";
enum Type {
HELLO, REGISTER, NOTIFICATION, UNREGISTER, ACK, PING
}
/**
* Returns the Type of this message.
*
* @return {@code Type} the {@link Type} of this message.
*/
Type getMessageType();
}