Examples of FileInfoDescriptor


Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

   
    ExecRow              row;

    if (td != null
    {
      FileInfoDescriptor descriptor = (FileInfoDescriptor)td;
      id_S = descriptor.getUUID().toString();
      schemaId_S = descriptor.getSchemaDescriptor().getUUID().toString();
      SQLname = descriptor.getName();
      generationId = descriptor.getGenerationId();
    }
 
    /* Build the row to insert  */
    row = getExecutionFactory().getValueRow(SYSFILES_COLUMN_COUNT);

View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

    String  name;
    long     generationId;
    DataValueDescriptor  col;

    SchemaDescriptor  schemaDescriptor;
    FileInfoDescriptor  result;

    /* 1st column is ID (UUID - char(36)) */
    col = row.getColumn(ID_COL_NUM);
    id_S = col.getString();
    id = getUUIDFactory().recreateUUID(id_S);
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

  public long add(InputStream is) throws StandardException
  {
    //
    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);
    FileInfoDescriptor fid = getInfo();
    if (fid != null)
      throw
        StandardException.newException(SQLState.LANG_OBJECT_ALREADY_EXISTS_IN_OBJECT,
                         fid.getDescriptorType(), sqlName, fid.getSchemaDescriptor().getDescriptorType(), schemaName);

    try {
      notifyLoader(false);
      dd.invalidateAllSPSPlans();
      long generationId = fr.add(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()),is);
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

  public void drop(boolean purgeOnCommit) throws StandardException
  {
    //
    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);
    FileInfoDescriptor fid = getInfo();
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    if (SanityManager.DEBUG)
    {
      if (id != null && !fid.getUUID().equals(id))
      {
        SanityManager.THROWASSERT("Drop id mismatch want="+id+
            " have "+fid.getUUID());
      }
    }

    String dbcp_s = PropertyUtil.getServiceProperty(lcc.getTransactionExecute(),Property.DATABASE_CLASSPATH);
    if (dbcp_s != null)
    {
      String[][]dbcp= IdUtil.parseDbClassPath(dbcp_s,
                                                            lcc.getIdentifierCasing() != lcc.ANTI_ANSI_CASING );
      boolean found = false;
      //
      //Look for the jar we are dropping on our database classpath.
      //We don't concern ourselves with 3 part names since they may
      //refer to a jar file in another database and may not occur in
      //a database classpath that is stored in the propert congomerate.
      for (int ix=0;ix<dbcp.length;ix++)
        if (dbcp.length == 2 &&
          dbcp[ix][0].equals(schemaName) && dbcp[ix][1].equals(sqlName))
          found = true;
      if (found)
        throw StandardException.newException(SQLState.LANG_CANT_DROP_JAR_ON_DB_CLASS_PATH_DURING_EXECUTION,
                  IdUtil.mkQualifiedName(schemaName,sqlName),
                  dbcp_s);
    }

    try {
   
      notifyLoader(false);
      dd.invalidateAllSPSPlans();
      DependencyManager dm = dd.getDependencyManager();
      dm.invalidateFor(fid, DependencyManager.DROP_JAR, lcc);

      dd.dropFileInfoDescriptor(fid);

      fr.remove(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()),
        fid.getGenerationId(), true /*purgeOnCommit*/);
    } finally {
      notifyLoader(true);
    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

    //Like create table we say we are writing before we read the dd
    dd.startWriting(lcc);

    //
    //Temporarily drop the FileInfoDescriptor from the data dictionary.
    FileInfoDescriptor fid = getInfo();
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    if (SanityManager.DEBUG)
    {
      if (id != null && !fid.getUUID().equals(id))
      {
        SanityManager.THROWASSERT("Replace id mismatch want="+
          id+" have "+fid.getUUID());
      }
    }

    try {
      // disable loads from this jar
      notifyLoader(false);
      dd.invalidateAllSPSPlans();
      dd.dropFileInfoDescriptor(fid);

      //
      //Replace the file.
      long generationId =
        fr.replace(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()),
          fid.getGenerationId(), is, purgeOnCommit);

      //
      //Re-add the descriptor to the data dictionary.
      FileInfoDescriptor fid2 =
        ddg.newFileInfoDescriptor(fid.getUUID(),fid.getSchemaDescriptor(),
                sqlName,generationId);
      dd.addDescriptor(fid2, fid.getSchemaDescriptor(),
               DataDictionary.SYSFILES_CATALOG_NUM, false, lcc.getTransactionExecute());
      return generationId;
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

  public static Object getAsObject(String schemaName, String sqlName)
     throws StandardException
  {
    JarUtil jUtil = new JarUtil(null,schemaName,sqlName);

    FileInfoDescriptor fid = jUtil.getInfo();
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    long generationId = fid.getGenerationId();

    StorageFile f = jUtil.getAsFile(generationId);
    if (f != null)
      return f;
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

    {
      for (int ix=0;ix<dbcp.length;ix++)
      {
        SchemaDescriptor sd = dd.getSchemaDescriptor(dbcp[ix][IdUtil.DBCP_SCHEMA_NAME], null, false);

                FileInfoDescriptor fid = null
        if (sd != null)
          fid = dd.getFileInfoDescriptor(sd,dbcp[ix][IdUtil.DBCP_SQL_JAR_NAME]);     

        if (fid == null){
          throw StandardException.newException(SQLState.LANG_DB_CLASS_PATH_HAS_MISSING_JAR            , IdUtil.mkQualifiedName(dbcp[ix]));
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

    DataDictionaryContext ddc =
      (DataDictionaryContext) ContextService.getContext(DataDictionaryContext.CONTEXT_ID);
    DataDictionary dd = ddc.getDataDictionary();

    SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
    FileInfoDescriptor fid = dd.getFileInfoDescriptor(sd,sqlName);
    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    long generationId = fid.getGenerationId();

    FileResource fr = af.getTransaction(ddc.getContextManager()).getFileHandler();

    String externalName = org.apache.derby.impl.sql.execute.JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

   
    ExecRow              row;

    if (td != null
    {
      FileInfoDescriptor descriptor = (FileInfoDescriptor)td;
      id_S = descriptor.getUUID().toString();
      schemaId_S = descriptor.getSchemaDescriptor().getUUID().toString();
      SQLname = descriptor.getName();
      generationId = descriptor.getGenerationId();
    }
 
    /* Build the row to insert  */
    row = getExecutionFactory().getValueRow(SYSFILES_COLUMN_COUNT);

View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.FileInfoDescriptor

    String  name;
    long     generationId;
    DataValueDescriptor  col;

    SchemaDescriptor  schemaDescriptor;
    FileInfoDescriptor  result;

    /* 1st column is ID (UUID - char(36)) */
    col = row.getColumn(ID_COL_NUM);
    id_S = col.getString();
    id = getUUIDFactory().recreateUUID(id_S);
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.