Package com.thingworx.networks
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
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public class Network
extends ServiceProviderEntity
implements ISupportsAccessModifier
- See Also:
-
Field Summary
Fields inherited from class com.thingworx.entities.RootEntity
BASIC_PROPERTY_DEFINITIONS, EXCLUDED_ENTITY_TYPES_IN_PROJECT
Fields inherited from class com.thingworx.types.NamedObject
NAME_COMPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
AddConnection
(String from, String to, String connectionType) Service Category: Connections Service Description: Add a connection.
Adds a connection of the specified type between the given parent and child on this Network.void
DeleteConnection
(String to, String from) Service Category: Connections Service Description: Delete a connection.
Deletes the connection between the given parent and child from this Network.GetChildConnections
(String name) 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.GetChildConnectionsForShape
(String name, String thingShapeName) 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.GetChildConnectionsForTemplate
(String name, String thingTemplateName) 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.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.GetNetworkConnections
(Double maxDepth) 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.GetNetworkConnectionsWithTemplate
(Double maxDepth) 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.GetParentName
(String name) Service Category: Relationships Service Description: Get parent of a given Thing in the network.GetSubNetworkConnections
(String start, Double maxDepth) 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.GetSubNetworkConnectionsWithTemplate
(String start, Double maxDepth) 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.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.IsInNetwork
(String name) Service Category: Relationships Service Description: Checks to see if a Thing exists in this network.IsInSubNetwork
(String start, String name) 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.Service Category: Relationships Service Description: Check if the parent of a given Thing in the network matches a specific Thing name.void
RemoveFromNetwork
(String name) Service Category: Connections Service Description: Remove a specific Thing from the network.
Removes Connections to and from the given Thing in this Networkvoid
SetConnections
(InfoTable connections) Service Category: Connections Service Description: Assign all connections.
Assigns all connections from given NetworkConnection InfoTable to this Network.Methods inherited from class com.thingworx.entities.ServiceProviderEntity
getInstancePublicServiceDefinitions, getInstanceServiceDefinition, getInstanceServiceDefinitions, initializeEntity, preInitializeEntity, processAPIServiceRequest, processServiceRequest
Methods inherited from class com.thingworx.entities.RootEntity
AddConfigurationTableDefinition, AddConfigurationTableDefinition, addDesignTimePermission, AddDesignTimePermission, addRunTimePermission, AddRunTimePermission, AddTags, addVisibilityPermission, AddVisibilityPermission, CheckDesignTimePermission, CheckDesignTimePermissionForGroup, CheckDesignTimePermissionForUser, CheckPermission, CheckPermissionForGroup, CheckPermissionForUser, cleanupEntity, DeleteAllConfigurationTableRows, DeleteConfigurationTable, DeleteConfigurationTableRows, DeleteConfigurationTableRows, deleteDesignTimePermission, DeleteDesignTimePermission, deleteRunTimePermission, DeleteRunTimePermission, deleteVisibilityPermission, DeleteVisibilityPermission, dispose, getAspects, GetAvatar, getAvatarContent, GetAvatarURL, GetConfigurationChangeHistory, getConfigurationSetting, getConfigurationTable, GetConfigurationTable, GetConfigurationTableDefinition, GetConfigurationTableRow, GetConfigurationTables, GetDescription, getDesignTimePermissions, GetDesignTimePermissions, GetDesignTimePermissionsAsJSON, getDocumentationContent, getEntityTypeAsString, GetEventDefinition, GetEventDefinitions, GetHomeMashup, GetIncomingDependencies, GetIncomingDependenciesAsNetwork, GetInstanceMetadataAsJSON, GetInstanceMetadataWithPermissionsAsJSON, GetLastModifiedDate, GetMetadata, GetMetadataAsJSON, GetMetadataWithPermissionsAsJSON, GetOutgoingDependencies, GetOutgoingDependenciesAsNetwork, getOwner, GetOwner, GetPermissionsForCurrentUser, GetPermissionsForGroup, GetPermissionsForUser, GetProjectName, GetPropertyDefinition, GetPropertyDefinitions, getRunTimePermissions, GetRunTimePermissions, GetRunTimePermissionsAsJSON, GetServiceDefinition, GetServiceDefinitions, getStringConfigurationSetting, getStringConfigurationSettingWithDefault, GetSummaryInformation, getTags, GetTags, GetTagsAsInfoTable, getVisibilityPermissions, GetVisibilityPermissions, GetVisibilityPermissionsAsJSON, HasIncomingDependencies, HasOutgoingDependencies, isEditable, isEditableExtensionObject, isEditableSystemObject, isExtensionObject, IsMultiRowTable, isOwner, isSystemObject, isThemeObject, isVisible, isVisible, ListDeprecatedUsage, persistDesignTimePermissions, persistRunTimePermissions, persistVisibilityPermissions, RemoveTags, SaveConfigurationTables, SetAvatar, setConfigurationSetting, SetConfigurationTable, SetConfigurationTableRows, SetDescription, setDesignTimePermissions, SetDesignTimePermissionsAsJSON, setDocumentationContent, setExtensionObject, SetHomeMashup, setLastModifiedDate, SetMultiRowConfigurationTable, setOwner, SetOwner, SetProjectName, setRunTimePermissions, SetRunTimePermissionsAsJSON, setStringConfigurationSetting, SetTags, setVisibilityPermissions, SetVisibilityPermissionsAsJSON, toJSON, toJSONDefinition, UpdateProjectDependencies, validateConfiguration
Methods inherited from class com.thingworx.persistence.common.PersistableNamedObject
getID, hasID, isTransient
Methods inherited from class com.thingworx.types.NamedObject
getDescription, getName, setDescription, setName, toValueCollection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thingworx.types.INamedObject
getDescription, getName
Methods inherited from interface com.thingworx.entities.interfaces.IPersistable
getID, hasID
Methods inherited from interface com.thingworx.security.permissions.ISecurable
getID, getName
Methods inherited from interface com.thingworx.accesscontrol.ISupportsAccessModifier
getAccessModifier, getAccessModifierScope, getExemptList, hasAccessModifier, isInternalAccess, isPrivateAccess, isRestrictedAccess
Methods inherited from interface com.thingworx.deprecation.ISupportsDeprecation
getDeprecated, isDeprecated, isDeprecatedBefore, since
-
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 Thingto
- Name of the Thing new childconnectionType
- 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 deletedfrom
- 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 childrenthingShapeName
- 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 childrenthingTemplateName
- 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 atmaxDepth
- 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 atmaxDepth
- 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 ThingparentName
- 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 fromname
- 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 fromname
- 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
@ThingworxExtensionApiMethod(since={6,6,5}) public RelationshipTypes.ThingworxRelationshipTypes getEntityType()Description copied from class:RootEntity
Returns the type of this entity.
- Specified by:
getEntityType
in classRootEntity
- Returns:
- the entity type
-