Package cascading.lingual.catalog

Examples of cascading.lingual.catalog.SchemaDef


  private void addTaps( SchemaDef parentSchemaDef, TapSchema parentTapSchema, Map<String, Tap> taps, Function<Tap, Fields> function )
    {
    for( String name : taps.keySet() )
      {
      TapSchema currentTapSchema = parentTapSchema;
      SchemaDef currentSchemaDef = parentSchemaDef;
      Tap tap = taps.get( name );
      String[] split = name.split( "\\." );

      for( int i = 0; i < split.length - 1; i++ )
        {
        currentTapSchema = createGetTapSchema( currentTapSchema, split[ i ] );
        currentSchemaDef = createGetSchemaDef( currentSchemaDef, split[ i ] );
        }

      name = split[ split.length - 1 ];

      Stereotype stereotype = new Stereotype( name, function.apply( tap ) );
      TableDef tableDef = new TableDef( currentSchemaDef, name, tap.getIdentifier(), stereotype );

      currentSchemaDef.addStereotype( stereotype );
      currentTapSchema.addTapTableFor( tableDef, getDefaultSchema() == null );
      }
    }
View Full Code Here


  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  private final InsensitiveMap<Repo> repositories = new InsensitiveMap<Repo>();

  protected JSONSchemaCatalog()
    {
    this.rootSchemaDef = new SchemaDef();
    }
View Full Code Here

    }

  public JSONSchemaCatalog( String platformName, Protocol defaultProtocol, Format defaultFormat )
    {
    this.platformName = platformName;
    this.rootSchemaDef = new SchemaDef( defaultProtocol, defaultFormat );
    }
View Full Code Here

    return getRootSchemaDef().renameSchema( schemaName, newName );
    }

  SchemaDef getSchemaDefChecked( String schemaName )
    {
    SchemaDef schemaDef = getSchemaDef( schemaName );

    if( schemaDef == null )
      throw new IllegalArgumentException( "schema does not exist: " + schemaName );

    return schemaDef;
View Full Code Here

    }

  @Override
  public boolean createStereotype( String schemaName, String name, Fields fields )
    {
    SchemaDef schemaDef = getSchemaDefChecked( schemaName );

    return createStereotype( schemaDef, name, fields ) != null;
    }
View Full Code Here

    }

  @Override
  public void addUpdateFormat( String schemaName, Format format, List<String> extensions, Map<String, String> properties, String providerName )
    {
    SchemaDef schemaDef = getSchemaDefChecked( schemaName );

    if( extensions != null && !extensions.isEmpty() )
      schemaDef.addFormatProperty( format, FormatProperties.EXTENSIONS, extensions );

    if( providerName != null )
      schemaDef.addFormatProperty( format, FormatProperties.PROVIDER, providerName );

    if( properties == null )
      return;

    for( Map.Entry<String, String> entry : properties.entrySet() )
      schemaDef.addFormatProperty( format, entry.getKey(), entry.getValue() );
    }
View Full Code Here

    }

  @Override
  public boolean removeFormat( String schemaName, Format format )
    {
    SchemaDef schemaDef = getSchemaDefChecked( schemaName );

    schemaDef.removeFormatProperties( format );

    return true;
    }
View Full Code Here

    }

  @Override
  public boolean renameFormat( String schemaName, Format oldFormat, Format newFormat )
    {
    SchemaDef schemaDef = getSchemaDefChecked( schemaName );

    Map<String, List<String>> oldProperties = schemaDef.removeFormatProperties( oldFormat );
    schemaDef.addFormatProperties( newFormat, oldProperties );

    return true;
    }
View Full Code Here

    }

  @Override
  public void addUpdateProtocol( String schemaName, Protocol protocol, List<String> schemes, Map<String, String> properties, String providerName )
    {
    SchemaDef schemaDef = getSchemaDefChecked( schemaName );

    if( schemes != null && !schemes.isEmpty() )
      schemaDef.addProtocolProperty( protocol, ProtocolProperties.SCHEMES, schemes );

    if( providerName != null )
      schemaDef.addProtocolProperty( protocol, ProtocolProperties.PROVIDER, providerName );

    if( properties == null )
      return;

    for( Map.Entry<String, String> entry : properties.entrySet() )
      schemaDef.addProtocolProperty( protocol, entry.getKey(), entry.getValue() );
    }
View Full Code Here

      }
    }

  private void verifySchemaDef()
    {
    SchemaDef schemaDef = catalogManager.getSchemaDef( schemaName );

    if( schemaDef == null )
      throw new IllegalStateException( "schema does not exist: " + schemaName );
    else if( schemaDef.getIdentifier() != null && !schemaPath.equals( schemaDef.getIdentifier() ) )
      throw new IllegalStateException( "schema path: " + schemaPath + " does not match identifier: " + schemaDef.getIdentifier() );
    }
View Full Code Here

TOP

Related Classes of cascading.lingual.catalog.SchemaDef

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.