Tabnine Logo
Annotation.getElement
Code IndexAdd Tabnine to your IDE (free)

How to use
getElement
method
in
org.wso2.siddhi.query.api.annotation.Annotation

Best Java code snippets using org.wso2.siddhi.query.api.annotation.Annotation.getElement (Showing top 14 results out of 315)

origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core

/**
 * Traverse the annotation and returns the execute group id
 *
 * @param annotations
 * @return
 */
private static String getExecuteGroup(List<Annotation> annotations) {
  String id = null;
  if (annotations != null) {
    for (Annotation annotation : annotations) {
      if (annotation.getName().equals(EventProcessorConstants.DIST)) {
        if (annotation.getElement(EventProcessorConstants.EXEC_GROUP) != null) {
          id = annotation.getElement(EventProcessorConstants.EXEC_GROUP);
        }
      }
    }
  }
  return id;
}
origin: org.wso2.siddhi/siddhi-extension-event-table

String dataSourceName = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_DATASOURCE_NAME);
String tableName = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_TABLE_NAME);
DataSource dataSource = executionPlanContext.getSiddhiContext().getSiddhiDataSource(dataSourceName);
List<Attribute> attributeList = tableDefinition.getAttributeList();
  String jdbcConnectionUrl = fromAnnotation.getElement(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_TABLE_JDBC_URL);
  String username = fromAnnotation.getElement(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_TABLE_USERNAME);
  String password = fromAnnotation.getElement(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_TABLE_PASSWORD);
  String driverName = fromAnnotation.getElement(RDBMSEventTableConstants.EVENT_TABLE_RDBMS_TABLE_DRIVER_NAME);
  List<Element> connectionPropertyElements = null;
