Initializes the account manager based on provided accounts

@param accts
@throws StorageException
764222
public void initialize(List<StorageAccount> accts)
        throws StorageException {

        storageAccounts = new HashMap<>();
        for (StorageAccount acct : accts) {
            storageAccounts.put(acct.getId(), acct);
            if (acct.isPrimary()) {
                primaryStorageProviderId = acct.getId();
            }
        }

        // Make sure a primary provider is set
        if (primaryStorageProviderId == null) {
            primaryStorageProviderId = accts.get(0).getId();
        }
    }
605882
public void setRoles(java.util.Collection<PermissionInfo> roles) {
        if (roles == null) {
            this.roles = null;
            return;
        }

        this.roles = new java.util.ArrayList<PermissionInfo>(roles);
    }
1331983
public static function initialize(array &$storage, array $data)
    {
        foreach($data as $key => $value)
        {
            unset($storage[$key]);

            $next = &self::set($storage, $key, $value);

            // recursive.
            if(is_array($value))
                self::initialize($next, $value);
        }
    }
434950
public static void init(final AuthAPI authzAPI, AuthzFacade facade) throws Exception {
		/**
		 * Request User Role Access
		 */
		authzAPI.route(POST,"/authz/userRole",API.USER_ROLE_REQ,new Code(facade,"Request User Role Access", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.requestUserRole(trans, req, resp);
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.CREATED_201); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});
		
		
		/**
		 * Get UserRoles by Role
		 */
		authzAPI.route(GET,"/authz/userRoles/role/:role",API.USER_ROLES,new Code(facade,"Get UserRoles by Role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getUserRolesByRole(trans, resp, pathParam(req,":role"));
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});
		
		/**
		 * Get UserRoles by User
		 */
		authzAPI.route(GET,"/authz/userRoles/user/:user",API.USER_ROLES,new Code(facade,"Get UserRoles by User", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getUserRolesByUser(trans, resp, pathParam(req,":user"));
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});

		
		/**
		 * Update roles attached to user in path
		 */
		authzAPI.route(PUT,"/authz/userRole/user",API.USER_ROLE_REQ,new Code(facade,"Update Roles for a user", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.resetRolesForUser(trans, resp, req);
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});
		
		
		/**
		 * Update users attached to role in path
		 */
		authzAPI.route(PUT,"/authz/userRole/role",API.USER_ROLE_REQ,new Code(facade,"Update Users for a role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.resetUsersForRole(trans, resp, req);
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});
		
		/**
		 * Extend Expiration Date (according to Organizational rules)
		 */
		authzAPI.route(PUT, "/authz/userRole/extend/:user/:role", API.VOID, new Code(facade,"Extend Expiration", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.extendUserRoleExpiration(trans,resp,pathParam(req,":user"),pathParam(req,":role"));
				switch(r.status) {
				case OK:
					resp.setStatus(HttpStatus.OK_200); 
					break;
				default:
					context.error(trans,resp,r);
			}
	
			}
			
		});
		
		
		/**
		 * Create a new ID/Credential
		 */
		authzAPI.route(DELETE,"/authz/userRole/:user/:role",API.VOID,new Code(facade,"Delete User Role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.deleteUserRole(trans, resp, pathParam(req,":user"),pathParam(req,":role"));
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});

	}
154742
public function initialize()
    {
        if ((false === $this->exists($this->localPath)) && false === $this->filesystem->createDir($this->localPath)) {
            throw new RuntimeException(
                'Unable to create a local storage for temporary filesystem operations.'
            );
        }

        $this->initialized = true;
    }
303910
@Override
    public void setRoles(List<RoleEntity> inRoles) {
        if (inRoles == null) {
            this.roles = new ArrayList<>();
        } else {
            this.roles = new ArrayList<>(inRoles);
        }
        this.roles = inRoles;
    }
