Class BasePartnerCredentials
java.lang.Object
com.microsoft.store.partnercenter.extensions.BasePartnerCredentials
- All Implemented Interfaces:
IPartnerCredentials
- Direct Known Subclasses:
ApplicationPartnerCredentials,UserPartnerCredentials
public abstract class BasePartnerCredentials extends Object implements IPartnerCredentials
A base implementation for partner credentials.
-
Constructor Summary
Constructors Constructor Description BasePartnerCredentials(String clientId)Initializes a new instance of the BasePartnerCredentials class. -
Method Summary
Modifier and Type Method Description voidauthenticate()Authenticates with the partner service.voidauthenticate(IRequestContext requestContext)Authenticates with the partner service.protected AuthenticationTokengetAADToken()Gets the Azure Active Directory token.protected StringgetClientId()Gets the Azure Active Directory client identifier.org.joda.time.DateTimegetExpiresAt()Gets the expiry time in UTC for the token.StringgetPartnerServiceToken()Gets the partner service token.booleanisExpired()Indicates whether the partner credentials have expired or not.protected voidsetAADToken(AuthenticationToken value)Sets the Azure Active Directory token.protected voidsetClientId(String value)Sets the Azure Active Directory client identifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.microsoft.store.partnercenter.IPartnerCredentials
onCredentialsRefreshNeeded
-
Constructor Details
-
BasePartnerCredentials
Initializes a new instance of the BasePartnerCredentials class.- Parameters:
clientId- The Azure Active Directory client Id.
-
-
Method Details
-
getPartnerServiceToken
Gets the partner service token.- Specified by:
getPartnerServiceTokenin interfaceIPartnerCredentials- Returns:
- The partner service token.
-
getExpiresAt
public org.joda.time.DateTime getExpiresAt()Gets the expiry time in UTC for the token.- Specified by:
getExpiresAtin interfaceIPartnerCredentials- Returns:
- The expiry time in UTC for the token.
-
getAADToken
Gets the Azure Active Directory token.- Returns:
- The Azure Active Directory token.
-
setAADToken
Sets the Azure Active Directory token.- Parameters:
value- The Azure Active Directory token.
-
getClientId
Gets the Azure Active Directory client identifier.- Returns:
- The Azure Active Directory client identifier.
-
setClientId
Sets the Azure Active Directory client identifier.- Parameters:
value- The Azure Active Directory client identifier.
-
isExpired
public boolean isExpired()Indicates whether the partner credentials have expired or not.- Specified by:
isExpiredin interfaceIPartnerCredentials- Returns:
- true if credentials have expired; otherwise, false.
-
authenticate
public void authenticate()Authenticates with the partner service. -
authenticate
Authenticates with the partner service.- Parameters:
requestContext- The request context.
-