Gets the supported features of the servers pubsub implementation
as a standard {@link DiscoverInfo} instance.

@return The supported features
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException
516050
public DiscoverInfo getSupportedFeatures() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        ServiceDiscoveryManager mgr = ServiceDiscoveryManager.getInstanceFor(connection());
        return mgr.discoverInfo(pubSubService);
    }
1054834
@Override
    public ProvisioningFeatureDefinition getFeature(String featureName) {
        ProvisioningFeatureDefinition result = repo.getFeature(featureName);
        if (result == null) {
            return null;
        }
        if (restricted.contains(result.getSymbolicName())) {
            // record the restricted attemp
            if (!restrictedAttempts.contains(result.getSymbolicName())) {
                restrictedAttempts.add(result.getSymbolicName());
            }
            return null;
        }
        return result;
    }
1163841
public java.util.List<String> getSupportedTierList() {
        if (supportedTierList == null) {
            supportedTierList = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return supportedTierList;
    }
197100
protected int discoverPeers() {
        // Don't hold the lock whilst doing peer discovery: it can take a long time and cause high API latency.
        checkState(!lock.isHeldByCurrentThread());
        int maxPeersToDiscoverCount = this.vMaxPeersToDiscoverCount;
        long peerDiscoveryTimeoutMillis = this.vPeerDiscoveryTimeoutMillis;
        final Stopwatch watch = Stopwatch.createStarted();
        final List<PeerAddress> addressList = Lists.newLinkedList();
        for (PeerDiscovery peerDiscovery : peerDiscoverers /* COW */) {
            InetSocketAddress[] addresses;
            try {
                addresses = peerDiscovery.getPeers(requiredServices, peerDiscoveryTimeoutMillis, TimeUnit.MILLISECONDS);
            } catch (PeerDiscoveryException e) {
                log.warn(e.getMessage());
                continue;
            }
            for (InetSocketAddress address : addresses) addressList.add(new PeerAddress(params, address));
            if (addressList.size() >= maxPeersToDiscoverCount) break;
        }
        if (!addressList.isEmpty()) {
            for (PeerAddress address : addressList) {
                addInactive(address);
            }
            final ImmutableSet<PeerAddress> peersDiscoveredSet = ImmutableSet.copyOf(addressList);
            for (final ListenerRegistration<PeerDiscoveredEventListener> registration : peerDiscoveredEventListeners /* COW */) {
                registration.executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        registration.listener.onPeersDiscovered(peersDiscoveredSet);
                    }
                });
            }
        }
        watch.stop();
        log.info("Peer discovery took {} and returned {} items", watch, addressList.size());
        return addressList.size();
    }
302439
public EndpointInfo build(EndpointInfoBuilderContext ctx, String serviceImplBeanClassName, EndpointType endpointType) throws UnableToAdaptException {

        EndpointInfo endpointInfo = new EndpointInfo(serviceImplBeanClassName, endpointType);
        endpointInfo.setBeanName((String) ctx.getContextEnv(JaxWsConstants.ENV_ATTRIBUTE_ENDPOINT_BEAN_NAME));
        endpointInfo.setServletName((String) ctx.getContextEnv(JaxWsConstants.ENV_ATTRIBUTE_ENDPOINT_SERVLET_NAME));

        invokeConfigurators(ctx, ConfigMethod.PREPARE, endpointInfo);
        invokeConfigurators(ctx, ConfigMethod.CONFIG, endpointInfo);

        validate(ctx, endpointInfo);

        ctx.clearContextEnv();

        return endpointInfo;
    }
