Java Code Examples for org.springframework.beans.factory.annotation.Autowired

The following are top voted examples for showing how to use org.springframework.beans.factory.annotation.Autowired. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: amv-access-api-poc   File: AccessCertificateCtrl.java   View source code 7 votes vote down vote up
@Autowired
public AccessCertificateCtrl(
        Environment environment,
        DemoService demoService,
        IssuerService issuerService,
        CreateAccessCertificateRequestValidator createAccessCertificateRequestValidator,
        AccessCertificateService accessCertificateService) {
    this.environment = requireNonNull(environment);
    this.demoService = requireNonNull(demoService);
    this.issuerService = requireNonNull(issuerService);
    this.createAccessCertificateRequestValidator = requireNonNull(createAccessCertificateRequestValidator);
    this.accessCertificateService = requireNonNull(accessCertificateService);
}
 
Example 2
Project: Spring-Security-Third-Edition   File: DefaultCalendarService.java   View source code 7 votes vote down vote up
@Autowired
public DefaultCalendarService(final EventDao eventDao,
                              final CalendarUserDao userDao,
                              final PasswordEncoder passwordEncoder) {
    if (eventDao == null) {
        throw new IllegalArgumentException("eventDao cannot be null");
    }
    if (userDao == null) {
        throw new IllegalArgumentException("userDao cannot be null");
    }
    if (passwordEncoder == null) {
        throw new IllegalArgumentException("passwordEncoder cannot be null");
    }
    this.eventDao = eventDao;
    this.userDao = userDao;
    this.passwordEncoder = passwordEncoder;
}
 
