Package com.apress.prospring.ch6.security

Examples of com.apress.prospring.ch6.security.UserInfo


    public static void main(String[] args) {
        SampleBean target = new SampleBean();

        // create advisor
        Advisor advisor = new DefaultPointcutAdvisor(
                new SimpleDynamicPointcut(), new SimpleAdvice());
       
        // create proxy
        ProxyFactory pf = new ProxyFactory();
        pf.setTarget(target);
        pf.addAdvisor(advisor);
View Full Code Here


        // create advisor
        NameMatchMethodPointcut pc = new NameMatchMethodPointcut();
        pc.addMethodName("foo");
        pc.addMethodName("bar");
        Advisor advisor = new DefaultPointcutAdvisor(pc, new SimpleAdvice());
       
        // create the proxy
        ProxyFactory pf = new ProxyFactory();
        pf.setTarget(target);
        pf.addAdvisor(advisor);
View Full Code Here

    public static void main(String[] args) {
        NameBean target = new NameBean();

        // create advisor
        NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor(
                new SimpleAdvice());
        advisor.addMethodName("foo");
        advisor.addMethodName("bar");

        // create the proxy
        ProxyFactory pf = new ProxyFactory();
View Full Code Here

        RegexpBean target = new RegexpBean();
       
        // create the advisor
        JdkRegexpMethodPointcut pc = new JdkRegexpMethodPointcut();
        pc.setPattern(".*foo.*");
        Advisor advisor = new DefaultPointcutAdvisor(pc, new SimpleAdvice());
       
        // create the proxy
        ProxyFactory pf = new ProxyFactory();
        pf.setTarget(target);
        pf.addAdvisor(advisor);
View Full Code Here

            boolean authenticated = false;
            if (RemotingContext.isSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                UserInfo userInfo = RemotingContext.getConnection().getUserInfo();
                Principal p = null;
                String credential = null;
                Subject subject = null;
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here

    @Override
    public HandleableCloseable.Key startReceiving(Channel channel) {
        final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel),
                getExecutor());
        UserInfo userInfo = channel.getConnection().getUserInfo();
        if (userInfo instanceof SubjectUserInfo) {
            handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler,
                    ((SubjectUserInfo) userInfo).getSubject()));
        } else {
            handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler));
View Full Code Here

    @Override
    public HandleableCloseable.Key startReceiving(Channel channel) {
        final ManagementChannelHandler handler = new ManagementChannelHandler(ManagementClientChannelStrategy.create(channel),
                getExecutor());
        UserInfo userInfo = channel.getConnection().getUserInfo();
        if (userInfo instanceof SubjectUserInfo) {
            handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler,
                    ((SubjectUserInfo) userInfo).getSubject()));
        } else {
            handler.addHandlerFactory(new ModelControllerClientOperationHandler(getController(), handler));
View Full Code Here

     */
    public static Collection<Principal> getConnectionPrincipals() {
        Connection con = RemotingContext.getConnection();

        if (con != null) {
            UserInfo userInfo = con.getUserInfo();
            if (userInfo instanceof SubjectUserInfo) {
                SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
                return sinfo.getPrincipals();
            } else {
                return Collections.emptySet();
View Full Code Here

            if (SecurityActions.remotingContextIsSet()) {
                // In this case the principal and credential will not have been set to set some random values.
                SecurityContextUtil util = current.getUtil();

                Connection connection = SecurityActions.remotingContextGetConnection();
                UserInfo userInfo = connection.getUserInfo();
                Principal p = null;
                Object credential = null;

                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
View Full Code Here

            desiredUser = new SimplePrincipal((String) contextData.get(DELEGATED_USER_KEY));

            Connection con = RemotingContext.getConnection();

            if (con != null) {
                UserInfo userInfo = con.getUserInfo();
                if (userInfo instanceof SubjectUserInfo) {
                    SubjectUserInfo sinfo = (SubjectUserInfo) userInfo;
                    for (Principal current : sinfo.getPrincipals()) {
                        if (current instanceof RealmUser) {
                            connectionUser = (RealmUser) current;
View Full Code Here

TOP

Related Classes of com.apress.prospring.ch6.security.UserInfo

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.