Class OAuth2TokenServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.oauth2.tokens.OAuth2TokenServiceImpl
-
- All Implemented Interfaces:
OAuth2TokenService
,Adaptable
,Component
,Extensible
,TimestampedService
public class OAuth2TokenServiceImpl extends DefaultComponent implements OAuth2TokenService
The implementation that manages the oauth2 tokens in Nuxeo.- Since:
- 11.1
-
-
Field Summary
Fields Modifier and Type Field Description static String
TOKEN_DIR
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description OAuth2TokenServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkPermission(NuxeoPrincipal principal)
protected List<NuxeoOAuth2Token>
findTokens(QueryBuilder queryBuilder)
protected List<NuxeoOAuth2Token>
findTokens(QueryBuilder queryBuilder, NuxeoPrincipal principal)
protected QueryBuilder
getQueryBuilder(String query)
protected QueryBuilder
getQueryBuilder(String nxuser, NuxeoOAuth2TokenType type)
List<NuxeoOAuth2Token>
getTokens(String nxuser)
Gets the OAuth2 tokens for the given user.List<NuxeoOAuth2Token>
getTokens(String nxuser, NuxeoOAuth2TokenType type)
Gets the OAuth2 tokens from a given user name and a type.List<NuxeoOAuth2Token>
getTokens(NuxeoPrincipal principal)
Gets the oAuth2 tokens as the given principal.List<NuxeoOAuth2Token>
getTokens(NuxeoOAuth2TokenType type, NuxeoPrincipal principal)
Gets the oAuth2 tokens for a given type as the given principal.List<NuxeoOAuth2Token>
search(String query, NuxeoPrincipal principal)
Finds the oAuth2 tokens that match the givenquery
as the given principal.-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
TOKEN_DIR
public static final String TOKEN_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTokens
public List<NuxeoOAuth2Token> getTokens(NuxeoPrincipal principal)
Description copied from interface:OAuth2TokenService
Gets the oAuth2 tokens as the given principal.- Specified by:
getTokens
in interfaceOAuth2TokenService
- Returns:
- the oAuth2 tokens
-
getTokens
public List<NuxeoOAuth2Token> getTokens(String nxuser)
Description copied from interface:OAuth2TokenService
Gets the OAuth2 tokens for the given user.- Specified by:
getTokens
in interfaceOAuth2TokenService
- Parameters:
nxuser
- the nuxeo user- Returns:
- the oAuth2 tokens that match the given user
-
getTokens
public List<NuxeoOAuth2Token> getTokens(NuxeoOAuth2TokenType type, NuxeoPrincipal principal)
Description copied from interface:OAuth2TokenService
Gets the oAuth2 tokens for a given type as the given principal.- Specified by:
getTokens
in interfaceOAuth2TokenService
- Parameters:
type
- the token typeNuxeoOAuth2TokenType
- Returns:
- the oAuth2 tokens that match the type
-
getTokens
public List<NuxeoOAuth2Token> getTokens(String nxuser, NuxeoOAuth2TokenType type)
Description copied from interface:OAuth2TokenService
Gets the OAuth2 tokens from a given user name and a type.- Specified by:
getTokens
in interfaceOAuth2TokenService
- Parameters:
nxuser
- the nuxeo usertype
- the token typeNuxeoOAuth2TokenType
- Returns:
- the oAuth2 tokens
-
search
public List<NuxeoOAuth2Token> search(String query, NuxeoPrincipal principal)
Description copied from interface:OAuth2TokenService
Finds the oAuth2 tokens that match the givenquery
as the given principal. To be retrieved a token should match thequery
anywhere in the string value of the fieldsNuxeoOAuth2Token.KEY_NUXEO_LOGIN
,NuxeoOAuth2Token.KEY_SERVICE_NAME
- Specified by:
search
in interfaceOAuth2TokenService
- Parameters:
query
- the query to match- Returns:
- the oAuth2 tokens that match the
query
-
findTokens
protected List<NuxeoOAuth2Token> findTokens(QueryBuilder queryBuilder)
-
findTokens
protected List<NuxeoOAuth2Token> findTokens(QueryBuilder queryBuilder, NuxeoPrincipal principal)
-
checkPermission
protected void checkPermission(NuxeoPrincipal principal)
-
getQueryBuilder
protected QueryBuilder getQueryBuilder(String query)
-
getQueryBuilder
protected QueryBuilder getQueryBuilder(String nxuser, NuxeoOAuth2TokenType type)
-
-