/** * Constructs vespa model using config given in app * * @param app the application to create a model from * @param configModelRegistry a registry of config model "main" classes which may be used * to instantiate config models */ public VespaModel(ApplicationPackage app, ConfigModelRegistry configModelRegistry) throws IOException, SAXException { this(configModelRegistry, new DeployState.Builder().applicationPackage(app).build()); }
public DeployLogger deployLogger() { return deployState.getDeployLogger(); }
private static DeployState createDeployState(ApplicationPackage applicationPackage, FileRegistry fileRegistry, DeployLogger logger) { DeployState.Builder builder = new DeployState.Builder() .applicationPackage(applicationPackage) .fileRegistry(fileRegistry) .deployLogger(logger) .configDefinitionRepo(configDefinitionRepo); /* Temporarily disable until we know how status.html is updated for config servers/controllers if (isConfigServer()) builder.properties(new DeployProperties.Builder() .hostedVespa(new CloudConfigInstallVariables().hostedVespa().orElse(Boolean.FALSE)) .build()); */ return builder.build(); }
private void addCommonServices(HostResource host, DeployState deployState) { addConfigSentinel(deployState.getDeployLogger(), host, deployState.getProperties().applicationId(), deployState.zone()); addLogd(deployState.getDeployLogger(), host); addConfigProxy(deployState.getDeployLogger(), host); addFileDistribution(host); if (logForwarderConfig != null) { addLogForwarder(deployState.getDeployLogger(), host); } }
public MockRoot(String rootConfigId, DeployState deployState) { super(rootConfigId); hostSystem = new HostSystem(this, "hostsystem", deployState.getProvisioner(), deployState.getDeployLogger()); this.deployState = deployState; fileDistributor = new FileDistributor(deployState.getFileRegistry(), null); }
public DeployState build() { return build(new ValidationParameters()); }
/** Initialize part 1.: Reads the config models used in the application package. */ public void readConfigModels(DeployState deployState, VespaModel vespaModel, VespaModelBuilder builder, ApplicationConfigProducerRoot root, ConfigModelRegistry configModelRegistry) throws IOException, SAXException { Element userServicesElement = getServicesFromApp(deployState.getApplicationPackage()); readConfigModels(root, userServicesElement, deployState, vespaModel, configModelRegistry); builder.postProc(deployState.getDeployLogger(), root, this); }
public ModelContext.Properties properties() { return deployState.getProperties(); }
protected static boolean stateIsHosted(DeployState deployState) { return (deployState != null) && deployState.isHosted(); }
public ApplicationPackage getApplicationPackage() { return deployState.getApplicationPackage(); } public String getProducerId() { return producerId; }
public DomAdminV4Builder(ConfigModelContext context, boolean multitenant, List<ConfigServerSpec> configServerSpecs, Collection<ContainerModel> containerModels) { super(context.getApplicationType(), context.getDeployState().getFileRegistry(), multitenant, configServerSpecs); this.containerModels = containerModels; this.context = context; }
private static HostProvisioner createHostProvisioner(ModelContext modelContext) { return modelContext.hostProvisioner().orElse( DeployState.getDefaultModelHostProvisioner(modelContext.applicationPackage())); }
public MockRoot(String rootConfigId, ApplicationPackage applicationPackage) { this(rootConfigId, new DeployState.Builder().applicationPackage(applicationPackage).build()); }
public DeployLogger getDeployLogger() { return deployState.getDeployLogger(); } public DeployState getDeployState() { return deployState; }
@Override protected ClusterControllerContainer doBuild(DeployState deployState, AbstractConfigProducer parent, Element spec) { return new ClusterControllerContainer(parent, i, runStandaloneZooKeeper, deployState.isHosted()); } }
private void setApplicationMetaData(DeployState deployState) { applicationMetaData = deployState.getApplicationPackage().getMetaData(); }
public static DeployState createTestState(ApplicationPackage applicationPackage) { return new Builder().applicationPackage(applicationPackage).build(); }
@SuppressWarnings({ "UnusedDeclaration"}) // Created by reflection in ConfigModelRepo public Content(ConfigModelContext modelContext, AdminModel adminModel, Collection<ContainerModel> containers) { super(modelContext); modelContext.getParentProducer().getRoot(); isHosted = modelContext.getDeployState().isHosted(); this.adminModel = adminModel; this.containers = containers; }
/** * Build a model from an application package. * * @param applicationPackage Any type of application package. * @return a producer root capable of answering getConfig requests. */ public TestRoot buildModel(ApplicationPackage applicationPackage) { return buildModel(new DeployState.Builder().applicationPackage(applicationPackage).build()); }