Compartilhar via


ServiceAuthenticationWithSharedAccessPolicyKey Class

public class ServiceAuthenticationWithSharedAccessPolicyKey
extends AuthenticationMethod

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

Constructor Summary

Constructor Description
ServiceAuthenticationWithSharedAccessPolicyKey(String policyName, String key)

Constructor to create instance from policy name and policy key

Method Summary

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

Getter for policy key

java.lang.String getPolicyName()

Getter for policy name

protected IotHubConnectionString populate(IotHubConnectionString iotHubConnectionString)

Populate given IotHubConnectionString with proper policy key authentication data

protected void setKey(String key)

Setter for policy key

protected void setPolicyName(String policyName)

Setter for policy name

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

ServiceAuthenticationWithSharedAccessPolicyKey

public ServiceAuthenticationWithSharedAccessPolicyKey(String policyName, String key)

Constructor to create instance from policy name and policy key

Parameters:

policyName - The policy name string
key - The policy key string

Method Details

getKey

public String getKey()

Getter for policy key

Returns:

The policy key string

getPolicyName

public String getPolicyName()

Getter for policy name

Returns:

The policy name string

populate

protected IotHubConnectionString populate(IotHubConnectionString iotHubConnectionString)

Populate given IotHubConnectionString with proper policy key authentication data

Overrides:

ServiceAuthenticationWithSharedAccessPolicyKey.populate(IotHubConnectionString iotHubConnectionString)

Parameters:

iotHubConnectionString - The iotHubConnectionString object to populate

Returns:

The populated IotHubConnectionString object

setKey

protected void setKey(String key)

Setter for policy key

Parameters:

key - The string value to set

setPolicyName

protected void setPolicyName(String policyName)

Setter for policy name

Parameters:

policyName - The string value to set

Applies to