@Override
 public Object getPropertyValue(Object id) {
   if (TARGET_NODE_NAME_PROPERTY_ID.equals(id)) {
     return fTargetNode.getName();
   }
   if (TARGET_NODE_ADDRESS_PROPERTY_ID.equals(id)) {
     IRemoteConnection connection = fTargetNode.getRemoteSystemProxy().getRemoteConnection();
     if (connection.hasService(IRemoteConnectionHostService.class)) {
       IRemoteConnectionHostService service =
           checkNotNull(connection.getService(IRemoteConnectionHostService.class));
       return service.getHostname();
     }
     return LOCAL_CONNECTION_HOST_NAME;
   }
   if (TARGET_NODE_STATE_PROPERTY_ID.equals(id)) {
     return fTargetNode.getTargetNodeState().name();
   }
   if (TARGET_NODE_VERSION_PROPERTY_ID.equals(id)) {
     return fTargetNode.getNodeVersion();
   }
   return null;
 }
Exemplo n.º 2
0
 public static String getRemoteHostname(ILaunchConfiguration config) throws CoreException {
   IRemoteConnection currentConnection = getCurrentConnection(config);
   IRemoteConnectionHostService hostService =
       currentConnection.getService(IRemoteConnectionHostService.class);
   return hostService.getHostname();
 }