Returns a {@link VmSpec} based on the data gathered by this visitor.

@throws IllegalStateException if not all the data has been gathered.
176201
VmSpec vmSpec() {
     ImmutableMap<String, String> options = vmOptionsBuilder.build();
    checkState(!options.isEmpty());
    return new VmSpec.Builder()
        .addAllProperties(vmProperties.get())
        .addAllOptions(options)
        .build();
  }
490554
public List<InstanceInfo> getInstancesBySecureVirtualHostName(String secureVirtualHostName) {
        return Optional.ofNullable(this.secureVirtualHostNameAppMap.get(secureVirtualHostName.toUpperCase(Locale.ROOT)))
                .map(VipIndexSupport::getVipList)
                .map(AtomicReference::get)
                .orElseGet(Collections::emptyList);        
    }
1269346
@SuppressWarnings("unchecked")
    public T get() {
        if (HystrixRequestContext.getContextForCurrentThread() == null) {
            throw new IllegalStateException(HystrixRequestContext.class.getSimpleName() + ".initializeContext() must be called at the beginning of each request before RequestVariable functionality can be used.");
        }
        ConcurrentHashMap<HystrixRequestVariableDefault<?>, LazyInitializer<?>> variableMap = HystrixRequestContext.getContextForCurrentThread().state;

        // short-circuit the synchronized path below if we already have the value in the ConcurrentHashMap
        LazyInitializer<?> v = variableMap.get(this);
        if (v != null) {
            return (T) v.get();
        }

        /*
         * Optimistically create a LazyInitializer to put into the ConcurrentHashMap.
         * 
         * The LazyInitializer will not invoke initialValue() unless the get() method is invoked
         * so we can optimistically instantiate LazyInitializer and then discard for garbage collection
         * if the putIfAbsent fails.
         * 
         * Whichever instance of LazyInitializer succeeds will then have get() invoked which will call
         * the initialValue() method once-and-only-once.
         */
        LazyInitializer<T> l = new LazyInitializer<T>(this);
        LazyInitializer<?> existing = variableMap.putIfAbsent(this, l);
        if (existing == null) {
            /*
             * We won the thread-race so can use 'l' that we just created.
             */
            return l.get();
        } else {
            /*
             * We lost the thread-race so let 'l' be garbage collected and instead return 'existing'
             */
            return (T) existing.get();
        }
    }
878774
public Stream<T> lazyStream() throws IllegalStateException {

        if (pagerStream == null) {
            synchronized (this) {
                if (pagerStream == null) {

                    // Make sure that current page is 0, this will ensure the whole list is streamed
                    // regardless of what page the instance is currently on.
                    currentPage = 0;

                    pagerStream = StreamSupport.stream(new PagerSpliterator<T>(this), false);
                    return (pagerStream);
                }
            }
        }

        throw new IllegalStateException("Stream already issued");
    }
1045495
public synchronized boolean getBoolean()
   {
      final byte value = get();
      if(value == CommsConstants.TRUE_BYTE) return true;
      else if(value == CommsConstants.FALSE_BYTE) return false;
      else throw new IllegalStateException("Unexpected byte: " + value);     
   }
228719
protected int getCurrentProcessID() throws ProcessHandlerException {
        int pid;
        // Not ideal but using JNA failed on RHEL5.
        RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
        Field jvm = null;
        try {
            jvm = runtime.getClass().getDeclaredField("jvm");
            jvm.setAccessible(true);
            VMManagement mgmt = (VMManagement) jvm.get(runtime);
            Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId");
            pid_method.setAccessible(true);
            pid = (Integer) pid_method.invoke(mgmt);
        } catch (NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
            throw new ProcessHandlerException(e);
        }
        return pid;
    }
159933
@Override
    public VirtualConnectionFactory getOutboundVCFactory(Map<Object, Object> sslProps, boolean overwriteExisting) throws IllegalStateException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "getOutboundVCFactory(ssl)");
        }

        // Ensure the SSL channel factory exists in the outbound channel
        // definitions.
        if (-1 == this.sslChannelIndex) {
            throw new IllegalStateException("The SSL channel factory does not exist in this CFEndPoint.");
        }

        // Create a new OutboundChannelDefintion with new properties.
        OutboundChannelDefinition existingDef = this.outboundChannelDefs.get(this.sslChannelIndex);
        OutboundChannelDefinition newChannelDef = new OutboundChannelDefinitionImpl(existingDef, sslProps, overwriteExisting);
        // Overlay the new definition into the array managed by this endpoint.
        this.outboundChannelDefs.add(this.sslChannelIndex, newChannelDef);
        // Now that the properties are folded in, call the basic implementation.
        VirtualConnectionFactory localVCF = getOutboundVCFactory();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "getOutboundVCFactory(ssl)");
        }
        return localVCF;
    }
