Java Code Examples for com.netflix.appinfo.InstanceInfo#PortWrapper

The following examples show how to use com.netflix.appinfo.InstanceInfo#PortWrapper . 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: NacosSyncToEurekaServiceImpl.java    From nacos-sync with Apache License 2.0 5 votes vote down vote up
private InstanceInfo buildSyncInstance(Instance instance, TaskDO taskDO) {
    DataCenterInfo dataCenterInfo = new MyDataCenterInfo(DataCenterInfo.Name.MyOwn);
    HashMap<String, String> metadata = new HashMap<>(16);
    metadata.put(SkyWalkerConstants.DEST_CLUSTERID_KEY, taskDO.getDestClusterId());
    metadata.put(SkyWalkerConstants.SYNC_SOURCE_KEY, skyWalkerCacheServices.getClusterType(taskDO.getSourceClusterId()).getCode());
    metadata.put(SkyWalkerConstants.SOURCE_CLUSTERID_KEY, taskDO.getSourceClusterId());
    String homePageUrl = "http://" + instance.getIp() + ":" + instance.getPort();
    String serviceName = taskDO.getServiceName();

    return new InstanceInfo(
            instance.getIp() + ":" + serviceName + ":" + instance.getPort(),
            serviceName,
            null,
            instance.getIp(),
            null,
            new InstanceInfo.PortWrapper(true, instance.getPort()),
            null,
            homePageUrl,
            homePageUrl + "/info",
            homePageUrl + "/health",
            null,
            serviceName,
            serviceName,
            1,
            dataCenterInfo,
            instance.getIp(),
            InstanceInfo.InstanceStatus.UP,
            InstanceInfo.InstanceStatus.UNKNOWN,
            null,
            new LeaseInfo(30, 90,
                    0L, 0L, 0L, 0L, 0L),
            false,
            metadata,
            System.currentTimeMillis(),
            System.currentTimeMillis(),
            null,
            null
    );
}
 
Example 2
Source File: InstanceLookupExecutorTest.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
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 3
Source File: ContainerServiceMockUtil.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
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 4
Source File: ApiServiceStatusServiceTest.java    From api-layer with Eclipse Public License 2.0 4 votes vote down vote up
private InstanceInfo getStandardInstance(String serviceId, InstanceInfo.InstanceStatus status,
        HashMap<String, String> metadata, String ipAddress, int port) {
    return new InstanceInfo(serviceId + ":" + port, serviceId.toUpperCase(), null, ipAddress, null,
            new InstanceInfo.PortWrapper(true, port), null, null, null, null, null, null, null, 0, null, "hostname",
            status, null, null, null, null, metadata, null, null, null, null);
}
 
Example 5
Source File: CachedServicesServiceTest.java    From api-layer with Eclipse Public License 2.0 4 votes vote down vote up
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 6
Source File: ApiCatalogControllerTests.java    From api-layer with Eclipse Public License 2.0 4 votes vote down vote up
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);
}