org.apache.tomcat.websocket.Transformation Java Examples

The following examples show how to use org.apache.tomcat.websocket.Transformation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WsHttpUpgradeHandler.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
public void preInit(Endpoint ep, ServerEndpointConfig serverEndpointConfig,
        WsServerContainer wsc, WsHandshakeRequest handshakeRequest,
        List<Extension> negotiatedExtensionsPhase2, String subProtocol,
        Transformation transformation, Map<String,String> pathParameters,
        boolean secure) {
    this.ep = ep;
    this.serverEndpointConfig = serverEndpointConfig;
    this.webSocketContainer = wsc;
    this.handshakeRequest = handshakeRequest;
    this.negotiatedExtensions = negotiatedExtensionsPhase2;
    this.subProtocol = subProtocol;
    this.transformation = transformation;
    this.pathParameters = pathParameters;
    this.secure = secure;
}
 
Example #2
Source File: UpgradeUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
private static List<Transformation> createTransformations(
        List<Extension> negotiatedExtensions) {

    TransformationFactory factory = TransformationFactory.getInstance();

    LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences =
            new LinkedHashMap<>();

    // Result will likely be smaller than this
    List<Transformation> result = new ArrayList<>(negotiatedExtensions.size());

    for (Extension extension : negotiatedExtensions) {
        List<List<Extension.Parameter>> preferences =
                extensionPreferences.get(extension.getName());

        if (preferences == null) {
            preferences = new ArrayList<>();
            extensionPreferences.put(extension.getName(), preferences);
        }

        preferences.add(extension.getParameters());
    }

    for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
        extensionPreferences.entrySet()) {
        Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
        if (transformation != null) {
            result.add(transformation);
        }
    }
    return result;
}
 
Example #3
Source File: WsHttpUpgradeHandler.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
public void preInit(Endpoint ep, EndpointConfig endpointConfig,
        WsServerContainer wsc, WsHandshakeRequest handshakeRequest,
        List<Extension> negotiatedExtensionsPhase2, String subProtocol,
        Transformation transformation, Map<String,String> pathParameters,
        boolean secure) {
    this.ep = ep;
    this.endpointConfig = endpointConfig;
    this.webSocketContainer = wsc;
    this.handshakeRequest = handshakeRequest;
    this.negotiatedExtensions = negotiatedExtensionsPhase2;
    this.subProtocol = subProtocol;
    this.transformation = transformation;
    this.pathParameters = pathParameters;
    this.secure = secure;
}
 
Example #4
Source File: UpgradeUtil.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
private static List<Transformation> createTransformations(
        List<Extension> negotiatedExtensions) {

    TransformationFactory factory = TransformationFactory.getInstance();

    LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences =
            new LinkedHashMap<String,List<List<Extension.Parameter>>>();

    // Result will likely be smaller than this
    List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size());

    for (Extension extension : negotiatedExtensions) {
        List<List<Extension.Parameter>> preferences =
                extensionPreferences.get(extension.getName());

        if (preferences == null) {
            preferences = new ArrayList<List<Extension.Parameter>>();
            extensionPreferences.put(extension.getName(), preferences);
        }

        preferences.add(extension.getParameters());
    }

    for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
        extensionPreferences.entrySet()) {
        Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
        if (transformation != null) {
            result.add(transformation);
        }
    }
    return result;
}
 
Example #5
Source File: WsHttpUpgradeHandler.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
public void preInit(Endpoint ep, EndpointConfig endpointConfig,
        WsServerContainer wsc, WsHandshakeRequest handshakeRequest,
        List<Extension> negotiatedExtensionsPhase2, String subProtocol,
        Transformation transformation, Map<String,String> pathParameters,
        boolean secure) {
    this.ep = ep;
    this.endpointConfig = endpointConfig;
    this.webSocketContainer = wsc;
    this.handshakeRequest = handshakeRequest;
    this.negotiatedExtensions = negotiatedExtensionsPhase2;
    this.subProtocol = subProtocol;
    this.transformation = transformation;
    this.pathParameters = pathParameters;
    this.secure = secure;
}
 
Example #6
Source File: UpgradeUtil.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
private static List<Transformation> createTransformations(
        List<Extension> negotiatedExtensions) {

    TransformationFactory factory = TransformationFactory.getInstance();

    LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences =
            new LinkedHashMap<String,List<List<Extension.Parameter>>>();

    // Result will likely be smaller than this
    List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size());

    for (Extension extension : negotiatedExtensions) {
        List<List<Extension.Parameter>> preferences =
                extensionPreferences.get(extension.getName());

        if (preferences == null) {
            preferences = new ArrayList<List<Extension.Parameter>>();
            extensionPreferences.put(extension.getName(), preferences);
        }

        preferences.add(extension.getParameters());
    }

    for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
        extensionPreferences.entrySet()) {
        Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
        if (transformation != null) {
            result.add(transformation);
        }
    }
    return result;
}
 
Example #7
Source File: WsFrameServer.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
public WsFrameServer(SocketWrapperBase<?> socketWrapper, WsSession wsSession,
        Transformation transformation, ClassLoader applicationClassLoader) {
    super(wsSession, transformation);
    this.socketWrapper = socketWrapper;
    this.applicationClassLoader = applicationClassLoader;
}
 
Example #8
Source File: WsFrameServer.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
protected Transformation getTransformation() {
    // Overridden to make it visible to other classes in this package
    return super.getTransformation();
}
 
Example #9
Source File: WsRemoteEndpointImplServer.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
protected void setTransformation(Transformation transformation) {
    // Overridden purely so it is visible to other classes in this package
    super.setTransformation(transformation);
}
 
Example #10
Source File: WsFrameServer.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
public WsFrameServer(AbstractServletInputStream sis, WsSession wsSession,
        Transformation transformation) {
    super(wsSession, transformation);
    this.sis = sis;
}
 
Example #11
Source File: WsFrameServer.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
@Override
protected Transformation getTransformation() {
    // Overridden to make it visible to other classes in this package
    return super.getTransformation();
}
 
Example #12
Source File: WsRemoteEndpointImplServer.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
@Override
protected void setTransformation(Transformation transformation) {
    // Overridden purely so it is visible to other classes in this package
    super.setTransformation(transformation);
}
 
Example #13
Source File: WsFrameServer.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
public WsFrameServer(AbstractServletInputStream sis, WsSession wsSession,
        Transformation transformation) {
    super(wsSession, transformation);
    this.sis = sis;
}
 
Example #14
Source File: WsFrameServer.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
@Override
protected Transformation getTransformation() {
    // Overridden to make it visible to other classes in this package
    return super.getTransformation();
}
 
Example #15
Source File: WsRemoteEndpointImplServer.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
@Override
protected void setTransformation(Transformation transformation) {
    // Overridden purely so it is visible to other classes in this package
    super.setTransformation(transformation);
}