Example 3
Project: cas-5.1.0   File: CasValidationConfiguration.java   View source code 6 votes vote down vote up
@Autowired
@Bean
@ConditionalOnMissingBean(name = "v3ServiceValidateController")
public V3ServiceValidateController v3ServiceValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor,
                                                               @Qualifier("defaultAuthenticationSystemSupport")
                                                               final AuthenticationSystemSupport authenticationSystemSupport) {
    final V3ServiceValidateController c = new V3ServiceValidateController();
    c.setValidationSpecification(this.cas20WithoutProxyProtocolValidationSpecification);
    c.setSuccessView(cas3ServiceSuccessView());
    c.setFailureView(cas3ServiceFailureView);
    c.setProxyHandler(proxy20Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView());
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
 
Example 4
Project: Spring-Security-Third-Edition   File: DefaultCalendarService.java   View source code 5 votes vote down vote up
@Autowired
public DefaultCalendarService(final EventDao eventDao,
                              final CalendarUserDao userDao,
                              final CalendarUserRepository userRepository,
                              final PasswordEncoder passwordEncoder) {
    if (eventDao == null) {
        throw new IllegalArgumentException("eventDao cannot be null");
    }
    if (userDao == null) {
        throw new IllegalArgumentException("userDao cannot be null");
    }
    if (userRepository == null) {
        throw new IllegalArgumentException("userRepository cannot be null");
    }
    if (passwordEncoder == null) {
        throw new IllegalArgumentException("passwordEncoder cannot be null");
    }
    this.eventDao = eventDao;
    this.userDao = userDao;
    this.passwordEncoder = passwordEncoder;
}
 
Example 5
Project: Spring-Security-Third-Edition   File: JpaCalendarUserDao.java   View source code 5 votes vote down vote up
@Autowired
public JpaCalendarUserDao(final CalendarUserRepository repository,
                          final RoleRepository roleRepository) {
    if (repository == null) {
        throw new IllegalArgumentException("repository cannot be null");
    }
    if (roleRepository == null) {
        throw new IllegalArgumentException("roleRepository cannot be null");
    }

    this.userRepository = repository;
    this.roleRepository = roleRepository;
}
 
Example 6
Project: springboot-shiro-cas-mybatis   File: JcifsConfig.java   View source code 5 votes vote down vote up
/**
 * Sets the kerberos conf.
 *
 * @param kerberosConf the new kerberos conf
 */
@Autowired
public void setKerberosConf(@Value("${cas.spnego.kerb.conf:}") final String kerberosConf) {
    if (StringUtils.isNotBlank(kerberosConf)) {
        logger.debug("kerberosConf is set to :{}", kerberosConf);
        System.setProperty(SYS_PROP_KERBEROS_CONF, kerberosConf);
    }
}
 
Example 7
Project: cas-5.1.0   File: CasValidationConfiguration.java   View source code 5 votes vote down vote up
@Autowired
@Bean
@ConditionalOnMissingBean(name = "legacyValidateController")
public LegacyValidateController legacyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor,
                                                         @Qualifier("defaultAuthenticationSystemSupport")
                                                         final AuthenticationSystemSupport authenticationSystemSupport) {
    final LegacyValidateController c = new LegacyValidateController();
    c.setValidationSpecification(this.cas10ProtocolValidationSpecification);
    c.setSuccessView(cas1ServiceSuccessView());
    c.setFailureView(cas1ServiceFailureView());
    c.setProxyHandler(proxy10Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView());
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
 
Example 8
Project: circus-train   File: ViewTransformation.java   View source code 5 votes vote down vote up
@Autowired
public ViewTransformation(
    HiveConf replicaHiveConf,
    HqlTranslator hqlTranslator,
    Supplier<CloseableMetaStoreClient> replicaMetaStoreClientSupplier) {
  this.replicaHiveConf = replicaHiveConf;
  this.hqlTranslator = hqlTranslator;
  this.replicaMetaStoreClientSupplier = replicaMetaStoreClientSupplier;
}
 
Example 9
Project: Spring-Security-Third-Edition   File: JdbcCalendarUserDao.java   View source code 5 votes vote down vote up
@Autowired
public JdbcCalendarUserDao(JdbcOperations jdbcOperations) {
    if (jdbcOperations == null) {
        throw new IllegalArgumentException("jdbcOperations cannot be null");
    }
    this.jdbcOperations = jdbcOperations;
}
 
Example 10
Project: InfoSys-1D   File: ProfCalendarController.java   View source code 5 votes vote down vote up
@Autowired
public ProfCalendarController(WeekCalendarService weekCalendarService,
                              ProfessorService professorService, ProfChoperAuthFacade authFacade,
                              BookingSlotService bookingSlotService) {

    this.weekCalendarService = weekCalendarService;
    this.professorService = professorService;
    this.bookingSlotService = bookingSlotService;
    this.authFacade = authFacade;
}
 
Example 11
Project: only-short-poc   File: OrganizationController.java   View source code 5 votes vote down vote up
@Autowired
public OrganizationController(
        @Qualifier(MySqlSource1Config.RepositoryBeanName) OrganizationRepository organizationRepositoryFromSource1,
        @Qualifier(MySqlSource2Config.RepositoryBeanName) OrganizationRepository organizationRepositoryFromSource2) {

    this.organizationRepositoryFromSource1 = organizationRepositoryFromSource1;
    this.organizationRepositoryFromSource2 = organizationRepositoryFromSource2;
}
 
Example 12
Project: cas-server-4.2.1   File: JcifsConfig.java   View source code 5 votes vote down vote up
/**
 * @param jcifsNetbiosWins the jcifsNetbiosWins to set
 */
@Autowired
public void setJcifsNetbiosWins(@Value("${cas.spnego.jcifs.netbios.wins:}")
                                final String jcifsNetbiosWins) {
    if (StringUtils.isNotBlank(jcifsNetbiosWins)) {
        logger.debug("jcifsNetbiosWins is set to {}", jcifsNetbiosWins);
        Config.setProperty(JCIFS_PROP_NETBIOS_WINS, jcifsNetbiosWins);
    }
}
 
Example 13
Project: spring-data-tarantool   File: TarantoolOperationsTests.java   View source code 5 votes vote down vote up
@Bean
@Autowired
public TarantoolClient tarantoolClient(
        SocketChannelProvider socketChannelProvider
) {
    final TarantoolClientConfig config = new TarantoolClientConfig();
    config.username = "test";
    config.password = "test";
    config.initTimeoutMillis = 5000;
    config.writeTimeoutMillis = 5000;
    return new TarantoolClientImpl(socketChannelProvider, config);
}
 
Example 14
Project: family-tree-xml-parser   File: ScheduledFileReader.java   View source code 5 votes vote down vote up
@Autowired
public ScheduledFileReader(PathValidator pathValidator, EntriesXmlParser xmlParser,
                           DocumentService service) {
  this.pathValidator = pathValidator;
  this.xmlParser = xmlParser;
  this.service = service;
}
 
Example 15
Project: AppCoins-ethereumj   File: DbFlushManager.java   View source code 5 votes vote down vote up
@Autowired
public void setEthereumListener(CompositeEthereumListener listener) {
    if (!flushAfterSyncDone) return;
    listener.addListener(new EthereumListenerAdapter() {
        @Override
        public void onSyncDone(SyncState state) {
            if (state == SyncState.COMPLETE) {
                logger.info("DbFlushManager: long sync done, flushing each block now");
                syncDone = true;
            }
        }
    });
}
 
Example 16
Project: wamp2spring   File: WampConfiguration.java   View source code 5 votes vote down vote up
@Autowired(required = false)
public void setConfigurers(List<WampConfigurer> configurers) {
	if (!CollectionUtils.isEmpty(configurers)) {
		this.configurers.addAll(configurers);

		configureFeatures(this.features);
		for (WampConfigurer wc : this.configurers) {
			wc.configureFeatures(this.features);
		}
	}
}
 
Example 17
Project: Spring-Security-Third-Edition   File: DefaultCalendarService.java   View source code 5 votes vote down vote up
@Autowired
    public DefaultCalendarService(final EventDao eventDao,
                                  final CalendarUserDao userDao,
                                  final CalendarUserRepository userRepository
//                                  final PasswordEncoder passwordEncoder
    ) {
        if (eventDao == null) {
            throw new IllegalArgumentException("eventDao cannot be null");
        }
        if (userDao == null) {
            throw new IllegalArgumentException("userDao cannot be null");
        }
        if (userRepository == null) {
            throw new IllegalArgumentException("userRepository cannot be null");
        }
//        if (passwordEncoder == null) {
//            throw new IllegalArgumentException("passwordEncoder cannot be null");
//        }
        this.eventDao = eventDao;
        this.userDao = userDao;
//        this.passwordEncoder = passwordEncoder;
    }
 
Example 18
Project: cas-server-4.2.1   File: StormpathAuthenticationHandler.java   View source code 5 votes vote down vote up
@Autowired(required = false)
@Override
public void setPasswordEncoder(@Qualifier("stormpathPasswordEncoder")
                               final PasswordEncoder passwordEncoder) {
    if (passwordEncoder != null) {
        super.setPasswordEncoder(passwordEncoder);
    }
}
 
Example 19
Project: jeeves   File: WechatHttpServiceInternal.java   View source code 5 votes vote down vote up
@Autowired
WechatHttpServiceInternal(RestTemplate restTemplate, @Value("${wechat.ua}") String BROWSER_DEFAULT_USER_AGENT) {
    this.restTemplate = restTemplate;
    this.postHeader = new HttpHeaders();
    postHeader.set(HttpHeaders.USER_AGENT, BROWSER_DEFAULT_USER_AGENT);
    postHeader.set(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString());
    postHeader.setAccept(Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.ALL));
    postHeader.set(HttpHeaders.ACCEPT_LANGUAGE, BROWSER_DEFAULT_ACCEPT_LANGUAGE);
    postHeader.set(HttpHeaders.ACCEPT_ENCODING, BROWSER_DEFAULT_ACCEPT_ENCODING);
    this.getHeader = new HttpHeaders();
    getHeader.set(HttpHeaders.USER_AGENT, BROWSER_DEFAULT_USER_AGENT);
    getHeader.set(HttpHeaders.ACCEPT_LANGUAGE, BROWSER_DEFAULT_ACCEPT_LANGUAGE);
    getHeader.set(HttpHeaders.ACCEPT_ENCODING, BROWSER_DEFAULT_ACCEPT_ENCODING);
}
 
