com.netflix.eureka.resources
Class InstanceResource

java.lang.Object
  extended by com.netflix.eureka.resources.InstanceResource

public class InstanceResource
extends java.lang.Object

A jersey resource that handles operations for a particular instance.


Constructor Summary
InstanceResource(ApplicationResource app, java.lang.String id)
           
 
Method Summary
 javax.ws.rs.core.Response cancelLease(java.lang.String isReplication)
          Handles cancellation of leases for this particular instance.
 javax.ws.rs.core.Response getInstanceInfo()
          Get requests returns the information about the instance's InstanceInfo.
 javax.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.
 javax.ws.rs.core.Response statusUpdate(java.lang.String newStatus, java.lang.String isReplication, java.lang.String lastDirtyTimestamp)
          Handles InstanceInfo.InstanceStatus updates.
 javax.ws.rs.core.Response updateMetadata(javax.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
 

Constructor Detail

InstanceResource

public InstanceResource(ApplicationResource app,
                        java.lang.String id)
Method Detail

getInstanceInfo

public javax.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

public javax.ws.rs.core.Response renewLease(@HeaderParam(value="x-netflix-discovery-replication")
                                            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.

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

public javax.ws.rs.core.Response statusUpdate(java.lang.String newStatus,
                                              @HeaderParam(value="x-netflix-discovery-replication")
                                              java.lang.String isReplication,
                                              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.

updateMetadata

public javax.ws.rs.core.Response updateMetadata(@Context
                                                javax.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

public javax.ws.rs.core.Response cancelLease(@HeaderParam(value="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.