119042
public final SrvSqlEscape lazyGetSrvSqlEscape() throws Exception {
    String beanName = getSrvSqlEscapeName();
    SrvSqlEscape srvSqlEscape = (SrvSqlEscape) this.beansMap.get(beanName);
    if (srvSqlEscape == null) {
      srvSqlEscape = new SrvSqlEscape();
      this.beansMap.put(beanName, srvSqlEscape);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return srvSqlEscape;
  }
1019737
public static synchronized UTEHelper getHelperInstance()
   throws java.lang.IllegalStateException
  {
    
    if (tcInt.isEntryEnabled()) SibTr.entry(tcInt, "getHelperInstance");
    
    // ************** CHECK TO SEE IF IT IS ENABLED *******************
    try
    {      
      // Initialise the test env flag from a system property if it has been set.
      String prop = System.getProperty("com.ibm.ws.sib.api.testenv");

      // Check that the text reads "enabled".      
      if ((prop != null) && ("enabled".equals(prop.toLowerCase())))
      {
        if (tcInt.isDebugEnabled())
          SibTr.debug(tcInt, "TestEnv flag enabled by system property.");
        UTEHelperFactory.jmsTestEnvironmentEnabled = true;
    
      } else
      {
        if (tcInt.isDebugEnabled())
           SibTr.debug(tcInt, "testenv system property was present but did not enable testenv - "+prop);
      }//if
  
    } catch(SecurityException sce)
    {
      // No FFDC code needed
      if (tcInt.isDebugEnabled())
        SibTr.debug(tcInt, "Could not read system property due to SecurityException", sce);
    
    }//try
    
    
    // d250397 IGH it is valid to use a UTEHelper with UTE disabled
    // when running unit tests in remote client mode (see JMSTestCase)
    // so don't throw an exception here
/*
    if (!UTEHelperFactory.jmsTestEnvironmentEnabled) 
    {
      // NB. This is for unit test only and so need not be NLS'd.
      throw new java.lang.IllegalStateException("JMS Test Environment is not enabled.");
      
    }//if
*/    

    if (instance == null)
    {
      try
      {
        instance = (UTEHelper)Class.forName(
         "com.ibm.ws.sib.api.jms.impl.ute.UTEHelperImpl").newInstance();
      } catch (Exception e)
      {
        // No FFDC code needed
        if (tcInt.isDebugEnabled())
          SibTr.debug(tcInt, "Couldn't find impl class", e);
          
        RuntimeException f = new java.lang.IllegalStateException("UTEHelperFactory.getHelperInstance()");
        f.initCause(e);
        
        if (tcInt.isEntryEnabled()) SibTr.exit(tcInt, "getHelperInstance");
        throw f;
      }
    }
    
    if (tcInt.isEntryEnabled()) SibTr.exit(tcInt, "getHelperInstance");
    return instance;
    
  }
416930
public boolean getDSR() throws IllegalStateException, IOException{
        // validate state
        if (isClosed())
            throw new IllegalStateException("Serial connection is not open; cannot 'getDSR()'.");

        // get pin state
        return com.pi4j.jni.Serial.getDSR(fileDescriptor);
    }
753487
public Server build() {
        final VirtualHost defaultVirtualHost;
        if (this.defaultVirtualHost != null) {
            defaultVirtualHost = this.defaultVirtualHost.decorate(decorator);
        } else {
            defaultVirtualHost = defaultVirtualHostBuilder.build().decorate(decorator);
        }

        virtualHostBuilders.forEach(vhb -> virtualHosts.add(vhb.build()));

        final List<VirtualHost> virtualHosts;
        if (decorator != null) {
            virtualHosts = this.virtualHosts.stream()
                                            .map(h -> h.decorate(decorator))
                                            .collect(Collectors.toList());
        } else {
            virtualHosts = this.virtualHosts;
        }

        // Gets the access logger for each virtual host.
        virtualHosts.forEach(vh -> {
            if (vh.accessLoggerOrNull() == null) {
                final Logger logger = accessLoggerMapper.apply(vh);

                checkState(logger != null, "accessLoggerMapper.apply() has returned null for virtual host: %s.",
                           vh.hostnamePattern());
                vh.accessLogger(logger);
            }
            // combine content preview factories (one for VirtualHost, the other for Server)
            vh.requestContentPreviewerFactory(ContentPreviewerFactory.of(vh.requestContentPreviewerFactory(),
                                                                         requestContentPreviewerFactory));
            vh.responseContentPreviewerFactory(ContentPreviewerFactory.of(vh.responseContentPreviewerFactory(),
                                                                          responseContentPreviewerFactory));
        });
        if (defaultVirtualHost.accessLoggerOrNull() == null) {
            final Logger logger = accessLoggerMapper.apply(defaultVirtualHost);
            checkState(logger != null,
                       "accessLoggerMapper.apply() has returned null for the default virtual host.");
            defaultVirtualHost.accessLogger(logger);
        }

        defaultVirtualHost.requestContentPreviewerFactory(
                ContentPreviewerFactory.of(defaultVirtualHost.requestContentPreviewerFactory(),
                                           requestContentPreviewerFactory));
        defaultVirtualHost.responseContentPreviewerFactory(
                ContentPreviewerFactory.of(defaultVirtualHost.responseContentPreviewerFactory(),
                                           responseContentPreviewerFactory));

        // Pre-populate the domain name mapping for later matching.
        final DomainNameMapping<SslContext> sslContexts;
        final SslContext defaultSslContext = findDefaultSslContext(defaultVirtualHost, virtualHosts);

        final Collection<ServerPort> ports;

        this.ports.forEach(
                port -> checkState(port.protocols().stream().anyMatch(p -> p != PROXY),
                                   "protocols: %s (expected: at least one %s or %s)",
                                   port.protocols(), HTTP, HTTPS));

        if (defaultSslContext == null) {
            sslContexts = null;
            if (!this.ports.isEmpty()) {
                ports = resolveDistinctPorts(this.ports);
                for (final ServerPort p : ports) {
                    if (p.hasTls()) {
                        throw new IllegalArgumentException("TLS not configured; cannot serve HTTPS");
                    }
                }
            } else {
                ports = ImmutableList.of(new ServerPort(0, HTTP));
            }
        } else {
            if (!this.ports.isEmpty()) {
                ports = resolveDistinctPorts(this.ports);
            } else {
                ports = ImmutableList.of(new ServerPort(0, HTTPS));
            }

            final DomainNameMappingBuilder<SslContext>
                    mappingBuilder = new DomainNameMappingBuilder<>(defaultSslContext);
            for (VirtualHost h : virtualHosts) {
                final SslContext sslCtx = h.sslContext();
                if (sslCtx != null) {
                    mappingBuilder.add(h.hostnamePattern(), sslCtx);
                }
            }
            sslContexts = mappingBuilder.build();
        }

        final Server server = new Server(new ServerConfig(
                ports, normalizeDefaultVirtualHost(defaultVirtualHost, defaultSslContext), virtualHosts,
                workerGroup, shutdownWorkerGroupOnStop, startStopExecutor, maxNumConnections,
                idleTimeoutMillis, defaultRequestTimeoutMillis, defaultMaxRequestLength, verboseResponses,
                http2InitialConnectionWindowSize, http2InitialStreamWindowSize, http2MaxStreamsPerConnection,
                http2MaxFrameSize, http2MaxHeaderListSize,
                http1MaxInitialLineLength, http1MaxHeaderSize, http1MaxChunkSize,
                gracefulShutdownQuietPeriod, gracefulShutdownTimeout,
                blockingTaskExecutor, shutdownBlockingTaskExecutorOnStop,
                meterRegistry, serviceLoggerPrefix, accessLogWriter, shutdownAccessLogWriterOnStop,
                proxyProtocolMaxTlvSize, channelOptions, childChannelOptions,
                clientAddressSources, clientAddressTrustedProxyFilter, clientAddressFilter), sslContexts);

        serverListeners.forEach(server::addListener);
        return server;
    }
1242396
public java.lang.String getVmStatus() {
    java.lang.Object ref = vmStatus_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      vmStatus_ = s;
      return s;
    }
  }
