Example usage for org.springframework.security.messaging.access.expression ExpressionBasedMessageSecurityMetadataSourceFactory createExpressionMessageMetadataSource

List of usage examples for org.springframework.security.messaging.access.expression ExpressionBasedMessageSecurityMetadataSourceFactory createExpressionMessageMetadataSource

Introduction

In this page you can find the example usage for org.springframework.security.messaging.access.expression ExpressionBasedMessageSecurityMetadataSourceFactory createExpressionMessageMetadataSource.

Prototype

public static MessageSecurityMetadataSource createExpressionMessageMetadataSource(
        LinkedHashMap<MessageMatcher<?>, String> matcherToExpression) 

Source Link

Document

Create a MessageSecurityMetadataSource that uses MessageMatcher mapped to Spring Expressions.

Usage

From source file:ch.rasc.wampspring.security.WampMessageSecurityMetadataSourceRegistry.java

/**
 * Allows subclasses to create creating a {@link MessageSecurityMetadataSource}.
 *
 * <p>/*from  w  w  w  . j a va2 s .c o m*/
 * This is not exposed so as not to confuse users of the API, which should never
 * invoke this method.
 * </p>
 *
 * @return the {@link MessageSecurityMetadataSource} to use
 */
protected MessageSecurityMetadataSource createMetadataSource() {
    LinkedHashMap<MessageMatcher<?>, String> mte = new LinkedHashMap<>();
    for (Map.Entry<MatcherBuilder, String> entry : this.matcherToExpression.entrySet()) {
        mte.put(entry.getKey().build(), entry.getValue());
    }
    return ExpressionBasedMessageSecurityMetadataSourceFactory.createExpressionMessageMetadataSource(mte);
}