9
9
import java .nio .file .Paths ;
10
10
import java .util .ArrayList ;
11
11
import java .util .Collections ;
12
- import java .util .LinkedList ;
13
12
import java .util .List ;
14
13
15
14
import com .oracle .weblogic .imagetool .api .model .CachedFile ;
19
18
import com .oracle .weblogic .imagetool .cachestore .CacheStoreFactory ;
20
19
import com .oracle .weblogic .imagetool .logging .LoggingFacade ;
21
20
import com .oracle .weblogic .imagetool .logging .LoggingFactory ;
22
- import com .oracle .weblogic .imagetool .util .Constants ;
23
21
import com .oracle .weblogic .imagetool .util .DockerfileOptions ;
24
- import com .oracle .weblogic .imagetool .util .HttpUtil ;
25
- import com .oracle .weblogic .imagetool .wdt .DomainType ;
26
22
import picocli .CommandLine .Option ;
27
23
28
24
public class WdtOptions {
@@ -50,12 +46,7 @@ void handleWdtArgsIfRequired(DockerfileOptions dockerfileOptions, String tmpDir,
50
46
dockerfileOptions .setWdtModels (modelList );
51
47
52
48
dockerfileOptions .setWdtDomainType (wdtDomainType );
53
- if (wdtDomainType != DomainType .WLS ) {
54
- if (installerType != FmwInstallerType .FMW ) {
55
- throw new IOException ("FMW installer is required for JRF domain" );
56
- }
57
- dockerfileOptions .setRunRcu (runRcu );
58
- }
49
+ dockerfileOptions .setRunRcu (runRcu );
59
50
60
51
if (wdtArchivePath != null ) {
61
52
@@ -83,52 +74,6 @@ void handleWdtArgsIfRequired(DockerfileOptions dockerfileOptions, String tmpDir,
83
74
logger .exiting ();
84
75
}
85
76
86
- /**
87
- * Builds a list of {@link CachedFile} objects based on user input which are processed.
88
- * to download the required install artifacts
89
- *
90
- * @return list of CachedFile
91
- * @throws Exception in case of error
92
- */
93
- public List <CachedFile > gatherWdtRequiredInstallers () throws Exception {
94
- logger .entering ();
95
- List <CachedFile > result = new LinkedList <>();
96
- if (wdtModelPath != null ) {
97
- logger .finer ("IMG-0001" , InstallerType .WDT , wdtVersion );
98
- CachedFile wdtInstaller = new CachedFile (InstallerType .WDT , wdtVersion );
99
- result .add (wdtInstaller );
100
- addWdtUrl (wdtInstaller .getKey (), cacheStore , wdtVersion );
101
- }
102
- logger .exiting (result .size ());
103
- return result ;
104
- }
105
-
106
- public CachedFile getWdtInstaller () {
107
- return new CachedFile (InstallerType .WDT , wdtVersion );
108
- }
109
-
110
- private void addWdtUrl (String wdtKey , CacheStore cacheStore , String wdtVersion ) throws Exception {
111
- logger .entering (wdtKey );
112
- String wdtUrlKey = wdtKey + "_url" ;
113
- if (cacheStore .getValueFromCache (wdtKey ) == null ) {
114
- //if (userId == null || password == null) {
115
- // throw new Exception("CachePolicy prohibits download. Add the required wdt installer to cache");
116
- //}
117
- List <String > wdtTags = HttpUtil .getWDTTags ();
118
- String tagToMatch = "latest" .equalsIgnoreCase (wdtVersion ) ? wdtTags .get (0 ) :
119
- "weblogic-deploy-tooling-" + wdtVersion ;
120
- if (wdtTags .contains (tagToMatch )) {
121
- String downloadLink = String .format (Constants .WDT_URL_FORMAT , tagToMatch );
122
- logger .info ("IMG-0007" , downloadLink );
123
- cacheStore .addToCache (wdtUrlKey , downloadLink );
124
- } else {
125
- throw new Exception ("Couldn't find WDT download url for version:" + wdtVersion );
126
- }
127
- }
128
- logger .exiting ();
129
- }
130
-
131
-
132
77
private List <String > addWdtFilesAsList (Path fileArg , String type , String tmpDir ) throws IOException {
133
78
String [] listOfFiles = fileArg .toString ().split ("," );
134
79
List <String > fileList = new ArrayList <>();
@@ -148,10 +93,6 @@ private List<String> addWdtFilesAsList(Path fileArg, String type, String tmpDir)
148
93
}
149
94
150
95
151
- public DomainType getWdtDomainType () {
152
- return wdtDomainType ;
153
- }
154
-
155
96
@ Option (
156
97
names = {"--wdtModel" },
157
98
description = "path to the WDT model file that defines the Domain to create"
@@ -179,9 +120,10 @@ public DomainType getWdtDomainType() {
179
120
180
121
@ Option (
181
122
names = {"--wdtDomainType" },
182
- description = "WDT Domain Type. Default: WLS. Supported values: ${COMPLETION-CANDIDATES} "
123
+ description = "WDT Domain Type (-domain_type) . Default: WLS. Supported values: WLS, JRF, or RestrictedJRF "
183
124
)
184
- private DomainType wdtDomainType = DomainType .WLS ;
125
+ @ SuppressWarnings ("FieldCanBeLocal" )
126
+ private String wdtDomainType = "WLS" ;
185
127
186
128
@ Option (
187
129
names = "--wdtRunRCU" ,
0 commit comments