Package thredds.catalog2.builder

Examples of thredds.catalog2.builder.BuilderIssues


    String vocabAuthUrl = "vocabAuthUrl";
    ThreddsMetadataBuilder.VariableGroupBuilder mockVarGrp = createMockVarGroupBasic( vocabAuthId, vocabAuthUrl );

    ThreddsMetadataImpl.VariableImpl var = new ThreddsMetadataImpl.VariableImpl( "name", "descrip", "unit", "vocabId", "vocabName", mockVarGrp );

    BuilderIssues bldrIssues = var.getIssues();
    assertTrue( bldrIssues.isEmpty());
  }
View Full Code Here


    String vocabAuthUrl = "vocabAuthUrl";
    ThreddsMetadataBuilder.VariableGroupBuilder mockVarGrp = createMockVarGroupBasic( vocabAuthId, vocabAuthUrl );

    ThreddsMetadataImpl.VariableImpl var = new ThreddsMetadataImpl.VariableImpl( null, "descrip", "unit", "vocabId", "vocabName", mockVarGrp );

    BuilderIssues bldrIssues = var.getIssues();
    assertFalse( bldrIssues.isEmpty());
    assertEquals( 1, bldrIssues.size());
  }
View Full Code Here

    String vocabAuthUrl = "vocabAuthUrl";
    ThreddsMetadataBuilder.VariableGroupBuilder mockVarGrp = createMockVarGroupBasic( vocabAuthId, vocabAuthUrl );

    ThreddsMetadataImpl.VariableImpl var = new ThreddsMetadataImpl.VariableImpl( "name", null, null, null, null, mockVarGrp );

    BuilderIssues bldrIssues = var.getIssues();
    assertTrue( bldrIssues.isEmpty());
  }
View Full Code Here

  }

  private void buildBuilder()
  {
    // Check if buildable
    BuilderIssues issues = tmb.getIssues();
    if ( ! issues.isValid() )
    {
      StringBuilder stringBuilder = new StringBuilder( "Not isBuildable(): " ).append( issues.toString() );
      fail( stringBuilder.toString() );
    }

    // Build
    try
View Full Code Here

      long start = System.currentTimeMillis();
      cat = LargeCatalogReadUtils.parseCatalogIntoInvCatalogImpl( catAsString, catURL );
      long done = System.currentTimeMillis();
      long elapsed = done - start;

        BuilderIssues bldIssues = new BuilderIssues();

      start = System.currentTimeMillis();
      catalogBuilder = LargeCatalogReadUtils.parseCatalogIntoBuilder( catAsString, catURL );
      BuilderIssues issues = catalogBuilder.getIssues();
      if ( ! issues.isValid() )
          System.out.println( "Invalid catalog [" + i + "]: " + bldIssues.toString() );
      catalogBuilder.build();
      done = System.currentTimeMillis();
      long elapsed2 = done - start;

      cum+=elapsed;
      cum2+=elapsed2;
      System.out.println( "Read catalog ["+i+"]: InvCat=" + elapsed + " stax=" + elapsed2 + "\n" );
    }
    System.out.println( "Cum=" + cum );
    System.out.println( "Avg=" + cum/ numAttempts );
    System.out.println( "CumStax=" + cum2 );
    System.out.println( "AvgStax=" + cum2/ numAttempts );

      System.out.println( "InvCat" );
    StringBuilder sb = new StringBuilder();
    if ( cat.check( sb ) )
      System.out.println( "Failed check:\n" + sb );
    else
      System.out.println( "OK check:\n" + sb );

      System.out.println( "thredds.catalog2" );
      BuilderIssues bldIssues = catalogBuilder.getIssues();
      if ( ! bldIssues.isValid() )
          System.out.println( "Invalid catalog: " + bldIssues.toString() );
      else
          System.out.println( "Valid catalog: " + ( bldIssues.isEmpty() ? "" : bldIssues.toString()) );

    System.out.println( "Done" );

  }
View Full Code Here

   *
   * @return true if this ServiceBuilder is in a state where build() will succeed.
   */
  public BuilderIssues getIssues()
  {
    BuilderIssues issues = this.serviceContainer.getIssues();

    // Check subordinates.
    if ( this.isRootContainer)
      issues.addAllIssues( this.globalServiceContainer.getIssues( this ));
    issues.addAllIssues( this.propertyContainer.getIssues());

    // Check if this is leaf service that it has a baseUri.
    if ( this.serviceContainer.isEmpty() && this.baseUri == null )
      issues.addIssue( BuilderIssue.Severity.WARNING, "Non-compound services must have base URI.", this, null );

    return issues;
  }
View Full Code Here

            return this.isBuilt;
        }

        public BuilderIssues getIssues() {
          if ( this.date == null )
            return new BuilderIssues( BuilderIssue.Severity.ERROR, "Date may not be null.", this, null);
          return new BuilderIssues();
        }
View Full Code Here

                specified--;
            if ( this.duration == null || this.duration.length() == 0 )
                specified--;

            if ( specified == 2 )
                return new BuilderIssues();
            else if ( specified < 2)
              return new BuilderIssues( BuilderIssue.Severity.ERROR, "Underspecified " + this.toString(), this, null);
            else // if (specified > 2)
              return new BuilderIssues( BuilderIssue.Severity.ERROR, "Overspecified " + this.toString(), this, null);
        }
View Full Code Here

      return this.isBuilt;
    }

    public BuilderIssues getIssues() {
      if ( this.name == null )
        return new BuilderIssues( BuilderIssue.Severity.ERROR, "Name may not be null.", this, null);
      return new BuilderIssues();
    }
View Full Code Here

    }

    public BuilderIssues getIssues()
    {
      if ( variableMapUrl != null && this.variables != null && ! this.variables.isEmpty())
        return new BuilderIssues( BuilderIssue.Severity.ERROR, "This VariableGroupBuilder has variables and variableMap.", this, null );
      return new BuilderIssues();
    }
View Full Code Here

TOP

Related Classes of thredds.catalog2.builder.BuilderIssues

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.