private static String getMmsi(SecuredUser user) { String mmsi = null; if (user.getRole().getClass() == SailorRole.class) { mmsi = ((SailorRole) user.getRole()).getVessel().getMmsi().toString(); } return mmsi; }
private static String getName(SecuredUser user) { String name = user.getUserName(); if (user.getRole().getClass() == SailorRole.class) { Vessel vessel = ((SailorRole) user.getRole()).getVessel(); if (vessel.getAisData() != null && vessel.getAisData().getName() != null) { name = vessel.getAisData().getName(); } } return name; }