UpstreamTemplate Class

  • java.lang.Object
    • com.azure.resourcemanager.signalr.models.UpstreamTemplate

public final class UpstreamTemplate

Upstream template item settings. It defines the Upstream URL of the incoming requests. The template defines the pattern of the event, the hub or the category of the incoming request that matches current URL template.

Constructor Summary

Constructor Description
UpstreamTemplate()

Creates an instance of UpstreamTemplate class.

Method Summary

Modifier and Type Method and Description
UpstreamAuthSettings auth()

Get the auth property: Upstream auth settings.

String categoryPattern()

Get the categoryPattern property: Gets or sets the matching pattern for category names.

String eventPattern()

Get the eventPattern property: Gets or sets the matching pattern for event names.

String hubPattern()

Get the hubPattern property: Gets or sets the matching pattern for hub names.

String urlTemplate()

Get the urlTemplate property: Gets or sets the Upstream URL template.

void validate()

Validates the instance.

UpstreamTemplate withAuth(UpstreamAuthSettings auth)

Set the auth property: Upstream auth settings.

UpstreamTemplate withCategoryPattern(String categoryPattern)

Set the categoryPattern property: Gets or sets the matching pattern for category names.

UpstreamTemplate withEventPattern(String eventPattern)

Set the eventPattern property: Gets or sets the matching pattern for event names.

UpstreamTemplate withHubPattern(String hubPattern)

Set the hubPattern property: Gets or sets the matching pattern for hub names.

UpstreamTemplate withUrlTemplate(String urlTemplate)

Set the urlTemplate property: Gets or sets the Upstream URL template.

Methods inherited from java.lang.Object

Constructor Details

UpstreamTemplate

public UpstreamTemplate()

Creates an instance of UpstreamTemplate class.

Method Details

auth

public UpstreamAuthSettings auth()

Get the auth property: Upstream auth settings. If not set, no auth is used for upstream messages.

Returns:

the auth value.

categoryPattern

public String categoryPattern()

Get the categoryPattern property: Gets or sets the matching pattern for category names. If not set, it matches any category. There are 3 kind of patterns supported: 1. "*", it to matches any category name. 2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages". 3. The single category name, for example, "connections", it matches the category "connections".

Returns:

the categoryPattern value.

eventPattern

public String eventPattern()

Get the eventPattern property: Gets or sets the matching pattern for event names. If not set, it matches any event. There are 3 kind of patterns supported: 1. "*", it to matches any event name. 2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect". 3. The single event name, for example, "connect", it matches "connect".

Returns:

the eventPattern value.

hubPattern

public String hubPattern()

Get the hubPattern property: Gets or sets the matching pattern for hub names. If not set, it matches any hub. There are 3 kind of patterns supported: 1. "*", it to matches any hub name. 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2". 3. The single hub name, for example, "hub1", it matches "hub1".

Returns:

the hubPattern value.

urlTemplate

public String urlTemplate()

Get the urlTemplate property: Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in. For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`.

Returns:

the urlTemplate value.

validate

public void validate()

Validates the instance.

withAuth

public UpstreamTemplate withAuth(UpstreamAuthSettings auth)

Set the auth property: Upstream auth settings. If not set, no auth is used for upstream messages.

Parameters:

auth - the auth value to set.

Returns:

the UpstreamTemplate object itself.

withCategoryPattern

public UpstreamTemplate withCategoryPattern(String categoryPattern)

Set the categoryPattern property: Gets or sets the matching pattern for category names. If not set, it matches any category. There are 3 kind of patterns supported: 1. "*", it to matches any category name. 2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages". 3. The single category name, for example, "connections", it matches the category "connections".

Parameters:

categoryPattern - the categoryPattern value to set.

Returns:

the UpstreamTemplate object itself.

withEventPattern

public UpstreamTemplate withEventPattern(String eventPattern)

Set the eventPattern property: Gets or sets the matching pattern for event names. If not set, it matches any event. There are 3 kind of patterns supported: 1. "*", it to matches any event name. 2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect". 3. The single event name, for example, "connect", it matches "connect".

Parameters:

eventPattern - the eventPattern value to set.

Returns:

the UpstreamTemplate object itself.

withHubPattern

public UpstreamTemplate withHubPattern(String hubPattern)

Set the hubPattern property: Gets or sets the matching pattern for hub names. If not set, it matches any hub. There are 3 kind of patterns supported: 1. "*", it to matches any hub name. 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2". 3. The single hub name, for example, "hub1", it matches "hub1".

Parameters:

hubPattern - the hubPattern value to set.

Returns:

the UpstreamTemplate object itself.

withUrlTemplate

public UpstreamTemplate withUrlTemplate(String urlTemplate)

Set the urlTemplate property: Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in. For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`.

Parameters:

urlTemplate - the urlTemplate value to set.

Returns:

the UpstreamTemplate object itself.

Applies to