Class CosmosOfficeCabinet<D>

  • All Implemented Interfaces:
    net.officefloor.cabinet.OfficeCabinet<D>

    public class CosmosOfficeCabinet<D>
    extends java.lang.Object
    implements net.officefloor.cabinet.OfficeCabinet<D>
    Cosmos DB OfficeCabinet.
    Author:
    Daniel Sagenschneider
    • Constructor Summary

      Constructors 
      Constructor Description
      CosmosOfficeCabinet​(java.lang.Class<D> documentType, com.azure.cosmos.CosmosDatabase cosmosDatabase)
      Instantiate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<D> retrieveByKey​(java.lang.String key)  
      void store​(D document)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CosmosOfficeCabinet

        public CosmosOfficeCabinet​(java.lang.Class<D> documentType,
                                   com.azure.cosmos.CosmosDatabase cosmosDatabase)
                            throws java.lang.Exception
        Instantiate.
        Parameters:
        documentType - Document type.
        cosmosDatabase - CosmosDatabase.
        Throws:
        java.lang.Exception - If fails to instantiate OfficeCabinet.
    • Method Detail

      • retrieveByKey

        public java.util.Optional<D> retrieveByKey​(java.lang.String key)
        Specified by:
        retrieveByKey in interface net.officefloor.cabinet.OfficeCabinet<D>
      • store

        public void store​(D document)
        Specified by:
        store in interface net.officefloor.cabinet.OfficeCabinet<D>