Class InMemoryJwtAuthorityRepositoryManagedObjectSource
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,None>
-
- net.officefloor.tutorial.jwtauthorityhttpserver.InMemoryJwtAuthorityRepositoryManagedObjectSource
-
- All Implemented Interfaces:
ManagedObject
,ManagedObjectSource<None,None>
,JwtAuthorityRepository
public class InMemoryJwtAuthorityRepositoryManagedObjectSource extends AbstractManagedObjectSource<None,None> implements ManagedObject, JwtAuthorityRepository
In memory
JwtAuthorityRepository
ManagedObjectSource
.Production environments should persist
JwtValidateKey
instances to persistent storage. This is only provided for an easier tutorial.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
-
Nested classes/interfaces inherited from interface net.officefloor.web.jwt.authority.repository.JwtAuthorityRepository
JwtAuthorityRepository.ClusterCriticalSection, JwtAuthorityRepository.RetrieveKeysContext, JwtAuthorityRepository.SaveKeysContext
-
-
Constructor Summary
Constructors Constructor Description InMemoryJwtAuthorityRepositoryManagedObjectSource()
-
Method Summary
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.web.jwt.authority.repository.JwtAuthorityRepository
doClusterCriticalSection
-
-
-
-
Method Detail
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context) throws java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSource
Synchronously obtains theManagedObject
.- Specified by:
getManagedObject
in classAbstractManagedObjectSource<None,None>
- Returns:
ManagedObject
.- Throws:
java.lang.Throwable
- If fails to obtain theManagedObject
.
-
getObject
public java.lang.Object getObject() throws java.lang.Throwable
Description copied from interface:ManagedObject
Obtains the object being managed.- Specified by:
getObject
in interfaceManagedObject
- Returns:
- Object being managed.
- Throws:
java.lang.Throwable
- Indicating failed to obtain the object for use.
-
retrieveJwtAccessKeys
public java.util.List<JwtAccessKey> retrieveJwtAccessKeys(JwtAuthorityRepository.RetrieveKeysContext context) throws java.lang.Exception
Description copied from interface:JwtAuthorityRepository
Retrieves the list ofJwtAccessKey
instances.- Specified by:
retrieveJwtAccessKeys
in interfaceJwtAuthorityRepository
- Parameters:
context
-JwtAuthorityRepository.RetrieveKeysContext
.- Returns:
JwtAccessKey
instances.- Throws:
java.lang.Exception
- Possible failure in retrieving theJwtAccessKey
instances.
-
saveJwtAccessKeys
public void saveJwtAccessKeys(JwtAuthorityRepository.SaveKeysContext context, JwtAccessKey... accessKeys) throws java.lang.Exception
Description copied from interface:JwtAuthorityRepository
Saves newJwtAccessKey
instances.- Specified by:
saveJwtAccessKeys
in interfaceJwtAuthorityRepository
- Parameters:
context
-JwtAuthorityRepository.SaveKeysContext
.accessKeys
- NewJwtAccessKey
instances.- Throws:
java.lang.Exception
- If fails to save theJwtAccessKey
instance.
-
retrieveJwtRefreshKeys
public java.util.List<JwtRefreshKey> retrieveJwtRefreshKeys(JwtAuthorityRepository.RetrieveKeysContext context) throws java.lang.Exception
Description copied from interface:JwtAuthorityRepository
Retrieves the list ofJwtRefreshKey
instances.- Specified by:
retrieveJwtRefreshKeys
in interfaceJwtAuthorityRepository
- Parameters:
context
-JwtAuthorityRepository.RetrieveKeysContext
.- Returns:
JwtRefreshKey
instances.- Throws:
java.lang.Exception
- Possible failure in retrieving theJwtRefreshKey
instances.
-
saveJwtRefreshKeys
public void saveJwtRefreshKeys(JwtAuthorityRepository.SaveKeysContext context, JwtRefreshKey... refreshKeys)
Description copied from interface:JwtAuthorityRepository
Saves newJwtRefreshKey
instances.- Specified by:
saveJwtRefreshKeys
in interfaceJwtAuthorityRepository
- Parameters:
context
-JwtAuthorityRepository.SaveKeysContext
.refreshKeys
- NewJwtRefreshKey
instances.
-
-