Compartilhar via


ServiceAuthenticationWithSharedAccessPolicyToken Class

public class ServiceAuthenticationWithSharedAccessPolicyToken
extends AuthenticationMethod

Extend AuthenticationMethod class, provide getters for protected properties and implement populate function to set ServiceAuthenticationWithSharedAccessPolicyToken type policy on given IotHubConnectionString object.

Constructor Summary

Constructor Description
ServiceAuthenticationWithSharedAccessPolicyToken(String policyName, String token)

Constructor to create instance from policy name and policy key

Method Summary

Modifier and Type Method and Description
java.lang.String getPolicyName()

Getter for policy name

java.lang.String getToken()

Getter for policy token

IotHubConnectionString populate(IotHubConnectionString iotHubConnectionString)

Populate given IotHubConnectionString with proper policy token authentication data

protected final void setPolicyName(String policyName)

Setter for policy name

protected final void setToken(String token)

Setter for policy token

Methods inherited from AuthenticationMethod

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ServiceAuthenticationWithSharedAccessPolicyToken

public ServiceAuthenticationWithSharedAccessPolicyToken(String policyName, String token)

Constructor to create instance from policy name and policy key

Parameters:

policyName - The policy name string
token - The token string

Method Details

getPolicyName

public String getPolicyName()

Getter for policy name

Returns:

The policy name string

getToken

public String getToken()

Getter for policy token

Returns:

The policy token string

populate

public IotHubConnectionString populate(IotHubConnectionString iotHubConnectionString)

Populate given IotHubConnectionString with proper policy token authentication data

Overrides:

ServiceAuthenticationWithSharedAccessPolicyToken.populate(IotHubConnectionString iotHubConnectionString)

Parameters:

iotHubConnectionString - The iotHubConnectionString object to populate

Returns:

The populated IotHubConnectionString object

setPolicyName

protected final void setPolicyName(String policyName)

Setter for policy name

Parameters:

policyName - The string value to set

setToken

protected final void setToken(String token)

Setter for policy token

Parameters:

token - The string value to set

Applies to