// Path: src/main/java/ch/rasc/wampspring/message/CallMessage.java
// public class CallMessage extends WampMessage {
// 	private final String callID;
// 
// 	private final String procURI;
// 
// 	private final List<Object> arguments;
// 
// 	public CallMessage(String callID, String procURI, Object... arguments) {
// 		super(WampMessageType.CALL);
// 		this.callID = callID;
// 		this.procURI = procURI;
// 		if (arguments != null) {
// 			this.arguments = Arrays.asList(arguments);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 
// 	}
// 
// 	public CallMessage(JsonParser jp) throws IOException {
// 		this(jp, null);
// 	}
// 
// 	public CallMessage(JsonParser jp, WampSession wampSession) throws IOException {
// 		super(WampMessageType.CALL);
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.callID = jp.getValueAsString();
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.procURI = replacePrefix(jp.getValueAsString(), wampSession);
// 
// 		List<Object> args = new ArrayList<>();
// 		while (jp.nextToken() != JsonToken.END_ARRAY) {
// 			args.add(jp.readValueAs(Object.class));
// 		}
// 
// 		if (!args.isEmpty()) {
// 			this.arguments = Collections.unmodifiableList(args);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 	}
// 
// 	public String getCallID() {
// 		return this.callID;
// 	}
// 
// 	public String getProcURI() {
// 		return this.procURI;
// 	}
// 
// 	public List<Object> getArguments() {
// 		return this.arguments;
// 	}
// 
// 	@Override
// 	public String getDestination() {
// 		return this.procURI;
// 	}
// 
// 	@Override
// 	public String toJson(JsonFactory jsonFactory) throws IOException {
// 		try (StringWriter sw = new StringWriter();
// 				JsonGenerator jg = jsonFactory.createGenerator(sw)) {
// 			jg.writeStartArray();
// 			jg.writeNumber(getTypeId());
// 			jg.writeString(this.callID);
// 			jg.writeString(this.procURI);
// 			if (this.arguments != null) {
// 				for (Object argument : this.arguments) {
// 					jg.writeObject(argument);
// 				}
// 			}
// 
// 			jg.writeEndArray();
// 			jg.close();
// 			return sw.toString();
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CallMessage [callID=" + this.callID + ", procURI=" + this.procURI
// 				+ ", arguments=" + this.arguments + "]";
// 	}
// 
// }


import java.util.Map;
import ch.rasc.wampspring.annotation.WampCallListener;
import ch.rasc.wampspring.message.CallMessage;
/**
 * Copyright 2014-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.wampspring.cra;



public interface AuthenticationHandler {

	@WampCallListener(value = "http://api.wamp.ws/procedure#authreq",
			authenticated = false)
// Path: src/main/java/ch/rasc/wampspring/message/CallMessage.java
// public class CallMessage extends WampMessage {
// 	private final String callID;
// 
// 	private final String procURI;
// 
// 	private final List<Object> arguments;
// 
// 	public CallMessage(String callID, String procURI, Object... arguments) {
// 		super(WampMessageType.CALL);
// 		this.callID = callID;
// 		this.procURI = procURI;
// 		if (arguments != null) {
// 			this.arguments = Arrays.asList(arguments);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 
// 	}
// 
// 	public CallMessage(JsonParser jp) throws IOException {
// 		this(jp, null);
// 	}
// 
// 	public CallMessage(JsonParser jp, WampSession wampSession) throws IOException {
// 		super(WampMessageType.CALL);
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.callID = jp.getValueAsString();
// 
// 		if (jp.nextToken() != JsonToken.VALUE_STRING) {
// 			throw new IOException();
// 		}
// 		this.procURI = replacePrefix(jp.getValueAsString(), wampSession);
// 
// 		List<Object> args = new ArrayList<>();
// 		while (jp.nextToken() != JsonToken.END_ARRAY) {
// 			args.add(jp.readValueAs(Object.class));
// 		}
// 
// 		if (!args.isEmpty()) {
// 			this.arguments = Collections.unmodifiableList(args);
// 		}
// 		else {
// 			this.arguments = null;
// 		}
// 	}
// 
// 	public String getCallID() {
// 		return this.callID;
// 	}
// 
// 	public String getProcURI() {
// 		return this.procURI;
// 	}
// 
// 	public List<Object> getArguments() {
// 		return this.arguments;
// 	}
// 
// 	@Override
// 	public String getDestination() {
// 		return this.procURI;
// 	}
// 
// 	@Override
// 	public String toJson(JsonFactory jsonFactory) throws IOException {
// 		try (StringWriter sw = new StringWriter();
// 				JsonGenerator jg = jsonFactory.createGenerator(sw)) {
// 			jg.writeStartArray();
// 			jg.writeNumber(getTypeId());
// 			jg.writeString(this.callID);
// 			jg.writeString(this.procURI);
// 			if (this.arguments != null) {
// 				for (Object argument : this.arguments) {
// 					jg.writeObject(argument);
// 				}
// 			}
// 
// 			jg.writeEndArray();
// 			jg.close();
// 			return sw.toString();
// 		}
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "CallMessage [callID=" + this.callID + ", procURI=" + this.procURI
// 				+ ", arguments=" + this.arguments + "]";
// 	}
// 
// }


// Path: src/main/java/ch/rasc/wampspring/cra/AuthenticationHandler.java
import java.util.Map;
import ch.rasc.wampspring.annotation.WampCallListener;
import ch.rasc.wampspring.message.CallMessage;

/**
 * Copyright 2014-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.wampspring.cra;



public interface AuthenticationHandler {

	@WampCallListener(value = "http://api.wamp.ws/procedure#authreq",
			authenticated = false)
	Object handleAuthReq(String authKey, Map<String, Object> extra, CallMessage message);