Example 20
Project: Spring-Security-Third-Edition   File: SpringSecurityUserContext.java   View source code 5 votes vote down vote up
@Autowired
public SpringSecurityUserContext(CalendarService calendarService,UserDetailsService userDetailsService) {
    if (calendarService == null) {
        throw new IllegalArgumentException("calendarService cannot be null");
    }
    if (userDetailsService == null) {
        throw new IllegalArgumentException("userDetailsService cannot be null");
    }
    this.calendarService = calendarService;
    this.userDetailsService = userDetailsService;
}
 
Example 21
Project: Spring-Security-Third-Edition   File: CalendarUserAuthenticationProvider.java   View source code 5 votes vote down vote up
@Autowired
public CalendarUserAuthenticationProvider(final CalendarService calendarService,
                                          final PasswordEncoder passwordEncoder) {
    if (calendarService == null) {
        throw new IllegalArgumentException("calendarService cannot be null");
    }
    if (passwordEncoder == null) {
        throw new IllegalArgumentException("passwordEncoder cannot be null");
    }

    this.calendarService = calendarService;
    this.passwordEncoder = passwordEncoder;
}
 
Example 22
Project: nifi-registry   File: ItemResource.java   View source code 5 votes vote down vote up
@Autowired
public ItemResource(
        final RegistryService registryService,
        final LinkService linkService,
        final PermissionsService permissionsService,
        final AuthorizationService authorizationService,
        final Authorizer authorizer) {
    super(authorizer, authorizationService);
    this.registryService = registryService;
    this.linkService = linkService;
    this.permissionsService = permissionsService;
}
 
