FabricClient Class
- java.
lang. Object - AutoCloseable
- system.
fabric. FabricClient
- system.
public class FabricClient
Client for a Service Fabric cluster.
Remarks:It is highly recommended that you share FabricClients as much as possible. This is because the FabricClient has multiple optimizations such as caching and batching that you would not be able to fully utilize otherwise.
Constructor Summary
Constructor | Description |
---|---|
FabricClient() |
Initializes a new instance of the system.fabric.FabricClient class.
Remarks:If the system.fabric.FabricClient is on the same cluster as the service, then use a Local system.fabric.FabricClient. Local system.fabric.FabricClient is a feature of Service Fabric that allows the system.fabric.FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local system.fabric.FabricClient , as it enables automatic load balancing and improves performance. |
FabricClient(FabricClientRole clientRole) |
Initializes a new instance of the FabricClient class with the specified fabric client role. |
FabricClient(FabricClientSettings settings) |
Initializes a new instance of the system.fabric.FabricClient class with the desired fabric client settings. If the system.fabric.FabricClient is on the same cluster as the service, then use a Local system.fabric.FabricClient. Local system.fabric.FabricClient is a feature of Service Fabric that allows the system.fabric.FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local system.fabric.FabricClient, as it enables automatic load balancing and improves performance. |
FabricClient(FabricClientSettings settings, String[] hostEndpoints) |
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints) and the desired fabric client settings. |
FabricClient(SecurityCredentials credential, FabricClientSettings settings, String[] hostEndpoints) |
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints), security credentials and fabric client settings. |
FabricClient(SecurityCredentials credential, String[] hostEndpoints) |
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints) and security credentials. |
FabricClient(String[] hostEndpoints) |
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints). |
Method Summary
Modifier and Type | Method and Description |
---|---|
void | close() |
void | createNativeClient(String[] hostEndPoints) |
Observable<Gateway |
getClientConnectionObservable() |
Observable<Gateway |
getClientDisconnectionObservable() |
Security |
getCredential() |
String [] | getHostEndpoints() |
Fabric |
getSettings()
Gets the fabric client settings. |
void |
registerOnClaimsRetrievalCallback(BiFunction<FabricClient, AzureActiveDirectoryMetadata, String> callback)
Registers the claims token retrieval callback for the ClaimsRetrieval event |
void |
updateSecurityCredentials(SecurityCredentials credentials)
Updates the fabric client security credentials. |
void | UpdateSettings(FabricClientSettings settings) |
Constructor Details
FabricClient
public FabricClient()
Initializes a new instance of the system.fabric.FabricClient class.
Remarks:If the system.fabric.FabricClient is on the same cluster as the service, then use a Local system.fabric.FabricClient. Local system.fabric.FabricClient is a feature of Service Fabric that allows the system.fabric.FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local system.fabric.FabricClient , as it enables automatic load balancing and improves performance.
FabricClient
public FabricClient(FabricClientRole clientRole)
Initializes a new instance of the FabricClient class with the specified fabric client role.
Parameters:
FabricClient
public FabricClient(FabricClientSettings settings)
Initializes a new instance of the system.fabric.FabricClient class with the desired fabric client settings. If the system.fabric.FabricClient is on the same cluster as the service, then use a Local system.fabric.FabricClient. Local system.fabric.FabricClient is a feature of Service Fabric that allows the system.fabric.FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local system.fabric.FabricClient, as it enables automatic load balancing and improves performance.
Parameters:
FabricClient
public FabricClient(FabricClientSettings settings, String[] hostEndpoints)
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints) and the desired fabric client settings.
Parameters:
FabricClient
public FabricClient(SecurityCredentials credential, FabricClientSettings settings, String[] hostEndpoints)
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints), security credentials and fabric client settings.
Parameters:
SecurityCredentials defines the security settings for the system.fabric.FabricClient.
FabricClient
public FabricClient(SecurityCredentials credential, String[] hostEndpoints)
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints) and security credentials.
Parameters:
SecurityCredentials defines the security settings for the system.fabric.FabricClient.
FabricClient
public FabricClient(String[] hostEndpoints)
Initializes a new instance of the system.fabric.FabricClient class with given Service Fabric Gateway addresses (hostEndpoints).
Parameters:
Method Details
close
public void close()
createNativeClient
public void createNativeClient(String[] hostEndPoints)
Parameters:
getClientConnectionObservable
public Observable
getClientDisconnectionObservable
public Observable
getCredential
public SecurityCredentials getCredential()
getHostEndpoints
public String [] getHostEndpoints()
getSettings
public FabricClientSettings getSettings()
Gets the fabric client settings.
Returns:
registerOnClaimsRetrievalCallback
public void registerOnClaimsRetrievalCallback(BiFunction
Registers the claims token retrieval callback for the ClaimsRetrieval event
Parameters:
updateSecurityCredentials
public void updateSecurityCredentials(SecurityCredentials credentials)
Updates the fabric client security credentials.
Parameters:
UpdateSettings
public void UpdateSettings(FabricClientSettings settings)
Parameters: