diff options
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model')
29 files changed, 0 insertions, 3529 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java deleted file mode 100644 index 21d7b3bfdc..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IBaseEventInfo.java +++ /dev/null @@ -1,89 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - * <p> - * Interface for retrieval of basic trace event information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IBaseEventInfo extends ITraceInfo { - - /** - * @return the trace event type - */ - TraceEventType getEventType(); - - /** - * Sets the trace event type to the given type - * @param type - type to set - */ - void setEventType(TraceEventType type); - - /** - * Sets the trace event type to the type specified by the given name. - * @param typeName - event type name - */ - void setEventType(String typeName); - - /** - * @return the trace event log level - */ - TraceLogLevel getLogLevel(); - - /** - * Sets the trace event log level to the given level - * @param level - event log level to set - */ - void setLogLevel(TraceLogLevel level); - - /** - * Sets the trace event log level to the level specified by the given name. - * @param levelName - event log level name - */ - void setLogLevel(String levelName); - - /** - * Returns the field information (if exists) - * @return the field information or null - */ - IFieldInfo[] getFields(); - - /** - * @param field The field to add - */ - void addField(IFieldInfo field); - - /** - * Sets the fields - * @param fields The fields - */ - void setFields(List<IFieldInfo> fields); - - /** - * Returns filter expression. - * @return filter expression - */ - String getFilterExpression(); - - /** - * Sets the filter expression. - * @param filter The filter expression to set - */ - void setFilterExpression(String filter); - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java deleted file mode 100644 index 8018ea0458..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IChannelInfo.java +++ /dev/null @@ -1,157 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Simon Delisle - Updated for support of LTTng Tools 2.2 - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; - -/** - * <p> - * Interface for retrieval of trace channel information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IChannelInfo extends ITraceInfo { - - // ------------------------------------------------------------------------ - // Constants - // ------------------------------------------------------------------------ - /** - * Default value for overwrite mode. - */ - public final static boolean DEFAULT_OVERWRITE_MODE = false; - - /** - * @return the overwrite mode value. - */ - boolean isOverwriteMode(); - /** - * Sets the overwrite mode value to the given mode. - * @param mode - mode to set. - */ - void setOverwriteMode(boolean mode); - - /** - * @return the sub-buffer size. - */ - long getSubBufferSize(); - /** - * Sets the sub-buffer size to the given value. - * @param bufferSize - size to set to set. - */ - void setSubBufferSize(long bufferSize); - - /** - * @return the number of sub-buffers. - */ - int getNumberOfSubBuffers(); - /** - * Sets the number of sub-buffers to the given value. - * @param numberOfSubBuffers - value to set. - */ - void setNumberOfSubBuffers(int numberOfSubBuffers); - - /** - * @return the switch timer interval. - */ - long getSwitchTimer(); - /** - * Sets the switch timer interval to the given value. - * @param timer - timer value to set. - */ - void setSwitchTimer(long timer); - - /** - * @return the read timer interval. - */ - long getReadTimer(); - /** - * Sets the read timer interval to the given value. - * @param timer - timer value to set.. - */ - void setReadTimer(long timer); - - /** - * @return the output type. - */ - TraceChannelOutputType getOutputType(); - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - void setOutputType(String type); - /** - * Sets the output type to the given value. - * @param type - type to set. - */ - void setOutputType(TraceChannelOutputType type); - - /** - * @return the channel state (enabled or disabled). - */ - TraceEnablement getState(); - /** - * Sets the channel state (enablement) to the given value. - * @param state - state to set. - */ - void setState(TraceEnablement state); - /** - * Sets the channel state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - void setState(String stateName); - - /** - * @return all event information as array. - */ - IEventInfo[] getEvents(); - /** - * Sets the event information specified by given list. - * @param events - all event information to set. - */ - void setEvents(List<IEventInfo> events); - /** - * Adds a single event information. - * @param event - event information to add. - */ - void addEvent(IEventInfo event); - /** - * Sets the maximum size of trace files - * @param maxSizeTraceFiles - maximum size - */ - void setMaxSizeTraceFiles(int maxSizeTraceFiles); - /** - * Sets the maximum number of trace files - * @param maxNumberTraceFiles - maximum number - */ - void setMaxNumberTraceFiles(int maxNumberTraceFiles); - /** - * @return maximum size of trace files - */ - int getMaxSizeTraceFiles(); - /** - * @return maximum number of trace files - */ - int getMaxNumberTraceFiles(); - /** - * Sets per UID buffers - * @param buffersUID - enable or not - */ - void setBufferType(BufferType buffersUID); - /** - * @return the value of buffersUID (enable or not) - */ - BufferType getBufferType(); -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java deleted file mode 100644 index 783deb511f..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IDomainInfo.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.BufferType; - -/** - * <p> - * Interface for retrieval of trace domain information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IDomainInfo extends ITraceInfo { - - /** - * @return information about all channels - */ - IChannelInfo[] getChannels(); - - /** - * Sets the channel information specified by given list. - * @param channels - all channel information to set. - */ - void setChannels(List<IChannelInfo> channels); - - /** - * Adds a single channel information. - * @param channel - channel information to add. - */ - void addChannel(IChannelInfo channel); - - /** - * @return true if domain is kernel, false for UST - */ - boolean isKernel(); - - /** - * Sets whether domain is Kernel domain or UST - * @param isKernel true for kernel, false for UST - */ - void setIsKernel(boolean isKernel); - - /** - * @return Information about the buffer type - */ - BufferType getBufferType(); - - /** - * Sets the buffer type - * - * @param bufferType - * The buffer type - */ - void setBufferType(BufferType bufferType); - - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java deleted file mode 100644 index cd11e82b10..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IEventInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * <p> - * Interface for retrieval of trace event information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IEventInfo extends IBaseEventInfo { - - /** - * @return the event state (enabled or disabled). - */ - TraceEnablement getState(); - - /** - * Sets the event state (enablement) to the given value. - * @param state - state to set. - */ - void setState(TraceEnablement state); - - /** - * Sets the event state (enablement) to the value specified by the given name. - * @param stateName - state to set. - */ - void setState(String stateName); - - /** - * Returns the log level type. - * @return log level type. - */ - LogLevelType getLogLevelType(); - - /** - * Sets the LogLevelType. - * @param type - log level type - */ - void setLogLevelType(LogLevelType type); - - /** - * Sets the LogLevelType based on given short name. - * @param shortName - short name of type - */ - void setLogLevelType(String shortName); - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java deleted file mode 100644 index 3486a841fd..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IFieldInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * <p> - * Interface for retrieval of event field information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IFieldInfo extends ITraceInfo { - - /** - * @return the event field type - */ - String getFieldType(); - - /** - * Sets field type string - * - * @param fieldType - sting of event field type - */ - void setFieldType(String fieldType); -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java deleted file mode 100644 index 915998bdbf..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IProbeEventInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * <p> - * Interface for retrieval of probe event information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IProbeEventInfo extends IEventInfo { - - /** - * @return the address of the probe. (null if not used) - */ - String getAddress(); - - /** - * Sets the address of the probe. - * @param address - a address (null if not used) - */ - void setAddress(String address); - - /** - * @return the offset applied to the symbol (null if not used). - */ - String getOffset(); - - /** - * Sets the offset applied to the symbol. - * @param offset - a offset ((null if not used) - */ - void setOffset(String offset); - - /** - * @return the symbol name. ((null if not used)) - */ - String getSymbol(); - - /** - * Sets the symbol name. - * @param symbol - a symbol name ((null if not used)) - */ - void setSymbol(String symbol); -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java deleted file mode 100644 index d40a695b4a..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISessionInfo.java +++ /dev/null @@ -1,222 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - * <p> - * Interface for retrieval of trace session information. - * </p> - * - * @author Bernd Hufmann - */ -public interface ISessionInfo extends ITraceInfo { - - /** - * @return the session state state (active or inactive). - */ - TraceSessionState getSessionState(); - /** - * Sets the session state to the given value. - * @param state - state to set. - */ - void setSessionState(TraceSessionState state); - - /** - * Sets the event state to the value specified by the given name. - * @param stateName - state to set. - */ - void setSessionState(String stateName); - - /** - * @return path string where session is located. - */ - String getSessionPath(); - - /** - * Sets the path string (where session is located) to the given value. - * @param path - session path to set. - */ - void setSessionPath(String path); - - /** - * @return all domain information as array. - */ - IDomainInfo[] getDomains(); - - /** - * Sets all domain information specified by given list. - * @param domains - all domain information to set. - */ - void setDomains(List<IDomainInfo> domains); - - /** - * Adds a single domain information. - * @param domainInfo domain information to add. - */ - void addDomain(IDomainInfo domainInfo); - - /** - * Returns if session is streamed over network - * @return <code>true</code> if streamed over network else <code>false</code> - */ - boolean isStreamedTrace(); - - /** - * Sets whether the trace is streamed or not - * @param isStreamedTrace <code>true</code> if streamed over network else <code>false</code> - */ - void setStreamedTrace(boolean isStreamedTrace); - - /** - * Returns whether the session is snapshot session or not - * @return <code>true</code> if it is snapshot session else <code>false</code> - */ - boolean isSnapshotSession(); - - /** - * Set whether or not the session should be in snapshot mode - * - * @param isSnapshot - * true for snapshot mode, false otherwise - */ - void setSnapshot(boolean isSnapshot); - - /** - * Gets the snapshot information the session or null if it is not a - * snapshot session. - * @return snapshot information - */ - ISnapshotInfo getSnapshotInfo(); - - /** - * Sets the snapshot information of the session - * @param setSnapshotInfo - the snapshot data to set. - */ - void setSnapshotInfo(ISnapshotInfo setSnapshotInfo); - - /** - * Get whether or not the session should be in Live mode - * - * @return <code>true</code> if is a live session else <code>false</code> - */ - public boolean isLive(); - - /** - * Set whether or not the session should be in Live mode - * - * @param isLive - * true for Live mode, false otherwise - */ - public void setLive(boolean isLive); - - /** - * Get the live delay which is the delay in micro seconds before the data is - * flushed and streamed. - * - * @return the live delay or -1 if the default value should be used - */ - public int getLiveDelay(); - - /** - * Set the live delay which is the delay in micro seconds before the data is - * flushed and streamed. - * - * @param liveDelay - * the live delay - */ - public void setLiveDelay(int liveDelay); - - /** - * Get the network URL in case control and data is configured together - * otherwise null If it returns a non-null value, getControlUrl() and - * getDataUrl() have to return null. - * - * @return The network URL or null. - */ - String getNetworkUrl(); - - /** - * Set the network URL - * - * @param networkUrl - * the network URL - */ - void setNetworkUrl(String networkUrl); - - /** - * Get the control URL in case control and data is configured separately. If - * it returns a non-null value, getDataUrl() has to return a valid value too - * and getNetworkUrl() has to return null. - * - * @return The control URL or null. - */ - String getControlUrl(); - - /** - * Set the control URL - * - * @param controlUrl - * the control URL - */ - void setControlUrl(String controlUrl); - - /** - * Get the data URL in case control and data is configured separately. If it - * returns a non-null value, getControlUrl() has to return a valid value too - * and getNetworkUrl() has to return null. - * - * @return The data URL or null. - */ - String getDataUrl(); - - /** - * Set the data URL - * - * @param datalUrl - * the data URL - */ - void setDataUrl(String datalUrl); - - /** - * Get the live URL. - * - * @return the live URL - */ - String getLiveUrl(); - - /** - * Set the live URL. - * - * @param liveUrl - * the live URL - */ - void setLiveUrl(String liveUrl); - - /** - * Get the live port. - * - * @return the live port - */ - Integer getLivePort(); - - /** - * Set the live port. - * - * @param livePort - * the live port - */ - void setLivePort(Integer livePort); -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java deleted file mode 100644 index 7c360feb9c..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ISnapshotInfo.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - * <p> - * Interface for retrieval of snapshot information of a session. - * </p> - * - * @author Bernd Hufmann - */ -public interface ISnapshotInfo extends ITraceInfo { - - /** - * @return path string where snapshot is located. - */ - String getSnapshotPath(); - - /** - * Sets the path string (where snapshot is located) to the given value. - * @param path - session path to set. - */ - void setSnapshotPath(String path); - - /** - * @return the snapshot ID. - */ - int getId(); - - /** - * Sets the snapshot ID. - * @param id - the ID to set. - */ - void setId(int id); - - /** - * Sets whether snapshot is streamed over the network or stored locally - * at the tracers host. - * - * @param isStreamed - <code>true</code> if streamed else <code>false</code> - */ - void setStreamedSnapshot(boolean isStreamed); - - /** - * Gets whether snapshot is streamed over the network or stored locally - * at the tracers host. - * - * @return <code>true</code> if streamed else <code>false</code> - */ - boolean isStreamedSnapshot(); - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java deleted file mode 100644 index 1a3722730c..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/ITraceInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * <p> - * Interface for retrieve trace comon information. - * </p> - * - * @author Bernd Hufmann - */ -public interface ITraceInfo { - /** - * @return the name of the information element. - */ - String getName(); - - /** - * Sets the name of the information element. - * - * @param name - * The name to assign - */ - void setName(String name); - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java deleted file mode 100644 index 843028bf9d..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/IUstProviderInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.util.List; - -/** - * <p> - * Interface for retrieval of UST provider information. - * </p> - * - * @author Bernd Hufmann - */ -public interface IUstProviderInfo extends ITraceInfo { - - /** - * @return the process ID of the UST provider. - */ - int getPid(); - - /** - * Sets the process ID of the UST provider to the given value. - * @param pid - process ID to set - */ - void setPid(int pid); - - /** - * @return all event information as array. - */ - IBaseEventInfo[] getEvents(); - - /** - * Sets the event information specified by given list. - * @param events - all event information to set. - */ - void setEvents(List<IBaseEventInfo> events); - - /** - * Adds a single event information. - * @param event - event information to add. - */ - void addEvent(IBaseEventInfo event); -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java deleted file mode 100644 index 7f6f2cef50..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/LogLevelType.java +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - *********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - * Type of log Level enumeration. - * - * @author Bernd Hufmann - */ -public enum LogLevelType { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** range of log levels [0,logLevel] */ - LOGLEVEL("<=", "RANGE"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** all log level */ - LOGLEVEL_ALL("", "ALL"), //$NON-NLS-1$//$NON-NLS-2$ - - /** single log level */ - LOGLEVEL_ONLY("==", "SINGLE"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** no log level */ - LOGLEVEL_NONE("", "UNKNOWN"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private LogLevelType(String shortName, String miName) { - fShortName = shortName; - fMiName = miName; - } - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fShortName; - private final String fMiName; - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return short string - */ - public String getShortName() { - return fShortName; - } - - /** - * @return machine interface name string - */ - public String getMiName() { - return fMiName; - } - - // ------------------------------------------------------------------------ - // Utility - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link LogLevelType} to String "name" - * - * @param name - * String to compare to retrieve the good LogLevelType - * @return the corresponding {@link LogLevelType} - */ - public static LogLevelType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (LogLevelType lltype : LogLevelType.values()) { - if (!lltype.equals(LOGLEVEL_NONE)) { - boolean isEqual = lltype.fShortName.equalsIgnoreCase(name) || lltype.fMiName.equalsIgnoreCase(name); - if (isEqual) { - return lltype; - } - } - } - - // No match - return LogLevelType.LOGLEVEL_NONE; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java deleted file mode 100644 index 5a023155b2..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TargetNodeState.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * <p> - * Enumeration for the node connection state. - * </p> - * - * @author Bernd Hufmann - */ -public enum TargetNodeState { - /** State when disconnected */ - DISCONNECTED, - /** State while disconnecting */ - DISCONNECTING, - /** State when connected */ - CONNECTED, - /** State while connecting */ - CONNECTING; -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java deleted file mode 100644 index 7e53f81f96..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceChannelOutputType.java +++ /dev/null @@ -1,74 +0,0 @@ -/********************************************************************** - * Copyright (c) 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Rajotte - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace domain type enumeration. - * - * @author Jonathan Rajotte - */ -public enum TraceChannelOutputType { - /** Channel output type : splice */ - SPLICE("splice()", "SPLICE" ), //$NON-NLS-1$ //$NON-NLS-2$ - /** Channel output type : mmap */ - MMAP("mmap()", "MMAP"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Channel output type : unknown */ - UNKNOWN("unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$ - - private final String fInName; - private final String fInMiName; - - private TraceChannelOutputType(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInMiName() { - return fInMiName; - } - - /** - * Return the corresponding {@link TraceChannelOutputType} of string miName - * - * @param name - * name of the Trace domain type to look for - * @return the corresponding {@link TraceChannelOutputType} - */ - public static TraceChannelOutputType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceChannelOutputType tdType : TraceChannelOutputType.values()) { - boolean isEqual = tdType.getInName().equalsIgnoreCase(name) || tdType.getInMiName().equalsIgnoreCase(name); - if (isEqual) { - return tdType; - } - } - // Unknown domain - return UNKNOWN; - } -}
\ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java deleted file mode 100644 index de52919b66..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceDomainType.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** - * Copyright (c) 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Rajotte - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace domain type enumeration. - * - * @author Jonathan Rajotte - */ -public enum TraceDomainType { - /** Domain type : ust */ - UST("ust"), //$NON-NLS-1$ - /** Domain type : kernel */ - KERNEL("kernel"), //$NON-NLS-1$ - /** Domain type : jul */ - JUL("jul"), //$NON-NLS-1$ - /** Unknown domain type */ - UNKNOWN("Unknown domain type"); //$NON-NLS-1$ - - private final String fInName; - - private TraceDomainType(String name) { - fInName = name; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Return the corresponding {@link TraceDomainType} of string miName - * - * @param miName - * name of the Trace domain type to look for - * @return the corresponding {@link TraceDomainType} - */ - public static TraceDomainType valueOfString(String miName) { - if (miName == null) { - throw new IllegalArgumentException(); - } - for (TraceDomainType tdType : TraceDomainType.values()) { - if (tdType.getInName().equalsIgnoreCase(miName)) { - return tdType; - } - } - // Unknown domain - return UNKNOWN; - } -}
\ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java deleted file mode 100644 index a9583e3f29..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEnablement.java +++ /dev/null @@ -1,91 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Machine interface support and utility function - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -import java.security.InvalidParameterException; - -/** - * Enumeration for enabled/disabled states. - * - * @author Bernd Hufmann - */ -public enum TraceEnablement { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Tracing is disabled */ - DISABLED("disabled", "false"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Tracing is enabled */ - ENABLED("enabled", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum - */ - private final String fInName; - private final String fInMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceEnablement(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return state name - */ - public String getInMiName() { - return fInMiName; - } - - /** - * @param name - * name of the desired enum - * @return the corresponding {@link TraceEnablement} matching name - */ - public static TraceEnablement valueOfString(String name) { - if (name == null) { - throw new InvalidParameterException(); - } - for (TraceEnablement enablementType : TraceEnablement.values()) { - boolean exist = enablementType.fInName.equalsIgnoreCase(name) || enablementType.fInMiName.equalsIgnoreCase(name); - if (exist) { - return enablementType; - } - } - return DISABLED; - } - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java deleted file mode 100644 index f77e9201f4..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceEventType.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Trace event type enumeration. - * - * @author Bernd Hufmann - */ -public enum TraceEventType { - /** Event type: tracepoint */ - TRACEPOINT("tracepoint"), //$NON-NLS-1$ - /** Event type: syscall */ - SYSCALL("syscall"), //$NON-NLS-1$ - /** Event type: probe */ - PROBE("probe"), //$NON-NLS-1$ - /** Event type: function */ - FUNCTION("function"), //$NON-NLS-1$ - /** Event type unknown */ - UNKNOWN("unknown"); //$NON-NLS-1$ - - private final String fInName; - - private TraceEventType(String name) { - fInName = name; - } - - /** - * Get the type's name - * - * @return The type's name - */ - public String getInName() { - return fInName; - } - - /** - * Return the corresponding {@link TraceEventType} of string miName - * - * @param name - * name of the {@link TraceEventType} to look for - * @return the corresponding {@link TraceEventType} - */ - public static TraceEventType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceEventType teType : TraceEventType.values()) { - if (teType.getInName().equalsIgnoreCase(name)) { - return teType; - } - } - return UNKNOWN; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java deleted file mode 100644 index 465312d84a..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceLogLevel.java +++ /dev/null @@ -1,114 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - Utility function - *********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - - -/** - * Log Level enumeration. - * - * @author Bernd Hufmann - */ -@SuppressWarnings("nls") -public enum TraceLogLevel { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Log level 0 */ - TRACE_EMERG("TRACE_EMERG"), - /** Log level 1 */ - TRACE_ALERT("TRACE_ALERT"), - /** Log level 2 */ - TRACE_CRIT("TRACE_CRIT"), - /** Log level 3 */ - TRACE_ERR("TRACE_ERR"), - /** Log level 4 */ - TRACE_WARNING("TRACE_WARNING"), - /** Log level 5 */ - TRACE_NOTICE("TRACE_NOTICE"), - /** Log level 6 */ - TRACE_INFO("TRACE_INFO"), - /** Log level 7 */ - TRACE_DEBUG_SYSTEM("TRACE_DEBUG_SYSTEM"), - /** Log level 8 */ - TRACE_DEBUG_PROGRAM("TRACE_DEBUG_PROGRAM"), - /** Log level 9 */ - TRACE_DEBUG_PROCESS("TRACE_DEBUG_PROCESS"), - /** Log level 10 */ - TRACE_DEBUG_MODULE("TRACE_DEBUG_MODULE"), - /** Log level 11 */ - TRACE_DEBUG_UNIT("TRACE_DEBUG_UNIT"), - /** Log level 12 */ - TRACE_DEBUG_FUNCTION("TRACE_DEBUG_FUNCTION"), - /** Log level 13 */ - TRACE_DEBUG_LINE("TRACE_DEBUG_LINE"), - /** Log level 14 */ - TRACE_DEBUG("TRACE_DEBUG"), - /** Log level 15 */ - LEVEL_UNKNOWN("LEVEL_UNKNOWN"); - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fInName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceLogLevel(String name) { - fInName = name; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - // ------------------------------------------------------------------------ - // Utility - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link TraceLogLevel} to String "name" - * - * @param name - * String to compare to retrieve the good {@link TraceLogLevel} - * @return the corresponding {@link TraceLogLevel} - */ - public static TraceLogLevel valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (TraceLogLevel tllevel : TraceLogLevel.values()) { - if (tllevel.getInName().equalsIgnoreCase(name)) { - return tllevel; - } - } - // No match - return LEVEL_UNKNOWN; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java deleted file mode 100644 index 4473a11d67..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/TraceSessionState.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Jonathan Rajotte - machine interface support and utility function - *********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model; - -/** - * Session state enumeration. - * - * @author Bernd Hufmann - */ -public enum TraceSessionState { - - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** Trace session inactive */ - INACTIVE("inactive", "false"), //$NON-NLS-1$ //$NON-NLS-2$ - /** Trace session active */ - ACTIVE("active", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum. - */ - private final String fInName; - private final String fMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private TraceSessionState(String name, String miName) { - fInName = name; - fMiName = miName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return the machine interface name - */ - public String getfMiName() { - return fMiName; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * Return the corresponding {@link TraceSessionState} to String "name" - * - * @param name - * String to compare to retrieve the good - * {@link TraceSessionState} - * @return the corresponding {@link TraceSessionState} - */ - public static TraceSessionState valueOfString(String name) { - if (name == null) { - return INACTIVE; - } - for (TraceSessionState tst : TraceSessionState.values()) { - boolean isEqual = tst.fInName.equalsIgnoreCase(name) || tst.fMiName.equalsIgnoreCase(name); - if (isEqual) { - return tst; - } - } - // No match - return INACTIVE; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java deleted file mode 100644 index 217891138c..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BaseEventInfo.java +++ /dev/null @@ -1,223 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEventType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceLogLevel; - -/** -* <p> -* Implementation of the basic trace event interface (IEventInfo) to store event -* related data. -* </p> -* -* @author Bernd Hufmann -*/ -public class BaseEventInfo extends TraceInfo implements IBaseEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace event type. - */ - private TraceEventType fEventType = TraceEventType.UNKNOWN; - /** - * The trace log level. - */ - private TraceLogLevel fLogLevel = TraceLogLevel.TRACE_DEBUG; - /** - * The Event fields - */ - private final List<IFieldInfo> fFields = new ArrayList<>(); - /** - * The filter expression. - */ - private String fFilterExpression; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public BaseEventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public BaseEventInfo(BaseEventInfo other) { - super(other); - fEventType = other.fEventType; - fLogLevel = other.fLogLevel; - for (Iterator<IFieldInfo> iterator = other.fFields.iterator(); iterator.hasNext();) { - IFieldInfo field = iterator.next(); - if (field instanceof FieldInfo) { - fFields.add(new FieldInfo((FieldInfo)field)); - } else { - fFields.add(field); - } - } - fFilterExpression = other.fFilterExpression; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceEventType getEventType() { - return fEventType; - } - - @Override - public void setEventType(TraceEventType type) { - fEventType = type; - } - - @Override - public void setEventType(String typeName) { - if(TraceEventType.TRACEPOINT.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.TRACEPOINT; - } else if(TraceEventType.SYSCALL.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.SYSCALL; - } else if (TraceEventType.PROBE.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.PROBE; - } else if (TraceEventType.FUNCTION.getInName().equalsIgnoreCase(typeName)) { - fEventType = TraceEventType.FUNCTION; - } else { - fEventType = TraceEventType.UNKNOWN; - } - } - - @Override - public TraceLogLevel getLogLevel() { - return fLogLevel; - } - - @Override - public void setLogLevel(TraceLogLevel level) { - fLogLevel = level; - } - - @Override - public void setLogLevel(String levelName) { - fLogLevel = TraceLogLevel.valueOfString(levelName); - } - - @Override - public IFieldInfo[] getFields() { - return fFields.toArray(new IFieldInfo[fFields.size()]); - } - - @Override - public void addField(IFieldInfo field) { - fFields.add(field); - } - - @Override - public void setFields(List<IFieldInfo> fields) { - fFields.clear(); - for (Iterator<IFieldInfo> iterator = fields.iterator(); iterator.hasNext();) { - IFieldInfo fieldInfo = iterator.next(); - fFields.add(fieldInfo); - } - } - - @Override - public String getFilterExpression() { - return fFilterExpression; - } - - @Override - public void setFilterExpression(String filter) { - fFilterExpression = filter; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fEventType == null) ? 0 : fEventType.hashCode()); - result = prime * result + fFields.hashCode(); - result = prime * result + ((fFilterExpression == null) ? 0 : fFilterExpression.hashCode()); - result = prime * result + ((fLogLevel == null) ? 0 : fLogLevel.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - BaseEventInfo other = (BaseEventInfo) obj; - if (fEventType != other.fEventType) { - return false; - } - if (!fFields.equals(other.fFields)) { - return false; - } - if (fFilterExpression == null) { - if (other.fFilterExpression != null) { - return false; - } - } else if (!fFilterExpression.equals(other.fFilterExpression)) { - return false; - } - if (fLogLevel != other.fLogLevel) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[BaseEventInfo("); - output.append(super.toString()); - output.append(",type="); - output.append(fEventType); - output.append(",level="); - output.append(fLogLevel); - if (!fFields.isEmpty()) { - output.append(",Fields="); - for (Iterator<IFieldInfo> iterator = fFields.iterator(); iterator.hasNext();) { - IFieldInfo field = iterator.next(); - output.append(field.toString()); - } - } - if (fFilterExpression != null) { - output.append(",Filter="); - output.append(fFilterExpression); - } - output.append(")]"); - return output.toString(); - } - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java deleted file mode 100644 index 6f67292274..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/BufferType.java +++ /dev/null @@ -1,116 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Simon Delisle - Initial API and implementation - * Bernd Hufmann - Updated to enum definition - * Jonathan Rajotte - Updated enum definition for lttng machine interface - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -/** - * Constants for buffer type. - * - * @author Simon Delisle - * @author Bernd Hufmann - */ - -public enum BufferType { - // ------------------------------------------------------------------------ - // Enum definition - // ------------------------------------------------------------------------ - /** - * Buffer type : per UID - */ - BUFFER_PER_UID("per UID", "PER_UID"), //$NON-NLS-1$ //$NON-NLS-2$ - /** - * Buffer type : per PID - */ - BUFFER_PER_PID("per PID", "PER_PID"), //$NON-NLS-1$ //$NON-NLS-2$ - /** - * Buffer type : shared - */ - BUFFER_SHARED("shared"), //$NON-NLS-1$ - /** - * If the LTTng version doesn't show the buffer type - */ - BUFFER_TYPE_UNKNOWN("information not unavailable"); //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * Name of enum - */ - private final String fInName; - - /** - * Name of the machine interface enum - */ - private final String fInMiName; - - // ------------------------------------------------------------------------ - // Constuctors - // ------------------------------------------------------------------------ - - /** - * Private constructor - * - * @param name - * the name of state - */ - private BufferType(String name, String miName) { - fInName = name; - fInMiName = miName; - } - - private BufferType(String name) { - fInName = name; - fInMiName = ""; //$NON-NLS-1$ - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - /** - * @return state name - */ - public String getInName() { - return fInName; - } - - /** - * @return machine interface buffer name - */ - public String getInMiName() { - return fInMiName; - } - - // / - // ------------------------------------------------------------------------ - // Utility function - // ------------------------------------------------------------------------- - /** - * @param name - * the string representation of the type - * @return enum BufferType of the corresponding type - */ - public static BufferType valueOfString(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - for (BufferType bufferType : BufferType.values()) { - boolean isEqual = bufferType.getInName().equalsIgnoreCase(name) || bufferType.getInMiName().equalsIgnoreCase(name); - if (isEqual) { - return bufferType; - } - } - return BUFFER_TYPE_UNKNOWN; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java deleted file mode 100644 index 6e2f626992..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ChannelInfo.java +++ /dev/null @@ -1,353 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Simon Delisle - Updated for support of LTTng Tools 2.2 - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceChannelOutputType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; - -/** - * Implementation of the trace channel interface (IChannelInfo) to store channel - * related data. - * - * @author Bernd Hufmann - */ -public class ChannelInfo extends TraceInfo implements IChannelInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The overwrite mode of the channel. - */ - private boolean fOverwriteMode; - /** - * The sub-buffer size of the channel. - */ - private long fSubBufferSize; - /** - * The number of sub-buffers of the channel. - */ - private int fNumberOfSubBuffers; - /** - * The switch timer interval of the channel. - */ - private long fSwitchTimer; - /** - * The read timer interval of the channel. - */ - private long fReadTimer; - /** - * The Output type of the channel. - */ - private TraceChannelOutputType fOutputType = TraceChannelOutputType.UNKNOWN; - /** - * The channel enable state. - */ - private TraceEnablement fState = TraceEnablement.DISABLED; - /** - * The events information of the channel. - */ - private final List<IEventInfo> fEvents = new ArrayList<>(); - /** - * The maximum size of trace files - */ - private int fMaxSizeTraceFiles; - /** - * The maximum number of trace files - */ - private int fMaxNumberTraceFiles; - /** - * The value of buffer type - */ - private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name channel - */ - public ChannelInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public ChannelInfo(ChannelInfo other) { - super(other); - fOverwriteMode = other.fOverwriteMode; - fSubBufferSize = other.fSubBufferSize; - fNumberOfSubBuffers = other.fNumberOfSubBuffers; - fSwitchTimer = other.fSwitchTimer; - fReadTimer = other.fReadTimer; - fMaxSizeTraceFiles = other.fMaxSizeTraceFiles; - fMaxNumberTraceFiles = other.fMaxNumberTraceFiles; - fBufferType = other.fBufferType; - fOutputType = (other.fOutputType == null ? null : other.fOutputType); - fState = other.fState; - for (Iterator<IEventInfo> iterator = other.fEvents.iterator(); iterator.hasNext();) { - IEventInfo event = iterator.next(); - if (event instanceof EventInfo) { - fEvents.add(new EventInfo((EventInfo) event)); - } else { - fEvents.add(event); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public boolean isOverwriteMode() { - return fOverwriteMode; - } - - @Override - public void setOverwriteMode(boolean mode) { - fOverwriteMode = mode; - } - - @Override - public long getSubBufferSize() { - return fSubBufferSize; - } - - @Override - public void setSubBufferSize(long bufferSize) { - fSubBufferSize = bufferSize; - } - - @Override - public int getNumberOfSubBuffers() { - return fNumberOfSubBuffers; - } - - @Override - public void setNumberOfSubBuffers(int numberOfSubBuffers) { - fNumberOfSubBuffers = numberOfSubBuffers; - } - - @Override - public long getSwitchTimer() { - return fSwitchTimer; - } - - @Override - public void setSwitchTimer(long timer) { - fSwitchTimer = timer; - } - - @Override - public long getReadTimer() { - return fReadTimer; - } - - @Override - public void setReadTimer(long timer) { - fReadTimer = timer; - } - - @Override - public TraceChannelOutputType getOutputType() { - return fOutputType; - } - - @Override - public void setOutputType(String type) { - fOutputType = TraceChannelOutputType.valueOfString(type); - } - - @Override - public void setOutputType(TraceChannelOutputType type) { - fOutputType = type; - } - - @Override - public TraceEnablement getState() { - return fState; - } - - @Override - public void setState(TraceEnablement state) { - fState = state; - } - - @Override - public void setState(String stateName) { - fState = TraceEnablement.valueOfString(stateName); - } - - @Override - public IEventInfo[] getEvents() { - return fEvents.toArray(new IEventInfo[fEvents.size()]); - } - - @Override - public void setEvents(List<IEventInfo> events) { - fEvents.clear(); - for (Iterator<IEventInfo> iterator = events.iterator(); iterator.hasNext();) { - IEventInfo eventInfo = iterator.next(); - fEvents.add(eventInfo); - } - } - - @Override - public void addEvent(IEventInfo channel) { - fEvents.add(channel); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fEvents.hashCode(); - result = prime * result + fNumberOfSubBuffers; - result = prime * result + ((fOutputType == null) ? 0 : fOutputType.hashCode()); - result = prime * result + (fOverwriteMode ? 1231 : 1237); - result = prime * result + (int) (fReadTimer ^ (fReadTimer >>> 32)); - result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); - result = prime * result + (int) (fSubBufferSize ^ (fSubBufferSize >>> 32)); - result = prime * result + (int) (fSwitchTimer ^ (fSwitchTimer >>> 32)); - result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ChannelInfo other = (ChannelInfo) obj; - if (!fEvents.equals(other.fEvents)) { - return false; - } - if (fNumberOfSubBuffers != other.fNumberOfSubBuffers) { - return false; - } - if (fOutputType == null) { - if (other.fOutputType != null) { - return false; - } - } else if (!fOutputType.equals(other.fOutputType)) { - return false; - } - if (fOverwriteMode != other.fOverwriteMode) { - return false; - } - if (fReadTimer != other.fReadTimer) { - return false; - } - if (fState != other.fState) { - return false; - } - if (fSubBufferSize != other.fSubBufferSize) { - return false; - } - if (fSwitchTimer != other.fSwitchTimer) { - return false; - } - if (fBufferType != other.fBufferType) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[ChannelInfo("); - output.append(super.toString()); - output.append(",State="); - output.append(fState); - output.append(",OverwriteMode="); - output.append(fOverwriteMode); - output.append(",SubBuffersSize="); - output.append(fSubBufferSize); - output.append(",NumberOfSubBuffers="); - output.append(fNumberOfSubBuffers); - output.append(",SwitchTimer="); - output.append(fSwitchTimer); - output.append(",ReadTimer="); - output.append(fReadTimer); - output.append(",output="); - output.append(fOutputType.getInName()); - if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { - output.append(",BufferType="); - output.append(fBufferType); - } - output.append(",Events="); - if (fEvents.isEmpty()) { - output.append("None"); - } else { - for (Iterator<IEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) { - IEventInfo event = iterator.next(); - output.append(event.toString()); - } - } - output.append(")]"); - return output.toString(); - } - - @Override - public void setMaxSizeTraceFiles(int maxSizeTraceFiles) { - fMaxSizeTraceFiles = maxSizeTraceFiles; - } - - @Override - public void setMaxNumberTraceFiles(int maxNumberTraceFiles) { - fMaxNumberTraceFiles = maxNumberTraceFiles; - } - - @Override - public int getMaxSizeTraceFiles() { - return fMaxSizeTraceFiles; - } - - @Override - public int getMaxNumberTraceFiles() { - return fMaxNumberTraceFiles; - } - - @Override - public void setBufferType(BufferType bufferType) { - fBufferType = bufferType; - } - - @Override - public BufferType getBufferType() { - return fBufferType; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java deleted file mode 100644 index c378e125f0..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/DomainInfo.java +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IChannelInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; - -/** - * <p> - * Implementation of the trace domain interface (IDomainInfo) to store domain - * related data. - * </p> - * - * @author Bernd Hufmann - */ -public class DomainInfo extends TraceInfo implements IDomainInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The channels information of the domain. - */ - private final List<IChannelInfo> fChannels = new ArrayList<>(); - private boolean fIsKernel = false; - private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of domain - */ - public DomainInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public DomainInfo(DomainInfo other) { - super(other); - for (int i = 0; i < other.fChannels.size(); i++) { - if (other.fChannels.get(i) instanceof ChannelInfo) { - fChannels.add(new ChannelInfo((ChannelInfo)other.fChannels.get(i))); - } else { - fChannels.add(other.fChannels.get(i)); - } - } - fIsKernel = other.fIsKernel; - fBufferType = other.fBufferType; - } - - @Override - public boolean isKernel() { - return fIsKernel; - } - - @Override - public void setIsKernel(boolean isKernel) { - fIsKernel = isKernel; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public IChannelInfo[] getChannels() { - return fChannels.toArray(new IChannelInfo[fChannels.size()]); - } - - @Override - public void setChannels(List<IChannelInfo> channels) { - fChannels.clear(); - for (Iterator<IChannelInfo> iterator = channels.iterator(); iterator.hasNext();) { - IChannelInfo channelInfo = iterator.next(); - fChannels.add(channelInfo); - } - } - - @Override - public void addChannel(IChannelInfo channel) { - fChannels.add(channel); - } - - @Override - public int hashCode() { - final int prime = 31; - 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; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - DomainInfo other = (DomainInfo) obj; - if (!fChannels.equals(other.fChannels)) { - return false; - } - if (fIsKernel != other.fIsKernel) { - return false; - } - if (fBufferType != other.fBufferType) { - return false; - } - return true; - } - - @Override - public BufferType getBufferType() { - if (fIsKernel) { - return BufferType.BUFFER_SHARED; - } - return fBufferType; - } - - @Override - public void setBufferType(BufferType bufferType) { - fBufferType = bufferType; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[DomainInfo("); - output.append(super.toString()); - output.append(",Channels="); - if (fChannels.isEmpty()) { - output.append("None"); - } else { - for (Iterator<IChannelInfo> iterator = fChannels.iterator(); iterator.hasNext();) { - IChannelInfo channel = iterator.next(); - output.append(channel.toString()); - } - } - output.append(",isKernel="); - output.append(String.valueOf(fIsKernel)); - if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) { - output.append(",BufferType="); - output.append(fBufferType); - } - output.append(")]"); - return output.toString(); - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java deleted file mode 100644 index 1de851095f..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/EventInfo.java +++ /dev/null @@ -1,139 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.LogLevelType; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceEnablement; - -/** -* <p> -* Implementation of the trace event interface (IEventInfo) to store event -* related data. -* </p> -* -* @author Bernd Hufmann -*/ -public class EventInfo extends BaseEventInfo implements IEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The enable state of the event. - */ - private TraceEnablement fState = TraceEnablement.DISABLED; - /** - * The log level type. - */ - private LogLevelType fLogLevelType = LogLevelType.LOGLEVEL_NONE; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of event - */ - public EventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public EventInfo(EventInfo other) { - super(other); - fState = other.fState; - fLogLevelType = other.fLogLevelType; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceEnablement getState() { - return fState; - } - - @Override - public void setState(TraceEnablement state) { - fState = state; - } - - @Override - public void setState(String stateName) { - fState = TraceEnablement.valueOfString(stateName); - } - - @Override - public LogLevelType getLogLevelType() { - return fLogLevelType; - } - - @Override - public void setLogLevelType(LogLevelType type) { - fLogLevelType = type; - } - - @Override - public void setLogLevelType(String shortName) { - fLogLevelType = LogLevelType.valueOfString(shortName); - } - - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fState == null) ? 0 : (fState.ordinal() + 1)); - result = prime * result + ((fLogLevelType == null) ? 0 : fLogLevelType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - EventInfo other = (EventInfo) obj; - if (fState != other.fState) { - return false; - } - if (fLogLevelType != other.fLogLevelType) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[EventInfo("); - output.append(super.toString()); - output.append(",State="); - output.append(fState); - output.append(",levelType="); - output.append(fLogLevelType); - output.append(")]"); - return output.toString(); - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java deleted file mode 100644 index 0ad2ceb42a..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/FieldInfo.java +++ /dev/null @@ -1,109 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IFieldInfo; - -/** -* <p> -* Implementation of the basic trace event interface (IEventInfo) to store event -* related data. -* </p> -* -* @author Bernd Hufmann -*/ -public class FieldInfo extends TraceInfo implements IFieldInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace event type. - */ - private String fFieldType; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public FieldInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public FieldInfo(FieldInfo other) { - super(other); - fFieldType = other.fFieldType; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getFieldType() { - return fFieldType; - } - - @Override - public void setFieldType(String fieldType) { - fFieldType = fieldType.toLowerCase(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result - + ((fFieldType == null) ? 0 : fFieldType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - FieldInfo other = (FieldInfo) obj; - if (fFieldType == null) { - if (other.fFieldType != null) { - return false; - } - } else if (!fFieldType.equals(other.fFieldType)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[FieldInfo("); - output.append(super.toString()); - output.append(",type="); - output.append(fFieldType); - return output.toString(); - } -}
\ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java deleted file mode 100644 index 69068ee8c9..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java +++ /dev/null @@ -1,187 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo; - -/** - * Implementation of the trace event interface (IProbeEventInfo) to store probe - * event related data. - * - * @author Bernd Hufmann - */ -public class ProbeEventInfo extends EventInfo implements IProbeEventInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The dynamic probe address (null if symbol is used). - */ - private String fAddress; - /** - * The dynamic probe offset (if symbol is used). - */ - private String fOffset; - - /** - * The symbol name (null if address is used) - */ - private String fSymbol; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name of event - */ - public ProbeEventInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public ProbeEventInfo(ProbeEventInfo other) { - super(other); - fAddress = other.fAddress; - fOffset = other.fOffset; - fSymbol = other.fSymbol; - } - - /** - * Constructor from a {@link IEventInfo} - * - * @param eventInfo - * - the instance to copy - */ - public ProbeEventInfo(IEventInfo eventInfo) { - super(eventInfo.getName()); - setState(eventInfo.getState()); - setLogLevelType(eventInfo.getLogLevelType()); - setLogLevel(eventInfo.getLogLevel()); - setFilterExpression(eventInfo.getFilterExpression()); - setEventType(eventInfo.getEventType()); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getAddress() { - return fAddress; - } - - @Override - public void setAddress(String address) { - fAddress = address; - } - - @Override - public String getOffset() { - return fOffset; - } - - @Override - public void setOffset(String offset) { - fOffset = offset; - } - - @Override - public String getSymbol() { - return fSymbol; - } - - @Override - public void setSymbol(String symbol) { - fSymbol = symbol; - } - - // ------------------------------------------------------------------------ - // Operation - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((fAddress == null) ? 0 : fAddress.hashCode()); - result = prime * result + ((fOffset == null) ? 0 : fOffset.hashCode()); - result = prime * result + ((fSymbol == null) ? 0 : fSymbol.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ProbeEventInfo other = (ProbeEventInfo) obj; - if (fAddress == null) { - if (other.fAddress != null) { - return false; - } - } else if (!fAddress.equals(other.fAddress)) { - return false; - } - if (fOffset == null) { - if (other.fOffset != null) { - return false; - } - } else if (!fOffset.equals(other.fOffset)) { - return false; - } - if (fSymbol == null) { - if (other.fSymbol != null) { - return false; - } - } else if (!fSymbol.equals(other.fSymbol)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[ProbeEventInfo("); - output.append(super.toString()); - if (fAddress != null) { - output.append(",fAddress="); - output.append(fAddress); - } else { - output.append(",fOffset="); - output.append(fOffset); - output.append(",fSymbol="); - output.append(fSymbol); - } - output.append(")]"); - return output.toString(); - } - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java deleted file mode 100644 index 9f2789357c..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SessionInfo.java +++ /dev/null @@ -1,333 +0,0 @@ -/********************************************************************** - - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - * Bernd Hufmann - Updated for support of LTTng Tools 2.1 - * Marc-Andre Laperle - Support for creating a live session - **********************************************************************/ - -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IDomainInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.TraceSessionState; - -/** - * Implementation of the trace session interface (ISessionInfo) to store session - * related data. - * - * @author Bernd Hufmann - */ -public class SessionInfo extends TraceInfo implements ISessionInfo { - - /** - * The default network URL when creating a live session. - */ - public static final String DEFAULT_LIVE_NETWORK_URK = "net://127.0.0.1"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The trace session state. - */ - private TraceSessionState fState = TraceSessionState.INACTIVE; - /** - * The trace session path for storing traces. - */ - private String fSessionPath = ""; //$NON-NLS-1$ - /** - * The domains information of this session. - */ - private final List<IDomainInfo> fDomains = new ArrayList<>(); - /** - * Flag to indicate whether trace is streamed over network or not. - */ - private boolean fIsStreamedTrace = false; - /** - * Flag to indicate whether the session is a snapshot session or not. - */ - private boolean fIsSnapshot = false; - /** - * The snapshot information of the session - */ - private ISnapshotInfo fSnapshotInfo = null; - /** - * The network URL for the session (-U) - */ - private String fNetworkUrl = null; - /** - * The control URL for the session (-C) - */ - private String fControlUrl = null; - /** - * The data URL for the session (-D) - */ - private String fDataUrl = null; - - /** - * Flag to indicate whether trace is live or not. - */ - private boolean fIsLive = false; - - /** - * The delay in micro seconds before the data is flushed and streamed. - */ - private int fLiveDelay = -1; - - /** - * The live connection url (Relayd). - */ - private String fLiveUrl; - - /** - * The live connection port (Relayd). - */ - private Integer fLivePort; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * - * @param name - * - name of base event - */ - public SessionInfo(String name) { - super(name); - } - - /** - * Copy constructor - * - * @param other - * - the instance to copy - */ - public SessionInfo(SessionInfo other) { - super(other); - fState = other.fState; - fSessionPath = other.fSessionPath; - fIsStreamedTrace = other.fIsStreamedTrace; - fIsSnapshot = other.fIsSnapshot; - fSnapshotInfo = other.fSnapshotInfo; - fNetworkUrl = other.fNetworkUrl; - fControlUrl = other.fControlUrl; - fDataUrl = other.fDataUrl; - - for (Iterator<IDomainInfo> iterator = other.fDomains.iterator(); iterator.hasNext();) { - IDomainInfo domain = iterator.next(); - if (domain instanceof DomainInfo) { - fDomains.add(new DomainInfo((DomainInfo) domain)); - } else { - fDomains.add(domain); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public TraceSessionState getSessionState() { - return fState; - } - - @Override - public void setSessionState(TraceSessionState state) { - fState = state; - } - - @Override - public void setSessionState(String stateName) { - fState = TraceSessionState.valueOfString(stateName); - } - - @Override - public String getSessionPath() { - if (isSnapshotSession() && fSnapshotInfo != null) { - return fSnapshotInfo.getSnapshotPath(); - } - return fSessionPath; - } - - @Override - public void setSessionPath(String path) { - fSessionPath = path; - } - - @Override - public IDomainInfo[] getDomains() { - return fDomains.toArray(new IDomainInfo[fDomains.size()]); - } - - @Override - public void setDomains(List<IDomainInfo> domains) { - fDomains.clear(); - for (Iterator<IDomainInfo> iterator = domains.iterator(); iterator.hasNext();) { - IDomainInfo domainInfo = iterator.next(); - fDomains.add(domainInfo); - } - } - - @Override - public boolean isStreamedTrace() { - if (isSnapshotSession() && getSnapshotInfo() != null) { - return getSnapshotInfo().isStreamedSnapshot(); - } - return fIsStreamedTrace; - } - - @Override - public void setStreamedTrace(boolean isStreamedTrace) { - fIsStreamedTrace = isStreamedTrace; - } - - @Override - public boolean isSnapshotSession() { - return fIsSnapshot || fSnapshotInfo != null; - } - - @Override - public void setSnapshot(boolean isSnapshot) { - fIsSnapshot = isSnapshot; - } - - @Override - public ISnapshotInfo getSnapshotInfo() { - return fSnapshotInfo; - } - - @Override - public void setSnapshotInfo(ISnapshotInfo info) { - fSnapshotInfo = info; - } - - @Override - public boolean isLive() { - return fIsLive; - } - - @Override - public void setLive(boolean isLive) { - fIsLive = isLive; - } - - @Override - public int getLiveDelay() { - return fLiveDelay; - } - - @Override - public void setLiveDelay(int liveDelay) { - fLiveDelay = liveDelay; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public void addDomain(IDomainInfo domainInfo) { - fDomains.add(domainInfo); - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[SessionInfo("); - output.append(super.toString()); - output.append(",Path="); - output.append(getSessionPath()); - output.append(",State="); - output.append(fState); - output.append(",isStreamedTrace="); - output.append(fIsStreamedTrace); - output.append(",isSnapshot="); - output.append(fIsSnapshot); - - if (fSnapshotInfo != null) { - output.append(",snapshotInfo="); - output.append(fSnapshotInfo.toString()); - } - output.append(",Domains="); - for (Iterator<IDomainInfo> iterator = fDomains.iterator(); iterator.hasNext();) { - IDomainInfo domain = iterator.next(); - output.append(domain.toString()); - } - - output.append(",NetworkUrl="); - output.append(getNetworkUrl()); - output.append(",ControlUrl="); - output.append(getControlUrl()); - output.append(",DataUrl="); - output.append(getDataUrl()); - - output.append(")]"); - return output.toString(); - } - - @Override - public String getNetworkUrl() { - return fNetworkUrl; - } - - @Override - public void setNetworkUrl(String networkUrl) { - fNetworkUrl = networkUrl; - } - - @Override - public String getControlUrl() { - return fControlUrl; - } - - @Override - public void setControlUrl(String controlUrl) { - fControlUrl = controlUrl; - } - - @Override - public void setDataUrl(String datalUrl) { - fDataUrl = datalUrl; - } - - @Override - public String getDataUrl() { - return fDataUrl; - } - - @Override - public void setLiveUrl(String liveUrl) { - fLiveUrl = liveUrl; - } - - @Override - public void setLivePort(Integer livePort) { - fLivePort = livePort; - } - - @Override - public String getLiveUrl() { - return fLiveUrl; - } - - @Override - public Integer getLivePort() { - return fLivePort; - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java deleted file mode 100644 index f7aa791e0e..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/SnapshotInfo.java +++ /dev/null @@ -1,150 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISnapshotInfo; - -/** - * <p> - * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot - * related data. - * </p> - * - * @author Bernd Hufmann - */ -public class SnapshotInfo extends TraceInfo implements ISnapshotInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** The snapshot path for storing traces. */ - private String fPath = ""; //$NON-NLS-1$ - /** The snapshot ID */ - private int fId = -1; - /** Flag whether snapshot is stored over the network or locally */ - private boolean fIsStreamed = false; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of base event - */ - public SnapshotInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public SnapshotInfo(SnapshotInfo other) { - super(other); - fPath = other.fPath; - fId = other.fId; - fIsStreamed = other.fIsStreamed; - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getSnapshotPath() { - return fPath; - } - - @Override - public void setSnapshotPath(String path) { - fPath = path; - } - - @Override - public int getId() { - return fId; - } - - @Override - public void setId(int id) { - fId = id; - } - - @Override - public void setStreamedSnapshot(boolean isStreamed) { - fIsStreamed = isStreamed; - } - - @Override - public boolean isStreamedSnapshot() { - return fIsStreamed; - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fId; - result = prime * result + (fIsStreamed ? 1231 : 1237); - result = prime * result + ((fPath == null) ? 0 : fPath.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - SnapshotInfo other = (SnapshotInfo) obj; - if (fId != other.fId) { - return false; - } - if (fIsStreamed != other.fIsStreamed) { - return false; - } - if (fPath == null) { - if (other.fPath != null) { - return false; - } - } else if (!fPath.equals(other.fPath)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[SnapshotInfo("); - output.append(super.toString()); - output.append(",snapshotPath="); - output.append(fPath); - output.append(",ID="); - output.append(fId); - output.append(",isStreamedSnapshot="); - output.append(fIsStreamed); - output.append(")]"); - return output.toString(); - } - -} diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java deleted file mode 100644 index 65ef13b41b..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/TraceInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2013 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.ITraceInfo; - -/** - * <p> - * Implementation of the base trace information interface (ITraceInfo) to - * store common data. - * </p> - * - * @author Bernd Hufmann - */ -public class TraceInfo implements ITraceInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - /** - * The name of the element. - */ - private String fName = null; - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - /** - * Constructor - * @param name - name of trace element - */ - public TraceInfo(String name) { - if (name == null) { - throw new IllegalArgumentException(); - } - fName = name; - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public TraceInfo(TraceInfo other) { - if (other == null) { - throw new IllegalArgumentException(); - } - fName = String.valueOf(other.fName); - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public String getName() { - return fName; - } - - @Override - public void setName(String name) { - fName = name; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fName == null) ? 0 : fName.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - TraceInfo other = (TraceInfo) obj; - if (fName == null) { - if (other.fName != null) { - return false; - } - } else if (!fName.equals(other.fName)) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[TraceInfo("); - output.append("Name="); - output.append(getName()); - output.append(")]"); - return output.toString(); - } -}
\ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java b/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java deleted file mode 100644 index 7f33c8a150..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/UstProviderInfo.java +++ /dev/null @@ -1,162 +0,0 @@ -/********************************************************************** - * Copyright (c) 2012, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Bernd Hufmann - Initial API and implementation - **********************************************************************/ -package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IBaseEventInfo; -import org.eclipse.linuxtools.internal.lttng2.control.core.model.IUstProviderInfo; - -/** - * <p> - * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST - * provider related data. - * </p> - * - * @author Bernd Hufmann - */ -public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { - - // ------------------------------------------------------------------------ - // Attributes - // ------------------------------------------------------------------------ - - /** - * The process ID of the UST provider. - */ - private int fPid = 0; - - /** - * List of event information. - */ - private final List<IBaseEventInfo> fEvents = new ArrayList<>(); - - // ------------------------------------------------------------------------ - // Constructors - // ------------------------------------------------------------------------ - - /** - * Constructor - * @param name - name of UST provider - */ - public UstProviderInfo(String name) { - super(name); - } - - /** - * Copy constructor - * @param other - the instance to copy - */ - public UstProviderInfo(UstProviderInfo other) { - super(other); - fPid = other.fPid; - for (Iterator<IBaseEventInfo> iterator = other.fEvents.iterator(); iterator.hasNext();) { - IBaseEventInfo event = iterator.next(); - if (event instanceof BaseEventInfo) { - fEvents.add(new BaseEventInfo((BaseEventInfo)event)); - } else { - fEvents.add(event); - } - } - } - - // ------------------------------------------------------------------------ - // Accessors - // ------------------------------------------------------------------------ - - @Override - public int getPid() { - return fPid; - } - - @Override - public void setPid(int pid) { - fPid = pid; - } - - @Override - public IBaseEventInfo[] getEvents() { - return fEvents.toArray(new IBaseEventInfo[fEvents.size()]); - } - - @Override - public void setEvents(List<IBaseEventInfo> events) { - fEvents.clear(); - for (Iterator<IBaseEventInfo> iterator = events.iterator(); iterator.hasNext();) { - IBaseEventInfo eventInfo = iterator.next(); - fEvents.add(eventInfo); - } - } - - @Override - public void addEvent(IBaseEventInfo event) { - fEvents.add(event); - } - - // ------------------------------------------------------------------------ - // Operations - // ------------------------------------------------------------------------ - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + fEvents.hashCode(); - result = prime * result + fPid; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - UstProviderInfo other = (UstProviderInfo) obj; - if (!fEvents.equals(other.fEvents)) { - return false; - } - if (fPid != other.fPid) { - return false; - } - return true; - } - - @SuppressWarnings("nls") - @Override - public String toString() { - StringBuffer output = new StringBuffer(); - output.append("[EventInfo("); - output.append(super.toString()); - output.append(",PID="); - output.append(fPid); - output.append(",Events="); - if (fEvents.isEmpty()) { - output.append("None"); - } else { - for (Iterator<IBaseEventInfo> iterator = fEvents.iterator(); iterator.hasNext();) { - IBaseEventInfo event = iterator.next(); - output.append(event.toString()); - } - } - output.append(")]"); - return output.toString(); - } - -} |