289151
public function setTokenFromStorage() {
    $accessToken = $this->storage->get();
    if (isset($accessToken)) {
      $this->client->setAccessToken($accessToken);
    }
  }
1179374
public void setDisks(java.util.Collection<Disk> disks) {
        if (disks == null) {
            this.disks = null;
            return;
        }

        this.disks = new com.amazonaws.internal.SdkInternalList<Disk>(disks);
    }
609291
function _initDefaultConnection() {
  if ('CLOUD_STORAGE_ACCOUNT' in process.env) {
    var accountSettings = utils.parseAccountString(process.env.CLOUD_STORAGE_ACCOUNT);
    if (accountSettings !== null) {
      _defaultClientSetting = _.defaults(_defaultClientSetting, accountSettings);
    }
  }
}
1025617
private void init() throws IndexerException {
		if (!loaded) {
			loaded = true;

			String storageType = config.getString(null, "storage", "type");
			try {
				storage = PluginManager.getStorage(storageType);
				storage.init(config.toString());
			} catch (PluginException pe) {
				throw new IndexerException(pe);
			}

			// Credentials
			usernameMap = new HashMap<String, String>();
			passwordMap = new HashMap<String, String>();

			solr = initCore("solr");
			anotar = initCore("anotar");

			// initialise non-hardcoded indexers
			solrServerMap = new HashMap<String, SolrServer>();
			JsonObject indexerConfig = config.getObject("indexer");

			List<String> hardcodedValues = Arrays.asList("type", "properties", "useCache", "buffer", "solr", "anotar");
			for (Object key : indexerConfig.keySet()) {
				if (key instanceof String) {
					String keyString = (String) key;
					if (!hardcodedValues.contains(keyString)) {
						solrServerMap.put(keyString, initCore(keyString));
					}
				}
			}

			anotarAutoCommit = config.getBoolean(true, "indexer", "anotar", "autocommit");
			propertiesId = config.getString(DEFAULT_METADATA_PAYLOAD, "indexer", "propertiesId");

			customParams = new HashMap<String, String>();

			// Caching
			scriptCache = new HashMap<String, PyObject>();
			groovyScriptCache = new HashMap<String, String>();
			configCache = new HashMap<String, JsonSimpleConfig>();
			useCache = config.getBoolean(true, "indexer", "useCache");

		}
		loaded = true;
	}
731844
public static void setAccountSid(final String accountSid) {
        if (accountSid == null) {
            throw new AuthenticationException("AccountSid can not be null");
        }

        if (!accountSid.equals(Twilio.accountSid)) {
            Twilio.invalidate();
        }

        Twilio.accountSid = accountSid;
    }
27884
private void init(InetSocketAddress namenodeAddress) throws IOException {
    this.namenodeAddress = namenodeAddress;
    this.myMetrics = new BalancerMetrics(conf, namenodeAddress);
    this.fetchBlocksSize = conf.getLong(BalancerConfigKeys.DFS_BALANCER_FETCH_SIZE_KEY,
        BalancerConfigKeys.DFS_BALANCER_FETCH_SIZE_DEFAULT);
    this.minBlockReplicas = conf.getInt(BalancerConfigKeys.DFS_BALANCER_MIN_REPLICAS_KEY,
        BalancerConfigKeys.DFS_BALANCER_MIN_REPLICAS_DEFAULT);
    this.maxFetchCount = conf.getInt(BalancerConfigKeys.DFS_BALANCER_FETCH_COUNT_KEY,
        BalancerConfigKeys.DFS_BALANCER_FETCH_COUNT_DEFAULT);
    initFS();
    initNameNodes();
    this.moverExecutor = Executors.newFixedThreadPool(moveThreads);
    int dispatchThreads = (int)Math.max(1, moveThreads/maxConcurrentMoves);
    this.dispatcherExecutor = Executors.newFixedThreadPool(dispatchThreads);
    /* Check if there is another balancer running.
     * Exit if there is another one running.
     */
    this.out = checkAndMarkRunningBalancer();
    if (out == null) {
      throw new IOException("Another balancer is running");
    }
    // get namespace id
    LocatedBlocksWithMetaInfo locations = client.openAndFetchMetaInfo(BALANCER_ID_PATH.toString(), 0L, 1L);
    this.namespaceId = locations.getNamespaceID();
  }
