@SuppressWarnings("unused") public static Collection<String> getAvailableConfigurationEncrypters() { return (new QpidServiceLoader()).getInstancesByType(ConfigurationSecretEncrypterFactory.class).keySet(); }
@Override public MessageStoreSerializer newInstance() { return new QpidServiceLoader().getInstancesByType(MessageStoreSerializer.class).get(MessageStoreSerializer.LATEST); }
@SuppressWarnings("unused") public static Collection<String> validIdentityResolvers() { return new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).keySet(); } }
private static PreferenceValue convertMapToPreferenceValue(String type, Map<String, Object> preferenceValueAttributes) { String implementationType = type; if (type != null && type.startsWith("X-")) { implementationType = "X-generic"; } final Map<String, PreferenceValueFactoryService> preferenceValueFactories = new QpidServiceLoader().getInstancesByType(PreferenceValueFactoryService.class); final PreferenceValueFactoryService preferenceValueFactory = preferenceValueFactories.get(implementationType); if (preferenceValueFactory == null) { throw new IllegalArgumentException(String.format("Cannot find preference type factory for type '%s'", implementationType)); } return preferenceValueFactory.createInstance(preferenceValueAttributes); } }
@Override public String getDefaultScope() { final OAuth2IdentityResolverService identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(getIdentityResolverType()); return identityResolverService == null ? null : identityResolverService.getDefaultScope(this); }
@Override public URI getDefaultIdentityResolverEndpointURI() { final OAuth2IdentityResolverService identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(getIdentityResolverType()); return identityResolverService == null ? null : identityResolverService.getDefaultIdentityResolverEndpointURI(this); }
@Override public URI getDefaultTokenEndpointURI() { final OAuth2IdentityResolverService identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(getIdentityResolverType()); return identityResolverService == null ? null : identityResolverService.getDefaultTokenEndpointURI(this); }
new QpidServiceLoader().getInstancesByType(MessageStoreSerializer.class);
@Override public URI getDefaultAuthorizationEndpointURI() { final OAuth2IdentityResolverService identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(getIdentityResolverType()); return identityResolverService == null ? null : identityResolverService.getDefaultAuthorizationEndpointURI(this); }
private void validateResolver(final OAuth2AuthenticationProvider<?> provider) { final OAuth2IdentityResolverService identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(provider.getIdentityResolverType()); if(identityResolverService == null) { throw new IllegalConfigurationException("Unknown identity resolver " + provider.getType()); } else { identityResolverService.validate(provider); } }
@Override public PreferenceStore createPreferenceStore() { PreferenceStoreAttributes preferenceStoreAttributes = getPreferenceStoreAttributes(); final Map<String, PreferenceStoreFactoryService> preferenceStoreFactories = new QpidServiceLoader().getInstancesByType(PreferenceStoreFactoryService.class); String preferenceStoreType; Map<String, Object> attributes; if (preferenceStoreAttributes == null) { preferenceStoreType = NoopPreferenceStoreFactoryService.TYPE; attributes = Collections.emptyMap(); } else { preferenceStoreType = preferenceStoreAttributes.getType(); attributes = preferenceStoreAttributes.getAttributes(); } final PreferenceStoreFactoryService preferenceStoreFactory = preferenceStoreFactories.get(preferenceStoreType); return preferenceStoreFactory.createInstance(this, attributes); }
@ManagedObjectFactoryConstructor public BrokerImpl(Map<String, Object> attributes, SystemConfig parent) { super(attributes, parent); _principal = new BrokerPrincipal(this); if (parent.isManagementMode()) { Map<String,Object> authManagerAttrs = new HashMap<String, Object>(); authManagerAttrs.put(NAME,"MANAGEMENT_MODE_AUTHENTICATION"); authManagerAttrs.put(ID, UUID.randomUUID()); SimpleAuthenticationManager authManager = new SimpleAuthenticationManager(authManagerAttrs, this); authManager.addUser(SystemConfig.MANAGEMENT_MODE_USER_NAME, _parent.getManagementModePassword()); _managementModeAuthenticationProvider = authManager; _accessControl = AccessControl.ALWAYS_ALLOWED; } else { _accessControl = new CompoundAccessControl(Collections.<AccessControl<?>>emptyList(), Result.ALLOWED); } QpidServiceLoader qpidServiceLoader = new QpidServiceLoader(); final Set<String> systemNodeCreatorTypes = qpidServiceLoader.getInstancesByType(SystemNodeCreator.class).keySet(); _virtualHostPropertiesNodeEnabled = systemNodeCreatorTypes.contains(VirtualHostPropertiesNodeCreator.TYPE); }
@Override public PreferenceStore createPreferenceStore() { final Map<String, PreferenceStoreFactoryService> preferenceStoreFactories = new QpidServiceLoader().getInstancesByType(PreferenceStoreFactoryService.class); String preferenceStoreType; PreferenceStoreAttributes preferenceStoreAttributes = getPreferenceStoreAttributes(); Map<String, Object> attributes; if (preferenceStoreAttributes == null) { preferenceStoreType = NoopPreferenceStoreFactoryService.TYPE; attributes = Collections.emptyMap(); } else { preferenceStoreType = preferenceStoreAttributes.getType(); attributes = preferenceStoreAttributes.getAttributes(); } final PreferenceStoreFactoryService preferenceStoreFactory = preferenceStoreFactories.get(preferenceStoreType); return preferenceStoreFactory.createInstance(this, attributes); }
Map<String, ContainerType> instancesByType = loader.getInstancesByType(ContainerType.class); final ContainerType<?> containerType = instancesByType.get(containerTypeName);
@Override protected void onOpen() { super.onOpen(); _protocolHandshakeTimeout = getContextValue(Long.class, AmqpPort.PROTOCOL_HANDSHAKE_TIMEOUT); _connectionWarnCount = getContextValue(Integer.class, OPEN_CONNECTIONS_WARN_PERCENT); _closeWhenNoRoute = getContextValue(Boolean.class, AmqpPort.CLOSE_WHEN_NO_ROUTE); _sessionCountLimit = getContextValue(Integer.class, AmqpPort.SESSION_COUNT_LIMIT); _heartBeatDelay = getContextValue(Integer.class, AmqpPort.HEART_BEAT_DELAY); _tlsSessionTimeout = getContextValue(Integer.class, AmqpPort.TLS_SESSION_TIMEOUT); _tlsSessionCacheSize = getContextValue(Integer.class, AmqpPort.TLS_SESSION_CACHE_SIZE); @SuppressWarnings("unchecked") List<String> configurationPropertyEnrichers = getContextValue(List.class, AmqpPort.CONNECTION_PROPERTY_ENRICHERS); List<ConnectionPropertyEnricher> enrichers = new ArrayList<>(configurationPropertyEnrichers.size()); final Map<String, ConnectionPropertyEnricher> enrichersByType = new QpidServiceLoader().getInstancesByType(ConnectionPropertyEnricher.class); for(String enricherName : configurationPropertyEnrichers) { ConnectionPropertyEnricher enricher = enrichersByType.get(enricherName); if(enricher != null) { enrichers.add(enricher); } else { LOGGER.warn("Ignoring unknown Connection Property Enricher type: '"+enricherName+"' on port " + this.getName()); } } _connectionPropertyEnrichers = Collections.unmodifiableList(enrichers); }
loader.getInstancesByType(ContainerType.class).get(containerTypeName);
@Override protected void onOpen() { super.onOpen(); String type = getIdentityResolverType(); _identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(type); _tlsProtocolWhiteList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_PROTOCOL_WHITE_LIST); _tlsProtocolBlackList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_PROTOCOL_BLACK_LIST); _tlsCipherSuiteWhiteList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_WHITE_LIST); _tlsCipherSuiteBlackList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_BLACK_LIST); _connectTimeout = getContextValue(Integer.class, AUTHENTICATION_OAUTH2_CONNECT_TIMEOUT); _readTimeout = getContextValue(Integer.class, AUTHENTICATION_OAUTH2_READ_TIMEOUT); Integer cacheMaxSize = getContextValue(Integer.class, AUTHENTICATION_CACHE_MAX_SIZE); Long cacheExpirationTime = getContextValue(Long.class, AUTHENTICATION_CACHE_EXPIRATION_TIME); Integer cacheIterationCount = getContextValue(Integer.class, AUTHENTICATION_CACHE_ITERATION_COUNT); if (cacheMaxSize == null || cacheMaxSize <= 0 || cacheExpirationTime == null || cacheExpirationTime <= 0 || cacheIterationCount == null || cacheIterationCount < 0) { LOGGER.debug("disabling authentication result caching"); cacheMaxSize = 0; cacheExpirationTime = 1L; cacheIterationCount = 0; } _authenticationResultCacher = new AuthenticationResultCacher(cacheMaxSize, cacheExpirationTime, cacheIterationCount); }
final ContainerType<?> containerType = loader.getInstancesByType(ContainerType.class).get(containerTypeName);
qpidServiceLoader.getInstancesByType(MessageFilterFactory.class);