/** * Gets the {@link InstanceInfo} information. * * @param appName the application name for which the information is requested. * @param id the unique identifier of the instance. * @return the information about the instance. */ @Override public InstanceInfo getInstanceByAppAndId(String appName, String id) { return this.getInstanceByAppAndId(appName, id, true); }
/** * Stores overridden status if it is not already there. This happens during * a reconciliation process during renewal requests. * * @param appName the application name of the instance. * @param id the unique identifier of the instance. * @param overriddenStatus overridden status if any. */ @Override public void storeOverriddenStatusIfRequired(String appName, String id, InstanceStatus overriddenStatus) { InstanceStatus instanceStatus = overriddenInstanceStatusMap.get(id); if ((instanceStatus == null) || (!overriddenStatus.equals(instanceStatus))) { // We might not have the overridden status if the server got // restarted -this will help us maintain the overridden state // from the replica logger.info("Adding overridden status for instance id {} and the value is {}", id, overriddenStatus.name()); overriddenInstanceStatusMap.put(id, overriddenStatus); InstanceInfo instanceInfo = this.getInstanceByAppAndId(appName, id, false); instanceInfo.setOverriddenStatus(overriddenStatus); logger.info("Set the overridden status for instance (appname:{}, id:{}} and the value is {} ", appName, id, overriddenStatus.name()); } }
/** * Gets the {@link InstanceInfo} information. * * @param appName the application name for which the information is requested. * @param id the unique identifier of the instance. * @return the information about the instance. */ @Override public InstanceInfo getInstanceByAppAndId(String appName, String id) { return this.getInstanceByAppAndId(appName, id, true); }
/** * Stores overridden status if it is not already there. This happens during * a reconciliation process during renewal requests. * * @param appName the application name of the instance. * @param id the unique identifier of the instance. * @param overriddenStatus overridden status if any. */ @Override public void storeOverriddenStatusIfRequired(String appName, String id, InstanceStatus overriddenStatus) { InstanceStatus instanceStatus = overriddenInstanceStatusMap.get(id); if ((instanceStatus == null) || (!overriddenStatus.equals(instanceStatus))) { // We might not have the overridden status if the server got // restarted -this will help us maintain the overridden state // from the replica logger.info("Adding overridden status for instance id {} and the value is {}", id, overriddenStatus.name()); overriddenInstanceStatusMap.put(id, overriddenStatus); InstanceInfo instanceInfo = this.getInstanceByAppAndId(appName, id, false); instanceInfo.setOverriddenStatus(overriddenStatus); logger.info("Set the overridden status for instance (appname:{}, id:{}} and the value is {} ", appName, id, overriddenStatus.name()); } }