Class SUIDUtil


  • public class SUIDUtil
    extends Object
    This utility class provides methods to save and restore SUIDs that are sent to remote execution environments across sessions.

    Module: jobs-api

    To use this in your app, include the following dependency in your POM:

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>jobs-api</artifactId>
    </dependency>
    • Constructor Detail

      • SUIDUtil

        public SUIDUtil()
    • Method Detail

      • saveSUIDs

        public static void saveSUIDs​(CyJob job,
                                     CyNetwork network,
                                     List<? extends CyIdentifiable> objs)
        This method may be used to save a list of SUIDs that have been sent to a remote service so that they may be restored later
        Parameters:
        job - the job that we're saving the SUIDs for
        network - the network that the SUIDs are part of
        objs - the Cytoscape objects whose SUIDs we want to save
      • restoreNetwork

        public static CyNetwork restoreNetwork​(CyJob job,
                                               CyNetworkManager netManager,
                                               Long networkSUID,
                                               boolean clear)
        This method is used to restore a saved network based on the network SUID. This takes some special handling, since our access to the network tables are through the network itself, we need to use the network manager to get the list of networks in order to find the right network.
        Parameters:
        job - the CyJob we're restoring
        netManager - the CyNetworkManager to get the list of networks
        networkSUID - the SUIDof the network we're restoring
        clear - if true, remove the column for this job
        Returns:
        the restored network or null if we can't find it
      • restoreSUIDs

        public static Map<Long,​CyIdentifiable> restoreSUIDs​(CyJob job,
                                                                  CyNetwork network,
                                                                  List<Long> oldIds,
                                                                  boolean clear)
        Method to restore Cytoscape objects based on a list of SUIDs that were sent to the remote service as saved in the hidden table.
        Parameters:
        job - the CyJob we're restoring
        network - the network the SUIDs are part of. See {@link SaveSUID.restoreNetwork()} for a method to get the network
        oldIds - the list of old SUIDs that were sent to the remote server and saved in the session
        clear - if true, remove the columns for this job
        Returns:
        a map that relates the original id to the Cytoscape object