Class InstanceResource


  • @Produces({"application/xml","application/json"})
    public class InstanceResource
    extends java.lang.Object
    A jersey resource that handles operations for a particular instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      jakarta.ws.rs.core.Response cancelLease​(java.lang.String isReplication)
      Handles cancellation of leases for this particular instance.
      jakarta.ws.rs.core.Response deleteStatusUpdate​(java.lang.String isReplication, java.lang.String newStatusValue, java.lang.String lastDirtyTimestamp)
      Removes status override for an instance, set with statusUpdate(String, String, String).
      jakarta.ws.rs.core.Response getInstanceInfo()
      Get requests returns the information about the instance's InstanceInfo.
      jakarta.ws.rs.core.Response renewLease​(java.lang.String isReplication, java.lang.String overriddenStatus, java.lang.String status, java.lang.String lastDirtyTimestamp)
      A put request for renewing lease from a client instance.
      jakarta.ws.rs.core.Response statusUpdate​(java.lang.String newStatus, java.lang.String isReplication, java.lang.String lastDirtyTimestamp)
      Handles InstanceInfo.InstanceStatus updates.
      jakarta.ws.rs.core.Response updateMetadata​(jakarta.ws.rs.core.UriInfo uriInfo)
      Updates user-specific metadata information.
      • Methods inherited from class java.lang.Object

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

      • getInstanceInfo

        @GET
        public jakarta.ws.rs.core.Response getInstanceInfo()
        Get requests returns the information about the instance's InstanceInfo.
        Returns:
        response containing information about the the instance's InstanceInfo.
      • renewLease

        @PUT
        public jakarta.ws.rs.core.Response renewLease​(@HeaderParam("x-netflix-discovery-replication")
                                                      java.lang.String isReplication,
                                                      @QueryParam("overriddenstatus")
                                                      java.lang.String overriddenStatus,
                                                      @QueryParam("status")
                                                      java.lang.String status,
                                                      @QueryParam("lastDirtyTimestamp")
                                                      java.lang.String lastDirtyTimestamp)
        A put request for renewing lease from a client instance.
        Parameters:
        isReplication - a header parameter containing information whether this is replicated from other nodes.
        overriddenStatus - overridden status if any.
        status - the InstanceInfo.InstanceStatus of the instance.
        lastDirtyTimestamp - last timestamp when this instance information was updated.
        Returns:
        response indicating whether the operation was a success or failure.
      • statusUpdate

        @PUT
        @Path("status")
        public jakarta.ws.rs.core.Response statusUpdate​(@QueryParam("value")
                                                        java.lang.String newStatus,
                                                        @HeaderParam("x-netflix-discovery-replication")
                                                        java.lang.String isReplication,
                                                        @QueryParam("lastDirtyTimestamp")
                                                        java.lang.String lastDirtyTimestamp)
        Handles InstanceInfo.InstanceStatus updates.

        The status updates are normally done for administrative purposes to change the instance status between InstanceInfo.InstanceStatus.UP and InstanceInfo.InstanceStatus.OUT_OF_SERVICE to select or remove instances for receiving traffic.

        Parameters:
        newStatus - the new status of the instance.
        isReplication - a header parameter containing information whether this is replicated from other nodes.
        lastDirtyTimestamp - last timestamp when this instance information was updated.
        Returns:
        response indicating whether the operation was a success or failure.
      • deleteStatusUpdate

        @DELETE
        @Path("status")
        public jakarta.ws.rs.core.Response deleteStatusUpdate​(@HeaderParam("x-netflix-discovery-replication")
                                                              java.lang.String isReplication,
                                                              @QueryParam("value")
                                                              java.lang.String newStatusValue,
                                                              @QueryParam("lastDirtyTimestamp")
                                                              java.lang.String lastDirtyTimestamp)
        Removes status override for an instance, set with statusUpdate(String, String, String).
        Parameters:
        isReplication - a header parameter containing information whether this is replicated from other nodes.
        lastDirtyTimestamp - last timestamp when this instance information was updated.
        Returns:
        response indicating whether the operation was a success or failure.
      • updateMetadata

        @PUT
        @Path("metadata")
        public jakarta.ws.rs.core.Response updateMetadata​(@Context
                                                          jakarta.ws.rs.core.UriInfo uriInfo)
        Updates user-specific metadata information. If the key is already available, its value will be overwritten. If not, it will be added.
        Parameters:
        uriInfo - - URI information generated by jersey.
        Returns:
        response indicating whether the operation was a success or failure.
      • cancelLease

        @DELETE
        public jakarta.ws.rs.core.Response cancelLease​(@HeaderParam("x-netflix-discovery-replication")
                                                       java.lang.String isReplication)
        Handles cancellation of leases for this particular instance.
        Parameters:
        isReplication - a header parameter containing information whether this is replicated from other nodes.
        Returns:
        response indicating whether the operation was a success or failure.