Example 23
Project: Spring-Security-Third-Edition   File: CalendarUserDetailsService.java   View source code 5 votes vote down vote up
@Autowired
public CalendarUserDetailsService(CalendarUserDao calendarUserDao) {
    if (calendarUserDao == null) {
        throw new IllegalArgumentException("calendarUserDao cannot be null");
    }
    this.calendarUserDao = calendarUserDao;
}
 
Example 24
Project: Spring-Security-Third-Edition   File: SpringSecurityUserContext.java   View source code 5 votes vote down vote up
@Autowired
public SpringSecurityUserContext(CalendarService calendarService,UserDetailsService userDetailsService) {
    if (calendarService == null) {
        throw new IllegalArgumentException("calendarService cannot be null");
    }
    if (userDetailsService == null) {
        throw new IllegalArgumentException("userDetailsService cannot be null");
    }
    this.calendarService = calendarService;
    this.userDetailsService = userDetailsService;
}
 
Example 25
Project: Spring-Security-Third-Edition   File: JpaEventDao.java   View source code 5 votes vote down vote up
@Autowired
public JpaEventDao(EventRepository repository) {
    if (repository == null) {
        throw new IllegalArgumentException("repository cannot be null");
    }
    this.repository = repository;
}
 
Example 26
Project: Spring-Security-Third-Edition   File: JdbcCalendarUserDao.java   View source code 5 votes vote down vote up
@Autowired
public JdbcCalendarUserDao(JdbcOperations jdbcOperations) {
    if (jdbcOperations == null) {
        throw new IllegalArgumentException("jdbcOperations cannot be null");
    }
    this.jdbcOperations = jdbcOperations;
}
 
Example 27
Project: REST-Web-Services   File: MovieRestController.java   View source code 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param moviePersistenceService The movie persistence service to use
 * @param movieSearchService The movie search service to use
 * @param authorizationService The authorization service to use
 * @param movieResourceAssembler Assemble movie resources out of movies
 * @param movieSearchResultResourceAssembler Assemble movie search resources out of movies
 */
@Autowired
public MovieRestController(
        final MoviePersistenceService moviePersistenceService,
        final MovieSearchService movieSearchService,
        final AuthorizationService authorizationService,
        final MovieResourceAssembler movieResourceAssembler,
        final MovieSearchResultResourceAssembler movieSearchResultResourceAssembler
) {
    this.moviePersistenceService = moviePersistenceService;
    this.movieSearchService = movieSearchService;
    this.authorizationService = authorizationService;
    this.movieResourceAssembler = movieResourceAssembler;
    this.movieSearchResultResourceAssembler = movieSearchResultResourceAssembler;
}
 
Example 28
Project: Spring-Security-Third-Edition   File: UserContextStub.java   View source code 5 votes vote down vote up
@Autowired
public UserContextStub(CalendarUserDao userService) {
    if (userService == null) {
        throw new IllegalArgumentException("userService cannot be null");
    }
    this.userService = userService;
}
 
Example 29
Project: Spring-Security-Third-Edition   File: JdbcEventDao.java   View source code 5 votes vote down vote up
@Autowired
public JdbcEventDao(JdbcOperations jdbcOperations) {
    if (jdbcOperations == null) {
        throw new IllegalArgumentException("jdbcOperations cannot be null");
    }
    this.jdbcOperations = jdbcOperations;
}
 
