public AuthBootstrapService() { super(ServiceDocument.class); toggleOption(ServiceOption.IDEMPOTENT_POST, true); toggleOption(ServiceOption.PERSISTENCE, true); toggleOption(ServiceOption.REPLICATION, true); toggleOption(ServiceOption.OWNER_SELECTION, true); }
protected void startServices(VerificationHost host) throws Throwable { HostInitCommonServiceConfig.startServices(host); HostInitPhotonModelServiceConfig.startServices(host); HostInitComputeServicesConfig.startServices(host, true); HostInitAuthServiceConfig.startServices(host); host.registerForServiceAvailability(AuthBootstrapService.startTask(host), true, AuthBootstrapService.FACTORY_LINK); }
@Override public void handleStart(Operation post) { AuthConfigProvider provider = AuthUtil.getPreferredAuthConfigProvider(); if (!ServiceHost.isServiceCreate(post)) { // do not perform bootstrap logic when the post is NOT from direct client, eg: node // restart provider.initConfig(getHost(), post, null); post.complete(); return; } provider.initBootConfig(getHost(), post, null); provider.initConfig(getHost(), post, null); post.complete(); }
@Override public void handlePut(Operation put) { if (put.hasPragmaDirective(Operation.PRAGMA_DIRECTIVE_POST_TO_PUT)) { // converted PUT due to IDEMPOTENT_POST option logInfo("Task has already started. Ignoring converted PUT."); put.complete(); return; } // normal PUT is not supported put.fail(Operation.STATUS_CODE_BAD_METHOD); }
/** * Start all services required to support management of infrastructure and applications. */ protected void startCommonServices() throws Throwable { this.log(Level.INFO, "Common service starting ..."); HostInitCommonServiceConfig.startServices(this); HostInitAuthServiceConfig.startServices(this); HostInitUpgradeServiceConfig.startServices(this); registerForServiceAvailability(AuthBootstrapService.startTask(this), true, AuthBootstrapService.FACTORY_LINK); if (!ConfigurationUtil.isVca()) { registerForServiceAvailability(ProjectsTransformationBootstrapService.startTask(this), true, ProjectsTransformationBootstrapService.FACTORY_LINK, ProjectFactoryService.SELF_LINK); } this.log(Level.INFO, "Common services started."); }
protected void startServices(VerificationHost host) throws Throwable { HostInitCommonServiceConfig.startServices(host); HostInitPhotonModelServiceConfig.startServices(host); HostInitComputeServicesConfig.startServices(host, true); HostInitAuthServiceConfig.startServices(host); HostInitHarborServices.startServices(host, true); host.registerForServiceAvailability(AuthBootstrapService.startTask(host), true, AuthBootstrapService.FACTORY_LINK); }