Class Network

All Implemented Interfaces:
ISupportsAccessModifier, IConfigurableObject, INotScriptFriendly, ISupportsDeprecation, IDiffableObject, IAvatar, IEntityLifeCycleEvent, IPersistable, IServiceProvider, ITaggableObject, IDependencyScannableObject, IEntityDefinition, IPersistableObject<String>, IDesignTimeSecurable, IDesignTimeSecurableEntity, IRunTimeSecurable, IRunTimeSecurableEntity, ISecurable, IVisibilitySecurable, IVisibilitySecurableEntity, IAspectContainer, INamedObject, Serializable

See Also:
  • Constructor Details

    • Network

      public Network()
  • Method Details

    • GetNetworkConnections

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetNetworkConnections(Double maxDepth) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetNetworkConnectionsWithTemplate

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetNetworkConnectionsWithTemplate(Double maxDepth) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetChildConnections

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetChildConnections(String name) throws 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:
      Exception - Thrown if an unexpected error occurs
    • AddConnection

      @ThingworxExtensionApiMethod(since={6,6,5}) public void AddConnection(String from, String to, String connectionType) throws 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:
      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 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:
      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(String to, String from) throws 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:
      Exception - Thrown if Connection does not exist or the Network changes cannot be persisted
    • RemoveFromNetwork

      @ThingworxExtensionApiMethod(since={6,6,5}) public void RemoveFromNetwork(String name) throws 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:
      Exception - Thrown if no Thing is specified or the Network changes cannot be persisted
    • GetChildConnectionsWithTemplate

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetChildConnectionsWithTemplate(String name) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetChildConnectionsForShape

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetChildConnectionsForShape(String name, String thingShapeName) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetChildConnectionsForTemplate

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetChildConnectionsForTemplate(String name, String thingTemplateName) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetSubNetworkConnections

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetSubNetworkConnections(String start, Double maxDepth) throws 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:
      Exception - Thrown if an unexpected error occurs
    • GetSubNetworkConnectionsWithTemplate

      @ThingworxExtensionApiMethod(since={6,6,5}) public InfoTable GetSubNetworkConnectionsWithTemplate(String start, Double maxDepth) throws 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:
      Exception - Thrown if an unexpected error occurs
    • IsParent

      @ThingworxExtensionApiMethod(since={6,6,5}) public Boolean IsParent(String name, String parentName) throws 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:
      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 String GetParentName(String name) throws 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:
      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 Boolean IsChild(String start, String name) throws 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:
      Exception - Thrown if an unexpected error occurs
    • IsInSubNetwork

      @ThingworxExtensionApiMethod(since={6,6,5}) public Boolean IsInSubNetwork(String start, String name) throws 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:
      Exception - Thrown if an unexpected error occurs
    • IsInNetwork

      @ThingworxExtensionApiMethod(since={6,6,5}) public Boolean IsInNetwork(String name) throws 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:
      Exception - If an error occurs

      Check if the given Thing is in the Network.
    • getEntityType

      Description copied from class: RootEntity


      Returns the type of this entity.

      Specified by:
      getEntityType in class RootEntity
      Returns:
      the entity type