Skip navigation links
Thingworx Platform API
8.5.0
com.thingworx.networks

Class Network

    • Constructor Detail

      • Network

        public Network()
    • Method Detail

      • GetNetworkConnections

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetNetworkConnections(java.lang.Double maxDepth)
                                                                                    throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the connections in this network.


        Returns a collection of all the connections in this network up to the given maximum depth.
        Parameters:
        maxDepth - Maximum depth for searching sub networks
        Returns:
        InfoTable of the network connections in the NetworkConnection DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetNetworkConnectionsWithTemplate

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetNetworkConnectionsWithTemplate(java.lang.Double maxDepth)
                                                                                                throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the connections in this network along with their implemented template name.


        Returns a collection of all the connections in this network that includes the Network's ThingTemplate up to a maximum depth.
        Parameters:
        maxDepth - Maximum depth for searching sub networks
        Returns:
        InfoTable of network connections in the NetworkConnectionWithTemplate DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetChildConnections

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetChildConnections(java.lang.String name)
                                                                                  throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the child connections in this network for a specific node.


        Returns a collection of all the child connections in this network for a specific node.
        Parameters:
        name - Name of node for whom to return children
        Returns:
        InfoTable of the network connections in the NetworkConnection DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • AddConnection

        @ThingworxExtensionApiMethod(since={6,6,5})
        public void AddConnection(java.lang.String from,
                                                                              java.lang.String to,
                                                                              java.lang.String connectionType)
                                                                       throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Add a connection.


        Adds a connection of the specified type between the given parent and child on this Network.
        Parameters:
        from - Name of the parent Thing
        to - Name of the Thing new child
        connectionType - Name of the connection type. Must not be null or empty.
        Throws:
        java.lang.Exception - Thrown if parent or child are not valid things, they don't exist on this Network or a connection already exists between them
      • SetConnections

        @ThingworxExtensionApiMethod(since={6,6,5})
        public void SetConnections(InfoTable connections)
                                                                        throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Assign all connections.


        Assigns all connections from given NetworkConnection InfoTable to this Network.
        Parameters:
        connections - InfoTable with NetworkConnection DataShape containing all connections to be added
        Throws:
        java.lang.Exception - Thrown if an InfoTable row has an invalid connection or the Network changes cannot be persisted
      • DeleteConnection

        @ThingworxExtensionApiMethod(since={6,6,5})
        public void DeleteConnection(java.lang.String to,
                                                                                 java.lang.String from)
                                                                          throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Delete a connection.


        Deletes the connection between the given parent and child from this Network.
        Parameters:
        to - Name of the child of the connection to be deleted
        from - Name of the parent to be deleted
        Throws:
        java.lang.Exception - Thrown if Connection does not exist or the Network changes cannot be persisted
      • RemoveFromNetwork

        @ThingworxExtensionApiMethod(since={6,6,5})
        public void RemoveFromNetwork(java.lang.String name)
                                                                           throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Remove a specific Thing from the network.


        Removes Connections to and from the given Thing in this Network
        Parameters:
        name - Name of the Thing to remove. Must not be null or empty.
        Throws:
        java.lang.Exception - Thrown if no Thing is specified or the Network changes cannot be persisted
      • GetChildConnectionsWithTemplate

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetChildConnectionsWithTemplate(java.lang.String name)
                                                                                              throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the child connections in this network for a specific node along with their implemented template name.


        Returns a collection of all the child connections in this network for a specific node along with their implemented ThingTemplate name.
        Parameters:
        name - Name of node for whom to return children
        Returns:
        InfoTable of the network connections in the NetworkConnectionWithTemplate DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetChildConnectionsForShape

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetChildConnectionsForShape(java.lang.String name,
                                                                                                 java.lang.String thingShapeName)
                                                                                          throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the child connections in this network for a specific node that implement a given shape.


        Returns a collection of all the child connections in this network for a specific node that implement a given ThingShape.
        Parameters:
        name - Name of node for whom to return children
        thingShapeName - Name of the Thing Shape
        Returns:
        InfoTable of the network connections in the NetworkConnection DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetChildConnectionsForTemplate

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetChildConnectionsForTemplate(java.lang.String name,
                                                                                                    java.lang.String thingTemplateName)
                                                                                             throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the child connections in this network for a specific node that implement a given template.


        Returns a collection of all the child connections in this network for a specific node that implement a given ThingTemplate.
        Parameters:
        name - Name of node for whom to return children
        thingTemplateName - Name of the Thing Template
        Returns:
        InfoTable of the network connections in the NetworkConnection DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetSubNetworkConnections

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetSubNetworkConnections(java.lang.String start,
                                                                                              java.lang.Double maxDepth)
                                                                                       throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the connections in this SubNetwork.


        Returns a collection of all the connections in this sub network.
        Parameters:
        start - Name of the Thing to start the search at
        maxDepth - Maximum depth for searching below this sub network
        Returns:
        InfoTable of the network connections on this sub network in the NetworkConnection DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • GetSubNetworkConnectionsWithTemplate

        @ThingworxExtensionApiMethod(since={6,6,5})
        public InfoTable GetSubNetworkConnectionsWithTemplate(java.lang.String start,
                                                                                                          java.lang.Double maxDepth)
                                                                                                   throws java.lang.Exception
        Service Category:
        Connections
        Service Description:
        Return a list of all the connections in this subnetwork with their implemented template name.


        Returns a collection of all the connections in this sub network with their implemented ThingTemplate.
        Parameters:
        start - Name of the Thing to start the search at
        maxDepth - Maximum depth for searching below this sub network
        Returns:
        InfoTable of the network connections on this sub network in the NetworkConnectionWithTemplate DataShape
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • IsParent

        @ThingworxExtensionApiMethod(since={6,6,5})
        public java.lang.Boolean IsParent(java.lang.String name,
                                                                                      java.lang.String parentName)
                                                                               throws java.lang.Exception
        Service Category:
        Relationships
        Service Description:
        Check if the parent of a given Thing in the network matches a specific Thing name.
        Parameters:
        name - Name of the child Thing
        parentName - Name of the parent Thing
        Returns:
        True if given parent is actually the parent of the given child, else false
        Throws:
        java.lang.Exception - If an error occurs

        Check if the parent of a given Thing in the Network has a specific Thing parent.
      • GetParentName

        @ThingworxExtensionApiMethod(since={6,6,5})
        public java.lang.String GetParentName(java.lang.String name)
                                                                                   throws java.lang.Exception
        Service Category:
        Relationships
        Service Description:
        Get parent of a given Thing in the network.
        Parameters:
        name - Name of the child
        Returns:
        Name of the parent if the child exists or null
        Throws:
        java.lang.Exception - If an error occurs

        Gets the name of the parent of a given Thing in this Network. Will return the first parent found if the given child has multiple parents. Will return null if the given child does not exist as a child on this Network.
      • IsChild

        @ThingworxExtensionApiMethod(since={6,6,5})
        public java.lang.Boolean IsChild(java.lang.String start,
                                                                                     java.lang.String name)
                                                                              throws java.lang.Exception
        Service Category:
        Relationships
        Service Description:
        Checks to see if a Thing exists as a child of the starting Thing.


        Check if the given Thing is a direct child in the Network. This method only checks one level below the start Thing.
        Parameters:
        start - Name of the Thing to start searching from
        name - Name of the child Thing to search for
        Returns:
        True if found, false if not
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • IsInSubNetwork

        @ThingworxExtensionApiMethod(since={6,6,5})
        public java.lang.Boolean IsInSubNetwork(java.lang.String start,
                                                                                            java.lang.String name)
                                                                                     throws java.lang.Exception
        Service Category:
        Relationships
        Service Description:
        Checks to see if a Thing exists in this subnetwork.


        Check if the given Thing is a child in the Network at any depth. This method will check up to the maximum depth of the Network.
        Parameters:
        start - Name of the Thing to start searching from
        name - Name of the child Thing to search for
        Returns:
        True if found, false if not
        Throws:
        java.lang.Exception - Thrown if an unexpected error occurs
      • IsInNetwork

        @ThingworxExtensionApiMethod(since={6,6,5})
        public java.lang.Boolean IsInNetwork(java.lang.String name)
                                                                                  throws java.lang.Exception
        Service Category:
        Relationships
        Service Description:
        Checks to see if a Thing exists in this network.
        Parameters:
        name - Name of the Thing to search for
        Returns:
        Boolean True if found, false if not
        Throws:
        java.lang.Exception - If an error occurs

        Check if the given Thing is in the Network.