[vlma-devel] commit: Use upper-case letters for enums. (Adrien Grand )

git version control git at videolan.org
Mon Aug 11 22:49:54 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Aug 11 22:47:53 2008 +0200| [3c0b608ed5e7e4f9a3ae20ad714cfa4899185e59] | committer: Adrien Grand 

Use upper-case letters for enums.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=3c0b608ed5e7e4f9a3ae20ad714cfa4899185e59
---

 .../vlma/model/media/StreamingStrategy.java        |    4 ++--
 .../src/main/java/org/videolan/vlma/DataImpl.java  |   10 +++++-----
 .../src/main/java/org/videolan/vlma/IpBank.java    |    2 +-
 .../java/org/videolan/vlma/order/OrderSender.java  |    4 ++--
 .../vlma/watcher/StreamWatcherDispatcher.java      |    2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/vlma-api/src/main/java/org/videolan/vlma/model/media/StreamingStrategy.java b/vlma-api/src/main/java/org/videolan/vlma/model/media/StreamingStrategy.java
index 2f39f6d..02aa273 100644
--- a/vlma-api/src/main/java/org/videolan/vlma/model/media/StreamingStrategy.java
+++ b/vlma-api/src/main/java/org/videolan/vlma/model/media/StreamingStrategy.java
@@ -35,7 +35,7 @@ public class StreamingStrategy implements Serializable {
     private static final long serialVersionUID = -75919931677731393L;
 
     public static enum Protocol {
-        UDP_Multicast, HTTP;
+        UDP_MULTICAST, HTTP;
     }
 
     public static enum Announcement {
@@ -46,7 +46,7 @@ public class StreamingStrategy implements Serializable {
         TS, PS, MPEG1, OGG, ASF, ASFH, AVI, MPJPEG;
     }
 
-    private static final Protocol DEFAULT_PROTOCOL = Protocol.UDP_Multicast;
+    private static final Protocol DEFAULT_PROTOCOL = Protocol.UDP_MULTICAST;
     private static final Encapsulation DEFAULT_ENCAPSULATION = Encapsulation.TS;
 
     private Protocol protocol = DEFAULT_PROTOCOL;
diff --git a/vlma-core/src/main/java/org/videolan/vlma/DataImpl.java b/vlma-core/src/main/java/org/videolan/vlma/DataImpl.java
index abd8030..fd31062 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/DataImpl.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/DataImpl.java
@@ -156,14 +156,14 @@ public class DataImpl implements Data {
     public void update(Media media) {
         Media m = vlmaDao.getMedia(media.getId());
         if (m.getProgram() != null
-                && m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)
+                && m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)
                 && (media.getProgram() == null
-                        || !media.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast))) {
+                        || !media.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST))) {
             ipBank.releaseIp(m.getProgram().getIp());
         } else if (media.getProgram() != null
                 && (m.getProgram() == null
-                        || !m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast))
-                && media.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)) {
+                        || !m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST))
+                && media.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)) {
             media.getProgram().setIp(ipBank.getIp());
         }
         // Update sap group
@@ -231,7 +231,7 @@ public class DataImpl implements Data {
         if (program != null) {
             if (program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.HTTP)) {
                 return "http://" + program.getPlayer().getHostAddress() + ":" + configuration.getInt("vlma.streaming.http.port") + "/" + program.hashCode();
-            } else if (program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)) {
+            } else if (program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)) {
                 return "udp://@" + program.getIp().getHostAddress();
             }
         }
diff --git a/vlma-core/src/main/java/org/videolan/vlma/IpBank.java b/vlma-core/src/main/java/org/videolan/vlma/IpBank.java
index 76cf2df..10a0978 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/IpBank.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/IpBank.java
@@ -68,7 +68,7 @@ public class IpBank {
 
         for (Media m : vlmaService.getMedias()) {
             Program p = m.getProgram();
-            if (p == null || !p.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)) {
+            if (p == null || !p.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)) {
                 continue;
             }
             logger.log(Level.DEBUG, "The media " + m.getName()
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
index 07f38bf..41c0a3e 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/OrderSender.java
@@ -151,7 +151,7 @@ public abstract class OrderSender {
      */
     public String getAccess(Program program) {
         StreamingStrategy streamingStrategy = program.getStreamingStrategy();
-        if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)) {
+        if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)) {
             return "udp";
         } else if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.HTTP)) {
             return "http";
@@ -167,7 +167,7 @@ public abstract class OrderSender {
      */
     public String getDst(Program program) {
         StreamingStrategy streamingStrategy = program.getStreamingStrategy();
-        if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.UDP_Multicast)) {
+        if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.UDP_MULTICAST)) {
             return program.getIp().getHostAddress();
         } else if (streamingStrategy.getProtocol().equals(StreamingStrategy.Protocol.HTTP)) {
             Integer port = configuration.getInt("vlma.streaming.http.port");
diff --git a/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherDispatcher.java b/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherDispatcher.java
index 7eda21c..7d5d815 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherDispatcher.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/watcher/StreamWatcherDispatcher.java
@@ -39,7 +39,7 @@ public class StreamWatcherDispatcher implements StreamWatcher {
         StreamingStrategy.Protocol protocol = program.getStreamingStrategy().getProtocol();
         if (StreamingStrategy.Protocol.HTTP.equals(protocol)) {
             return httpStreamWatcher.isPlayed(program);
-        } else if (StreamingStrategy.Protocol.UDP_Multicast.equals(protocol)) {
+        } else if (StreamingStrategy.Protocol.UDP_MULTICAST.equals(protocol)) {
             return directMulticastStreamWatcher.isPlayed(program);
         } else {
             return mockStreamWatcher.isPlayed(program);



More information about the vlma-devel mailing list