99import java .nio .file .Paths ;
1010import java .util .ArrayList ;
1111import java .util .Collections ;
12- import java .util .LinkedList ;
1312import java .util .List ;
1413
1514import com .oracle .weblogic .imagetool .api .model .CachedFile ;
1918import com .oracle .weblogic .imagetool .cachestore .CacheStoreFactory ;
2019import com .oracle .weblogic .imagetool .logging .LoggingFacade ;
2120import com .oracle .weblogic .imagetool .logging .LoggingFactory ;
22- import com .oracle .weblogic .imagetool .util .Constants ;
2321import com .oracle .weblogic .imagetool .util .DockerfileOptions ;
24- import com .oracle .weblogic .imagetool .util .HttpUtil ;
25- import com .oracle .weblogic .imagetool .wdt .DomainType ;
2622import picocli .CommandLine .Option ;
2723
2824public class WdtOptions {
@@ -50,12 +46,7 @@ void handleWdtArgsIfRequired(DockerfileOptions dockerfileOptions, String tmpDir,
5046 dockerfileOptions .setWdtModels (modelList );
5147
5248 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 );
5950
6051 if (wdtArchivePath != null ) {
6152
@@ -83,52 +74,6 @@ void handleWdtArgsIfRequired(DockerfileOptions dockerfileOptions, String tmpDir,
8374 logger .exiting ();
8475 }
8576
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-
13277 private List <String > addWdtFilesAsList (Path fileArg , String type , String tmpDir ) throws IOException {
13378 String [] listOfFiles = fileArg .toString ().split ("," );
13479 List <String > fileList = new ArrayList <>();
@@ -148,10 +93,6 @@ private List<String> addWdtFilesAsList(Path fileArg, String type, String tmpDir)
14893 }
14994
15095
151- public DomainType getWdtDomainType () {
152- return wdtDomainType ;
153- }
154-
15596 @ Option (
15697 names = {"--wdtModel" },
15798 description = "path to the WDT model file that defines the Domain to create"
@@ -179,9 +120,10 @@ public DomainType getWdtDomainType() {
179120
180121 @ Option (
181122 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 "
183124 )
184- private DomainType wdtDomainType = DomainType .WLS ;
125+ @ SuppressWarnings ("FieldCanBeLocal" )
126+ private String wdtDomainType = "WLS" ;
185127
186128 @ Option (
187129 names = "--wdtRunRCU" ,
0 commit comments