lttng: update enable channel for UST buffer type
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.core / src / org / eclipse / linuxtools / internal / lttng2 / core / control / model / impl / DomainInfo.java
index 27dc84af7bfc4aa2dce81befa8a9926c4ce69dff..45e89952a98f43f83a8ce644f6dc40dcea2a1e81 100644 (file)
@@ -36,7 +36,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
      */
     private final List<IChannelInfo> fChannels = new ArrayList<IChannelInfo>();
     private boolean fIsKernel = false;
-    private String fBufferType = null;
+    private BufferType fBufferType = null;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -63,6 +63,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
             }
         }
         fIsKernel = other.fIsKernel;
+        fBufferType = other.fBufferType;
     }
 
     @Override
@@ -104,6 +105,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
         int result = super.hashCode();
         result = prime * result + fChannels.hashCode();
         result = prime * result + (fIsKernel ? 1231 : 1237);
+        result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1));
         return result;
     }
 
@@ -125,19 +127,22 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
         if (fIsKernel != other.fIsKernel) {
             return false;
         }
+        if (fBufferType != other.fBufferType) {
+            return false;
+        }
         return true;
     }
 
     @Override
-    public String getBufferType() {
+    public BufferType getBufferType() {
         if (fIsKernel) {
-            return BufferTypeConstants.BUFFER_SHARED;
+            return BufferType.BUFFER_SHARED;
         }
         return fBufferType;
     }
 
     @Override
-    public void setBufferType(String bufferType) {
+    public void setBufferType(BufferType bufferType) {
         fBufferType = bufferType;
     }
 
@@ -158,6 +163,10 @@ public class DomainInfo extends TraceInfo implements IDomainInfo {
             }
             output.append(",isKernel=");
             output.append(String.valueOf(fIsKernel));
+            if (!fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) {
+                output.append(",BufferType=");
+                output.append(fBufferType);
+            }
             output.append(")]");
             return output.toString();
     }
This page took 0.024575 seconds and 5 git commands to generate.