Examples of SourceType


Examples of org.apache.flume.conf.source.SourceType

        String sourceName = iter.next();
        Context srcContext = sourceContextMap.get(sourceName);
        String config = null;
        boolean configSpecified = false;
        if (srcContext != null) {
          SourceType srcType = getKnownSource(srcContext.getString(
              BasicConfigurationConstants.CONFIG_TYPE));
          if (srcType == null) {
            config = srcContext.getString(
                BasicConfigurationConstants.CONFIG_CONFIG);
            if (config == null || config.isEmpty()) {
              config = "OTHER";
            } else {
              configSpecified = true;
            }
          } else {
            config = srcType.toString().toUpperCase(Locale.ENGLISH);
            configSpecified = true;
          }
          try {
            // Possible reason the configuration can fail here:
            // Old component is configured directly using Context
View Full Code Here

Examples of org.apache.flume.conf.source.SourceType

        String sourceName = iter.next();
        Context srcContext = sourceContextMap.get(sourceName);
        String config = null;
        boolean configSpecified = false;
        if (srcContext != null) {
          SourceType srcType = getKnownSource(srcContext.getString(
              BasicConfigurationConstants.CONFIG_TYPE));
          if (srcType == null) {
            config = srcContext.getString(
                BasicConfigurationConstants.CONFIG_CONFIG);
            if (config == null || config.isEmpty()) {
              config = "OTHER";
            } else {
              configSpecified = true;
            }
          } else {
            config = srcType.toString().toUpperCase();
            configSpecified = true;
          }
          try {
            // Possible reason the configuration can fail here:
            // Old component is configured directly using Context
View Full Code Here

Examples of org.apache.flume.conf.source.SourceType

  @SuppressWarnings("unchecked")
  @Override
  public Class<? extends Source> getClass(String type)
  throws FlumeException {
    String sourceClassName = type;
    SourceType srcType = SourceType.OTHER;
    try {
      srcType = SourceType.valueOf(type.toUpperCase());
    } catch (IllegalArgumentException ex) {
      logger.debug("Source type {} is a custom type", type);
    }
    if (!srcType.equals(SourceType.OTHER)) {
      sourceClassName = srcType.getSourceClassName();
    }
    try {
      return (Class<? extends Source>) Class.forName(sourceClassName);
    } catch (Exception ex) {
      throw new FlumeException("Unable to load source type: " + type
View Full Code Here

Examples of org.apache.flume.conf.source.SourceType

        String sourceName = iter.next();
        Context srcContext = sourceContextMap.get(sourceName);
        String config = null;
        boolean configSpecified = false;
        if (srcContext != null) {
          SourceType srcType = getKnownSource(srcContext.getString(
              BasicConfigurationConstants.CONFIG_TYPE));
          if (srcType == null) {
            config = srcContext.getString(
                BasicConfigurationConstants.CONFIG_CONFIG);
            if (config == null || config.isEmpty()) {
              config = "OTHER";
            } else {
              configSpecified = true;
            }
          } else {
            config = srcType.toString().toUpperCase();
            configSpecified = true;
          }
          try {
            // Possible reason the configuration can fail here:
            // Old component is configured directly using Context
View Full Code Here

Examples of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.SourceType

     */
    protected InetAddress getIpSourceAddress() throws UnknownHostException, SocketException {
        final String ipSource = getIpSource();
        if (ipSource.trim().length() > 0) {
            Class<? extends InetAddress> ipClass = null;
            final SourceType sourceType = HTTPSamplerBase.SourceType.values()[testElement.getIpSourceType()];
            switch (sourceType) {
            case DEVICE:
                ipClass = InetAddress.class;
                break;
            case DEVICE_IPV4:
View Full Code Here

Examples of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.SourceType

     */
    protected InetAddress getIpSourceAddress() throws UnknownHostException, SocketException {
        final String ipSource = getIpSource();
        if (ipSource.trim().length() > 0) {
            Class<? extends InetAddress> ipClass = null;
            final SourceType sourceType = HTTPSamplerBase.SourceType.values()[testElement.getIpSourceType()];
            switch (sourceType) {
            case DEVICE:
                ipClass = InetAddress.class;
                break;
            case DEVICE_IPV4:
View Full Code Here

Examples of org.apache.tuscany.sca.demos.aggregator.types.SourceType

     * @return the alert source
     */
    public SourceType getAlertSource (String id)
    {          
        System.err.println("getAlertSource(" + id + ")");
        SourceType alertSource = null;
       
        for (Object source : alertSources.getSource()) {
            if ( ((SourceType)source).getId().equals(id)) {
                alertSource = (SourceType)source;
            }
View Full Code Here

Examples of org.apache.tuscany.sca.demos.aggregator.types.SourceType

             
        try {
            ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
           
            for (Object source : alertSourceConfig.getSource()){
                SourceType sourceType = (SourceType)source;
               
                AlertsType alerts = null;
               
                if ( sourceType.getFeedType().equals("rss")){
                    alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
                                                     sourceType.getLastChecked());
                } else {
                   
                }
               
                // extend return list with any alerts we found
                for( Object alert : alerts.getAlert() ){        

                    // set the id on the alert so we know which source it
                    // came from
                    ((AlertType)alert).setSourceId(sourceType.getId());
                   
                    // convert from SDO to POJO so that the
                    // JSONRPC binding will work. It can't currently
                    // handle SDOs
                    AlertType newAlert = new AlertTypeNonSDOImpl();
   
                    newAlert.setSourceId(((AlertType)alert).getSourceId());
                    newAlert.setTitle(((AlertType)alert).getTitle());
                    newAlert.setSummary(((AlertType)alert).getSummary());                   
                    newAlert.setAddress(((AlertType)alert).getAddress());
                    newAlert.setDate(((AlertType)alert).getDate());
                    newAlert.setId(((AlertType)alert).getId());
                    newAlert.setUnread(((AlertType)alert).isUnread());               
                   
                    returnAlertList.add(newAlert);
                }
               
                // update the time last checked for this source
                sourceType.setLastChecked(nowString);
                //alertsSources.updateAlertSource(sourceType);
            }
        } catch(Exception ex) {
            System.err.println("Exception " + ex.toString());
        }
View Full Code Here

Examples of org.apache.tuscany.sca.demos.aggregator.types.SourceType

             
        try {
            ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
           
            for (Object source : alertSourceConfig.getSource()){
                SourceType sourceType = (SourceType)source;
               
                AlertsType alerts = null;
               
                if ( sourceType.getFeedType().equals("rss")){
                    alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
                                                     sourceType.getLastChecked());
                } else {
                   
                }
               
                // extend return list with any alerts we found
                for( Object alert : alerts.getAlert() ){        

                    // set the id on the alert so we know which source it
                    // came from
                    ((AlertType)alert).setSourceId(sourceType.getId());
                   
                    // convert from SDO to POJO so that the
                    // JSONRPC binding will work. It can't currently
                    // handle SDOs
                    AlertType newAlert = new AlertTypeNonSDOImpl();
   
                    newAlert.setSourceId(((AlertType)alert).getSourceId());
                    newAlert.setTitle(((AlertType)alert).getTitle());
                    newAlert.setSummary(((AlertType)alert).getSummary());                   
                    newAlert.setAddress(((AlertType)alert).getAddress());
                    newAlert.setDate(((AlertType)alert).getDate());
                    newAlert.setId(((AlertType)alert).getId());
                    newAlert.setUnread(((AlertType)alert).isUnread());               
                   
                    returnAlertList.add(newAlert);
                }
               
                // update the time last checked for this source
                sourceType.setLastChecked(nowString);
                //alertsSources.updateAlertSource(sourceType);
            }
        } catch(Exception ex) {
            System.err.println("Exception " + ex.toString());
        }
View Full Code Here

Examples of org.apache.tuscany.sca.demos.aggregator.types.SourceType

     * @return the alert source
     */
    public SourceType getAlertSource (String id)
    {          
        System.err.println("getAlertSource(" + id + ")");
        SourceType alertSource = null;
       
        for (Object source : alertSources.getSource()) {
            if ( ((SourceType)source).getId().equals(id)) {
                alertSource = (SourceType)source;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.