tmf: Remove the ITmfEventTableColumns extension point
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.pcap.core / src / org / eclipse / tracecompass / internal / tmf / pcap / core / event / aspect / PcapDestinationAspect.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Vincent Perot - Initial API and implementation
11 * Alexandre Montplaisir - Update to new ITmfEventAspect API
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.internal.tmf.pcap.core.event.aspect;
15
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent;
18 import org.eclipse.tracecompass.internal.tmf.pcap.core.protocol.TmfPcapProtocol;
19 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
20 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
21
22 /**
23 * The "packet destination" aspect for pcap events.
24 *
25 * @author Alexandre Montplaisir
26 */
27 public class PcapDestinationAspect implements ITmfEventAspect {
28
29 @Override
30 public String getName() {
31 return Messages.getMessage(Messages.PcapAspectName_Destination);
32 }
33
34 @Override
35 public String getHelpText() {
36 return EMPTY_STRING;
37 }
38
39 @Override
40 public String resolve(ITmfEvent event) {
41 if (!(event instanceof PcapEvent)) {
42 return EMPTY_STRING;
43 }
44 PcapEvent pcapEvent = (PcapEvent) event;
45 TmfPcapProtocol protocol = pcapEvent.getMostEncapsulatedProtocol();
46
47 String ret = pcapEvent.getDestinationEndpoint(protocol);
48 return (ret == null ? EMPTY_STRING : ret);
49 }
50
51 @Override
52 public @NonNull String getFilterId() {
53 return PcapEvent.EVENT_FIELD_PACKET_DESTINATION;
54 }
55 }
This page took 0.032881 seconds and 5 git commands to generate.