public BundleDestinationBaseDirectory(String name, String valueContext, String valueName, String description, List<String> acceptedBundleTypes) { super(name, description, acceptedBundleTypes); this.valueContext = Context .valueOf(valueContext); // will throw an exception if its not valid, which is what we want this.valueName = valueName; }
public ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration() { if (this.bundleConfiguration == null) { return null; } else { return new ResourceTypeBundleConfiguration(bundleConfiguration); } }
@Override public String toString() { return "BundleDestinationLocation[name=" + getName() + ", conn=" + connectionString + ", refs=" + referencedConfiguration + ", description=" + getDescription(); }
static File baseDirFor(BundleResourceDeployment rd, Configuration referencedConfiguration) { File root = getMetadataRoot(referencedConfiguration); return baseDirFor(rd.getBundleDeployment().getDestination().getId(), root); }
@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); }
public BundleVersion(String name, String version, Bundle bundle, String recipe) { setName(name); setVersion(version); setBundle(bundle); setRecipe(recipe); }
public Bundle(String name, BundleType type, Repo repo, PackageType packageType) { setName(name); setBundleType(type); setRepo(repo); setPackageType(packageType); }
public BundleType(String name, ResourceType resourceType) { setName(name); setResourceType(resourceType); }
/** * This also updates the inverse relation (remove this bundle group from bundle) * @param bundle * @return true if bundle was removed, otherwise false */ public boolean removeBundle(Bundle bundle) { boolean result = getBundles().remove(bundle); bundle.removeBundleGroup(this); return result; }
/** * This also updates the inverse relation (add this bundle group to bundle) * @param bundle */ public void addBundle(Bundle bundle) { getBundles().add(bundle); bundle.addBundleGroup(this); }
public void setResourceTypeBundleConfiguration(ResourceTypeBundleConfiguration rtbc) { if (rtbc == null) { this.bundleConfiguration = null; } else { this.bundleConfiguration = rtbc.getBundleConfiguration(); } }
public void setBundleVersionRepoPK(BundleVersionRepoPK pk) { this.bundleVersion = pk.getBundleVersion(); this.repo = pk.getRepo(); }
/** * Calling this method with a non-<code>null</code> error message implies that the request's status is * {@link ConfigurationUpdateStatus#FAILURE}. The inverse is <i>not</i> true - that is, if you set the error message * to <code>null</code>, the status is left as-is; it will not assume that a <code>null</code> error message means * the status is successful. * * @param errorMessage */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (this.errorMessage != null) { setStatus(BundleDeploymentStatus.FAILURE); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.bundleVersion == null) ? 0 : this.bundleVersion.hashCode()); result = prime * result + ((this.destination == null) ? 0 : this.destination.hashCode()); result = prime * result + ((this.name == null) ? 0 : this.name.hashCode()); return result; }
/** * Creates a new destination definition builder initialized with the provided name that will add * the built destination definition into this bundle configuration instance automatically. * * @param name the name of this bundle destination location (must not be <code>null</code>) * @since 4.13 */ public BundleDestinationDefinition.Builder createDestinationDefinitionBuilder(String name) { if (name == null) { throw new IllegalArgumentException("name == null"); } return BundleDestinationDefinition.builderAddingTo(this).withName(name); }
public static Builder builder() { return new Builder(null); }
/** * A generic method to obtain all types of bundle destination specifications. * If this bundle configuration doesn't have any specifications, null is returned (though this * should never happen if the bundle configuration has been fully prepared for a resource type). * * @return of bundle destination specifications that can be targets for bundle deployments * @since 4.13 */ public Set<BundleDestinationSpecification> getBundleDestinationSpecifications() { return getBundleDestinationSpecificationsOfType(BundleDestinationSpecification.class); }
public BundleDestinationDefinition build() { BundleDestinationDefinition ret = new BundleDestinationDefinition(name, connString, description, refs, acceptedBundleTypes); if (targetConfig != null) { targetConfig.addBundleDestinationSpecification(ret); } return ret; } }
public static Builder builderAddingTo(ResourceTypeBundleConfiguration bundleConfig) { return new Builder(bundleConfig); }