Create a new bucket, and start it.

@param config The bucket configuration to use
@throws BucketAlreadyExistsException If the bucket already exists
@throws IOException If an I/O error occurs
499695
public void createBucket(BucketConfiguration config) throws BucketAlreadyExistsException, IOException {
        if (!config.validate()) {
            throw new IllegalArgumentException("Invalid bucket configuration");
        }

        synchronized (buckets) {
            if (buckets.containsKey(config.name)) {
                throw new BucketAlreadyExistsException(config.name);
            }

            Bucket bucket = Bucket.create(this, config);
            BucketAdminServer adminServer = new BucketAdminServer(bucket, httpServer, this);
            adminServer.register();
            bucket.setAdminServer(adminServer);

            HttpAuthVerifier verifier = new HttpAuthVerifier(bucket, authenticator);

            if (config.type == BucketType.COUCHBASE) {
                CAPIServer capi = new CAPIServer(bucket, verifier);
                capi.register(httpServer);
                bucket.setCAPIServer(capi);
            }

            buckets.put(config.name, bucket);
            bucket.start();
        }
    }
1338569
public void init(ServletConfig config) throws ServletException {
		super.init(config);

		if (!(tmpDir.isDirectory() && tmpDir.canWrite())) {
			throw new ServletException(tmpDir.getAbsolutePath() + " is not a writable directory");
		}

		if (!(destinationDir.isDirectory() && destinationDir.canWrite())) {
			throw new ServletException(destinationDir.getAbsolutePath() + " is not a writable directory");
		}
	}
1272522
public static function start(&$config) {
		self::$cacheDirectory = self::initialGetCacheDirectory ( $config );
		$cacheDirectory = \ROOT . \DS . self::$cacheDirectory;
		Annotations::$config ['cache'] = new AnnotationCache ( $cacheDirectory . '/annotations' );
		self::register ( Annotations::getManager () );
		self::getCacheInstance ( $config, $cacheDirectory, ".cache" );
	}
896067
public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
        ServletTask.initServlet(this, BasicServlet.SERVLET_TYPE.PROXY);
        
        m_servletTask = this.createProxyTask();
    }
21965
function _bucketInit() {
            morayClient.getBucket(self.morayBucket.name, function _gb(err) {
                if (isBucketNotFoundError(err)) {
                    var name = self.morayBucket.name;
                    var config = self.morayBucket.config;
                    morayClient.createBucket(name, config, function _cb(err2) {
                        log.info({ n: name, c: config }, 'cf: creating bucket');
                        if (err2) {
                            log.error({ cErr: err2 }, 'cf: Bucket not created');
                            expBackoff.backoff();
                        } else {
                            log.info('cf: Bucket successfully setup');
                            self.emit('moray-ready');
                            expBackoff.reset();
                        }
                    });
                } else if (err) {
                    log.error({ cErr: err }, 'cf: Bucket was not loaded');
                    expBackoff.backoff();
                } else {
                    log.info('cf: Bucket successfully setup');
                    self.emit('moray-ready');
                    expBackoff.reset();
                }
            });
        }
114966
public Reader create(Reader input, String configuration, String defaultConfiguration) throws IOException {
    if(defaultConfiguration==null) {
      defaultConfiguration = defaultArgument;
    }
    if (configs != null && configs.size() > 0) {
      if (configuration == null && defaultConfiguration == null) {
        throw new IOException("no (default)configuration");
      } else if (configuration == null) {
        if (configs.get(defaultConfiguration) != null) {
          return create(input, configs.get(defaultConfiguration));
        } else {
          throw new IOException(
              "default configuration " + defaultConfiguration + " not available");
        }
      } else {
        MtasConfiguration config = configs.get(configuration);
        if (config == null) {
          if (defaultConfiguration != null) {
            if (configs.get(defaultConfiguration) != null) {
              return create(input, configs.get(defaultConfiguration));
            } else {
              throw new IOException("configuration " + configuration
                  + " not found and default configuration " + defaultConfiguration
                  + " not available");
            }
          } else {
            throw new IOException("configuration " + configuration
                + " not available and no default configuration");
          }
        } else {
          return create(input, config);
        }
      }
    } else if (config != null) {
      return create(input, config);
    } else {
      throw new IOException("no configuration");
    }

  }
146325
public OperationFuture<Group> create(GroupConfig groupConfig) {
        checkNotNull(groupConfig, "GroupConfig must be not null");
        checkNotNull(groupConfig.getName(), "Name of GroupConfig must be not null");
        checkNotNull(groupConfig.getParentGroup(), "ParentGroup of GroupConfig must be not null");

        GroupMetadata group = client.createGroup(
                converter.createGroupRequest(groupConfig, idByRef(groupConfig.getParentGroup()),
                    groupConfig.getCustomFields() == null || groupConfig.getCustomFields().size() == 0 ?
                        null : client.getCustomFields()
                ));

        return new OperationFuture<>(
            Group.refById(group.getId()),
            new NoWaitingJobFuture()
        );
    }
