Skip to content

Commit 0118640

Browse files
author
Johnny
committed
Add initial apis for UI
Former-commit-id: 729862d2ab8e9dc9d504474f6c0506a3a13de7c2
1 parent 883c232 commit 0118640

File tree

1 file changed

+28
-0
lines changed
  • src/main/java/com/oracle/weblogicx/imagebuilder/builder/util

1 file changed

+28
-0
lines changed

src/main/java/com/oracle/weblogicx/imagebuilder/builder/util/ARUUtil.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,22 @@ public static String getLatestPSUFor(String category, String version, UserSessio
9999
}
100100

101101

102+
/**
103+
* Get list of PSU available for given category and release
104+
* @param category wls or fmw
105+
* @param version version number like 12.2.1.3.0
106+
* @param userSession user session containing the oraclient
107+
* @return Document listing of all patches (full details)
108+
* @throws IOException when failed
109+
*/
110+
public static Document getAllPSUFor(String category, String version, UserSession userSession) throws IOException {
111+
User user = userSession.getUser();
112+
String releaseNumber = getReleaseNumber(category, version, user.getEmail(), String.valueOf(user.getPassword()));
113+
return getAllPSU(category, releaseNumber, user.getEmail(), String.valueOf(user.getPassword()));
114+
}
115+
116+
117+
102118
/**
103119
* Download a list of FMW patches
104120
*
@@ -211,6 +227,18 @@ private static String getLatestPSU(String category, String release, String userI
211227
return savePatch(allPatches, userId, password);
212228
}
213229

230+
private static Document getAllPSU(String category, String release, String userId, String password) throws
231+
IOException {
232+
233+
String expression;
234+
if ("wls".equalsIgnoreCase(category))
235+
expression = String.format(LATEST_PSU_URL, WLS_PROD_ID, release);
236+
else
237+
expression = String.format(LATEST_PSU_URL, FMW_PROD_ID, release);
238+
239+
return HttpUtil.getXMLContent(expression, userId, password);
240+
}
241+
214242
private static String getPatch(String category, String version, String bugNumber, String userId, String password)
215243
throws
216244
IOException {

0 commit comments

Comments
 (0)