@Override public String getHostName() { return hostControllerInfo.getLocalHostName(); } };
@Override public String getHostName() { return hostControllerInfo.getLocalHostName(); } };
@Override public boolean isHostRegistered(String id) { return hostControllerInfo.getLocalHostName().equals(id) || hostRegistrationMap.containsKey(id); }
private void startServers() { ModelNode addr = new ModelNode(); addr.add(HOST, hostControllerInfo.getLocalHostName()); ModelNode op = Util.getEmptyOperation(StartServersHandler.OPERATION_NAME, addr); getValue().execute(op, null, null, null); }
private void startServers() { ModelNode addr = new ModelNode(); addr.add(HOST, hostControllerInfo.getLocalHostName()); ModelNode op = Util.getEmptyOperation(StartServersHandler.OPERATION_NAME, addr); getValue().execute(op, null, null, null); }
private void startServers() { ModelNode addr = new ModelNode(); addr.add(HOST, hostControllerInfo.getLocalHostName()); ModelNode op = Util.getEmptyOperation(StartServersHandler.OPERATION_NAME, addr); getValue().execute(op, null, null, null); }
@Override public void unregisterRunningServer(String serverName) { PathAddress pa = PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName())); PathElement pe = PathElement.pathElement(RUNNING_SERVER, serverName); ROOT_LOGGER.unregisteringServer(serverName); ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(pa); hostRegistration.unregisterProxyController(pe); serverProxies.remove(serverName); }
@Override public void unregisterRunningServer(String serverName) { PathAddress pa = PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName())); PathElement pe = PathElement.pathElement(RUNNING_SERVER, serverName); ROOT_LOGGER.unregisteringServer(serverName); ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(pa); hostRegistration.unregisterProxyController(pe); serverProxies.remove(serverName); }
@Override public void unregisterRunningServer(String serverName) { PathAddress pa = PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName())); PathElement pe = PathElement.pathElement(RUNNING_SERVER, serverName); ROOT_LOGGER.unregisteringServer(serverName); ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(pa); hostRegistration.unregisterProxyController(pe); serverProxies.remove(serverName); }
@Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException { populateHostControllerInfo(hostControllerInfo, context, model); final ServiceTarget serviceTarget = context.getServiceTarget(); ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT); ManagementRemotingServices.installRemotingEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostControllerInfo.getLocalHostName(), EndpointService.EndpointType.MANAGEMENT, CONNECTION_OPTIONS, null, null); final boolean onDemand = context.isBooting(); installNativeManagementServices(serviceTarget, hostControllerInfo, verificationHandler, newControllers, onDemand); }
@Override public void registerRunningServer(final ProxyController serverControllerClient) { PathAddress pa = serverControllerClient.getProxyNodeAddress(); PathElement pe = pa.getElement(1); if (modelNodeRegistration.getProxyController(pa) != null) { throw MESSAGES.serverNameAlreadyRegistered(pe.getValue()); } ROOT_LOGGER.registeringServer(pe.getValue()); ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName()))); hostRegistration.registerProxyController(pe, serverControllerClient); serverProxies.put(pe.getValue(), serverControllerClient); }
@Override public void registerRemoteHost(final String hostName, final ManagementChannelHandler handler, final Transformers transformers, final Long remoteConnectionId, final boolean registerProxyController) throws SlaveRegistrationException { if (!hostControllerInfo.isMasterDomainController()) { throw SlaveRegistrationException.forHostIsNotMaster(); } if (runningModeControl.getRunningMode() == RunningMode.ADMIN_ONLY) { throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode()); } final PathElement pe = PathElement.pathElement(ModelDescriptionConstants.HOST, hostName); final PathAddress addr = PathAddress.pathAddress(pe); ProxyController existingController = modelNodeRegistration.getProxyController(addr); if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){ throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue()); } final SlaveHostPinger pinger = remoteConnectionId == null ? null : new SlaveHostPinger(hostName, handler, pingScheduler, remoteConnectionId); final String address = handler.getRemoteAddress().getHostAddress(); slaveHostRegistrations.registerHost(hostName, pinger, address); if (registerProxyController) { // Create the proxy controller final TransformingProxyController hostControllerClient = TransformingProxyController.Factory.create(handler, transformers, addr, ProxyOperationAddressTranslator.HOST); modelNodeRegistration.registerProxyController(pe, hostControllerClient); hostProxies.put(hostName, hostControllerClient); } }
ProxyController existingController = modelNodeRegistration.getProxyController(addr); if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){ throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue());
@Override public void registerRemoteHost(final String hostName, final ManagementChannelHandler handler, final Transformers transformers, final Long remoteConnectionId, final boolean registerProxyController) throws SlaveRegistrationException { if (!hostControllerInfo.isMasterDomainController()) { throw SlaveRegistrationException.forHostIsNotMaster(); } if (runningModeControl.getRunningMode() == RunningMode.ADMIN_ONLY) { throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode()); } final PathElement pe = PathElement.pathElement(ModelDescriptionConstants.HOST, hostName); final PathAddress addr = PathAddress.pathAddress(pe); ProxyController existingController = modelNodeRegistration.getProxyController(addr); if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){ throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue()); } final SlaveHostPinger pinger = remoteConnectionId == null ? null : new SlaveHostPinger(hostName, handler, pingScheduler, remoteConnectionId); final String address = handler.getRemoteAddress().getHostAddress(); slaveHostRegistrations.registerHost(hostName, pinger, address); if (registerProxyController) { // Create the proxy controller final TransformingProxyController hostControllerClient = TransformingProxyController.Factory.create(handler, transformers, addr, ProxyOperationAddressTranslator.HOST); modelNodeRegistration.registerProxyController(pe, hostControllerClient); hostProxies.put(hostName, hostControllerClient); } }
@Override public void registerRunningServer(final ProxyController serverControllerClient) { PathAddress pa = serverControllerClient.getProxyNodeAddress(); PathElement pe = pa.getElement(1); if (modelNodeRegistration.getProxyController(pa) != null) { throw HostControllerLogger.ROOT_LOGGER.serverNameAlreadyRegistered(pe.getValue()); } ROOT_LOGGER.registeringServer(pe.getValue()); // Register the proxy final ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName()))); hostRegistration.registerProxyController(pe, serverControllerClient); // Register local operation overrides final ManagementResourceRegistration serverRegistration = hostRegistration.getSubModel(PathAddress.EMPTY_ADDRESS.append(pe)); ServerConfigResourceDefinition.registerServerLifecycleOperations(serverRegistration, serverInventory); serverProxies.put(pe.getValue(), serverControllerClient); }
@Override public void registerRunningServer(final ProxyController serverControllerClient) { PathAddress pa = serverControllerClient.getProxyNodeAddress(); PathElement pe = pa.getElement(1); if (modelNodeRegistration.getProxyController(pa) != null) { throw HostControllerLogger.ROOT_LOGGER.serverNameAlreadyRegistered(pe.getValue()); } ROOT_LOGGER.registeringServer(pe.getValue()); // Register the proxy final ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName()))); hostRegistration.registerProxyController(pe, serverControllerClient); // Register local operation overrides final ManagementResourceRegistration serverRegistration = hostRegistration.getSubModel(PathAddress.EMPTY_ADDRESS.append(pe)); ServerConfigResourceDefinition.registerServerLifecycleOperations(serverRegistration, serverInventory); serverProxies.put(pe.getValue(), serverControllerClient); }
@Override protected List<ServiceName> installServices(OperationContext context, NativeInterfaceCommonPolicy commonPolicy, ModelNode model) throws OperationFailedException { populateHostControllerInfo(hostControllerInfo, context, model); final ServiceTarget serviceTarget = context.getServiceTarget(); final boolean onDemand = context.isBooting(); NativeManagementServices.installRemotingServicesIfNotInstalled(serviceTarget, hostControllerInfo.getLocalHostName(), context.getServiceRegistry(false), onDemand); OptionMap options = createConnectorOptions(commonPolicy); final ServiceName nativeManagementInterfaceBinding = context.getCapabilityServiceName("org.wildfly.network.interface", hostControllerInfo.getNativeManagementInterface(), NetworkInterfaceBinding.class); final String securityRealm = commonPolicy.getSecurityRealm(); final String saslAuthenticationFactory = commonPolicy.getSaslAuthenticationFactory(); if (saslAuthenticationFactory == null && securityRealm == null) { ROOT_LOGGER.nativeManagementInterfaceIsUnsecured(); } ServiceName securityRealmName = securityRealm != null ? SecurityRealm.ServiceUtil.createServiceName(securityRealm) : null; ServiceName saslAuthenticationFactoryName = saslAuthenticationFactory != null ? context.getCapabilityServiceName( SASL_AUTHENTICATION_FACTORY_CAPABILITY, saslAuthenticationFactory, SaslAuthenticationFactory.class) : null; String sslContext = commonPolicy.getSSLContext(); ServiceName sslContextName = sslContext != null ? context.getCapabilityServiceName(SSL_CONTEXT_CAPABILITY, sslContext, SSLContext.class) : null; NativeManagementServices.installManagementWorkerService(serviceTarget, context.getServiceRegistry(false)); ManagementRemotingServices.installDomainConnectorServices(context, serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, nativeManagementInterfaceBinding, hostControllerInfo.getNativeManagementPort(), options, securityRealmName, saslAuthenticationFactoryName, sslContextName); return Arrays.asList(REMOTING_BASE.append("server", MANAGEMENT_CONNECTOR), nativeManagementInterfaceBinding); }
@Override protected List<ServiceName> installServices(OperationContext context, NativeInterfaceCommonPolicy commonPolicy, ModelNode model) throws OperationFailedException { populateHostControllerInfo(hostControllerInfo, context, model); final ServiceTarget serviceTarget = context.getServiceTarget(); final boolean onDemand = context.isBooting(); NativeManagementServices.installRemotingServicesIfNotInstalled(serviceTarget, hostControllerInfo.getLocalHostName(), context.getServiceRegistry(false), onDemand); OptionMap options = createConnectorOptions(commonPolicy); final ServiceName nativeManagementInterfaceBinding = context.getCapabilityServiceName("org.wildfly.network.interface", hostControllerInfo.getNativeManagementInterface(), NetworkInterfaceBinding.class); final String securityRealm = commonPolicy.getSecurityRealm(); final String saslAuthenticationFactory = commonPolicy.getSaslAuthenticationFactory(); if (saslAuthenticationFactory == null && securityRealm == null) { ROOT_LOGGER.nativeManagementInterfaceIsUnsecured(); } ServiceName securityRealmName = securityRealm != null ? SecurityRealm.ServiceUtil.createServiceName(securityRealm) : null; ServiceName saslAuthenticationFactoryName = saslAuthenticationFactory != null ? context.getCapabilityServiceName( SASL_AUTHENTICATION_FACTORY_CAPABILITY, saslAuthenticationFactory, SaslAuthenticationFactory.class) : null; String sslContext = commonPolicy.getSSLContext(); ServiceName sslContextName = sslContext != null ? context.getCapabilityServiceName(SSL_CONTEXT_CAPABILITY, sslContext, SSLContext.class) : null; NativeManagementServices.installManagementWorkerService(serviceTarget, context.getServiceRegistry(false)); ManagementRemotingServices.installDomainConnectorServices(context, serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, nativeManagementInterfaceBinding, hostControllerInfo.getNativeManagementPort(), options, securityRealmName, saslAuthenticationFactoryName, sslContextName); return Arrays.asList(REMOTING_BASE.append("server", MANAGEMENT_CONNECTOR), nativeManagementInterfaceBinding); }
NativeManagementServices.installRemotingServicesIfNotInstalled(serviceTarget, hostControllerInfo.getLocalHostName(), context.getServiceRegistry(true), onDemand); final String httpConnectorName; if (port > -1 || securePort < 0) {
NativeManagementServices.installRemotingServicesIfNotInstalled(serviceTarget, hostControllerInfo.getLocalHostName(), context.getServiceRegistry(true), onDemand); final String httpConnectorName; if (port > -1 || securePort < 0) {