Package com.openfin.desktop.interop
Class InteropClientImpl
- java.lang.Object
-
- com.openfin.desktop.interop.InteropClientImpl
-
- All Implemented Interfaces:
InteropClient
public class InteropClientImpl extends Object implements InteropClient
-
-
Constructor Summary
Constructors Constructor Description InteropClientImpl(DesktopConnection conn, String brokerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddConnectionListener(InteropConnectionListener listener)Add a listener for interop channel connection lifecycle events.CompletionStage<Void>addContextListener(ContextListener contextListener)Adds a context listener for incoming context.CompletionStage<Void>addContextListener(String contextType, ContextListener listener)Adds a context listener for incoming context of specified context type.CompletionStage<Void>fireIntent(Intent intent)Sends an intent to the Interop Broker to resolve.CompletionStage<ClientIdentity[]>getAllClientsInContextGroup(String contextGroupId)Gets all clients for a context group.CompletionStage<ContextGroupInfo[]>getContextGroups()Gets the Interop-Broker-defined context groups available for an entity to join.CompletionStage<ContextGroupInfo>getInfoForContextGroup(String contextGroupId)Gets display info for a context group.CompletionStage<Void>joinContextGroup(String contextGroupId)Joins this InteropClient to the context group.CompletionStage<Void>joinContextGroup(String contextGroupId, Identity target)Joins specified InteropClient to the context group.CompletionStage<Void>registerIntentListener(String intentName, IntentListener intentListener)Register an intent listener for incoming intent.booleanremoveConnectionListener(InteropConnectionListener listener)Remove a previously added interop channel connection listener.CompletionStage<Void>removeContextListener(ContextListener contextListener)Removes the context listener.CompletionStage<Void>removeContextListener(String contextType, ContextListener listener)Remove the context listener of specified context type.CompletionStage<Void>removeFromContextGroup()Removes this InteropClient from the context group it currently joined.CompletionStage<Void>removeFromContextGroup(Identity target)Removes specified InteropClient from the context group it currently joined.CompletionStage<Void>setContext(Context context)Sets a context for the context group of the current entity.
-
-
-
Constructor Detail
-
InteropClientImpl
public InteropClientImpl(DesktopConnection conn, String brokerName)
-
-
Method Detail
-
addConnectionListener
public boolean addConnectionListener(InteropConnectionListener listener)
Description copied from interface:InteropClientAdd a listener for interop channel connection lifecycle events.- Specified by:
addConnectionListenerin interfaceInteropClient- Parameters:
listener- listener to add- Returns:
- true if listener was added
-
removeConnectionListener
public boolean removeConnectionListener(InteropConnectionListener listener)
Description copied from interface:InteropClientRemove a previously added interop channel connection listener.- Specified by:
removeConnectionListenerin interfaceInteropClient- Parameters:
listener- listener to remove- Returns:
- true if listener was removed
-
setContext
public CompletionStage<Void> setContext(Context context)
Description copied from interface:InteropClientSets a context for the context group of the current entity.- Specified by:
setContextin interfaceInteropClient- Parameters:
context- New context to set.- Returns:
- A new CompletionStage for the task.
-
addContextListener
public CompletionStage<Void> addContextListener(ContextListener contextListener)
Description copied from interface:InteropClientAdds a context listener for incoming context.- Specified by:
addContextListenerin interfaceInteropClient- Parameters:
contextListener- The listener for incoming context.- Returns:
- A new CompletionStage for the task.
-
addContextListener
public CompletionStage<Void> addContextListener(String contextType, ContextListener listener)
Description copied from interface:InteropClientAdds a context listener for incoming context of specified context type.- Specified by:
addContextListenerin interfaceInteropClient- Parameters:
contextType- The context type to listen to.listener- The listener for incoming context.- Returns:
- A new CompletionStage for the task.
-
removeContextListener
public CompletionStage<Void> removeContextListener(ContextListener contextListener)
Description copied from interface:InteropClientRemoves the context listener.- Specified by:
removeContextListenerin interfaceInteropClient- Parameters:
contextListener- The listener to be removed.- Returns:
- A new CompletionStage for the task.
-
removeContextListener
public CompletionStage<Void> removeContextListener(String contextType, ContextListener listener)
Description copied from interface:InteropClientRemove the context listener of specified context type.- Specified by:
removeContextListenerin interfaceInteropClient- Parameters:
contextType- The context type that the listener is listened to.listener- The listener to be removed.- Returns:
- A new CompletionStage for the task.
-
getContextGroups
public CompletionStage<ContextGroupInfo[]> getContextGroups()
Description copied from interface:InteropClientGets the Interop-Broker-defined context groups available for an entity to join.- Specified by:
getContextGroupsin interfaceInteropClient- Returns:
- A new CompletionStage for the array of the context group info.
-
joinContextGroup
public CompletionStage<Void> joinContextGroup(String contextGroupId)
Description copied from interface:InteropClientJoins this InteropClient to the context group.- Specified by:
joinContextGroupin interfaceInteropClient- Parameters:
contextGroupId- The id of context group.- Returns:
- A new CompletionStage for the task.
-
joinContextGroup
public CompletionStage<Void> joinContextGroup(String contextGroupId, Identity target)
Description copied from interface:InteropClientJoins specified InteropClient to the context group.- Specified by:
joinContextGroupin interfaceInteropClient- Parameters:
contextGroupId- The id of context group.target- The identity of the target InteropClient.- Returns:
- A new CompletionStage for the task.
-
removeFromContextGroup
public CompletionStage<Void> removeFromContextGroup()
Description copied from interface:InteropClientRemoves this InteropClient from the context group it currently joined.- Specified by:
removeFromContextGroupin interfaceInteropClient- Returns:
- A new CompletionStage for the task.
-
removeFromContextGroup
public CompletionStage<Void> removeFromContextGroup(Identity target)
Description copied from interface:InteropClientRemoves specified InteropClient from the context group it currently joined.- Specified by:
removeFromContextGroupin interfaceInteropClient- Parameters:
target- The identity of the target InteropClient.- Returns:
- A new CompletionStage for the task.
-
getAllClientsInContextGroup
public CompletionStage<ClientIdentity[]> getAllClientsInContextGroup(String contextGroupId)
Description copied from interface:InteropClientGets all clients for a context group.- Specified by:
getAllClientsInContextGroupin interfaceInteropClient- Parameters:
contextGroupId- The id of context group.- Returns:
- A new CompletionStage for the array of all clients in the context group.
-
getInfoForContextGroup
public CompletionStage<ContextGroupInfo> getInfoForContextGroup(String contextGroupId)
Description copied from interface:InteropClientGets display info for a context group.- Specified by:
getInfoForContextGroupin interfaceInteropClient- Parameters:
contextGroupId- The id of context group.- Returns:
- A new CompletionStage for the context group info.
-
fireIntent
public CompletionStage<Void> fireIntent(Intent intent)
Description copied from interface:InteropClientSends an intent to the Interop Broker to resolve.- Specified by:
fireIntentin interfaceInteropClient- Parameters:
intent- New intent to send.- Returns:
- A new CompletionStage for the task.
-
registerIntentListener
public CompletionStage<Void> registerIntentListener(String intentName, IntentListener intentListener)
Description copied from interface:InteropClientRegister an intent listener for incoming intent.- Specified by:
registerIntentListenerin interfaceInteropClient- Parameters:
intentName- name of the intentintentListener- The listener for incoming intent.- Returns:
- A new CompletionStage for the task.
-
-