499712
public java.util.List<String> getCapabilities() {
        if (capabilities == null) {
            capabilities = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return capabilities;
    }
138377
public EndpointInfoBuilder availableFormats(SerializationFormat... availableFormats) {
        requireNonNull(availableFormats, "availableFormats");
        return availableFormats(ImmutableSet.copyOf(availableFormats));
    }
174298
public java.util.List<SupportedOperation> getSupportedOperations() {
        if (supportedOperations == null) {
            supportedOperations = new com.amazonaws.internal.SdkInternalList<SupportedOperation>();
        }
        return supportedOperations;
    }
50081
@Override
    public boolean getFeature(String featureId)
            throws SAXNotRecognizedException, SAXNotSupportedException {
        if ((FEATURE + "validation").equals(featureId)) {
            return false;
        }

        // external entities (both types) are optionally included
        if ((FEATURE + "external-general-entities").equals(featureId)) {
            return extGE;
        }
        if ((FEATURE + "external-parameter-entities").equals(featureId)) {
            return extPE;
        }

        // element/attribute names are as written in document; no mangling
        if ((FEATURE + "namespace-prefixes").equals(featureId)) {
            return xmlNames;
        }

        // report element/attribute namespaces?
        if ((FEATURE + "namespaces").equals(featureId)) {
            return namespaces;
        }

        // all PEs and GEs are reported
        if ((FEATURE + "lexical-handler/parameter-entities").equals(featureId)) {
            return true;
        }

        // default is true
        if ((FEATURE + "string-interning").equals(featureId)) {
            return stringInterning;
        }

        // EXTENSIONS 1.1

        // always returns isSpecified info
        if ((FEATURE + "use-attributes2").equals(featureId)) {
            return true;
        }

        // meaningful between startDocument/endDocument
        if ((FEATURE + "is-standalone").equals(featureId)) {
            if (parser == null) {
                throw new SAXNotSupportedException(featureId);
            }
            return parser.isStandalone();
        }

        // optionally don't absolutize URIs in declarations
        if ((FEATURE + "resolve-dtd-uris").equals(featureId)) {
            return resolveAll;
        }

        // optionally use resolver2 interface methods, if possible
        if ((FEATURE + "use-entity-resolver2").equals(featureId)) {
            return useResolver2;
        }

        if ("http://xml.org/sax/features/unicode-normalization-checking".equals(featureId)) {
            return checkNormalization;
        }

        throw new SAXNotRecognizedException(featureId);
    }
337726
public List<DomainBareJid> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException  {
        ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
        return discoManager.findServices(UserSearch.NAMESPACE, false, false);
    }
36063
public java.util.List<String> getCustomEndpoints() {
        if (customEndpoints == null) {
            customEndpoints = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return customEndpoints;
    }
28455
public boolean getFeature(String name)
        throws SAXNotRecognizedException, SAXNotSupportedException
    {
        if(NAMESPACES_FEATURE.equals(name)) {
            return pp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES);
        } else if(NAMESPACE_PREFIXES_FEATURE.equals(name)) {
            return pp.getFeature(XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES);
        } else if(VALIDATION_FEATURE.equals(name)) {
            return pp.getFeature(XmlPullParser.FEATURE_VALIDATION);
            //        } else if(APACHE_SCHEMA_VALIDATION_FEATURE.equals(name)) {
            //            return false;  //TODO
            //        } else if(APACHE_DYNAMIC_VALIDATION_FEATURE.equals(name)) {
            //            return false; //TODO
        } else {
            return pp.getFeature(name);
            //throw new SAXNotRecognizedException("unrecognized feature "+name);
        }
    }
77781
@Override
    public Collection<Bundle> getBundles() {
        if (mfDetails == null)
            throw new IllegalStateException("Method called outside of provisioining operation or without a registered service");

        Collection<Bundle> bundles = featureBundles.get();

        if (bundles == null) {
            bundles = new ArrayList<Bundle>();

            Collection<FeatureResource> bundlesInFeature = mfDetails.getConstituents(SubsystemContentType.BUNDLE_TYPE);

            BundleContext ctx = FrameworkUtil.getBundle(FrameworkUtil.class).getBundleContext();

            // symbolic name to bundle map. 
            for (FeatureResource bundle : bundlesInFeature) {
                String location = bundle.getLocation();
                Bundle b = ctx.getBundle(location);
                if (b != null) {
                    bundles.add(b);
                }
            }

            // make an unmodifiable version.
            bundles = Collections.unmodifiableCollection(bundles);

            // store it away if it hasn't already been read. If this is read by another
            // thread at once then this thread will get this collection, and others will
            // the winner's.
            featureBundles.compareAndSet(null, bundles);
        }

        return bundles;
    }
670480
public SAXParseException[] getXMLWarnings() {

    if (mWarnings == null) {
      return null;
    }
    return (SAXParseException[]) mWarnings.toArray(new SAXParseException[mWarnings.size()]);
  }
259424
public boolean isSupported() throws NoResponseException, NotConnectedException,
                    InterruptedException, XMPPErrorException {
        // This is just a primitive hack, since XEP-49 does not specify a way to determine if the
        // service supports it
        try {
            setPrivateData(DUMMY_PRIVATE_DATA);
            return true;
        }
        catch (XMPPErrorException e) {
            if (e.getStanzaError().getCondition() == Condition.service_unavailable) {
                return false;
            }
            else {
                throw e;
            }
        }
    }
368316
public ConfigureForm getDefaultConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        // Errors will cause exceptions in getReply, so it only returns
        // on success.
        PubSub reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace());
        return NodeUtils.getFormFromPacket(reply, PubSubElementType.DEFAULT);
    }
348619
public SoundSettings getSoundSettings() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        SoundSettings request = new SoundSettings();
        request.setType(IQ.Type.get);
        request.setTo(workgroupJID);

        return connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
    }