Example 30
Project: Spring-Security-Third-Edition   File: JpaCalendarUserDao.java   View source code 5 votes vote down vote up
@Autowired
public JpaCalendarUserDao(final CalendarUserRepository repository,
                          final RoleRepository roleRepository) {
    if (repository == null) {
        throw new IllegalArgumentException("repository cannot be null");
    }
    if (roleRepository == null) {
        throw new IllegalArgumentException("roleRepository cannot be null");
    }

    this.userRepository = repository;
    this.roleRepository = roleRepository;
}
 
Example 31
Project: jkes   File: EsRestClient.java   View source code 4 votes vote down vote up
@Autowired
public EsRestClient(JkesSearchProperties jkesProperties) {
    SniffOnFailureListener sniffOnFailureListener = new SniffOnFailureListener();
    Header[] defaultHeaders = {new BasicHeader("Content-Type", "application/json")};

    String[] urls = jkesProperties.getEs().getServers().split("\\s*,");
    HttpHost[] hosts = new HttpHost[urls.length];
    for (int i = 0; i < urls.length; i++) {
        hosts[i] = HttpHost.create(urls[i]);
    }

    RestClient restClient = RestClient.builder(hosts)
            .setRequestConfigCallback(requestConfigBuilder -> {
                return requestConfigBuilder.setConnectTimeout(5000) // default 1s
                        .setSocketTimeout(60000); // defaults to 30 seconds
            }).setHttpClientConfigCallback(httpClientBuilder -> {
                return httpClientBuilder.setDefaultIOReactorConfig(
                        IOReactorConfig.custom().setIoThreadCount(2).build()); // because only used for admin, so not necessary to hold many worker threads
            })
            .setMaxRetryTimeoutMillis(60000) // defaults to 30 seconds
            .setDefaultHeaders(defaultHeaders)
            .setFailureListener(sniffOnFailureListener)
            .build();

    Sniffer sniffer = Sniffer.builder(restClient).build();
    sniffOnFailureListener.setSniffer(sniffer);

    this.sniffer = sniffer;
    this.restClient = restClient;
}
 
Example 32
Project: Spring-Security-Third-Edition   File: CalendarUserDetailsService.java   View source code 4 votes vote down vote up
@Autowired
public CalendarUserDetailsService(CalendarUserDao calendarUserDao) {
    if (calendarUserDao == null) {
        throw new IllegalArgumentException("calendarUserDao cannot be null");
    }
    this.calendarUserDao = calendarUserDao;
}
 
Example 33
Project: Armory   File: MetricsConfiguration.java   View source code 4 votes vote down vote up
@Autowired(required = false)
public void setHikariDataSource(HikariDataSource hikariDataSource) {
    this.hikariDataSource = hikariDataSource;
}
 
Example 34
Project: recruitervision   File: EndFileController.java   View source code 4 votes vote down vote up
@Autowired
public EndFileController(ScreensManager screensManager, PDFCreator pdfCreator, JSONCreator jsonCreator) {
    this.screensManager = screensManager;
    this.pdfCreator = pdfCreator;
    this.jsonCreator = jsonCreator;
}
 
Example 35
Project: jigsaw-payment   File: IdServerConfiguration.java   View source code 4 votes vote down vote up
@Bean
@Autowired
public RedisTemplate redisTemplate(ShardedJedisPool shardedJedisPool){
	return new RedisTemplate(shardedJedisPool);
}
 
Example 36
Project: ARCLib   File: ReportForms.java   View source code 4 votes vote down vote up
@Autowired(required = false)
public void setForms(List<ReportForm> forms) {
    this.forms = forms != null ? forms : emptyList();
}
 
Example 37
Project: sentry   File: SettingService.java   View source code 4 votes vote down vote up
@Autowired
public SettingService(SettingRepository settingRepository, SettingMapper settingMapper,
                      SentryProperties sentryProperties) {
    this.settingRepository = settingRepository;
    this.settingMapper = settingMapper;
    this.sentryProperties = sentryProperties;
}
 
Example 38
Project: mafia   File: I18nUtil.java   View source code 4 votes vote down vote up
@Autowired
public void setMessageSource(MessageSource messageSource) {
	I18nUtil.messageSource = messageSource;
}
 
Example 39
Project: yum   File: AuthApiController.java   View source code 4 votes vote down vote up
@Autowired
public AuthApiController(AuthService authService) {
    this.authService = authService;           

}
 
Example 40
Project: ARCLib   File: NotificationService.java   View source code 4 votes vote down vote up
@Autowired(required = false)
public void setUserDetails(UserDetails userDetails) {
    this.userDetails = userDetails;
}