Copyright header update, 2015 edition
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.pcap.core / src / org / eclipse / tracecompass / internal / tmf / pcap / core / event / aspect / PcapDestinationAspect.java
CommitLineData
b04903a2 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2014, 2015 Ericsson
b04903a2
AM
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
14package org.eclipse.tracecompass.internal.tmf.pcap.core.event.aspect;
15
2a28075c 16import org.eclipse.jdt.annotation.Nullable;
b04903a2
AM
17import org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent;
18import org.eclipse.tracecompass.internal.tmf.pcap.core.protocol.TmfPcapProtocol;
19import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
20import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
21
22/**
23 * The "packet destination" aspect for pcap events.
24 *
25 * @author Alexandre Montplaisir
26 */
27public 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
2a28075c 40 public @Nullable String resolve(ITmfEvent event) {
b04903a2 41 if (!(event instanceof PcapEvent)) {
2a28075c 42 return null;
b04903a2
AM
43 }
44 PcapEvent pcapEvent = (PcapEvent) event;
45 TmfPcapProtocol protocol = pcapEvent.getMostEncapsulatedProtocol();
46
2a28075c 47 return pcapEvent.getDestinationEndpoint(protocol);
b04903a2 48 }
b04903a2 49}
This page took 0.028708 seconds and 5 git commands to generate.