/*
 * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: OriginConfigurator.java 75507 2017-09-15 08:22:32Z anajosep $
 */

package com.sun.ts.tests.websocket.ee.javax.websocket.server.serverendpointconfig.configurator;

import javax.websocket.server.ServerEndpointConfig.Configurator;

public class OriginConfigurator extends Configurator {
	private static String origin;
	public static String NULL="NULL";

	@Override
	public boolean checkOrigin(String originHeaderValue) {
		OriginConfigurator.setOrigin(originHeaderValue);
		return super.checkOrigin(originHeaderValue);
	}

	static String getOrigin() {
		return origin == null ? NULL : origin;
	}

	static void setOrigin(String origin) {
		OriginConfigurator.origin = origin;
	}
}