677791
public static function init() {

		if(is_null(self::$storage)) {
			self::$storage = new NativeSessionStorage();
		}

		self::$storage->start();
		
	}
850387
@Override
	public void init() throws TransactionException {
		systemConfig = getJsonConfig();

		// Load the storage plugin
		String storageId = systemConfig.getString("file-system", "storage",
				"type");
		if (storageId == null) {
			throw new TransactionException("No Storage ID provided");
		}
		storage = PluginManager.getStorage(storageId);
		if (storage == null) {
			throw new TransactionException("Unable to load Storage '"
					+ storageId + "'");
		}
		try {
			storage.init(systemConfig.toString());
		} catch (PluginException ex) {
			log.error("Unable to initialise storage layer!", ex);
			throw new TransactionException(ex);
		}

		// Load the indexer plugin
		String indexerId = systemConfig.getString("solr", "indexer", "type");
		if (indexerId == null) {
			throw new TransactionException("No Indexer ID provided");
		}
		indexer = PluginManager.getIndexer(indexerId);
		if (indexer == null) {
			throw new TransactionException("Unable to load Indexer '"
					+ indexerId + "'");
		}
		try {
			indexer.init(systemConfig.toString());
		} catch (PluginException ex) {
			log.error("Unable to initialise indexer!", ex);
			throw new TransactionException(ex);
		}

		// External facing URL
		urlBase = systemConfig.getString(null, "urlBase");
		if (urlBase == null) {
			throw new TransactionException("URL Base in config cannot be null");
		}

		// Where should emails be sent?
		emailAddress = systemConfig.getString(null, "curation",
				"curationEmailAddress");
		if (emailAddress == null) {
			throw new TransactionException("An admin email is required!");
		}

		// Where are PIDs stored?
		pidProperty = systemConfig.getString(null, "curation", "pidProperty");
		if (pidProperty == null) {
			throw new TransactionException("An admin email is required!");
		}

		// Do admin staff want to confirm each curation?
		manualConfirmation = systemConfig.getBoolean(false, "curation",
				"curationRequiresConfirmation");

		// Find the address of our broker
		brokerUrl = systemConfig.getString(null, "messaging", "url");
		if (brokerUrl == null) {
			throw new TransactionException("Cannot find the message broker.");
		}

		// We also need Mint's AMQ url
		mintBroker = systemConfig.getString(null, "curation", "mintBroker");
		if (mintBroker == null) {
			throw new TransactionException("Cannot find Mint's message broker.");
		}

		/** Relationship mapping */
		relationFields = systemConfig.getJsonSimpleMap("curation", "relations");
		if (relationFields == null) {
			log.warn("Curation configuration has no relationships");
			relationFields = new HashMap<String, JsonSimple>();
		}
	}
546697
public void setUnprocessedAccounts(java.util.Collection<Result> unprocessedAccounts) {
        if (unprocessedAccounts == null) {
            this.unprocessedAccounts = null;
            return;
        }

        this.unprocessedAccounts = new java.util.ArrayList<Result>(unprocessedAccounts);
    }
348406
public void setAccountLimits(java.util.Collection<AccountLimit> accountLimits) {
        if (accountLimits == null) {
            this.accountLimits = null;
            return;
        }

        this.accountLimits = new com.amazonaws.internal.SdkInternalList<AccountLimit>(accountLimits);
    }
252676
def init_storage(self):
        """"""
        if not self.storage.exists('term'):
            self.storage.update({
                'term': 0,
            })

        self.storage.update({
            'voted_for': None
        })