public NodeInfo(String environment) { this("test-application", new NodeConfig().setEnvironment(environment)); }
@Inject public NodeInfo(@ApplicationName String application, @ApplicationVersion String applicationVersion, @PlatformVersion String platformVersion, NodeConfig config) { this(application, applicationVersion, platformVersion, config.getEnvironment(), config.getPool(), config.getNodeId(), config.getNodeInternalIp(), config.getNodeInternalHostname(), config.getNodeBindIp(), config.getNodeExternalAddress(), config.getLocation() ); }
@Inject public SimpleDbStateManager(AmazonSimpleDB simpleDb, NodeInfo nodeInfo) { this.simpleDb = simpleDb; domainName = "galaxy-" + nodeInfo.getEnvironment(); }
@Inject public LauncherLifecycleManager(AgentConfig config, NodeInfo nodeInfo, HttpServerInfo httpServerInfo) { this(nodeInfo.getEnvironment(), nodeInfo.getInternalIp(), nodeInfo.getExternalAddress(), nodeInfo.getBindIp(), config.getLauncherTimeout(), config.getLauncherStopTimeout(), uriBuilderFrom(httpServerInfo.getHttpsUri() != null ? httpServerInfo.getHttpsUri() : httpServerInfo.getHttpUri()).appendPath("/v1/serviceInventory").build() ); }
@Override public void configure(Binder binder) { NodeConfig nodeConfig = new NodeConfig() .setEnvironment(environment) .setNodeInternalIp(getV4Localhost()) .setNodeBindIp(getV4Localhost()); if (pool.isPresent()) { nodeConfig.setPool(pool.get()); } binder.bind(NodeConfig.class).toInstance(nodeConfig); newExporter(binder).export(NodeInfo.class).withGeneratedName(); }
@Inject public Agent(AgentConfig config, HttpServerInfo httpServerInfo, NodeInfo nodeInfo, DeploymentManagerFactory deploymentManagerFactory, LifecycleManager lifecycleManager) { this(nodeInfo.getNodeId(), nodeInfo.getLocation(), config.getSlotsDir(), httpServerInfo.getHttpUri(), httpServerInfo.getHttpExternalUri(), config.getResourcesFile(), deploymentManagerFactory, lifecycleManager, config.getMaxLockWait() ); }
public EventJsonSerializer(NodeInfo nodeInfo, @Nullable String token, EventTypeMetadata<T> eventTypeMetadata) { this.token = token; this.eventTypeMetadata = checkNotNull(eventTypeMetadata, "eventTypeMetadata is null"); if (eventTypeMetadata.getHostField() == null) { hostName = nodeInfo.getInternalHostname(); } else { hostName = null; } }
@Provides @Singleton NodeInfo createNodeInfo(NodeConfig config) { return new NodeInfo("test-application", config); }
public static CassandraServerInfo getServerInfo() { Preconditions.checkState(initialized.get(), "Embedded Cassandra instance not yet initialized. Make sure to call tryInitialize() before calling this method."); return new CassandraServerInfo(nodeInfo.getBindIp(), rpcPort); }
@JsonProperty String getApplication() { return getNodeInfo().getApplication(); }
@JsonProperty String getPlatformVersion() { String platformVersion = getNodeInfo().getPlatformVersion(); if (platformVersion.isEmpty()) { return null; } return platformVersion; } }
@JsonProperty String getApplicationVersion() { String applicationVersion = getNodeInfo().getApplicationVersion(); if (applicationVersion.isEmpty()) { return null; } return applicationVersion; }
@Inject public DirectoryDeploymentManagerFactory(NodeInfo nodeInfo, AgentConfig config) { this(nodeInfo.getLocation(), config.getSlotsDir(), config.getTarTimeout()); }
@Override public synchronized ServiceAnnouncement get() { if (httpServerInfo.getAdminUri() != null) { URI adminUri = httpServerInfo.getAdminUri(); if (adminUri.getScheme().equals("http")) { builder.addProperty("http", adminUri.toString()); builder.addProperty("http-external", httpServerInfo.getAdminExternalUri().toString()); } else if (adminUri.getScheme().equals("https")) { builder.addProperty("https", adminUri.toString()); builder.addProperty("https-external", httpServerInfo.getAdminExternalUri().toString()); } } if (nodeInfo.getBinarySpec() != null) { builder.addProperty("binary", nodeInfo.getBinarySpec()); } if (nodeInfo.getConfigSpec() != null) { builder.addProperty("config", nodeInfo.getConfigSpec()); } return builder.build(); } }
@Override public Bootstrap withModules(Iterable<? extends Module> modules) { return new Bootstrap(new ApplicationNameModule(applicationName), modules, initializeLogging); } }
@Inject public ServiceInventoryResource(Coordinator coordinator, ServiceInventory serviceInventory, NodeInfo nodeInfo) { Preconditions.checkNotNull(coordinator, "coordinator is null"); Preconditions.checkNotNull(serviceInventory, "serviceInventory is null"); Preconditions.checkNotNull(nodeInfo, "nodeInfo is null"); this.coordinator = coordinator; this.serviceInventory = serviceInventory; this.environment = nodeInfo.getEnvironment(); }
@SuppressWarnings("deprecation") private UnitTestBootstrap(Iterable<? extends Module> modules) { bootstrap = new Bootstrap(new ApplicationNameModule("test-application"), modules, false) .quiet() .setRequiredConfigurationProperties(ImmutableMap.of()); // Suppress reading configuration file }
@Inject public HttpRemoteAgentFactory(NodeInfo nodeInfo, JsonCodec<InstallationRepresentation> installationCodec, JsonCodec<SlotStatusRepresentation> slotStatusCodec, JsonCodec<AgentStatusRepresentation> agentStatusCodec, JsonCodec<ServiceDescriptorsRepresentation> serviceDescriptorsCodec) { environment = nodeInfo.getEnvironment(); this.agentStatusCodec = agentStatusCodec; this.httpClient = new ApacheHttpClient(); this.installationCodec = installationCodec; this.slotStatusCodec = slotStatusCodec; this.serviceDescriptorsCodec = serviceDescriptorsCodec; }
@Override protected void setup(Binder binder) { T configObject = buildConfigObject(configClass); binder.install(new ApplicationNameModule(applicationNameFunction.apply(configObject))); } }
@Inject public ServiceInventoryResource(NodeInfo nodeInfo) { environment = nodeInfo.getEnvironment(); descriptor.set(new ServiceDescriptorsRepresentation(environment, ImmutableList.<ServiceDescriptor>of())); }