public class PolicyManager extends Object
Constructor and Description |
---|
PolicyManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
disableLogging()
Disable logging.
|
protected void |
enableLogging()
Re-enable logging.
|
HashMap |
getClassPolicyActionContexts(String policyFileName)
Gets the PolicyActionContexts specified by the policy file.
|
void |
log()
Puts out a blank line to the log
|
void |
log(int indentLevel,
String msg)
Puts out an indented string to the log.
|
void |
log(String msg)
Puts out a string to the log
|
void |
log(Throwable throwable)
Puts out an exception to the log
|
protected ClassObject |
lookupClassObject(String name)
Find a ClassObject by name; throw an exception if no ClassObject
exists with the specified name.
|
protected PolicyList |
lookupPolicyList(String name)
Find a PolicyList by name; return null if no PolicyList
exists with the specified name.
|
static void |
main(String[] args)
Creates Policies, PolicyLists, and PolicyListElements from the
command line.
|
void |
printStackTrace(Throwable e)
Add stack trace to the log.
|
void |
run(String[] args)
Creates Policies, PolicyLists, and PolicyListElements.
|
static int |
toExecutionMode(String executionModeLabel)
Convert an execution mode label to a numeric execution mode.
|
static String |
toExecutionModeLabel(int executionMode)
Convert an execution mode to a String label representation.
|
public static void main(String[] args)
args
- the command-line argumentspublic void run(String[] args) throws Exception
Exception
- if the operation failspublic HashMap getClassPolicyActionContexts(String policyFileName) throws Exception
This method is used for bootstrapping the policy framework at schema creation time. It processes the specified policy file and creates, for each ClassObject to which a ClassPolicyList is applied, the list of PolicyActionContexts for that ClassObject (not including any PolicyActionContexts inherited from the superclasses).
The return value is a HashMap whose keys are the uppercased ClassObject names and whose values are Lists of PolicyActionContexts.
policyFileName
- the name of the policy fileException
- if the operation failspublic static int toExecutionMode(String executionModeLabel)
executionModeLabel
- the string representation of an exceution
mode; expected to be one of:
PREEXISTING,
USER,
DISCOVERYADMINISTRATION,
ADMINISTRATION,
SYSTEMADMINISTRATION,
INSTALLATIONpublic static String toExecutionModeLabel(int executionMode)
executionMode
- the numeric execution modeprotected ClassObject lookupClassObject(String name) throws IfsException
name
- ClassObject nameIfsException
- if operation failsprotected PolicyList lookupPolicyList(String name) throws IfsException
name
- PolicyList nameIfsException
- if operation failsprotected void disableLogging()
protected void enableLogging()
public void log()
public void log(String msg)
msg
- the Stringpublic void log(int indentLevel, String msg)
indentLevel
- degree to which the message should be indentedmsg
- the Stringpublic void log(Throwable throwable)
throwable
- the exceptionpublic void printStackTrace(Throwable e)
e
- the exception for which to print a stack traceCopyright © 2023. All rights reserved.