Normal Init level APIs

@param authzAPI
@param facade
@throws Exception
338526
public static void init(final AuthAPI authzAPI, AuthzFacade facade) throws Exception {
		/**
		 * get all Users who have Permission X
		 */
		authzAPI.route(GET,"/authz/users/perm/:type/:instance/:action",API.USERS,new Code(facade,"Get Users By Permission", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
//				trans.checkpoint(pathParam(req,"type") + " " 
//						+ pathParam(req,"instance") + " " 
//						+ pathParam(req,"action"));
//
				Result<Void> r = context.getUsersByPermission(trans, resp,
						pathParam(req, ":type"),
						pathParam(req, ":instance"),
						pathParam(req, ":action"));
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});


		/**
		 * get all Users who have Role X
		 */
		authzAPI.route(GET,"/authz/users/role/:role",API.USERS,new Code(facade,"Get Users By Role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getUsersByRole(trans, resp, pathParam(req, ":role"));
				switch(r.status) {
					case OK:
						resp.setStatus(HttpStatus.OK_200); 
						break;
					default:
						context.error(trans,resp,r);
				}
			}
		});
		
		/**
		 * Get User Role if exists
		 * @deprecated
		 */
		authzAPI.route(GET,"/authz/userRole/:user/:role",API.USERS,new Code(facade,"Get if User is In Role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getUserInRole(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);
				}
			}
		});

		/**
		 * Get User Role if exists
		 */
		authzAPI.route(GET,"/authz/users/:user/:role",API.USERS,new Code(facade,"Get if User is In Role", true) {
			@Override
			public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
				Result<Void> r = context.getUserInRole(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);
				}
			}
		});
		


	}
735456
protected static void initClients() throws Exception {
        /*
         * The ProfileCredentialsProvider will return your [default] credential
         * profile by reading from the credentials file located at
         * (~/.aws/credentials).
         */
        ProfileCredentialsProvider credentialsProvider = new ProfileCredentialsProvider();
        try {
            credentialsProvider.getCredentials();
        } catch (Exception e) {
            throw new AmazonClientException("Cannot load the credentials from the credential profiles file. "
                    + "Please make sure that your credentials file is at the correct "
                    + "location (~/.aws/credentials), and is in valid format.", e);
        }

        // S3 client
        s3Client = AmazonS3ClientBuilder.standard()
            .withCredentials(credentialsProvider)
            .withRegion(s3RegionName)
            .build();


        // Firehose client
        firehoseClient = AmazonKinesisFirehoseClientBuilder.standard()
            .withCredentials(credentialsProvider)
            .withRegion(firehoseRegion)
            .build();

        // IAM client
        iamClient = AmazonIdentityManagementClientBuilder.standard()
            .withCredentials(credentialsProvider)
            .withRegion(iamRegion)
            .build();
    }
1056292
private void initializeConnection(String user, String password, String restApiBaseUrl) {
		csrfToken = null;
		cookies = new HashMap<String, Cookie>();
		
		connection = ClientHelper.createClient().register(HttpAuthenticationFeature.basic(user, password)).target(restApiBaseUrl);
	}
57341
public void afterPropertiesSet() throws Exception {
        if (loginService == null) {
            loginService = new SimpleLoginService();
            ((SimpleLoginService) loginService).setName(realm);
        }
    }
1360317
public RestApi initialiseRestClient(int logLevelNet, APIConfig.BaseURIs baseURIs) {

        AuthManager authManager = new AuthManager() {
            @Override
            protected Observable<SessionData> restartSession() {
                return reAuthenticate();
            }
        };

        restClient = new RestClient(new OkHttpAuthenticator(authManager), logLevelNet, baseURIs.getService().toString());
        service = restClient.getService();
        setService(service);
        return service;
    }
669360
protected void initOutputs() throws Exception {
		this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
		this.eventualOutputs = new ArrayList<BufferWriter>();
		this.output = initOutputs(this, this.userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs);
	}
