Skip to content

Commit 3593dd2

Browse files
committed
Merge branch 'main' into docs-4.2.0
2 parents b9ece92 + f234005 commit 3593dd2

File tree

57 files changed

+2418
-500
lines changed

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

+2418
-500
lines changed

core/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
<element>org.slf4j:slf4j-jdk14:jar</element>
259259
<element>org.slf4j:slf4j-api:jar</element>
260260
<element>com.jcraft:jzlib:jar</element>
261+
<element>${project.build.directory}/test-classes</element>
261262
</wlstExtClasspath>
262263
<systemProperties>
263264
<unit-test-wlst-dir>${unit-test-wlst-dir}</unit-test-wlst-dir>

core/src/main/java/oracle/weblogic/deploy/tool/archive_helper/add/AddCommand.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
AddSharedLibraryCommand.class,
3535
AddSharedLibraryPlanCommand.class,
3636
AddStructuredApplicationCommand.class,
37-
AddWebLogicRemoteConsoleExtensionCommand.class
37+
AddWebLogicRemoteConsoleExtensionCommand.class,
38+
AddXACMLPolicyCommand.class,
39+
AddXACMLRoleCommand.class
3840
}
3941
)
4042
public class AddCommand {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.add;
6+
7+
import java.io.File;
8+
9+
import oracle.weblogic.deploy.logging.PlatformLogger;
10+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
11+
import oracle.weblogic.deploy.tool.archive_helper.ArchiveHelperException;
12+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
13+
import oracle.weblogic.deploy.util.ExitCode;
14+
import oracle.weblogic.deploy.util.WLSDeployArchiveIOException;
15+
import picocli.CommandLine.Command;
16+
import picocli.CommandLine.Option;
17+
18+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
19+
20+
@Command(
21+
name = "xacmlPolicy",
22+
header = "Add the XACML Authorizer policy definition file to the archive file.",
23+
description = "%nCommand-line options:"
24+
)
25+
public class AddXACMLPolicyCommand extends AddTypeCommandBase {
26+
private static final String CLASS = AddScriptCommand.class.getName();
27+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
28+
private static final String TYPE = "XACML Authorizer policy definition file";
29+
30+
@Option(
31+
names = {"-source"},
32+
paramLabel = "<path>",
33+
description = "File system path to the XACML Authorizer policy definition file to add",
34+
required = true
35+
)
36+
private String sourcePath;
37+
38+
@Override
39+
public CommandResponse call() throws Exception {
40+
final String METHOD = "call";
41+
LOGGER.entering(CLASS, METHOD);
42+
43+
CommandResponse response;
44+
File sourceFile;
45+
try {
46+
sourceFile = initializeOptions(this.sourcePath);
47+
48+
String resultName;
49+
if (this.overwrite) {
50+
resultName = this.archive.replaceXACMLPolicyFile(sourceFile.getName(), sourceFile.getPath());
51+
} else {
52+
resultName = this.archive.addXACMLPolicyFile(sourceFile.getPath());
53+
}
54+
response = new CommandResponse(ExitCode.OK, resultName);
55+
} catch (ArchiveHelperException ex) {
56+
LOGGER.severe("WLSDPLY-30010", ex, TYPE, this.sourcePath,
57+
this.archiveFilePath, ex.getLocalizedMessage());
58+
response = new CommandResponse(ex.getExitCode(), "WLSDPLY-30010", TYPE,
59+
this.sourcePath, this.archiveFilePath, ex.getLocalizedMessage());
60+
} catch (WLSDeployArchiveIOException | IllegalArgumentException ex) {
61+
LOGGER.severe("WLSDPLY-30011", ex, TYPE, this.sourcePath,
62+
this.overwrite, this.archiveFilePath, ex.getLocalizedMessage());
63+
response = new CommandResponse(ExitCode.ERROR, "WLSDPLY-30011", TYPE,
64+
this.sourcePath, this.overwrite, this.archiveFilePath, ex.getLocalizedMessage());
65+
}
66+
67+
LOGGER.exiting(CLASS, METHOD, response);
68+
return response;
69+
}
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.add;
6+
7+
import java.io.File;
8+
9+
import oracle.weblogic.deploy.logging.PlatformLogger;
10+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
11+
import oracle.weblogic.deploy.tool.archive_helper.ArchiveHelperException;
12+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
13+
import oracle.weblogic.deploy.util.ExitCode;
14+
import oracle.weblogic.deploy.util.WLSDeployArchiveIOException;
15+
16+
import picocli.CommandLine.Command;
17+
import picocli.CommandLine.Option;
18+
19+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
20+
21+
@Command(
22+
name = "xacmlRole",
23+
header = "Add the XACML Role Mapper role definition file to the archive file.",
24+
description = "%nCommand-line options:"
25+
)
26+
public class AddXACMLRoleCommand extends AddTypeCommandBase {
27+
private static final String CLASS = AddScriptCommand.class.getName();
28+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
29+
private static final String TYPE = "XACML Role Mapper role definition file";
30+
31+
@Option(
32+
names = {"-source"},
33+
paramLabel = "<path>",
34+
description = "File system path to the XACML Role Mapper role definition file to add",
35+
required = true
36+
)
37+
private String sourcePath;
38+
39+
@Override
40+
public CommandResponse call() throws Exception {
41+
final String METHOD = "call";
42+
LOGGER.entering(CLASS, METHOD);
43+
44+
CommandResponse response;
45+
File sourceFile;
46+
try {
47+
sourceFile = initializeOptions(this.sourcePath);
48+
49+
String resultName;
50+
if (this.overwrite) {
51+
resultName = this.archive.replaceXACMLRoleFile(sourceFile.getName(), sourceFile.getPath());
52+
} else {
53+
resultName = this.archive.addXACMLPolicyFile(sourceFile.getPath());
54+
}
55+
response = new CommandResponse(ExitCode.OK, resultName);
56+
} catch (ArchiveHelperException ex) {
57+
LOGGER.severe("WLSDPLY-30010", ex, TYPE, this.sourcePath,
58+
this.archiveFilePath, ex.getLocalizedMessage());
59+
response = new CommandResponse(ex.getExitCode(), "WLSDPLY-30010", TYPE,
60+
this.sourcePath, this.archiveFilePath, ex.getLocalizedMessage());
61+
} catch (WLSDeployArchiveIOException | IllegalArgumentException ex) {
62+
LOGGER.severe("WLSDPLY-30011", ex, TYPE, this.sourcePath,
63+
this.overwrite, this.archiveFilePath, ex.getLocalizedMessage());
64+
response = new CommandResponse(ExitCode.ERROR, "WLSDPLY-30011", TYPE,
65+
this.sourcePath, this.overwrite, this.archiveFilePath, ex.getLocalizedMessage());
66+
}
67+
68+
LOGGER.exiting(CLASS, METHOD, response);
69+
return response;
70+
}
71+
}

core/src/main/java/oracle/weblogic/deploy/tool/archive_helper/extract/ExtractCommand.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
ExtractSharedLibraryCommand.class,
3636
ExtractSharedLibraryPlanCommand.class,
3737
ExtractStructuredApplicationCommand.class,
38-
ExtractWebLogicRemoteConsoleExtensionCommand.class
38+
ExtractWebLogicRemoteConsoleExtensionCommand.class,
39+
ExtractXACMLPolicyCommand.class,
40+
ExtractXACMLRoleCommand.class
3941
}
4042
)
4143
public class ExtractCommand {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.extract;
6+
7+
import oracle.weblogic.deploy.logging.PlatformLogger;
8+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
9+
import oracle.weblogic.deploy.tool.archive_helper.ArchiveHelperException;
10+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
11+
import oracle.weblogic.deploy.util.ExitCode;
12+
import oracle.weblogic.deploy.util.WLSDeployArchiveIOException;
13+
import picocli.CommandLine.Command;
14+
import picocli.CommandLine.Option;
15+
16+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
17+
18+
@Command(
19+
name = "xacmlPolicy",
20+
header = "Extract XACML Authorizer policy definition file from the archive file.",
21+
description = "%nCommand-line options:"
22+
)
23+
public class ExtractXACMLPolicyCommand extends ExtractTypeCommandBase {
24+
private static final String CLASS = ExtractXACMLPolicyCommand.class.getName();
25+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
26+
private static final String TYPE = "XACML Authorizer policy definition file";
27+
private static final String ERROR_KEY = "WLSDPLY-30047";
28+
29+
@Option(
30+
names = {"-name"},
31+
description = "Name of the XACML Authorizer policy definition file to be extracted from the archive file",
32+
required = true
33+
)
34+
private String name;
35+
36+
@Override
37+
public CommandResponse call() throws Exception {
38+
final String METHOD = "call";
39+
LOGGER.entering(CLASS, METHOD);
40+
41+
CommandResponse response;
42+
try {
43+
initializeOptions();
44+
45+
this.archive.extractXACMLPolicyFile(this.name, this.targetDirectory);
46+
response = new CommandResponse(ExitCode.OK, "WLSDPLY-30046", TYPE, this.name,
47+
this.archiveFilePath, this.targetDirectory.getPath());
48+
} catch (ArchiveHelperException ex) {
49+
LOGGER.severe(ERROR_KEY, ex, TYPE, this.name, this.archiveFilePath,
50+
this.targetDirectory.getPath(), ex.getLocalizedMessage());
51+
response = new CommandResponse(ex.getExitCode(), ERROR_KEY, TYPE, this.name,
52+
this.archiveFilePath, this.targetDirectory.getPath(), ex.getLocalizedMessage());
53+
} catch (WLSDeployArchiveIOException | IllegalArgumentException ex) {
54+
LOGGER.severe(ERROR_KEY, ex, TYPE, this.name, this.archiveFilePath,
55+
this.targetDirectory.getPath(), ex.getLocalizedMessage());
56+
response = new CommandResponse(ExitCode.ERROR, ERROR_KEY, TYPE, this.name,
57+
this.archiveFilePath, this.targetDirectory.getPath(), ex.getLocalizedMessage());
58+
}
59+
60+
LOGGER.exiting(CLASS, METHOD, response);
61+
return response;
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.extract;
6+
7+
import oracle.weblogic.deploy.logging.PlatformLogger;
8+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
9+
import oracle.weblogic.deploy.tool.archive_helper.ArchiveHelperException;
10+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
11+
import oracle.weblogic.deploy.util.ExitCode;
12+
import oracle.weblogic.deploy.util.WLSDeployArchiveIOException;
13+
import picocli.CommandLine.Command;
14+
import picocli.CommandLine.Option;
15+
16+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
17+
18+
@Command(
19+
name = "xacmlRole",
20+
header = "Extract XACML Role Mapper role definition file from the archive file.",
21+
description = "%nCommand-line options:"
22+
)
23+
public class ExtractXACMLRoleCommand extends ExtractTypeCommandBase {
24+
private static final String CLASS = ExtractXACMLRoleCommand.class.getName();
25+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
26+
private static final String TYPE = "XACML Role Mapper role definition file";
27+
private static final String ERROR_KEY = "WLSDPLY-30047";
28+
29+
@Option(
30+
names = {"-name"},
31+
description = "Name of the XACML Role Mapper role definition file to be extracted from the archive file",
32+
required = true
33+
)
34+
private String name;
35+
36+
@Override
37+
public CommandResponse call() throws Exception {
38+
final String METHOD = "call";
39+
LOGGER.entering(CLASS, METHOD);
40+
41+
CommandResponse response;
42+
try {
43+
initializeOptions();
44+
45+
this.archive.extractXACMLRoleFile(this.name, this.targetDirectory);
46+
response = new CommandResponse(ExitCode.OK, "WLSDPLY-30046", TYPE, this.name,
47+
this.archiveFilePath, this.targetDirectory.getPath());
48+
} catch (ArchiveHelperException ex) {
49+
LOGGER.severe(ERROR_KEY, ex, TYPE, this.name, this.archiveFilePath,
50+
this.targetDirectory.getPath(), ex.getLocalizedMessage());
51+
response = new CommandResponse(ex.getExitCode(), ERROR_KEY, TYPE, this.name,
52+
this.archiveFilePath, this.targetDirectory.getPath(), ex.getLocalizedMessage());
53+
} catch (WLSDeployArchiveIOException | IllegalArgumentException ex) {
54+
LOGGER.severe(ERROR_KEY, ex, TYPE, this.name, this.archiveFilePath,
55+
this.targetDirectory.getPath(), ex.getLocalizedMessage());
56+
response = new CommandResponse(ExitCode.ERROR, ERROR_KEY, TYPE, this.name,
57+
this.archiveFilePath, this.targetDirectory.getPath(), ex.getLocalizedMessage());
58+
}
59+
60+
LOGGER.exiting(CLASS, METHOD, response);
61+
return response;
62+
}
63+
}

core/src/main/java/oracle/weblogic/deploy/tool/archive_helper/list/ListCommand.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
ListServerKeystoreCommand.class,
3333
ListSharedLibraryCommand.class,
3434
ListStructuredApplicationCommand.class,
35-
ListWebLogicRemoteConsoleExtensionCommand.class
35+
ListWebLogicRemoteConsoleExtensionCommand.class,
36+
ListXACMLPolicyCommand.class,
37+
ListXACMLRoleCommand.class
3638
}
3739
)
3840
public class ListCommand {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.list;
6+
7+
import oracle.weblogic.deploy.logging.PlatformLogger;
8+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
9+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
10+
import picocli.CommandLine.Command;
11+
import picocli.CommandLine.Option;
12+
13+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
14+
import static oracle.weblogic.deploy.util.WLSDeployArchive.ArchiveEntryType.XACML_ROLE;
15+
16+
@Command(
17+
name = "xacmlPolicy",
18+
header = "List XACML Authorizer policy definition entries in the archive file.",
19+
description = "%nCommand-line options:"
20+
)
21+
public class ListXACMLPolicyCommand extends ListTypeCommandBase {
22+
private static final String CLASS = ListXACMLPolicyCommand.class.getName();
23+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
24+
25+
@Option(
26+
names = { "-name" },
27+
paramLabel = "<name>",
28+
description = "Name of the XACML Authorizer policy definition entry to list"
29+
)
30+
private String name;
31+
32+
@Override
33+
public CommandResponse call() throws Exception {
34+
final String METHOD = "call";
35+
LOGGER.entering(CLASS, METHOD);
36+
37+
CommandResponse response = listType(XACML_ROLE, "XACML Authorizer policy definition", name);
38+
39+
LOGGER.exiting(CLASS, METHOD, response);
40+
return response;
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.tool.archive_helper.list;
6+
7+
import oracle.weblogic.deploy.logging.PlatformLogger;
8+
import oracle.weblogic.deploy.logging.WLSDeployLogFactory;
9+
import oracle.weblogic.deploy.tool.archive_helper.CommandResponse;
10+
import picocli.CommandLine.Command;
11+
import picocli.CommandLine.Option;
12+
13+
import static oracle.weblogic.deploy.tool.ArchiveHelper.LOGGER_NAME;
14+
import static oracle.weblogic.deploy.util.WLSDeployArchive.ArchiveEntryType.APPLICATION;
15+
import static oracle.weblogic.deploy.util.WLSDeployArchive.ArchiveEntryType.XACML_ROLE;
16+
17+
@Command(
18+
name = "xacmlRole",
19+
header = "List XACML Role Mapper role definition entries in the archive file.",
20+
description = "%nCommand-line options:"
21+
)
22+
public class ListXACMLRoleCommand extends ListTypeCommandBase {
23+
private static final String CLASS = ListXACMLRoleCommand.class.getName();
24+
private static final PlatformLogger LOGGER = WLSDeployLogFactory.getLogger(LOGGER_NAME);
25+
26+
@Option(
27+
names = { "-name" },
28+
paramLabel = "<name>",
29+
description = "Name of the XACML Role Mapper role definition entry to list"
30+
)
31+
private String name;
32+
33+
@Override
34+
public CommandResponse call() throws Exception {
35+
final String METHOD = "call";
36+
LOGGER.entering(CLASS, METHOD);
37+
38+
CommandResponse response = listType(XACML_ROLE, "XACML Role Mapper role definition", name);
39+
40+
LOGGER.exiting(CLASS, METHOD, response);
41+
return response;
42+
}
43+
}

0 commit comments

Comments
 (0)