From 6d626ee21dbbd608fec544e90c4d51c3c2c15a30 Mon Sep 17 00:00:00 2001 From: Dave Barfield Date: Fri, 15 Jan 2016 14:29:32 +0000 Subject: [PATCH 1/2] Fix appliesTo() and ApplicableToProduct Interfaces for Resources that are applicable to a product should implement ApplicableToProduct and should not define appliesTo (as this is defined in ApplicableToProduct) Also adds WritableResourceFactory.createResource which was left out. --- .../resources/AdminScriptResource.java | 13 +++------- .../resources/ConfigSnippetResource.java | 4 ++-- .../ws/repository/resources/EsaResource.java | 9 +------ .../ws/repository/resources/IfixResource.java | 13 +++------- .../repository/resources/ProductResource.java | 9 +------ .../repository/resources/SampleResource.java | 13 +++------- .../writeable/WritableResourceFactory.java | 24 +++++++++++++++++++ 7 files changed, 37 insertions(+), 48 deletions(-) diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java index 1477644..1c4fdb2 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java @@ -22,25 +22,18 @@ *

* This interface allows read access to fields which are specific to admin scripts. */ -public interface AdminScriptResource extends RepositoryResource { +public interface AdminScriptResource extends RepositoryResource, ApplicableToProduct { /** * Get the language that the script is written in - * + * * @return the language the script is written in, or null if it has not been set */ public String getScriptLanguage(); - /** - * Gets the appliesTo field associated with the resource - * - * @return The appliesTo field associated with the resource, or null if it has not been set - */ - public String getAppliesTo(); - /** * Gets the list of required features for this admin script - * + * * @return The list of required features for this admin script, or null if no features are required */ public Collection getRequireFeature(); diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/ConfigSnippetResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/ConfigSnippetResource.java index 5e26867..5902f00 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/ConfigSnippetResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/ConfigSnippetResource.java @@ -22,11 +22,11 @@ *

* This interface allows read access to fields which are specific to config snippets. */ -public interface ConfigSnippetResource extends RepositoryResource { +public interface ConfigSnippetResource extends RepositoryResource, ApplicableToProduct { /** * Gets the list of required features for this config snippet - * + * * @return The list of required features for this config snippet, or null if no features are required */ public Collection getRequireFeature(); diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/EsaResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/EsaResource.java index 6949dc5..674771b 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/EsaResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/EsaResource.java @@ -25,7 +25,7 @@ *

* This interface allows read access to fields which are specific to features. */ -public interface EsaResource extends RepositoryResource { +public interface EsaResource extends RepositoryResource, ApplicableToProduct { /** * Gets the symbolic name of the feature @@ -62,13 +62,6 @@ public interface EsaResource extends RepositoryResource { */ public String getLowerCaseShortName(); - /** - * Gets the appliesTo field associated with the resource - * - * @return The appliesTo field associated with the resource, or null if it has not been set - */ - public String getAppliesTo(); - /** * Returns the value of the ibmProvisionCapability field (from the * "IBM-Provision-Capability" header in the ESA's manifest) which gives diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java index 61eecd4..1a6b4e4 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java @@ -23,25 +23,18 @@ *

* This interface allows read access to fields which are specific to ifixes. */ -public interface IfixResource extends RepositoryResource { +public interface IfixResource extends RepositoryResource, ApplicableToProduct { /** * Gets the list of APAR IDs which are provided in this ifix resource - * + * * @return the list of APAR IDs, or null if no APAR IDs are provided */ public Collection getProvideFix(); - /** - * Gets the appliesTo field associated with the resource - * - * @return The appliesTo field associated with the resource, or null if it has not been set - */ - public String getAppliesTo(); - /** * Gets the modified date of the most recently modified file to be replaced by the update - * + * * @return the date, or null if it has not been set */ public Date getDate(); diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/ProductResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/ProductResource.java index 8748d4c..51db33b 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/ProductResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/ProductResource.java @@ -24,13 +24,6 @@ *

* Products represented by this interface can either be of type {@link ResourceType#INSTALL} or {@link ResourceType#ADDON}. */ -public interface ProductResource extends ProductRelatedResource { - - /** - * Gets the appliesTo field associated with the resource - * - * @return The appliesTo field associated with the resource, or null if it has not been set - */ - public String getAppliesTo(); +public interface ProductResource extends ProductRelatedResource, ApplicableToProduct { } diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java index ccdac8a..c46c57b 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java @@ -26,18 +26,11 @@ *

* Samples represented by this interface can either be of type {@link ResourceType#PRODUCTSAMPLE} or {@link ResourceType#OPENSOURCE}. */ -public interface SampleResource extends RepositoryResource { - - /** - * Gets the appliesTo field associated with the resource - * - * @return The appliesTo field associated with the resource, or null if it has not been set - */ - public String getAppliesTo(); +public interface SampleResource extends RepositoryResource, ApplicableToProduct { /** * Gets the list of required features for this sample - * + * * @return The list of required features for this sample, or null if it has not been set */ public Collection getRequireFeature(); @@ -46,7 +39,7 @@ public interface SampleResource extends RepositoryResource { * Gets the short name for this sample *

* The short name should be the name of the server included in the sample. - * + * * @return The short name for this sample, or null if it has not been set */ public String getShortName(); diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java index 4f97fd5..124f156 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java @@ -17,6 +17,7 @@ import com.ibm.ws.repository.common.enums.ResourceType; import com.ibm.ws.repository.connections.RepositoryConnection; +import com.ibm.ws.repository.exceptions.RepositoryResourceCreationException; import com.ibm.ws.repository.resources.internal.AdminScriptResourceImpl; import com.ibm.ws.repository.resources.internal.ConfigSnippetResourceImpl; import com.ibm.ws.repository.resources.internal.EsaResourceImpl; @@ -62,4 +63,27 @@ public static ToolResourceWritable createTool(RepositoryConnection repoConnectio return new ToolResourceImpl(repoConnection); } + public static RepositoryResourceWritable createResource(RepositoryConnection repoConnection, ResourceType type) throws RepositoryResourceCreationException { + switch (type) { + case ADDON: + case INSTALL: + return createProduct(repoConnection, type); + case ADMINSCRIPT: + return createAdminScript(repoConnection); + case CONFIGSNIPPET: + return createConfigSnippet(repoConnection); + case FEATURE: + return createEsa(repoConnection); + case IFIX: + return createIfix(repoConnection); + case OPENSOURCE: + case PRODUCTSAMPLE: + return createSample(repoConnection, type); + case TOOL: + return createTool(repoConnection); + default: + throw new RepositoryResourceCreationException("Can not create an asset of type " + type, null); + } + } + } From fc37f86eb757cc57a6d356306d806a1a3be05c85 Mon Sep 17 00:00:00 2001 From: Dave Barfield Date: Fri, 15 Jan 2016 15:11:56 +0000 Subject: [PATCH 2/2] Fix boot classpath for windows 6 VMs For windows VMs some jar files are under jre/bin rather than jre/lib --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index 9a2aa76..1a28b77 100644 --- a/build.gradle +++ b/build.gradle @@ -285,6 +285,11 @@ if(hasProperty("java6Home")) { jars.add(it.path) } } + new File(java_bin_dir).eachFileRecurse { + if (it.path =~/\.jar$/) { + jars.add(it.path) + } + } } catch (FileNotFoundException e) { // do nothing. The check below will fail the build }