def domain_runtime():
    """
    Change to the domainRuntime MBean tree.
    :raises: PyWLSTException: if a WLST error occurs
    """
    _method_name = 'domain_runtime'
    try:
        wlst.domainRuntime()
    except wlst.WLSTException, e:
        pwe = exception_helper.create_pywlst_exception('WLSDPLY-00066', _format_exception(e), error=e)
        _logger.throwing(class_name=_class_name, method_name=_method_name, error=pwe)
        raise pwe
예제 #2
0
def createCustomAppRole(appStripe=None, appRoleName=None, displayName=None, description=None):
    from oracle.security.jps.mas.mgmt.jmx.util import JpsJmxConstants
    from javax.management import MBeanException
    from java.util import ArrayList
    import wlstModule

    try:
        wlstModule.domainRuntime()
        on = wlstModule.ObjectName(JpsJmxConstants.MBEAN_JPS_APPLICATION_POLICY_STORE)

        params = [appStripe, appRoleName, displayName, description, None]

        sign = ["java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String"]
        wlstModule.mbs.invoke(on, "createApplicationRole", params, sign)
    except MBeanException, e:
        # msg = opss_resourceBundle.getString(WlstResources.MSG_WLST_COMMAND_FAILED)
        msg = "MSG_WLST_COMMAND_FAILED"
        print msg + e.getLocalizedMessage() + "\n"
예제 #3
0
def grantCustomAppRole(appStripe=None,
                       appRoleName=None,
                       principalClass=None,
                       principalName=None,
                       principalType=None):
    from javax.management.openmbean import CompositeData
    from oracle.security.jps.mas.mgmt.jmx.policy import PortableApplicationRole
    from oracle.security.jps.mas.mgmt.jmx.policy import PortableRoleMember
    from oracle.security.jps.mas.mgmt.jmx.policy.PortablePrincipal import PrincipalType
    from oracle.security.jps.mas.mgmt.jmx.util import JpsJmxConstants
    from javax.management import MBeanException
    from java.util import ArrayList
    import wlstModule

    try:
        wlstModule.domainRuntime()
        on = wlstModule.ObjectName(
            JpsJmxConstants.MBEAN_JPS_APPLICATION_POLICY_STORE)
        r = PortableApplicationRole(appRoleName, "", "", "", appStripe)

        if principalType == 'CUSTOM':
            princType = PrincipalType.CUSTOM
        elif principalType == 'APP_ROLE':
            princType = PrincipalType.APP_ROLE
        else:
            print "No hay role"

        pm = PortableRoleMember(principalClass, principalName, princType,
                                appStripe)
        marr = wlstModule.array([pm.toCompositeData(None)], CompositeData)
        params = [appStripe, r.toCompositeData(None), marr]

        sign = [
            "java.lang.String", "javax.management.openmbean.CompositeData",
            "[Ljavax.management.openmbean.CompositeData;"
        ]
        wlstModule.mbs.invoke(on, "addMembersToApplicationRole", params, sign)
    except MBeanException, e:
        # msg = opss_resourceBundle.getString(WlstResources.MSG_WLST_COMMAND_FAILED)
        msg = "MSG_WLST_COMMAND_FAILED"
        print msg + e.getLocalizedMessage() + "\n"
예제 #4
0
def grantCustomAppRole(appStripe=None, appRoleName=None, principalClass=None, principalName=None, principalType=None):
    from javax.management.openmbean import CompositeData
    from oracle.security.jps.mas.mgmt.jmx.policy import PortableApplicationRole
    from oracle.security.jps.mas.mgmt.jmx.policy import PortableRoleMember
    from oracle.security.jps.mas.mgmt.jmx.policy.PortablePrincipal import PrincipalType
    from oracle.security.jps.mas.mgmt.jmx.util import JpsJmxConstants
    from javax.management import MBeanException
    from java.util import ArrayList
    import wlstModule

    try:
        wlstModule.domainRuntime()
        on = wlstModule.ObjectName(JpsJmxConstants.MBEAN_JPS_APPLICATION_POLICY_STORE)
        r = PortableApplicationRole(appRoleName, "", "", "", appStripe)

        if principalType == "CUSTOM":
            princType = PrincipalType.CUSTOM
        elif principalType == "APP_ROLE":
            princType = PrincipalType.APP_ROLE
        else:
            print "No hay role"

        pm = PortableRoleMember(principalClass, principalName, princType, appStripe)
        marr = wlstModule.array([pm.toCompositeData(None)], CompositeData)
        params = [appStripe, r.toCompositeData(None), marr]

        sign = [
            "java.lang.String",
            "javax.management.openmbean.CompositeData",
            "[Ljavax.management.openmbean.CompositeData;",
        ]
        wlstModule.mbs.invoke(on, "addMembersToApplicationRole", params, sign)
    except MBeanException, e:
        # msg = opss_resourceBundle.getString(WlstResources.MSG_WLST_COMMAND_FAILED)
        msg = "MSG_WLST_COMMAND_FAILED"
        print msg + e.getLocalizedMessage() + "\n"
예제 #5
0
def createCustomAppRole(appStripe=None,
                        appRoleName=None,
                        displayName=None,
                        description=None):
    from oracle.security.jps.mas.mgmt.jmx.util import JpsJmxConstants
    from javax.management import MBeanException
    from java.util import ArrayList
    import wlstModule
    try:
        wlstModule.domainRuntime()
        on = wlstModule.ObjectName(
            JpsJmxConstants.MBEAN_JPS_APPLICATION_POLICY_STORE)

        params = [appStripe, appRoleName, displayName, description, None]

        sign = [
            "java.lang.String", "java.lang.String", "java.lang.String",
            "java.lang.String", "java.lang.String"
        ]
        wlstModule.mbs.invoke(on, "createApplicationRole", params, sign)
    except MBeanException, e:
        # msg = opss_resourceBundle.getString(WlstResources.MSG_WLST_COMMAND_FAILED)
        msg = "MSG_WLST_COMMAND_FAILED"
        print msg + e.getLocalizedMessage() + "\n"
예제 #6
0
def domainRuntime():
    return wlst.domainRuntime()