Class KubernetesCrudDispatcher

    • Constructor Detail

      • KubernetesCrudDispatcher

        public KubernetesCrudDispatcher()
      • KubernetesCrudDispatcher

        public KubernetesCrudDispatcher​(List<io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext> crdContexts)
    • Method Detail

      • handleCreate

        public io.fabric8.mockwebserver.http.MockResponse handleCreate​(io.fabric8.mockwebserver.http.RecordedRequest request)
        Adds the specified object to the in-memory db.
        Overrides:
        handleCreate in class io.fabric8.mockwebserver.crud.CrudDispatcher
        Parameters:
        request - RecordedRequest information.
        Returns:
        a MockResponse to be dispatched.
      • handleUpdate

        public io.fabric8.mockwebserver.http.MockResponse handleUpdate​(io.fabric8.mockwebserver.http.RecordedRequest request)
        Updates the specified object to the in-memory db.
        Overrides:
        handleUpdate in class io.fabric8.mockwebserver.crud.CrudDispatcher
        Parameters:
        request - RecordedRequest information.
        Returns:
        a MockResponse to be dispatched.
      • handleGet

        public io.fabric8.mockwebserver.http.MockResponse handleGet​(String path)
        Performs a get for the corresponding object from the in-memory db.
        Overrides:
        handleGet in class io.fabric8.mockwebserver.crud.CrudDispatcher
        Parameters:
        path - The path.
        Returns:
        The MockResponse
      • handlePatch

        public io.fabric8.mockwebserver.http.MockResponse handlePatch​(io.fabric8.mockwebserver.http.RecordedRequest request)
        Patches the specified object to the in-memory db.
        Overrides:
        handlePatch in class io.fabric8.mockwebserver.crud.CrudDispatcher
        Returns:
        The MockResponse
      • handleDelete

        public io.fabric8.mockwebserver.http.MockResponse handleDelete​(String path)
        Performs a delete for the corresponding object from the in-memory db.
        Overrides:
        handleDelete in class io.fabric8.mockwebserver.crud.CrudDispatcher
        Parameters:
        path - String
        Returns:
        The MockResponse
      • processEvent

        public void processEvent​(String path,
                                 io.fabric8.mockwebserver.crud.AttributeSet pathAttributes,
                                 io.fabric8.mockwebserver.crud.AttributeSet oldAttributes,
                                 io.fabric8.kubernetes.api.model.GenericKubernetesResource resource,
                                 String newState)
        Specified by:
        processEvent in interface KubernetesCrudPersistence
      • handleWatch

        public io.fabric8.mockwebserver.http.MockResponse handleWatch​(String path)
        Watch the resource list on `path` endpoint
        Parameters:
        path - String
        Returns:
        The MockResponse
      • reset

        public void reset()
        Description copied from interface: Resetable
        return the resource to its initial state
        Specified by:
        reset in interface Resetable
      • expectCustomResource

        public void expectCustomResource​(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext rdc)
        Specified by:
        expectCustomResource in interface CustomResourceAware
      • locked

        protected void locked​(Lock lock)