Compare commits
No commits in common. "599730ff969d29bcfcd974c4250cfff5c80dbc1d" and "7725329d43ec7d5b238b9f0376c91f601e79f207" have entirely different histories.
599730ff96
...
7725329d43
@ -253,7 +253,7 @@ class Record {
|
|||||||
|
|
||||||
Integer getInteger(final String columnName) {
|
Integer getInteger(final String columnName) {
|
||||||
final String value = getString(columnName);
|
final String value = getString(columnName);
|
||||||
return isNotBlank(value) ? Integer.parseInt(value.trim()) : null;
|
return isNotBlank(value) ? Integer.parseInt(value.trim()) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal getBigDecimal(final String columnName) {
|
BigDecimal getBigDecimal(final String columnName) {
|
||||||
|
@ -130,10 +130,10 @@ public class ImportHostingAssets extends ImportOfficeData {
|
|||||||
assertThat(firstOfEachType(5, IPV4_NUMBER)).isEqualToIgnoringWhitespace("""
|
assertThat(firstOfEachType(5, IPV4_NUMBER)).isEqualToIgnoringWhitespace("""
|
||||||
{
|
{
|
||||||
1000363=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.34),
|
1000363=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.34),
|
||||||
1000381=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.52),
|
|
||||||
1000402=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.73),
|
1000402=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.73),
|
||||||
1000433=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.104),
|
1000433=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.104),
|
||||||
1000457=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.128)
|
1000473=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.144),
|
||||||
|
1000574=HsHostingAssetEntity(IPV4_NUMBER, 83.223.95.245)
|
||||||
}
|
}
|
||||||
""");
|
""");
|
||||||
}
|
}
|
||||||
@ -278,10 +278,10 @@ public class ImportHostingAssets extends ImportOfficeData {
|
|||||||
bookingItems.forEach(this::persistRecursively);
|
bookingItems.forEach(this::persistRecursively);
|
||||||
}).assertSuccessful();
|
}).assertSuccessful();
|
||||||
|
|
||||||
|
persistHostingAssetsOfType(IPV4_NUMBER);
|
||||||
persistHostingAssetsOfType(CLOUD_SERVER);
|
persistHostingAssetsOfType(CLOUD_SERVER);
|
||||||
persistHostingAssetsOfType(MANAGED_SERVER);
|
persistHostingAssetsOfType(MANAGED_SERVER);
|
||||||
persistHostingAssetsOfType(MANAGED_WEBSPACE);
|
persistHostingAssetsOfType(MANAGED_WEBSPACE);
|
||||||
persistHostingAssetsOfType(IPV4_NUMBER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void persistRecursively(final Integer key, final HsBookingItemEntity bi) {
|
private void persistRecursively(final Integer key, final HsBookingItemEntity bi) {
|
||||||
@ -352,14 +352,10 @@ public class ImportHostingAssets extends ImportOfficeData {
|
|||||||
final var hive_id = rec.getInteger("hive_id");
|
final var hive_id = rec.getInteger("hive_id");
|
||||||
final var created = rec.getLocalDate("created");
|
final var created = rec.getLocalDate("created");
|
||||||
final var cancelled = rec.getLocalDate("cancelled");
|
final var cancelled = rec.getLocalDate("cancelled");
|
||||||
final var cur_inet_addr_id = rec.getInteger("cur_inet_addr_id");
|
final var cur_inet_addr_id = rec.getInteger("cur_inet_addr_id"); // FIXME: import MANAGED_WEBSPACE
|
||||||
final var old_inet_addr_id = rec.getInteger("old_inet_addr_id"); // FIXME: assert that null
|
final var old_inet_addr_id = rec.getInteger("old_inet_addr_id"); // FIXME: assert that null
|
||||||
final var free = rec.getBoolean("free"); // FIXME: assert that "free webspace => in customer managed server", otherwise ignore
|
final var free = rec.getBoolean("free"); // FIXME: assert that "free webspace => in customer managed server", otherwise ignore
|
||||||
|
|
||||||
assertThat(old_inet_addr_id)
|
|
||||||
.as("packet.old_inet_addr_id not supported, but is not null for " + packet_name)
|
|
||||||
.isNull();
|
|
||||||
|
|
||||||
final var biType = determineBiType(basepacket_code);
|
final var biType = determineBiType(basepacket_code);
|
||||||
final var bookingItem = HsBookingItemEntity.builder()
|
final var bookingItem = HsBookingItemEntity.builder()
|
||||||
.type(biType)
|
.type(biType)
|
||||||
@ -370,10 +366,6 @@ public class ImportHostingAssets extends ImportOfficeData {
|
|||||||
bookingItems.put(PACKET_ID_OFFSET + packet_id, bookingItem);
|
bookingItems.put(PACKET_ID_OFFSET + packet_id, bookingItem);
|
||||||
|
|
||||||
final var haType = determineHaType(basepacket_code);
|
final var haType = determineHaType(basepacket_code);
|
||||||
assertThat(!free || haType == MANAGED_WEBSPACE || bookingItem.getRelatedProject().getDebitor().getDefaultPrefix().equals("hsh"))
|
|
||||||
.as("packet.free only supported for Hostsharing-Assets and ManagedWebspace in customer-ManagedServer, but is set for " + packet_name)
|
|
||||||
.isTrue();
|
|
||||||
|
|
||||||
final var asset = HsHostingAssetEntity.builder()
|
final var asset = HsHostingAssetEntity.builder()
|
||||||
.isLoaded(haType == MANAGED_WEBSPACE) // this turns off identifier validation to accept former default prefixes
|
.isLoaded(haType == MANAGED_WEBSPACE) // this turns off identifier validation to accept former default prefixes
|
||||||
.type(haType)
|
.type(haType)
|
||||||
@ -385,10 +377,6 @@ public class ImportHostingAssets extends ImportOfficeData {
|
|||||||
if (haType == MANAGED_SERVER) {
|
if (haType == MANAGED_SERVER) {
|
||||||
hive(hive_id).serverRef.set(asset);
|
hive(hive_id).serverRef.set(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cur_inet_addr_id != null) {
|
|
||||||
ipNumber(cur_inet_addr_id).setAssignedToAsset(asset);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// once we know all hosting assets, we can set the parentAsset for managed webspaces
|
// once we know all hosting assets, we can set the parentAsset for managed webspaces
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
inet_addr_id;inet_addr;description
|
inet_addr_id;inet_addr;description
|
||||||
363;83.223.95.34;
|
363;83.223.95.34;
|
||||||
381;83.223.95.52;
|
|
||||||
402;83.223.95.73;
|
402;83.223.95.73;
|
||||||
433;83.223.95.104;
|
433;83.223.95.104;
|
||||||
457;83.223.95.128;
|
|
||||||
473;83.223.95.144;
|
473;83.223.95.144;
|
||||||
574;83.223.95.245;
|
574;83.223.95.245;
|
||||||
1168;83.223.79.72;
|
1168;83.223.79.72;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user