Examples of JMXPrincipal


Examples of javax.management.remote.JMXPrincipal

        {
            throw new SecurityException("Invalid password");
        }

        Set<Principal> principals = new HashSet<Principal>();
        principals.add(new JMXPrincipal(username));
        return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
    }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

            throw new SecurityException("Authentication manager failed", result.getCause());
        }
        else if (AuthenticationStatus.SUCCESS.equals(result.getStatus()))
        {
            final Subject subject = result.getSubject();
            subject.getPrincipals().add(new JMXPrincipal(username));
            subject.setReadOnly();
            return subject;
        }
        else
        {
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

      localPasswd = props.getProperty(username)// can be null
  }
  if (password.equals(localPasswd)) {
      return
    new Subject(true,
          Collections.singleton(new JMXPrincipal(username)),
          Collections.EMPTY_SET,
          Collections.EMPTY_SET);
  } else {
      if (props.containsKey(username)) {
    final String message =
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

      ((SocketConnectionIf)mc).replaceStreams(saslis, saslos);
  }
  // Retrieve authorization id
  //
  final String authorizationId = saslServer.getAuthorizationID();
  final Principal principal = new JMXPrincipal(authorizationId);
  if (subject == null) subject = new Subject();
  AccessController.doPrivileged(new PrivilegedAction() {
    public Object run() {
        subject.getPrincipals().add(principal);
        return null;
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

                monitor[i].setObservedAttribute(attributes[i % 3]);
                monitor[i].setGranularityPeriod(500);
                final Monitor m = monitor[i];
                Subject subject = new Subject();
                echo(">>> RUN Principal = " + principals[i / 3]);
                subject.getPrincipals().add(new JMXPrincipal(principals[i / 3]));
                PrivilegedAction action = new PrivilegedAction() {
                    public Object run() {
                        m.start();
                        return null;
                    }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

    public class CustomJMXAuthenticator implements JMXAuthenticator {
        public Subject authenticate(Object credentials) {
            String role = ((String[]) credentials)[0];
            echo("Create principal with name = " + role);
            return new Subject(true,
                               Collections.singleton(new JMXPrincipal(role)),
                               Collections.EMPTY_SET,
                               Collections.EMPTY_SET);
        }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

            echo("\tsubject: " +
                 (subject == null ? null : subject.getPrincipals()));
            if (throwException)
                if (name.getCanonicalName().equals("domain:name=1,type=NB")
                    &&
                    subject.getPrincipals().contains(new JMXPrincipal("role")))
                    throw new SecurityException();
        }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

            echo("\tsubject: " +
                 (subject == null ? null : subject.getPrincipals()));
            if (throwException)
                if (name.getCanonicalName().equals("domain:name=2,type=NB")
                    &&
                    subject.getPrincipals().contains(new JMXPrincipal("role")))
                    throw new SecurityException();
        }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

            echo("\tnotification: " +  notification);
            echo("\tsubject: " +
                 (subject == null ? null : subject.getPrincipals()));
            if (!throwException)
                if (name.getCanonicalName().equals("domain:name=2,type=NB") &&
                    subject.getPrincipals().contains(new JMXPrincipal("role")))
                    throw new SecurityException();
        }
View Full Code Here

Examples of javax.management.remote.JMXPrincipal

    public class CustomJMXAuthenticator implements JMXAuthenticator {
        public Subject authenticate(Object credentials) {
            String role = ((String[]) credentials)[0];
            echo("\nCreate principal with name = " + role);
            return new Subject(true,
                               Collections.singleton(new JMXPrincipal(role)),
                               Collections.EMPTY_SET,
                               Collections.EMPTY_SET);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.