java.lang.Object
net.i2p.router.startup.MigrateJetty
Second migration, as of 2.9.0.
Migrate all the jetty*.xml files to change Ref id= to Ref refid= because dup ids is a fatal error. Also migrate the old configure.dtd to configure_9_3.dtd. Reference: https://github.com/jetty/jetty.project/issues/12881
First migration, as of 0.9.30:
Migrate the clients.config and jetty.xml files from Jetty 5/6 to Jetty 7/8. Also migrate jetty.xml from Jetty 7/8 to Jetty 9.
For each client for class org.mortbay.jetty.Server:
Let $D be the dir that jetty.xml is in (usually ~/.i2p/eepsite) Saves $D/jetty.xml to $D/jetty6.xml Copies $I2P/eepsite-jetty7/jetty.xml to $D/jetty.xml, edited for $D Copies $I2P/eepsite-jetty7/jetty-ssl.xml to $D/jetty-ssl.xml, edited for $D Copies $I2P/eepsite-jetty7/jetty-rewrite.xml to $D/jetty-rewrite.xml Copies $I2P/eepsite-jetty7/context/base-context.xml to $D/jetty.xml, edited for $D Copies $I2P/eepsite-jetty7/context/cgi-context.xml to $D/jetty.xml, edited for $D Copies $I2P/eepsite-jetty7/etc/* to $D/etc Changes main class in clients.configCopies
clients.config to clients.config.jetty6; Saves new clients.config.Does NOT preserve port number, thread counts, etc. in the migration to 7/8. DOES preserve everything in the migration to 9.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanTrue if the latest Jetty is installed.private static booleanTrue once the migration was checked.private static final StringSuffix of the Jetty 6 config backups.private static final StringSuffix of the Jetty 8 config backups.private static final StringSuffix of the Jetty 9 config backups.private static final StringClass of the current Jetty launcher.private static final StringClass present only in the old Jetty 6.private static final StringMain class present only in the old Jetty 6.private static final StringConfig key marking the Jetty 9 migration done.private static final StringConfig key marking the second migration done.private static final StringClass testing that the new Jetty works.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot called, the migration class is never instantiated.Method Summary
Modifier and TypeMethodDescriptionprivate static booleanbackupFile(File from, String suffix) Backup a file with given suffix.private static booleanWhether the latest Jetty (7/8/9) is available.static voidmigrate(RouterContext ctx, List<ClientAppConfig> apps) For each entry in apps, if the main class is an old Jetty class, migrate it to the new Jetty class, and update the Jetty config files.
Field Details
_wasChecked
private static boolean _wasCheckedTrue once the migration was checked._hasLatestJetty
private static boolean _hasLatestJettyTrue if the latest Jetty is installed.OLD_CLASS
Class present only in the old Jetty 6.- See Also:
OLD_CLASS_6
Main class present only in the old Jetty 6.- See Also:
NEW_CLASS
Class of the current Jetty launcher.- See Also:
TEST_CLASS
Class testing that the new Jetty works.- See Also:
BACKUP_SUFFIX
Suffix of the Jetty 6 config backups.- See Also:
BACKUP_SUFFIX_8
Suffix of the Jetty 8 config backups.- See Also:
BACKUP_SUFFIX_9
Suffix of the Jetty 9 config backups.- See Also:
PROP_JETTY9_MIGRATED
Config key marking the Jetty 9 migration done.- See Also:
PROP_JETTY9_MIGRATED_2
Config key marking the second migration done.- See Also:
Constructor Details
MigrateJetty
private MigrateJetty()Not called, the migration class is never instantiated.
Method Details
migrate
For each entry in apps, if the main class is an old Jetty class, migrate it to the new Jetty class, and update the Jetty config files.- Parameters:
ctx- router context used to read app configs and save migration flagsapps- installed client apps whose main class and config may be rewritten
hasLatestJetty
private static boolean hasLatestJetty()Whether the latest Jetty (7/8/9) is available.- Returns:
- true if the Jetty client test class loads
backupFile