1616// under the License.
1717package com .cloud .upgrade .dao ;
1818
19- import java .io .InputStream ;
20- import java .sql .Connection ;
21-
22- import com .cloud .upgrade .SystemVmTemplateRegistration ;
23- import com .cloud .utils .exception .CloudRuntimeException ;
24-
2519public class Upgrade42200to42210 extends DbUpgradeAbstractImpl implements DbUpgrade , DbUpgradeSystemVmTemplate {
26- private SystemVmTemplateRegistration systemVmTemplateRegistration ;
2720
2821 @ Override
2922 public String [] getUpgradableVersionRange () {
@@ -34,50 +27,4 @@ public String[] getUpgradableVersionRange() {
3427 public String getUpgradedVersion () {
3528 return "4.22.1.0" ;
3629 }
37-
38- @ Override
39- public boolean supportsRollingUpgrade () {
40- return false ;
41- }
42-
43- @ Override
44- public InputStream [] getPrepareScripts () {
45- final String scriptFile = "META-INF/db/schema-42200to42210.sql" ;
46- final InputStream script = Thread .currentThread ().getContextClassLoader ().getResourceAsStream (scriptFile );
47- if (script == null ) {
48- throw new CloudRuntimeException ("Unable to find " + scriptFile );
49- }
50-
51- return new InputStream [] {script };
52- }
53-
54- @ Override
55- public void performDataMigration (Connection conn ) {
56- }
57-
58- @ Override
59- public InputStream [] getCleanupScripts () {
60- final String scriptFile = "META-INF/db/schema-42200to42210-cleanup.sql" ;
61- final InputStream script = Thread .currentThread ().getContextClassLoader ().getResourceAsStream (scriptFile );
62- if (script == null ) {
63- throw new CloudRuntimeException ("Unable to find " + scriptFile );
64- }
65-
66- return new InputStream [] {script };
67- }
68-
69- private void initSystemVmTemplateRegistration () {
70- systemVmTemplateRegistration = new SystemVmTemplateRegistration ("" );
71- }
72-
73- @ Override
74- public void updateSystemVmTemplates (Connection conn ) {
75- logger .debug ("Updating System Vm template IDs" );
76- initSystemVmTemplateRegistration ();
77- try {
78- systemVmTemplateRegistration .updateSystemVmTemplates (conn );
79- } catch (Exception e ) {
80- throw new CloudRuntimeException ("Failed to find / register SystemVM template(s)" , e );
81- }
82- }
8330}
0 commit comments