46806
public static vm_device[] get(nitro_service client) throws Exception
	{
		vm_device resource = new vm_device();
		resource.validate("get");
		return (vm_device[]) resource.get_resources(client);
	}
1105274
public ConnectionSpec toConnectionSpec() {
        try {
            return getDatabaseAPI().newConnectionSpecInstance(getConnect(), getUser(), getPasswd(), false);
        } catch (InvalidConnectionSpecArguments ex) {
            throw new AssertionError(ex);
        }
    }
397781
public SIMPIterator getRemoteQueuePointIterator() throws SIMPException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteQueuePointIterator");
      
    assertMessageHandlerNotCorrupt();
    
    Index index = baseDest.getRemoteQueuePoints();
    SIMPIterator itr = index.iterator();
    SIMPIterator returnItr = new BasicSIMPIterator(itr);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteQueuePointIterator", returnItr);
    return returnItr;
  }
439378
public Map<String, Object> getSpec() {
        return ImmutableMap.<String, Object>of(
                "ioConfig", getIoConfig(),
                "dataSchema", getDataSchema(),
                "tuningConfig", getTuningConfig());
    }
834993
public VM validate(Iterator<Split> dataSplits, TrainingParameters trainingParameters) {
        AbstractModeler modeler = MLBuilder.create(trainingParameters, configuration);

        List<VM> validationMetricsList = new LinkedList<>();
        while (dataSplits.hasNext()) {
            Split s = dataSplits.next();
            Dataframe trainData = s.getTrain();
            Dataframe testData = s.getTest();

            modeler.fit(trainData);
            trainData.close();

            modeler.predict(testData);
            VM entrySample = ValidationMetrics.newInstance(vmClass, testData);
            testData.close();

            validationMetricsList.add(entrySample);
        }
        modeler.close();

        VM avgValidationMetrics = ValidationMetrics.newInstance(vmClass, validationMetricsList);

        return avgValidationMetrics;
    }