Improve WonMessageType
package won.protocol.message;
+import java.net.URI;
+
import org.apache.jena.rdf.model.Resource;
-import won.protocol.vocabulary.WONMSG;
-import java.net.URI;
+import won.protocol.vocabulary.WONMSG;
/**
* User: ypanchenko Date: 13.08.2014
@@ -60,6 +61,20 @@ public enum WonMessageType {
return this == ATOM_HINT_MESSAGE || this == SOCKET_HINT_MESSAGE;
}
+ public boolean isResponseMessage() {
+ return this == SUCCESS_RESPONSE || this == FAILURE_RESPONSE;
+ }
+
+ public boolean causesOutgoingMessage() {
+ return this == CLOSE
+ || this == OPEN
+ || this == CONNECT
+ || this == CONNECTION_MESSAGE
+ || this == FAILURE_RESPONSE
+ || this == SUCCESS_RESPONSE
+ || this == CHANGE_NOTIFICATION;
+ }
+
public static WonMessageType getWonMessageType(Resource resource) {
if (WONMSG.CreateMessage.equals(resource))
return CREATE_ATOM;