22995
public void init(ServletConfig config)
         throws ServletException
    {
        super.init(config);

        Enumeration enm = config.getInitParameterNames();
        while (enm.hasMoreElements())
        {
            String path=(String)enm.nextElement();
            String forward=config.getInitParameter(path);
            _forwardMap.put(path,forward);
        }

    }
718987
public static synchronized void init(LogProviderConfig config) {
        if (config == null)
            throw new NullPointerException("LogProviderConfig must not be null");

        if (loggingConfig.compareAndSet(null, config)) {
            // Only initialize FFDC once -- all subsequent changes go through update
            // The synchronization of this method is gratuitous (just makes us feel better), 
            // it is called while the system is single threaded at startup. 

            // config.getTrDelegate() must not return null -- it should either
            // return a dummy/disabled delegate, or throw an exception so that startup
            // does not proceed.
            delegate = config.getFfdcDelegate();
            if (delegate == null)
                throw new NullPointerException("LogProviderConfig must provide a FFDCFilterService delegate");

            delegate.init(config);
        }
    }
881958
public function createIndex(
        IndexUUID $indexUUID,
        Config $config
    ) {
        if (array_key_exists($this->getIndexKey($indexUUID), $this->indices)) {
            throw ResourceExistsException::indexExists();
        }

        $this->indices[$this->getIndexKey($indexUUID)] = [
            'config' => $config,
            'was_reset' => false,
            'was_reconfigured' => false,
        ];
    }
398082
protected StaticFsServiceFactory createServiceFactory(ServletConfig config)
	{
		StaticFsServiceFactory staticFsServiceFactory = new StaticFsServiceFactory();
		DefaultFsService fsService = createFsService();

		staticFsServiceFactory.setFsService(fsService);
		return staticFsServiceFactory;
	}
240596
@Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        try {
            fedoraServerPort = m_server.getParameter("fedoraServerPort");
            fedoraServerRedirectPort =
                    m_server.getParameter("fedoraRedirectPort");
            fedoraServerHost = m_server.getParameter("fedoraServerHost");
            m_manager =
                    (DOManager) m_server
                            .getModule("org.fcrepo.server.storage.DOManager");
            String expireLimit =
                    m_server.getParameter("datastreamMediationLimit");
            if (expireLimit == null || expireLimit.equalsIgnoreCase("")) {
                logger.info("datastreamMediationLimit unspecified, using default "
                        + "of 5 seconds");
                datastreamMediationLimit = 5000;
            } else {
                datastreamMediationLimit = Integer.parseInt(expireLimit);
                logger.info("datastreamMediationLimit: {}",
                        datastreamMediationLimit);
            }
        } catch (Throwable th) {
            logger.error("Error initializing servlet", th);
        }
    }
59482
public void setBucket(Bucket<Data> bucket) throws BucketContainerException, InterruptedException {
        buckets[bucket.getBucketId()] = bucket;
    }
1088023
public void setConfig(Configuration config) {
		if (config == null) {
			throw new IllegalArgumentException("Parameter config must not be null.");
		}
	    this.config = config;
	    this.loadFrom(config);
	}
96026
public OperationFuture<LoadBalancer> create(LoadBalancerConfig config) {
        String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId();

        LoadBalancerMetadata loadBalancer = loadBalancerClient.create(
            dataCenterId,
            new LoadBalancerRequest()
                .name(config.getName())
                .description(config.getDescription())
                .status(config.getStatus())
        );

        LoadBalancer loadBalancerRef = LoadBalancer.refById(loadBalancer.getId(), DataCenter.refById(dataCenterId));

        return new OperationFuture<>(
            loadBalancerRef,
            new SequentialJobsFuture(
                () -> new CreateLoadBalancerJobFuture(this, loadBalancerRef),
                () -> addLoadBalancerPools(config, loadBalancerRef)
            )
        );
    }
1165085
public void reconfigure(final String config)
	{
		try
		{
			final File tempFile = File.createTempFile("nginx", ".conf");
			try
			{
				FileHelper.write(tempFile, config);

				final Execed process = Exec.rootUtility(new File(binPath, "nginx-reconfigure").getAbsolutePath(),
				                                        tempFile.getAbsolutePath());

				process.waitForExit(new Timeout(30, TimeUnit.SECONDS).start(), 0);
			}
			finally
			{
				FileUtils.deleteQuietly(tempFile);
			}
		}
		catch (IOException e)
		{
			throw new RuntimeException("Error executing nginx-reload command", e);
		}

		reload();
	}
1081069
private synchronized void initBuckets() {
    final SparseIntArray bucketSizes = mPoolParams.bucketSizes;

    // create the buckets
    if (bucketSizes != null) {
      fillBuckets(bucketSizes);
      mAllowNewBuckets = false;
    } else {
      mAllowNewBuckets = true;
    }
  }