.getAcceptableBundleDestinationSpecifications(bundleType)) { if (destinationSpecification.equals(spec.getName())) { found = true; break;
private void addBundleDestinationSpecification(BundleDestinationSpecification def) { if (this.bundleConfiguration == null) { throw new NullPointerException("bundleConfiguration == null"); } PropertyList propertyList = this.bundleConfiguration.getList(BUNDLE_DEST_LIST_NAME); if (propertyList == null) { propertyList = new PropertyList(BUNDLE_DEST_LIST_NAME); this.bundleConfiguration.put(propertyList); } PropertyMap map = new PropertyMap(BUNDLE_DEST_LIST_ITEM_NAME); def.fillPropertyMap(map); propertyList.add(map); }
while (it.hasNext()) { BundleDestinationSpecification spec = it.next(); if (spec.getAcceptedBundleTypes().isEmpty()) { generic.add(spec); } else if (spec.getAcceptedBundleTypes().contains(bundleType)) { specific.add(spec);
if (specName.equals(spec.getName())) { ResourceTypeBundleConfiguration.BundleDestinationDefinition def = (ResourceTypeBundleConfiguration.BundleDestinationDefinition) spec;
private String getConnectionString(BundleResourceDeployment resourceDeployment) { ResourceContainer rc = inventoryManager.getResourceContainer(resourceDeployment.getResource()); BundleDestination dest = resourceDeployment.getBundleDeployment().getDestination(); ResourceType type = rc.getResource().getResourceType(); String specName = dest.getDestinationSpecificationName(); String relativeDeployDir = dest.getDeployDir(); Configuration config = new Configuration(); config.put(new PropertySimple("deployDir", relativeDeployDir)); ConnectionStringAvailableProperties props = new ConnectionStringAvailableProperties(rc, measurementManager, config); for (ResourceTypeBundleConfiguration.BundleDestinationSpecification spec : type .getResourceTypeBundleConfiguration().getBundleDestinationSpecifications()) { if (specName.equals(spec.getName())) { ResourceTypeBundleConfiguration.BundleDestinationDefinition def = (ResourceTypeBundleConfiguration.BundleDestinationDefinition) spec; String rawConnectionString = def.getConnectionString(); if (rawConnectionString == null) { return null; } TokenReplacingReader trr = new TokenReplacingReader(new StringReader(rawConnectionString), props); try { return StreamUtil.slurp(trr); } finally { StreamUtil.safeClose(trr); } } } return null; }
@Override protected void fillPropertyMap(PropertyMap map) { super.fillPropertyMap(map); map.put(new PropertySimple(BUNDLE_DEST_DEFINITION_CONNECTION_NAME, connectionString)); PropertyList list = new PropertyList(BUNDLE_DEST_DEFINITION_REF_LIST_NAME); map.put(list); for (ConfigRef ref : referencedConfiguration) { PropertyMap refMap = new PropertyMap(BUNDLE_DEST_DEFINITION_REF_LIST_MEMBER_NAME); refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_TYPE_NAME, ref.getType().name())); refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_CONTEXT_NAME, ref.getContext().name())); refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_NAME_NAME, ref.getName())); refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_TARGET_NAME_NAME, ref.getTargetName())); list.add(refMap); } }
protected void fillPropertyMap(PropertyMap map) { map.put(new PropertySimple(BUNDLE_DEST_NAME_NAME, getName())); if (getDescription() != null) { PropertySimple descriptionProp = new PropertySimple(BUNDLE_DEST_DESCRIPTION_NAME, getDescription()); map.put(descriptionProp); } PropertyList accepts = new PropertyList(BUNDLE_DEST_ACCEPTS_LIST_NAME); map.put(accepts); for (String acc : acceptedBundleTypes) { PropertySimple p = new PropertySimple(BUNDLE_DEST_ACCEPTS_LIST_MEMBER_NAME, acc); accepts.add(p); } }
@Override protected void fillPropertyMap(PropertyMap map) { super.fillPropertyMap(map); PropertySimple valueContextProp = new PropertySimple(BUNDLE_DEST_BASE_DIR_VALUE_CONTEXT_NAME, getValueContext().name()); PropertySimple valueNameProp = new PropertySimple(BUNDLE_DEST_BASE_DIR_VALUE_NAME_NAME, getValueName()); map.put(valueContextProp); map.put(valueNameProp); }