Java Code Examples for com.netflix.appinfo.InstanceInfo#InstanceStatus
The following examples show how to use
com.netflix.appinfo.InstanceInfo#InstanceStatus .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EurekaInstatnceTransformer.java From spring-cloud-gray with Apache License 2.0 | 6 votes |
public static InstanceStatus toGrayInstanceStatus(InstanceInfo.InstanceStatus status) { if (status == null) { return InstanceStatus.UNKNOWN; } switch (status) { case DOWN: return InstanceStatus.DOWN; case UP: return InstanceStatus.UP; case STARTING: return InstanceStatus.STARTING; case OUT_OF_SERVICE: return InstanceStatus.OUT_OF_SERVICE; default: return InstanceStatus.UNKNOWN; } }
Example 2
Source File: EurekaInstatnceTransformer.java From spring-cloud-gray with Apache License 2.0 | 6 votes |
public static InstanceInfo.InstanceStatus toEurekaInstanceStatus(InstanceStatus status) { switch (status) { case UP: return InstanceInfo.InstanceStatus.UP; case DOWN: return InstanceInfo.InstanceStatus.DOWN; case UNKNOWN: return InstanceInfo.InstanceStatus.UNKNOWN; case STARTING: return InstanceInfo.InstanceStatus.STARTING; case OUT_OF_SERVICE: return InstanceInfo.InstanceStatus.OUT_OF_SERVICE; default: log.error("不支持{}类型的实例状态", status); throw new UnsupportedOperationException("不支持的实例状态"); } }
Example 3
Source File: EurekaInstatnceTransformer.java From spring-cloud-gray with Apache License 2.0 | 6 votes |
public static InstanceStatus toGrayInstanceStatus(InstanceInfo.InstanceStatus status) { if (status == null) { return InstanceStatus.UNKNOWN; } switch (status) { case DOWN: return InstanceStatus.DOWN; case UP: return InstanceStatus.UP; case STARTING: return InstanceStatus.STARTING; case OUT_OF_SERVICE: return InstanceStatus.OUT_OF_SERVICE; default: return InstanceStatus.UNKNOWN; } }
Example 4
Source File: InstanceInitializeServiceTest.java From api-layer with Eclipse Public License 2.0 | 6 votes |
private InstanceInfo getStandardInstance(String serviceId, InstanceInfo.InstanceStatus status, HashMap<String, String> metadata, String vipAddress, String homePageUrl) { return InstanceInfo.Builder.newBuilder() .setInstanceId(serviceId) .setAppName(serviceId) .setIPAddr("192.168.0.1") .enablePort(InstanceInfo.PortType.SECURE, true) .setSecurePort(9090) .setHostName("localhost") .setHomePageUrl(homePageUrl, homePageUrl) .setSecureVIPAddress("localhost") .setMetadata(metadata) .setVIPAddress(vipAddress) .setStatus(status) .build(); }
Example 5
Source File: EurekaAgentStatusMonitor.java From titus-control-plane with Apache License 2.0 | 5 votes |
private void updateInstanceStatus(AgentInstance instance) { List<InstanceInfo> instancesById = eurekaClient.getInstancesById(instance.getId()); Optional<InstanceInfo> instanceInfo = instancesById.isEmpty() ? Optional.empty() : Optional.of(instancesById.get(0)); InstanceInfo.InstanceStatus newStatus = instanceInfo.map(InstanceInfo::getStatus).orElse(InstanceStatus.UNKNOWN); Pair<InstanceStatus, AgentStatus> previous = statusByInstanceId.get(instance.getId()); if (previous == null) { updateAndEmit(instance, instanceInfo, newStatus); } else { if (newStatus != previous.getLeft()) { updateAndEmit(instance, instanceInfo, newStatus); } } }
Example 6
Source File: AdminController.java From kayenta with Apache License 2.0 | 5 votes |
private void setInstanceEnabled(boolean enabled) { InstanceInfo.InstanceStatus currentStatus = enabled ? UP : OUT_OF_SERVICE; InstanceInfo.InstanceStatus previousStatus = currentStatus == OUT_OF_SERVICE ? UP : UNKNOWN; publisher.publishEvent( new RemoteStatusChangedEvent(new StatusChangeEvent(previousStatus, currentStatus))); }
Example 7
Source File: ContainerServiceMockUtil.java From api-layer with Eclipse Public License 2.0 | 5 votes |
public InstanceInfo createInstance(String serviceId, String instanceId, InstanceInfo.InstanceStatus status, InstanceInfo.ActionType actionType, HashMap<String, String> metadata) { return new InstanceInfo(instanceId, serviceId.toUpperCase(), null, "192.168.0.1", null, new InstanceInfo.PortWrapper(true, 9090), null, null, null, null, null, null, null, 0, null, "hostname", status, null, null, null, null, metadata, null, null, actionType, null); }
Example 8
Source File: CachedProductFamilyTest.java From api-layer with Eclipse Public License 2.0 | 5 votes |
private InstanceInfo getStandardInstance(String serviceId, InstanceInfo.InstanceStatus status, HashMap<String, String> metadata) { return InstanceInfo.Builder.newBuilder() .setInstanceId(serviceId) .setAppName(serviceId) .setStatus(status) .setMetadata(metadata) .build(); }
Example 9
Source File: BootHealthCheckHandler.java From kork with Apache License 2.0 | 5 votes |
@Override public InstanceInfo.InstanceStatus getStatus(InstanceInfo.InstanceStatus currentStatus) { final String statusCode = aggregateHealth.health().getStatus().getCode(); if (Status.UP.getCode().equals(statusCode)) { return InstanceInfo.InstanceStatus.UP; } else if (Status.OUT_OF_SERVICE.getCode().equals(statusCode)) { return InstanceInfo.InstanceStatus.OUT_OF_SERVICE; } else if (Status.DOWN.getCode().equals(statusCode)) { return InstanceInfo.InstanceStatus.DOWN; } else { return InstanceInfo.InstanceStatus.UNKNOWN; } }
Example 10
Source File: DefaultEurekaKaryonStatusBridge.java From karyon with Apache License 2.0 | 5 votes |
@Override public InstanceInfo.InstanceStatus interpretKaryonStatus(int karyonStatus) { if(karyonStatus == 204) { return InstanceInfo.InstanceStatus.STARTING; } else if (karyonStatus >= 200 && karyonStatus < 300) { return InstanceInfo.InstanceStatus.UP; } return InstanceInfo.InstanceStatus.DOWN; }
Example 11
Source File: InstanceLookupExecutorTest.java From api-layer with Eclipse Public License 2.0 | 5 votes |
public InstanceInfo createInstance(String serviceId, String instanceId, InstanceInfo.InstanceStatus status, InstanceInfo.ActionType actionType, HashMap<String, String> metadata) { return new InstanceInfo( instanceId, serviceId.toUpperCase(), null, "192.168.0.1", null, new InstanceInfo.PortWrapper(true, 9090), null, null, null, null, null, null, null, 0, null, "hostname", status, null, null, null, null, metadata, null, null, actionType, null); }
Example 12
Source File: EurekaGenerator.java From titus-control-plane with Apache License 2.0 | 5 votes |
public static InstanceInfo newInstanceInfo(String instanceId, String vipAddress, String ipAddress, InstanceInfo.InstanceStatus status) { return InstanceInfo.Builder.newBuilder() .setInstanceId(instanceId) .setAppName("testApp") .setVIPAddress(vipAddress) .setIPAddr(ipAddress) .setStatus(status) .build(); }
Example 13
Source File: MyHealthCheckHandler.java From shop with Apache License 2.0 | 5 votes |
@Override public InstanceInfo.InstanceStatus getStatus(InstanceInfo.InstanceStatus instanceStatus) { Status status = myHealthIndicator.health().getStatus(); if(Status.UP.equals(status)){ return InstanceInfo.InstanceStatus.UP; } return InstanceInfo.InstanceStatus.DOWN; }
Example 14
Source File: ApimlInstanceRegistry.java From api-layer with Eclipse Public License 2.0 | 4 votes |
@Override public boolean statusUpdate(String appName, String instanceId, InstanceInfo.InstanceStatus newStatus, String lastDirtyTimestamp, boolean isReplication) { boolean isUpdated = super.statusUpdate(appName, instanceId, newStatus, lastDirtyTimestamp, isReplication); this.appCntx.publishEvent(new EurekaStatusUpdateEvent(this, appName, instanceId)); return isUpdated; }
Example 15
Source File: CachedServicesServiceTest.java From api-layer with Eclipse Public License 2.0 | 4 votes |
private InstanceInfo getStandardInstance(String serviceId, InstanceInfo.InstanceStatus status, HashMap<String, String> metadata) { return new InstanceInfo(serviceId, serviceId.toUpperCase(), null, "192.168.0.1", null, new InstanceInfo.PortWrapper(true, 9090), null, null, null, null, null, null, null, 0, null, "hostname", status, null, null, null, null, metadata, null, null, null, null); }
Example 16
Source File: CachedProductFamilyTest.java From api-layer with Eclipse Public License 2.0 | 4 votes |
private InstanceInfo createApp(String serviceId, String catalogId, InstanceInfo.InstanceStatus status) { return createApp(serviceId, catalogId, "Title", "Description", "1.0.0", status); }
Example 17
Source File: EurekaHealthCheckHandler.java From karyon with Apache License 2.0 | 4 votes |
@Override public InstanceInfo.InstanceStatus getStatus(InstanceInfo.InstanceStatus currentStatus) { int healthStatus = healthCheckHandler.getStatus(); return eurekaKaryonStatusBridge.interpretKaryonStatus(healthStatus); }
Example 18
Source File: ApiCatalogControllerTests.java From api-layer with Eclipse Public License 2.0 | 4 votes |
private InstanceInfo getStandardInstance(String serviceId, InstanceInfo.InstanceStatus status) { return new InstanceInfo(serviceId, null, null, "192.168.0.1", null, new InstanceInfo.PortWrapper(true, 9090), null, null, null, null, null, null, null, 0, null, "hostname", status, null, null, null, null, null, null, null, null, null); }
Example 19
Source File: ServerStatusManager.java From zuul with Apache License 2.0 | 4 votes |
public void localStatus(InstanceInfo.InstanceStatus status) { applicationInfoManager.setInstanceStatus(status); }
Example 20
Source File: EurekaServerStub.java From titus-control-plane with Apache License 2.0 | 4 votes |
@Override public InstanceInfo.InstanceStatus getInstanceRemoteStatus() { return null; }