this.userProject = checkNotNull(userProject, "userProject");
}
@Override
public NodeMetadata apply(InstanceInZone instanceInZone) {
Instance input = instanceInZone.getInstance();
String group = groupFromMapOrName(input.getMetadata().getItems(),
input.getName(), nodeNamingConvention);
FluentIterable<String> tags = FluentIterable.from(input.getTags().getItems());
if (group != null) {
tags = tags.filter(Predicates.not(firewallTagNamingConvention.get(group).isFirewallTag()));
}
NodeMetadataBuilder builder = new NodeMetadataBuilder();
builder.id(SlashEncodedIds.fromTwoIds(checkNotNull(locations.get().get(input.getZone()),
"location for %s", input.getZone())
.getId(), input.getName()).slashEncode())
.name(input.getName())
.providerId(input.getId())
.hostname(input.getName())
.location(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone()))
.hardware(hardwares.get().get(input.getMachineType()))
.status(toPortableNodeStatus.get(input.getStatus()))
.tags(tags)
.uri(input.getSelfLink())
.userMetadata(input.getMetadata().getItems())
.group(group)
.privateAddresses(collectPrivateAddresses(input))
.publicAddresses(collectPublicAddresses(input));
if (input.getMetadata().getItems().containsKey(GCE_IMAGE_METADATA_KEY)) {
try {
URI imageUri = URI.create(input.getMetadata().getItems()
.get(GCE_IMAGE_METADATA_KEY));
Map<URI, ? extends Image> imagesMap = images.get();
Image image = checkNotNull(imagesMap.get(imageUri),