Package com.alibaba.json.bvt

Examples of com.alibaba.json.bvt.ByteArrayFieldTest_2$Entity


     * @return Entity - JAVA Object
     * @throws IvoryException
     */
    public Entity parseAndValidate(String xmlString) throws IvoryException {
        InputStream inputStream = new ByteArrayInputStream(xmlString.getBytes());
        Entity entity = parseAndValidate(inputStream);
        return entity;
    }
View Full Code Here


  @Override
  public void handleRerun(String cluster, String entityType,
      String entityName, String nominalTime, String runId, String wfId,
      long msgReceivedTime) {
    try {
      Entity entity = getEntity(entityType, entityName);
      Retry retry = getRetry(entity);

      if (retry == null) {
        LOG.warn("Retry not configured for entity:" + entityType + "("
            + entity.getName() + "), ignoring failed retries");
        return;
      }

      int attempts = retry.getAttempts();
      Frequency delay = retry.getDelay();
View Full Code Here

                    for (FileStatus file : files) {
                        String fileName = file.getPath().getName();
                        String encodedEntityName = fileName.substring(0, fileName.length() - 4); // drop
                                                                                                 // ".xml"
                        String entityName = URLDecoder.decode(encodedEntityName, UTF_8);
                        Entity entity = restore(type, entityName);
                        entityMap.put(entityName, entity);
                        onAdd(entity);
                    }
                }
            }
View Full Code Here

    private synchronized void updateInternal(EntityType type, Entity entity) throws IvoryException {
        try {
            if (get(type, entity.getName()) != null) {
                persist(type, entity);
                Entity oldEntity = dictionary.get(type).put(entity.getName(), entity);
                onChange(oldEntity, entity);
            } else {
                throw new IvoryException(entity.toShortString() + " doesn't exist");
            }
        } catch (IOException e) {
View Full Code Here

      return "";
    }
    Map<String, Long> feedSizes = new LinkedHashMap<String, Long>();
    String[] pathGroups = ivoryInPaths.split("#");
    String[] inputFeeds = ivoryInputFeeds.split("#");
    Entity entity = EntityUtil.getEntity(message.getEntityType(),
        message.getEntityName());

    List<String> lateFeed = new ArrayList<String>();
    if (EntityUtil.getLateProcess(entity) != null) {
      for (LateInput li : EntityUtil.getLateProcess(entity)
View Full Code Here

        public void process(EntityContainer entityContainer) {
            if (progressListener.isCanceled()) {
                target.cancel();
                throw new OsmosisRuntimeException("Cancelled by user");
            }
            Entity entity = entityContainer.getEntity();
            if (++count % 10 == 0) {
                progressListener.setProgress(count);
            }
            latestChangeset = Math.max(latestChangeset, entity.getChangesetId());
            latestTimestamp = Math.max(latestTimestamp, entity.getTimestamp().getTime());
            Geometry geom = null;
            switch (entity.getType()) {
            case Node:
                nodeCount++;
                geom = parsePoint((Node) entity);
                break;
            case Way:
View Full Code Here

            if (progressListener.isCanceled()) {
                target.cancel();
                throw new OsmosisRuntimeException("Cancelled by user");
            }
            final EntityContainer entityContainer = container.getEntityContainer();
            final Entity entity = entityContainer.getEntity();
            final ChangeAction changeAction = container.getAction();
            if (changeAction.equals(ChangeAction.Delete)) {
                SimpleFeatureType ft = entity instanceof Node ? OSMUtils.nodeType() : OSMUtils
                        .wayType();
                String id = Long.toString(entity.getId());
                target.put(new FeatureToDelete(ft, id));
                return;
            }
            if (changeAction.equals(ChangeAction.Modify)) {
                // Check that the feature to modify exist. If so, we will just treat it as an
                // addition, overwriting the previous feature
                SimpleFeatureType ft = entity instanceof Node ? OSMUtils.nodeType() : OSMUtils
                        .wayType();
                String path = ft.getName().getLocalPart();
                Optional<org.locationtech.geogig.api.Node> opt = workTree.findUnstaged(path);
                if (!opt.isPresent()) {
                    return;
                }
            }

            if (++count % 10 == 0) {
                progressListener.setProgress(count);
            }
            latestChangeset = Math.max(latestChangeset, entity.getChangesetId());
            latestTimestamp = Math.max(latestTimestamp, entity.getTimestamp().getTime());
            Geometry geom = null;
            switch (entity.getType()) {
            case Node:
                nodeCount++;
                geom = parsePoint((Node) entity);
                break;
            case Way:
View Full Code Here

     * @param replaceId. The changesetId to use in case the feature has a negative one indicating a
     *        temporary value
     * @return
     */
    public Entity toEntity(SimpleFeature feature, Long changesetId) {
        Entity entity;
        SimpleFeatureType type = feature.getFeatureType();
        long id = Long.parseLong(feature.getID());
        int version = ((Integer) feature.getAttribute("version")).intValue();
        Long changeset = (Long) feature.getAttribute("changeset");
        if (changesetId != null && changeset < 0) {
View Full Code Here

                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, id);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
                    container = new WayContainer((Way) entity);
View Full Code Here

                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, null);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
                    container = new WayContainer((Way) entity);
View Full Code Here

TOP

Related Classes of com.alibaba.json.bvt.ByteArrayFieldTest_2$Entity

Copyright © 2018 www.massapicom. 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.