Skip to content

Commit f03065a

Browse files
gosurya-oraclejshum2479
authored andcommitted
Java poc
Former-commit-id: be5b30adcd0bcc76145a34a286fa6b7d2b3ba39e
1 parent b9e54cd commit f03065a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2354
-1531
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<argument>--writeCommandScript</argument>
6565
<argument>--completionScript</argument>
6666
<argument>${project.build.directory}/imagebuilder_completion.sh</argument>
67-
<argument>com.oracle.weblogicx.imagebuilder.builder.cli.CLIDriver</argument>
67+
<argument>com.oracle.weblogicx.imagebuilder.cli.CLIDriver</argument>
6868
<!-- replace with your class -->
6969
</arguments>
7070
</configuration>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.oracle.weblogicx.imagebuilder.api;
2+
3+
import com.oracle.weblogicx.imagebuilder.api.meta.CacheStore;
4+
5+
public interface FileResolver {
6+
7+
/**
8+
* Given a cache store, check whether the installer / patch file exists on disk.
9+
* patch files will be downloaded as required.
10+
* @param cacheStore store that keeps track of required artifacts
11+
* @return location of file on disk if found
12+
* @throws Exception in case of error
13+
*/
14+
String resolve(CacheStore cacheStore) throws Exception;
15+
16+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. */
22

3-
package com.oracle.weblogicx.imagebuilder.builder.api.meta;
3+
package com.oracle.weblogicx.imagebuilder.api.meta;
44

55
import java.util.Map;
66

77
/**
88
* This is the interface that helps keep track of application metadata like
99
* which patches have been downloaded and their location on disk.
1010
*/
11-
public interface MetaDataResolver {
11+
public interface CacheStore {
1212

1313
String CACHE_KEY_SEPARATOR = "_";
1414

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/AbstractFile.java renamed to src/main/java/com/oracle/weblogicx/imagebuilder/api/model/AbstractFile.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
package com.oracle.weblogicx.imagebuilder.builder.api.model;
1+
package com.oracle.weblogicx.imagebuilder.api.model;
22

3-
import com.oracle.weblogicx.imagebuilder.builder.api.FileResolver;
3+
import com.oracle.weblogicx.imagebuilder.api.FileResolver;
44

55
import java.nio.file.Files;
66
import java.nio.file.Paths;
77

8+
/**
9+
* Base class to represent either an installer or a patch file
10+
*/
811
public abstract class AbstractFile implements FileResolver {
912

1013
protected String key;

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/CachePolicy.java renamed to src/main/java/com/oracle/weblogicx/imagebuilder/api/model/CachePolicy.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. */
22

3-
package com.oracle.weblogicx.imagebuilder.builder.api.model;
3+
package com.oracle.weblogicx.imagebuilder.api.model;
44

5-
@SuppressWarnings("unused")
5+
/**
6+
* first - Use cache entries and download artifacts if required
7+
* always - Use only cache entries and never download artifacts
8+
* never - Ignore cache entries and always download artifacts
9+
*/
610
public enum CachePolicy {
711
FIRST("first"),
812
ALWAYS("always"),

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/CommandResponse.java renamed to src/main/java/com/oracle/weblogicx/imagebuilder/api/model/CommandResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. */
22

3-
package com.oracle.weblogicx.imagebuilder.builder.api.model;
3+
package com.oracle.weblogicx.imagebuilder.api.model;
44

55
public class CommandResponse {
66

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/model/InstallerType.java renamed to src/main/java/com/oracle/weblogicx/imagebuilder/api/model/InstallerType.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
package com.oracle.weblogicx.imagebuilder.builder.api.model;
1+
package com.oracle.weblogicx.imagebuilder.api.model;
2+
3+
import com.oracle.weblogicx.imagebuilder.util.Constants;
24

35
import java.util.ArrayList;
46
import java.util.List;
57

6-
import static com.oracle.weblogicx.imagebuilder.builder.util.Constants.BUILD_ARG;
7-
8-
@SuppressWarnings("unused")
8+
/**
9+
* An enum to represent type of installer
10+
*/
911
public enum InstallerType {
1012

1113
FMW(WLSInstallerType.FMW.toString()),
@@ -26,7 +28,7 @@ public String toString() {
2628

2729
public List<String> getBuildArg(String location) {
2830
List<String> retVal = new ArrayList<>(2);
29-
retVal.add(BUILD_ARG);
31+
retVal.add(Constants.BUILD_ARG);
3032
if (this == WLS || this == FMW) {
3133
retVal.add("WLS_PKG=" + location);
3234
} else if (this == JDK) {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. */
2+
3+
package com.oracle.weblogicx.imagebuilder.api.model;
4+
5+
/**
6+
* Supported installer type. WebLogic Server and FMW Infrastructure.
7+
*/
8+
public enum WLSInstallerType {
9+
WLS("wls"),
10+
FMW("fmw");
11+
12+
private String value;
13+
14+
WLSInstallerType(String value) {
15+
this.value = value;
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return value;
21+
}
22+
23+
public static WLSInstallerType fromValue(String value) {
24+
for (WLSInstallerType eachType : WLSInstallerType.values()) {
25+
if (eachType.value.equalsIgnoreCase(value)) {
26+
return eachType;
27+
}
28+
}
29+
throw new IllegalArgumentException("argument " + value + " does not match any WLSInstallerType");
30+
}
31+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.oracle.weblogicx.imagebuilder.api.model;
2+
3+
import com.oracle.weblogicx.imagebuilder.util.Constants;
4+
5+
import java.util.ArrayList;
6+
import java.util.Arrays;
7+
8+
public class WLSVersionValues extends ArrayList<String> {
9+
WLSVersionValues() {
10+
super(Arrays.asList(Constants.DEFAULT_WLS_VERSION, "12.2.1.2.0"));
11+
}
12+
}

src/main/java/com/oracle/weblogicx/imagebuilder/builder/api/FileResolver.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)