Interface SocketConnectionService

  • All Known Implementing Classes:
    DefaultSocketConnectionService

    public interface SocketConnectionService
    Provides methods dealing with widget sockets and connections.
    • Field Detail

      • SOCKET_DATA_TYPE_PREFIX

        static final java.lang.String SOCKET_DATA_TYPE_PREFIX
        See Also:
        Constant Field Values
    • Method Detail

      • canReceiveFrom

        boolean canReceiveFrom​(WidgetSocket inputSocket,
                               Widget targetWidget,
                               WidgetSocket outputSocket,
                               Widget srcWidget)
        Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.
        Parameters:
        inputSocket - - WidgetSocket represents input socket
        outputSocket - - WidgetSocket represents output socket
        srcWidget - - Widget represents source widget
        targetWidget - - Widget represents target widget
        Returns:
        whether outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type
      • checkVisibilityRestrictions

        boolean checkVisibilityRestrictions​(WidgetSocket inputSocket,
                                            Widget targetWidget,
                                            WidgetSocket outputSocket,
                                            Widget srcWidget)
        Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to socket visibility.
        Parameters:
        inputSocket - - WidgetSocket represents input socket
        outputSocket - - WidgetSocket represents output socket
        srcWidget - - Widget represents source widget
        targetWidget - - Widget represents target widget
        Returns:
        whether outputSocket from srcWidget can be connected with inputSocket from targetWidget according to socket
      • canResolveGenericType

        default boolean canResolveGenericType​(WidgetSocket socket,
                                              Widget widget)
        Checks if the generic type for the specified socket and widget can be resolved to concrete type.
        Parameters:
        socket - - WidgetSocket represents socket
        widget - - Widget represents widget
        Returns:
        true if a widget socket does not have generic type or the type can be resolved
      • resolveGenericType

        java.lang.String resolveGenericType​(WidgetSocket socket,
                                            Widget widget)
        Resolves the generic type for the specified socket and widget if any.
        Parameters:
        socket - - WidgetSocket represents socket
        widget - - Widget represents widget
        Returns:
        the generic type for the specified socket and widget if any.
      • isCollectionTypeAssignable

        default boolean isCollectionTypeAssignable​(WidgetSocket.Multiplicity source,
                                                   WidgetSocket.Multiplicity target)
        Checks if target is compatible with source basing on WidgetSocket.Multiplicity
        Parameters:
        source - multiplicity to check
        target - multiplicity to check
        Returns:
        whether target is compatible with source basing on WidgetSocket.Multiplicity
      • hasGenericType

        default boolean hasGenericType​(WidgetSocket socket)
        Checks if socket data type definition has generic type
        Parameters:
        socket - - WidgetSocket represents socket
        Returns:
        whether socket data type definition has generic type