1331429
private void init() {
    host = DEFAULT_HOST;
    port = DEFAULT_PORT;
    database = DEFAULT_DATABASE;
    user = DEFAULT_USER;
    password = DEFAULT_PASSWORD;
    cachePreparedStatements = DEFAULT_CACHE_PREPARED_STATEMENTS;
    pipeliningLimit = DEFAULT_PIPELINING_LIMIT;
    sslMode = DEFAULT_SSLMODE;
  }
1024513
public static void init(final GwAPI gwAPI, GwFacade facade) throws Exception {
		
		String aafurl = gwAPI.env.getProperty(Config.AAF_URL);
		if(aafurl==null) {
		} else {

			////////
			// Transferring APIs
			///////
			gwAPI.routeAll(HttpMethods.GET,"/proxy/:path*",API.VOID,new GwCode(facade,"Proxy GET", true) {
				@Override
				public void handle(final AuthzTrans trans, final HttpServletRequest req, final HttpServletResponse resp) throws Exception {
					TimeTaken tt = trans.start("Forward to AAF Service", Env.REMOTE);
					try {
						gwAPI.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
							@Override
							public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
								Future<Void> ft = client.transfer(req,resp,pathParam(req, ":path"),HttpStatus.OK_200);
								ft.get(10000); // Covers return codes and err messages
								return null;
							}
						});
					
					} catch (CadiException | APIException e) {
						trans.error().log(e);
					} finally {
						tt.done();
					}
				}
			});
			
			gwAPI.routeAll(HttpMethods.POST,"/proxy/:path*",API.VOID,new GwCode(facade,"Proxy POST", true) {
				@Override
				public void handle(final AuthzTrans trans, final HttpServletRequest req, final HttpServletResponse resp) throws Exception {
					TimeTaken tt = trans.start("Forward to AAF Service", Env.REMOTE);
					try {
						gwAPI.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
							@Override
							public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
								Future<Void> ft = client.transfer(req,resp,pathParam(req, ":path"),HttpStatus.CREATED_201);
								ft.get(10000); // Covers return codes and err messages
								return null;
							}
						});
					} catch (CadiException | APIException e) {
						trans.error().log(e);
					} finally {
						tt.done();
					}
				}
			});
			
			gwAPI.routeAll(HttpMethods.PUT,"/proxy/:path*",API.VOID,new GwCode(facade,"Proxy PUT", true) {
				@Override
				public void handle(final AuthzTrans trans, final HttpServletRequest req, final HttpServletResponse resp) throws Exception {
					TimeTaken tt = trans.start("Forward to AAF Service", Env.REMOTE);
					try {
						gwAPI.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
							@Override
							public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
								Future<Void> ft = client.transfer(req,resp,pathParam(req, ":path"),HttpStatus.OK_200);
								ft.get(10000); // Covers return codes and err messages
								return null;
							}
						});
					} catch (CadiException | APIException e) {
						trans.error().log(e);
					} finally {
						tt.done();
					}
				}
			});
			
			gwAPI.routeAll(HttpMethods.DELETE,"/proxy/:path*",API.VOID,new GwCode(facade,"Proxy DELETE", true) {
				@Override
				public void handle(final AuthzTrans trans, final HttpServletRequest req, final HttpServletResponse resp) throws Exception {
					TimeTaken tt = trans.start("Forward to AAF Service", Env.REMOTE);
					try {
						gwAPI.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
							@Override
							public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException {
								Future<Void> ft = client.transfer(req,resp,pathParam(req, ":path"),HttpStatus.OK_200);
								ft.get(10000); // Covers return codes and err messages
								return null;
							}
						});
					} catch (CadiException | APIException e) {
						trans.error().log(e);
					} finally {
						tt.done();
					}
				}
			});
		}
	}
606035
@Override
    public void setAuthConfigFactory(AuthConfigFactory factory) {
        this.registry = factory;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "AuthConfigFactory = " + factory);
    }
