Package javax.management.remote

Examples of javax.management.remote.SubjectDelegationPermission


               for (Iterator i = principals.iterator(); i.hasNext();)
               {
                  Principal principal = (Principal)i.next();
                  buffer.setLength(0);
                  String permission = buffer.append(principal.getClass().getName()).append(".").append(principal.getName()).toString();
                  sm.checkPermission(new SubjectDelegationPermission(permission));
               }
               return null;
            }
         }, context);
      }
View Full Code Here


            for (Iterator i = principals.iterator(); i.hasNext();)
            {
               Principal principal = (Principal)i.next();
               buffer.setLength(0);
               String permission = buffer.append(principal.getClass().getName()).append(".").append(principal.getName()).toString();
               AccessController.checkPermission(new SubjectDelegationPermission(permission));
            }
            return null;
         }
      }, context);
   }
View Full Code Here

        //
        Collection<Principal> ps = getSubjectPrincipals(delegatedSubject);
        final Collection<Permission> permissions = new ArrayList<>(ps.size());
        for(Principal p : ps) {
            final String pname = p.getClass().getName() + "." + p.getName();
            permissions.add(new SubjectDelegationPermission(pname));
        }
        PrivilegedAction<Void> action =
            new PrivilegedAction<Void>() {
                public Void run() {
                    for (Permission sdp : permissions) {
View Full Code Here

        try {
            for (Principal p : getSubjectPrincipals(subject)) {
                final String pname =
                    p.getClass().getName() + "." + p.getName();
                final Permission sdp =
                    new SubjectDelegationPermission(pname);
                AccessController.checkPermission(sdp);
            }
        } catch (SecurityException e) {
            return false;
        }
View Full Code Here

    public Object run() {
        for (int i = 0 ; i < dp.length ; i++) {
      final String pname =
          dp[i].getClass().getName() + "." + dp[i].getName();
      Permission sdp =
          new SubjectDelegationPermission(pname);
      AccessController.checkPermission(sdp);
        }
        return null;
    }
      };
View Full Code Here

                subject.getPrincipals().toArray(new Principal[0]);
            for (int i = 0 ; i < dp.length ; i++) {
                final String pname =
                    dp[i].getClass().getName() + "." + dp[i].getName();
                final Permission sdp =
                    new SubjectDelegationPermission(pname);
                AccessController.checkPermission(sdp);
            }
        } catch (SecurityException e) {
            return false;
        }
View Full Code Here

      return result;
   }

   public SubjectDelegationPermission createSubjectDelegationPermission()
   {
      SubjectDelegationPermission sdp = new SubjectDelegationPermission(SubjectDelegationPermission.class.getName());
      return sdp;
   }
View Full Code Here

      if (!valid) throw new RuntimeException();
   }

   public void compareSubjectDelegationPermission(Object obj1, Object obj2)
   {
      SubjectDelegationPermission sdp1 = (SubjectDelegationPermission)obj1;
      SubjectDelegationPermission sdp2 = (SubjectDelegationPermission)obj2;
      boolean valid = sdp1.equals(sdp2);
      valid = valid && (sdp1.getActions().equals(sdp2.getActions()));
      valid = valid && (sdp1.getName().equals(sdp2.getName()));
      valid = valid && (sdp1.implies(sdp2));

      if (!valid) throw new RuntimeException();
   }
View Full Code Here

                public Void run() {
                    for (int i = 0 ; i < dp.length ; i++) {
                        final String pname =
                            dp[i].getClass().getName() + "." + dp[i].getName();
                        Permission sdp =
                            new SubjectDelegationPermission(pname);
                        AccessController.checkPermission(sdp);
                    }
                    return null;
                }
            };
View Full Code Here

                subject.getPrincipals().toArray(new Principal[0]);
            for (int i = 0 ; i < dp.length ; i++) {
                final String pname =
                    dp[i].getClass().getName() + "." + dp[i].getName();
                final Permission sdp =
                    new SubjectDelegationPermission(pname);
                AccessController.checkPermission(sdp);
            }
        } catch (SecurityException e) {
            return false;
        }
View Full Code Here

TOP

Related Classes of javax.management.remote.SubjectDelegationPermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.