0 Replies Latest reply: Sep 23, 2012 10:14 AM by 963775 RSS

    Custom Adjudication provider

    963775
      Hi, Team

      I implements custom adjudication provider. MBean files generated successfully, jar file is coped to $WLS_HOME$/server/lib/mbeantypes directory. After restart WLS custom provider isn't available in popup list of adjudication provider. In this jar I also have custom authentication providers. They are available in popup list of authentication providers. Can you help me?
      I used integrated in JDeveloper 11g(11.1.2.2.0) WLS version 10.3.5.
      The MBean file of custom ADJUDICATOR is
      <?xml version="1.0" ?>
      <!DOCTYPE MBeanType SYSTEM "commo.dtd">
      
      <MBeanType
       Name          = "KmAdjudicator"
       DisplayName   = "KmAdjudicator"
       Package       = "com.km.wls.security.provider.authorization"
       Extend        = "weblogic.management.security.authorization.Adjudicator"
       PersistPolicy = "OnUpdate"
      >
      
       <MBeanAttribute
        Name          = "ProviderClassName"
        Type          = "java.lang.String"
        Writeable     = "false"
        Preprocessor  = "weblogic.management.configuration.LegalHelper.checkClassName(value)"
        Default       = "&quot;com.km.wls.security.provider.authorization.KmAdjudicationProviderImpl&quot;"
       />
      
       <MBeanAttribute
        Name          = "Description"
        Type          = "java.lang.String"
        Writeable     = "false"
        Default       = "&quot;km Adjudicator&quot;"
       />
      
       <MBeanAttribute
        Name          = "Version"
        Type          = "java.lang.String"
        Writeable     = "false"
        Default       = "&quot;1.0&quot;"
       />
      
       <MBeanAttribute
        Name          = "RequireUnanimousPermit"
        Type          = "java.lang.Boolean"
        InterfaceType = "boolean"
        IsIs          = "true"
        Default       = "new java.lang.Boolean(true)"
        Description   = "Requires all authorization providers to vote PERMIT in
                         order for the adjudication provider to vote PERMIT. If the attribute
                         is set to disabled, ABSTAIN votes are ignored."
       />
       
      </MBeanType>
       
      The KmAdjudicationProviderImpl code is
      public class KmAdjudicationProviderImpl implements AdjudicationProviderV2  {
          private String description;
          private AdjudicatorV2 adjudicator;
      
          @Override
          public void initialize(ProviderMBean providerMBean, SecurityServices securityServices) {
              description = providerMBean.getDescription();
              this.adjudicator = new KmAdjudicator();
          }
      
          @Override
          public void shutdown() {
          }
      
          @Override
          public AdjudicatorV2 getAdjudicator() {
              return adjudicator;
          }
      
          @Override
          public String getDescription() {
              return description;
          }
      }
      The KmAdjudicator class code is
      public class KmAdjudicator implements AdjudicatorV2 {
          
          private String[] providerClassNames;
      
          @Override
          public void initialize(String[] providerClassNames) {
              this.providerClassNames = providerClassNames;
              for (String className : providerClassNames) {
                  System.out.println("Adjudicator ---------------------> initalize " + className);
              }
          }
      
          @Override
          public boolean adjudicate(Result[] results, Resource resource, ContextHandler contextHandler) {
              for (int i= 0; i < results.length; i++) {
                  System.out.println("RESULT ---------------> val:" + results.toString() + " provider:" + providerClassNames[i]);
      }
      return true;
      }
      }