Subversion Repositories DevTools

Rev

Rev 7253 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7253 Rev 7333
Line 23... Line 23...
23
import oracle.sql.ArrayDescriptor;
23
import oracle.sql.ArrayDescriptor;
24
 
24
 
25
import org.slf4j.Logger;
25
import org.slf4j.Logger;
26
import org.slf4j.LoggerFactory;
26
import org.slf4j.LoggerFactory;
27
 
27
 
-
 
28
import com.erggroup.buildtool.daemon.BuildInfo;
28
import com.erggroup.buildtool.ripple.RunLevel.BuildState;
29
import com.erggroup.buildtool.ripple.RunLevel.BuildState;
29
import com.erggroup.buildtool.utilities.MutableDate;
30
import com.erggroup.buildtool.utilities.MutableDate;
-
 
31
import com.erggroup.buildtool.utilities.StringAppender;
30
 
32
 
31
/**Release Manager schema abstraction
33
/**Release Manager schema abstraction
32
 */
34
 */
33
public class ReleaseManager implements Cloneable
35
public class ReleaseManager implements Cloneable
34
{
36
{
Line 4699... Line 4701...
4699
        }
4701
        }
4700
 
4702
 
4701
        mLogger.debug("resetPlanControl {} Done", mRtagId);        
4703
        mLogger.debug("resetPlanControl {} Done", mRtagId);        
4702
    }
4704
    }
4703
 
4705
 
-
 
4706
    /** Insert Build Information. Two items at the moment:
-
 
4707
     *   * The list of all platforms that the package 'can' be built for
-
 
4708
     *   * The list of all pltaforms the package was built for
-
 
4709
     * @param bIsaTestBuild - True. Is a Test Build 
-
 
4710
     * @param mReporting
-
 
4711
     * @param mBuildInfo
-
 
4712
     * @throws Exception 
-
 
4713
     */
-
 
4714
    public void insertBuildInfo(boolean bIsaTestBuild, ReportingData mReporting, BuildInfo mBuildInfo) throws Exception
-
 
4715
    {
-
 
4716
        if ( mUseDatabase )
-
 
4717
        {
-
 
4718
            String result = null;
-
 
4719
            try
-
 
4720
            {
-
 
4721
                connect();
-
 
4722
                
-
 
4723
                if ( ! bIsaTestBuild )
-
 
4724
                {
-
 
4725
                    // Platforms that the package can be built for
-
 
4726
                    // This is a property of the package-version
-
 
4727
                    //
-
 
4728
                    StringAppender platformList = new StringAppender(",");
-
 
4729
                    platformList.append(mBuildInfo.mPlatforms.iterator());
-
 
4730
                    
-
 
4731
                    
-
 
4732
                    CallableStatement stmt1 = mConnection.prepareCall( "BEGIN ? :=  PK_BUILDAPI.insert_pv_platforms( ?, ?, ? );  END;" );
-
 
4733
                    stmt1.registerOutParameter( 1, Types.VARCHAR);
-
 
4734
                    stmt1.setInt(2, mReporting.packageVersionId);    // PVID
-
 
4735
                    stmt1.setString(3, platformList.toString());     // Platforms we can build for 
-
 
4736
                    stmt1.setInt(4, 1);                              // Clear before add
-
 
4737
                    stmt1.executeUpdate();
-
 
4738
                    result = stmt1.getString(1);
-
 
4739
                    stmt1.close();
-
 
4740
                    
-
 
4741
                    if (result != null && result.length() > 0 )                 {
-
 
4742
                        mLogger.warn("Unknown platforms: {}", result);
-
 
4743
                    }
-
 
4744
                }
-
 
4745
                
-
 
4746
                // Platforms that the package was built for
-
 
4747
                // This is a property of the Build Instance and may differ from build to build
-
 
4748
                //
-
 
4749
                StringAppender platformBuildList = new StringAppender(",");
-
 
4750
                platformBuildList.append(mBuildInfo.mBuildPlatforms.iterator());
-
 
4751
                
-
 
4752
                CallableStatement stmt2 = mConnection.prepareCall( "BEGIN ? := PK_BUILDAPI.insert_bi_platforms( ?, ?, ? );  END;" );
-
 
4753
                stmt2.registerOutParameter( 1, Types.VARCHAR);
-
 
4754
                stmt2.setInt(2, mReporting.buildId);             // Build Id
-
 
4755
                stmt2.setString(3, platformBuildList.toString());     // Platforms we can build for 
-
 
4756
                stmt2.setInt(4, 1);                             // Clear before add
-
 
4757
                stmt2.executeUpdate();
-
 
4758
                result = stmt2.getString(1);
-
 
4759
                stmt2.close();
-
 
4760
                if (result != null && result.length() > 0 )                 {
-
 
4761
                    mLogger.warn("Unknown build platforms: {}", result);
-
 
4762
                }
-
 
4763
                
-
 
4764
                commit();
-
 
4765
            }
-
 
4766
            catch ( SQLException e )
-
 
4767
            {
-
 
4768
                handleSQLException(e, "");
-
 
4769
            }
-
 
4770
            finally
-
 
4771
            {
-
 
4772
                // this block is executed regardless of what happens in the try block
-
 
4773
                // even if an exception is thrown
-
 
4774
                // ensure disconnect
-
 
4775
                disconnect();
-
 
4776
            }
-
 
4777
        }        
-
 
4778
    }
-
 
4779
 
4704
}
4780
}
4705
 
4781