public class

HubSpotCredentialsManager

extends Object
java.lang.Object
   ↳ org.mule.module.hubspot.credential.HubSpotCredentialsManager

Class Overview

Class that handles the credentials of the users logged in through the HubSpot connector

Summary

Fields
private ObjectStore credentialsMap
Public Constructors
HubSpotCredentialsManager(ObjectStore objStore)
Public Methods
OAuthCredentials getCredentials(String userId)
Return the credentials corresponding to a user
String getCredentialsAccessToken(String userId)
Return the accessToken in the credentials corresponding to a user
String getCredentialsClientId(String userId)
Retrieves the clientId from the credentials for the tenant
String getCredentialsHubId(String userId)
Boolean getCredentialsOfflineScope(String userId)
boolean hasUserAccessToken(String userId)
Indicates if certain user has or not credentials
void setCredentias(OAuthCredentials credentials)
Store the credentials for the user.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private ObjectStore credentialsMap

Public Constructors

public HubSpotCredentialsManager (ObjectStore objStore)

Parameters
objStore

Public Methods

public OAuthCredentials getCredentials (String userId)

Return the credentials corresponding to a user

Parameters
userId The ID of the user of which we want to get the credentials
Returns
Throws
HubSpotConnectorNoAccessTokenException If the user does not have credentials, throw this exception

public String getCredentialsAccessToken (String userId)

Return the accessToken in the credentials corresponding to a user

Parameters
userId The ID of the user of which we want to get the credentials
Returns
  • The accessToken of the user
Throws
HubSpotConnectorNoAccessTokenException If the user does not have credentials, throw this exception

public String getCredentialsClientId (String userId)

Retrieves the clientId from the credentials for the tenant

Parameters
userId The UserId that has the credentials
Returns
  • The clientID
Throws
HubSpotConnectorNoAccessTokenException If the userId does not have credentials stored

public String getCredentialsHubId (String userId)

Parameters
userId

public Boolean getCredentialsOfflineScope (String userId)

Parameters
userId

public boolean hasUserAccessToken (String userId)

Indicates if certain user has or not credentials

Parameters
userId The ID of the user
Returns
  • true if the user has credentials, false otherwise

public void setCredentias (OAuthCredentials credentials)

Store the credentials for the user. The user ID is inside the Credentials object

Parameters
credentials The credentials of the user OAuthCredentials
Throws
HubSpotConnectorException If the value cannot be saved or overwriten in the Object Store