String cacheType = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_CACHE);
cacheSizeInString = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_CACHE_SIZE);
String cacheLoadingType = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_CACHE_LOADING);
String cacheValidityInterval = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_CACHE_VALIDITY_PERIOD);
String bloomsEnabled = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_BLOOM_FILTERS);
String bloomFilterValidityInterval = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_BLOOM_VALIDITY_PERIOD);
    String bloomsFilterSize = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_BLOOM_FILTERS_SIZE);
    String bloomsFilterHash = fromAnnotation.getElement(RDBMSEventTableConstants.ANNOTATION_ELEMENT_BLOOM_FILTERS_HASH);
    if (bloomsFilterSize != null) {
      bloomFilterSize = Integer.parseInt(bloomsFilterSize);
origin: org.wso2.extension.siddhi.store.rdbms/siddhi-store-rdbms

List<Element> indexElementList = (indices == null) ? new ArrayList<>() : indices.getElements();
List<String> queries = new ArrayList<>();
Map<String, String> fieldLengths = RDBMSTableUtils.processFieldLengths(storeAnnotation.getElement(
    ANNOTATION_ELEMENT_FIELD_LENGTHS));
this.validateFieldLengths(fieldLengths);
origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core

/**
 * Traverse the annotation and returns the parallelism hint
 *
 * @param annotations
 * @return
 */
private static int getParallelism(List<Annotation> annotations, String elementKey) {
  int parallelism = 1;
  if (annotations != null) {
    for (Annotation annotation : annotations) {
      if (annotation.getName().equals(EventProcessorConstants.DIST)) {
        if (annotation.getElement(elementKey) != null) {
          parallelism = Integer.parseInt(annotation.getElement(elementKey));
          if (parallelism == 0) {
            parallelism = 1;
          }
          return parallelism;
        }
      }
    }
  }
  return parallelism;
}
origin: org.wso2.extension.siddhi.store.rdbms/siddhi-store-rdbms

RDBMSTableUtils.validateAnnotation(primaryKeys);
RDBMSTableUtils.validateAnnotation(indices);
jndiResourceName = storeAnnotation.getElement(ANNOTATION_ELEMENT_JNDI_RESOURCE);
dataSourceName = storeAnnotation.getElement(ANNOTATION_ELEMENT_DATASOURCE);
if (null != configReader) {
  this.configReader = configReader;
  this.configReader = new DefaultConfigReader();
String tableName = storeAnnotation.getElement(ANNOTATION_ELEMENT_TABLE_NAME);
this.tableName = RDBMSTableUtils.isEmpty(tableName) ? tableDefinition.getId() : tableName;
origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

  /**
   * Provide the parallelism count for pass-through query. In case of multiple user given values,
   * lowest one will be selected. Default parallelism value would be 1.
   *
   * @param annotation Source annotation
   * @return Parallelism count for pass-through query
   */
  private int getSourceParallelism(Annotation annotation) {
    Set<Integer> parallelismSet = new HashSet<>();
    List<Annotation> distAnnotations = annotation.getAnnotations(
        SiddhiTopologyCreatorConstants.DISTRIBUTED_IDENTIFIER);
    if (distAnnotations.size() > 0) {
      for (Annotation distAnnotation : distAnnotations) {
        if (distAnnotation.getElement(SiddhiTopologyCreatorConstants.PARALLEL_IDENTIFIER) != null) {
          parallelismSet.add(Integer.valueOf(distAnnotation.getElement(
              SiddhiTopologyCreatorConstants.PARALLEL_IDENTIFIER)));
        } else {
          return SiddhiTopologyCreatorConstants.DEFAULT_PARALLEL;
        }
      }
    } else {
      return SiddhiTopologyCreatorConstants.DEFAULT_PARALLEL;
    }
    return parallelismSet.stream().min(Comparator.comparing(Integer::intValue)).get();
  }
}
origin: org.wso2.siddhi/siddhi-extension-event-table

String clusterName = fromAnnotation.getElement(
    HazelcastEventTableConstants.ANNOTATION_ELEMENT_HAZELCAST_CLUSTER_NAME);
String clusterPassword = fromAnnotation.getElement(
    HazelcastEventTableConstants.ANNOTATION_ELEMENT_HAZELCAST_CLUSTER_PASSWORD);
String hosts = fromAnnotation.getElement(
    HazelcastEventTableConstants.ANNOTATION_ELEMENT_HAZELCAST_CLUSTER_ADDRESSES);
String collectionName = fromAnnotation.getElement(
    HazelcastEventTableConstants.ANNOTATION_ELEMENT_HAZELCAST_CLUSTER_COLLECTION);
Annotation annotation = AnnotationHelper.getAnnotation(
boolean serverMode = (hosts == null || hosts.isEmpty());
if (serverMode) {
  hosts = fromAnnotation.getElement(
      HazelcastEventTableConstants.ANNOTATION_ELEMENT_HAZELCAST_WELL_KNOWN_ADDRESSES);
origin: org.wso2.carbon.analytics/org.wso2.carbon.siddhi.editor.core

/**
 * Extracts the query name from the annotation list, or returns the default query name
 * @param annotations           Query annotation list
 * @return query name           name of the query
 */
private String generateQueryName(List<Annotation> annotations) {
  for (Annotation annotation : annotations) {
    if (annotation.getName().equalsIgnoreCase("info")) {
      preserveCodeSegment(annotation);
      return annotation.getElement("name");
    }
  }
  return DEFAULT_QUERY_NAME;
}
origin: org.wso2.carbon.analytics/org.wso2.carbon.sp.jobmanager.core

/**
 * @param aggregationId Id of the aggregation which Store value to be checked.
 * @return True if the given aggregation uses in-memory store.
 */
private boolean isInMemoryStore(String aggregationId) {
  String storeType = SiddhiTopologyCreatorConstants.INMEMORY;
  for (Annotation annotation : siddhiApp.getAggregationDefinitionMap().get(aggregationId).getAnnotations()) {
    if (annotation.getName().equals(SiddhiTopologyCreatorConstants.PERSISTENCETABLE_IDENTIFIER)) {
      storeType = annotation.getElement(SiddhiTopologyCreatorConstants.TYPE_IDENTIFIER);
      break;
    }
  }
  return storeType.equalsIgnoreCase(SiddhiTopologyCreatorConstants.INMEMORY);
}
origin: org.wso2.carbon.analytics/org.wso2.carbon.analytics.eventtable

    tableDefinition.getAnnotations());
this.tableDefinition = tableDefinition;
this.tableName = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_TABLE_NAME);
if (this.tableName == null) {
  throw new IllegalArgumentException("The property " + AnalyticsEventTableConstants.ANNOTATION_TABLE_NAME +
      " must be provided for analytics event tables.");
this.primaryKeys = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_PRIMARY_KEYS);
this.indices = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_INDICES);
String mergeSchemaProp = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_MERGE_SCHEMA);
if (mergeSchemaProp != null) {
  mergeSchemaProp = mergeSchemaProp.trim();
String waitForIndexingProp = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_WAIT_FOR_INDEXING);
if (waitForIndexingProp != null) {
  waitForIndexingProp = waitForIndexingProp.trim();
String maxSearchResultCountProp = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_MAX_SEARCH_RESULT_COUNT);
if (maxSearchResultCountProp != null) {
  maxSearchResultCountProp = maxSearchResultCountProp.trim();
String cachingProp = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_CACHING);
if (cachingProp != null) {
  this.caching = Boolean.parseBoolean(cachingProp.trim());
String cacheTimeoutSecsProp = fromAnnotation.getElement(AnalyticsEventTableConstants.ANNOTATION_CACHE_TIMEOUT_SECONDS);
if (cacheTimeoutSecsProp != null) {
  this.cacheTimeoutSeconds = Integer.parseInt(cacheTimeoutSecsProp.trim());
origin: org.wso2.extension.siddhi.store.rdbms/siddhi-store-rdbms

String poolPropertyString = storeAnnotation.getElement(ANNOTATION_ELEMENT_POOL_PROPERTIES);
String url = storeAnnotation.getElement(ANNOTATION_ELEMENT_URL);
String username = storeAnnotation.getElement(ANNOTATION_ELEMENT_USERNAME);
String password = storeAnnotation.getElement(ANNOTATION_ELEMENT_PASSWORD);
String driverClassName = storeAnnotation.getElement(ANNOTATION_DRIVER_CLASS_NAME);
if (RDBMSTableUtils.isEmpty(url)) {
  throw new RDBMSTableException("Required parameter '" + ANNOTATION_ELEMENT_URL + "' for DB " +
origin: org.wso2.extension.siddhi.store.mongodb/siddhi-store-mongodb

@Override
protected void init(TableDefinition tableDefinition, ConfigReader configReader) {
  this.attributeNames =
      tableDefinition.getAttributeList().stream().map(Attribute::getName).collect(Collectors.toList());
  Annotation storeAnnotation = AnnotationHelper
      .getAnnotation(ANNOTATION_STORE, tableDefinition.getAnnotations());
  Annotation primaryKeys = AnnotationHelper
      .getAnnotation(ANNOTATION_PRIMARY_KEY, tableDefinition.getAnnotations());
  Annotation indices = AnnotationHelper
      .getAnnotation(ANNOTATION_INDEX_BY, tableDefinition.getAnnotations());
  this.initializeConnectionParameters(storeAnnotation, configReader);
  this.expectedIndexModels = new ArrayList<>();
  IndexModel primaryKey = MongoTableUtils.extractPrimaryKey(primaryKeys, this.attributeNames);
  if (primaryKey != null) {
    this.expectedIndexModels.add(primaryKey);
  }
  this.expectedIndexModels.addAll(MongoTableUtils.extractIndexModels(indices, this.attributeNames));
  String customCollectionName = storeAnnotation.getElement(
      MongoTableConstants.ANNOTATION_ELEMENT_COLLECTION_NAME);
  this.collectionName = MongoTableUtils.isEmpty(customCollectionName) ?
      tableDefinition.getId() : customCollectionName;
  this.initialCollectionTest = false;
}
origin: org.wso2.extension.siddhi.store.mongodb/siddhi-store-mongodb

String secureConnectionEnabled = storeAnnotation.getElement(
    MongoTableConstants.ANNOTATION_ELEMENT_SECURE_CONNECTION);
secureConnectionEnabled = secureConnectionEnabled == null ? "false" : secureConnectionEnabled;
  String trustStore = storeAnnotation.getElement(MongoTableConstants.ANNOTATION_ELEMENT_TRUSTSTORE);
  trustStore = trustStore == null ?
      configReader.readConfig("trustStore", DEFAULT_TRUST_STORE_FILE) : trustStore;
      storeAnnotation.getElement(MongoTableConstants.ANNOTATION_ELEMENT_TRUSTSTOREPASS);
  trustStorePassword = trustStorePassword == null ?
      configReader.readConfig("trustStorePassword", DEFAULT_TRUST_STORE_PASSWORD) :
      trustStorePassword;
  String keyStore = storeAnnotation.getElement(MongoTableConstants.ANNOTATION_ELEMENT_KEYSTORE);
  keyStore = keyStore == null ?
      configReader.readConfig("keyStore", DEFAULT_KEY_STORE_FILE) : keyStore;
  keyStore = resolveCarbonHome(keyStore);
  String keyStorePassword = storeAnnotation.getElement(MongoTableConstants.ANNOTATION_ELEMENT_STOREPASS);
  keyStorePassword = keyStorePassword == null ?
      configReader.readConfig("keyStorePassword", DEFAULT_KEY_STORE_PASSWORD) :
origin: org.wso2.extension.siddhi.store.mongodb/siddhi-store-mongodb

/**
 * Method for initializing mongoClientURI and database name.
 *
 * @param storeAnnotation the source annotation which contains the needed parameters.
 * @param configReader    {@link ConfigReader} ConfigurationReader.
 * @throws MongoTableException when store annotation does not contain mongodb.uri or contains an illegal
 *                             argument for mongodb.uri
 */
private void initializeConnectionParameters(Annotation storeAnnotation, ConfigReader configReader) {
  String mongoClientURI = storeAnnotation.getElement(MongoTableConstants.ANNOTATION_ELEMENT_URI);
  if (mongoClientURI != null) {
    MongoClientOptions.Builder mongoClientOptionsBuilder =
        MongoTableUtils.extractMongoClientOptionsBuilder(storeAnnotation, configReader);
    try {
      this.mongoClientURI = new MongoClientURI(mongoClientURI, mongoClientOptionsBuilder);
      this.databaseName = this.mongoClientURI.getDatabase();
    } catch (IllegalArgumentException e) {
      throw new SiddhiAppCreationException("Annotation '" + storeAnnotation.getName() + "' contains " +
          "illegal value for 'mongodb.uri' as '" + mongoClientURI + "'. Please check your query and " +
          "try again.", e);
    }
  } else {
    throw new SiddhiAppCreationException("Annotation '" + storeAnnotation.getName() +
        "' must contain the element 'mongodb.uri'. Please check your query and try again.");
  }
}
org.wso2.siddhi.query.api.annotationAnnotationgetElement

Popular methods of Annotation

  • getElements
  • getName
  • getAnnotations
  • <init>
  • annotation
  • element
  • getQueryContextEndIndex
  • getQueryContextStartIndex
  • toString

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now