1050070
private <TResponse> TResponse callServiceGetApi(
            String path, Map<String, String> queryParams,
            Class<TResponse> responseClass) throws AuthleteApiException
    {
        return callGetApi(mServiceCredentials, path, queryParams, responseClass);
    }
446334
public void setAuthMethod(String method)
    {
        if (isStarted() && _authMethod!=null && !_authMethod.equals(method))
            throw new IllegalStateException("Handler started");
        _authMethod = method;
    }
955553
public void init(final Authentication authentication, final Properties props) {
        this.authentication = authentication;
        shardingProperties = new ShardingProperties(props);
    }
593760
private void throwAuthzException() throws SecurityException {
        SubjectManager subjectManager = new SubjectManager();
        String name = "UNAUTHENTICATED";
        if (subjectManager.getInvocationSubject() != null) {
            name = subjectManager.getInvocationSubject().getPrincipals().iterator().next().getName();
        }
        Tr.audit(tc, "MANAGEMENT_SECURITY_AUTHZ_FAILED", name, "MBeanAccess", requiredRoles);
        String message = Tr.formatMessage(tc, "MANAGEMENT_SECURITY_AUTHZ_FAILED", name, "MBeanAccess", requiredRoles);
        throw new SecurityException(message);
    }
295145
protected void initOutputs() throws Exception {
		this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
		this.eventualOutputs = new ArrayList<RecordWriter<?>>();

		ClassLoader userCodeClassLoader = getUserCodeClassLoader();

		this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();

		this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs,
				this.getExecutionConfig(), this.accumulatorMap);
	}
220953
@Override
    public void init(FilterConfig filterConfig) throws ServletException {
        LOG.info("AtlasAuthenticationFilter initialization started");
        final FilterConfig globalConf = filterConfig;
        final Map<String, String> params = new HashMap<>();
        try {
            configuration = ApplicationProperties.get();
        } catch (Exception e) {
            throw new ServletException(e);
        }

        if (configuration != null) {
            headerProperties = ConfigurationConverter.getProperties(configuration.subset("atlas.headers"));
        }

        FilterConfig filterConfig1 = new FilterConfig() {
            @Override
            public ServletContext getServletContext() {
                if (globalConf != null) {
                    return globalConf.getServletContext();
                } else {
                    return nullContext;
                }
            }

            @SuppressWarnings("unchecked")
            @Override
            public Enumeration<String> getInitParameterNames() {
                return new IteratorEnumeration(params.keySet().iterator());
            }

            @Override
            public String getInitParameter(String param) {
                return params.get(param);
            }

            @Override
            public String getFilterName() {
                return "AtlasAuthenticationFilter";
            }
        };

        super.init(filterConfig1);

        optionsServlet = new HttpServlet() {
        };
        optionsServlet.init();
    }
863898
public static void initMBeans() {
		// rq: en général, il y a 2 connecteurs (http et ajp 1.3) définis dans server.xml et donc
		// 2 threadPools et 2 globalRequestProcessors de même nom : http-8080 et jk-8009 (ajp13)
		THREAD_POOLS.clear();
		GLOBAL_REQUEST_PROCESSORS.clear();
		THREAD_POOLS.addAll(MBeansAccessor.getTomcatThreadPools());
		GLOBAL_REQUEST_PROCESSORS.addAll(MBeansAccessor.getTomcatGlobalRequestProcessors());
	}
883503
public void initialize(AuthSource authSource) {
    this.authSource = authSource;
    AuthSourceSettingDAO authSourceSettingDAO = new AuthSourceSettingDAO();
    List<AuthSourceSetting> authSourceSettings = authSourceSettingDAO.listByAuthSource(authSource);
    this.settings = new HashMap<>();
    for (AuthSourceSetting setting : authSourceSettings) {
      settings.put(setting.getKey(), setting.getValue());
    }
  }