Examples of InstanceInfo


Examples of com.netflix.appinfo.InstanceInfo

        PropertyBasedAzToRegionMapper azToRegionMapper = new PropertyBasedAzToRegionMapper(new DefaultEurekaClientConfig());
        InstanceRegionChecker checker = new InstanceRegionChecker(azToRegionMapper, "us-east-1");
        azToRegionMapper.setRegionsToFetch(new String[] {"us-east-1"});
        AmazonInfo dcInfo = AmazonInfo.Builder.newBuilder().addMetadata(AmazonInfo.MetaDataKey.availabilityZone,
                                                                              "us-east-x").build();
        InstanceInfo instanceInfo = InstanceInfo.Builder.newBuilder().setAppName("abc").setDataCenterInfo(dcInfo) .build();
        String instanceRegion = checker.getInstanceRegion(instanceInfo);

        Assert.assertNull("Invalid instance region.", instanceRegion);
    }
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        mockLocalEurekaServer.addLocalRegionAppsDelta(LOCAL_REGION_APP_NAME, myappDelta);
    }

    private Application createLocalApps() {
        Application myapp = new Application(LOCAL_REGION_APP_NAME);
        InstanceInfo instanceInfo = createLocalInstance(LOCAL_REGION_INSTANCE_1_HOSTNAME);
        myapp.addInstance(instanceInfo);
        return myapp;
    }
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        return myapp;
    }

    private Application createLocalAppsDelta() {
        Application myapp = new Application(LOCAL_REGION_APP_NAME);
        InstanceInfo instanceInfo = createLocalInstance(LOCAL_REGION_INSTANCE_2_HOSTNAME);
        instanceInfo.setActionType(InstanceInfo.ActionType.ADDED);
        myapp.addInstance(instanceInfo);
        return myapp;
    }
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        mockLocalEurekaServer.addRemoteRegionAppsDelta(REMOTE_REGION_APP_NAME, myappDelta);
    }

    private Application createRemoteApps() {
        Application myapp = new Application(REMOTE_REGION_APP_NAME);
        InstanceInfo instanceInfo = createRemoteInstance(REMOTE_REGION_INSTANCE_1_HOSTNAME);
        myapp.addInstance(instanceInfo);
        return myapp;
    }
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        return myapp;
    }

    private Application createRemoteAppsDelta() {
        Application myapp = new Application(REMOTE_REGION_APP_NAME);
        InstanceInfo instanceInfo = createRemoteInstance(REMOTE_REGION_INSTANCE_2_HOSTNAME);
        instanceInfo.setActionType(InstanceInfo.ActionType.ADDED);
        myapp.addInstance(instanceInfo);
        return myapp;
    }
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        ApplicationInfoManager.getInstance().setInstanceStatus(
                InstanceStatus.UP);

        String vipAddress = configInstance.getStringProperty(
                "eureka.vipAddress", "sampleservice.mydomain.net").get();
        InstanceInfo nextServerInfo = null;
        while (nextServerInfo == null) {
            try {
                nextServerInfo = DiscoveryManager.getInstance()
                .getDiscoveryClient()
                .getNextServerFromEureka(vipAddress, false);
View Full Code Here

Examples of com.netflix.appinfo.InstanceInfo

        backupRegistry.getRemoteRegionVsApps().put(REMOTE_REGION, remoteApps);
    }

    private Application createLocalApps() {
        Application myapp = new Application(LOCAL_REGION_APP_NAME);
        InstanceInfo instanceInfo = createLocalInstance(LOCAL_REGION_INSTANCE_1_HOSTNAME);
        myapp.addInstance(instanceInfo);
        return myapp;
    }
View Full Code Here

Examples of com.netflix.staash.mesh.InstanceInfo

   
    @Inject
    public MemoryServer(InstanceRegistry instanceRegistry, ClientFactory clientFactory, EndpointPolicy endpointPolicy, String id) {
        this.instanceRegistry = instanceRegistry;
        this.clientFactory    = clientFactory;
        this.instanceInfo     = new InstanceInfo(id, UUID.randomUUID());
        this.endpointPolicy   = endpointPolicy;
       
        verbHandlers.put(Verb.DATA_PUSH,       new DataPushHandler());
        verbHandlers.put(Verb.DATA_REQUEST,    new DataRequestHandler());
        verbHandlers.put(Verb.DATA_RESPONSE,   new DataResponseHandler());
View Full Code Here

Examples of com.sun.enterprise.util.cluster.InstanceInfo

            Cluster cluster = domain.getClusterForInstance(name);
            String clusterName = (cluster != null) ? cluster.getName() : null;
            // skip DAS
            if (notDas(name)) {
                ActionReport tReport = habitat.getService(ActionReport.class, "html");
                InstanceInfo ii = new InstanceInfo(
                        habitat,
                        server,
                        port,
                        host,
                        clusterName,
                        logger,
                        timeoutInMsec,
                        tReport,
                        stateService);
                infos.add(ii);
            }
        }
        if (infos.size() < 1) {
            report.setMessage(NONE);
            return;
        }

        Properties extraProps = new Properties();
        List instanceList = new ArrayList();

        for (InstanceInfo ii : infos) {
            String name = ii.getName();
            String value = (ii.isRunning()) ? InstanceState.StateType.RUNNING.getDescription()
                    : InstanceState.StateType.NOT_RUNNING.getDescription();
            InstanceState.StateType state = (ii.isRunning())
                    ? (stateService.setState(name, InstanceState.StateType.RUNNING, false))
                    : (stateService.setState(name, InstanceState.StateType.NOT_RUNNING, false));
            List<String> failedCmds = stateService.getFailedCommands(name);
            if (state == InstanceState.StateType.RESTART_REQUIRED) {
                if (ii.isRunning()) {
                    //value += (";" + InstanceState.StateType.RESTART_REQUIRED.getDescription());
                    value = InstanceState.StateType.RESTART_REQUIRED.getDescription();
                }
            }

            HashMap<String, Object> insDetails = new HashMap<String, Object>();
            insDetails.put("name", name);
            insDetails.put("status", value);
            if (state == InstanceState.StateType.RESTART_REQUIRED) {
                insDetails.put("restartReasons", failedCmds);
            }
            if (ii.isRunning()) {
                insDetails.put("uptime", ii.getUptime());
            }
            instanceList.add(insDetails);
        }
        extraProps.put("instanceList", instanceList);
        report.setExtraProperties(extraProps);
View Full Code Here

Examples of com.sun.enterprise.util.cluster.InstanceInfo

            for (Server server : servers) {
                String name = server.getName();

                if (name != null) {
                    ActionReport tReport = habitat.getService(ActionReport.class, "html");
                    InstanceInfo ii = new InstanceInfo(
                            habitat, server, helper.getAdminPort(server), server.getAdminHost(),
                            clusterName, logger, timeoutInMsec, tReport, stateService);
                    infos.add(ii);
                }
            }
        }

        for(InstanceInfo ii : infos) {

            String clusterforInstance = ii.getCluster();
            ClusterInfo ci = clusterMap.get(clusterforInstance);
            if (ci == null ) {
                ci = new ClusterInfo(clusterforInstance);
            }
            ci.allInstancesRunning &= ii.isRunning();

            if (ii.isRunning()) {
                ci.atleastOneInstanceRunning = true;
            }

            clusterMap.put(clusterforInstance,ci);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.