Package com.hybris.cockpitng.core.impl
Class DefaultSocketConnectionService
- java.lang.Object
-
- com.hybris.cockpitng.core.impl.DefaultSocketConnectionService
-
- All Implemented Interfaces:
SocketConnectionService
public class DefaultSocketConnectionService extends java.lang.Object implements SocketConnectionService
Default implementation ofSocketConnectionService. Provides methods dealing with widget sockets and connections.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXTENDSstatic java.lang.StringJAVA_LANG_OBJECT-
Fields inherited from interface com.hybris.cockpitng.core.SocketConnectionService
SOCKET_DATA_TYPE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DefaultSocketConnectionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanAcceptAnyType(WidgetSocket inputSocket)booleancanReceiveFrom(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.booleancanResolveGenericType(WidgetSocket socket, Widget widget)Checks if the generic type for the specified socket and widget can be resolved to concrete type.booleancheckVisibilityRestrictions(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to socket visibility.protected java.lang.StringeraseGenericClass(java.lang.String socketType)protected java.lang.StringgetGenericDataTypeHolderName(java.lang.String typeVariable)booleanhasGenericType(WidgetSocket socket)Checks if socket data type definition has generic typebooleanisCollectionTypeAssignable(WidgetSocket.Multiplicity source, WidgetSocket.Multiplicity target)Checks if target is compatible with source basing on WidgetSocket.Multiplicityprotected booleanisSpecializedGenericClass(java.lang.String socketType)java.lang.StringresolveGenericType(WidgetSocket socket, Widget widget)Resolves the generic type for the specified socket and widget if any.voidsetCockpitTypeUtils(CockpitTypeUtils cockpitTypeUtils)
-
-
-
Field Detail
-
JAVA_LANG_OBJECT
public static final java.lang.String JAVA_LANG_OBJECT
-
EXTENDS
public static final java.lang.String EXTENDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
canReceiveFrom
public boolean canReceiveFrom(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)
Description copied from interface:SocketConnectionServiceChecks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.- Specified by:
canReceiveFromin interfaceSocketConnectionService- Parameters:
inputSocket- -WidgetSocketrepresents input sockettargetWidget- -Widgetrepresents target widgetoutputSocket- -WidgetSocketrepresents output socketsrcWidget- -Widgetrepresents source widget- Returns:
- whether outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type
-
canAcceptAnyType
protected boolean canAcceptAnyType(WidgetSocket inputSocket)
-
checkVisibilityRestrictions
public boolean checkVisibilityRestrictions(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)
Description copied from interface:SocketConnectionServiceChecks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to socket visibility.- Specified by:
checkVisibilityRestrictionsin interfaceSocketConnectionService- Parameters:
inputSocket- -WidgetSocketrepresents input sockettargetWidget- -Widgetrepresents target widgetoutputSocket- -WidgetSocketrepresents output socketsrcWidget- -Widgetrepresents source widget- Returns:
- whether outputSocket from srcWidget can be connected with inputSocket from targetWidget according to socket
-
canResolveGenericType
public boolean canResolveGenericType(WidgetSocket socket, Widget widget)
Description copied from interface:SocketConnectionServiceChecks if the generic type for the specified socket and widget can be resolved to concrete type.- Specified by:
canResolveGenericTypein interfaceSocketConnectionService- Parameters:
socket- -WidgetSocketrepresents socketwidget- -Widgetrepresents widget- Returns:
trueif a widget socket does not have generic type or the type can be resolved
-
resolveGenericType
public java.lang.String resolveGenericType(WidgetSocket socket, Widget widget)
Description copied from interface:SocketConnectionServiceResolves the generic type for the specified socket and widget if any.- Specified by:
resolveGenericTypein interfaceSocketConnectionService- Parameters:
socket- -WidgetSocketrepresents socketwidget- -Widgetrepresents widget- Returns:
- the generic type for the specified socket and widget if any.
-
eraseGenericClass
protected java.lang.String eraseGenericClass(java.lang.String socketType)
-
isSpecializedGenericClass
protected boolean isSpecializedGenericClass(java.lang.String socketType)
-
isCollectionTypeAssignable
public boolean isCollectionTypeAssignable(WidgetSocket.Multiplicity source, WidgetSocket.Multiplicity target)
Description copied from interface:SocketConnectionServiceChecks if target is compatible with source basing on WidgetSocket.Multiplicity- Specified by:
isCollectionTypeAssignablein interfaceSocketConnectionService- Parameters:
source- multiplicity to checktarget- multiplicity to check- Returns:
- whether target is compatible with source basing on WidgetSocket.Multiplicity
-
hasGenericType
public boolean hasGenericType(WidgetSocket socket)
Description copied from interface:SocketConnectionServiceChecks if socket data type definition has generic type- Specified by:
hasGenericTypein interfaceSocketConnectionService- Parameters:
socket- -WidgetSocketrepresents socket- Returns:
- whether socket data type definition has generic type
-
getGenericDataTypeHolderName
protected java.lang.String getGenericDataTypeHolderName(java.lang.String typeVariable)
-
setCockpitTypeUtils
public void setCockpitTypeUtils(CockpitTypeUtils cockpitTypeUtils)
-
-