/*
 * oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */

package org.xdi.oxauth.service.external.context;

import java.util.List;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.net.util.SubnetUtils;
import org.gluu.site.ldap.persistence.LdapEntryManager;
import org.gluu.site.ldap.persistence.exception.EntryPersistenceException;
import org.jboss.seam.log.Log;
import org.jboss.seam.log.Logging;
import org.xdi.ldap.model.CustomEntry;
import org.xdi.oxauth.model.common.User;
import org.xdi.oxauth.model.token.JsonWebResponse;
import org.xdi.oxauth.model.util.Util;
import org.xdi.oxauth.util.ServerUtil;

/**
 * Holds object required in dynamic scope custom scripts 
 * 
 * @author Yuriy Movchan  Date: 07/01/2015
 */

public class DynamicScopeExternalContext extends ExternalScriptContext {

	private List<String> dynamicScopes;
	private JsonWebResponse jsonToken;
	private User user;

    public DynamicScopeExternalContext(List<String> dynamicScopes, JsonWebResponse jsonToken, User user) {
    	super(null);

    	this.dynamicScopes = dynamicScopes;
    	this.jsonToken = jsonToken;
    	this.user = user;
    }

	public List<String> getDynamicScopes() {
		return dynamicScopes;
	}

	public void setDynamicScopes(List<String> dynamicScopes) {
		this.dynamicScopes = dynamicScopes;
	}

	public JsonWebResponse getJsonToken() {
		return jsonToken;
	}

	public void setJsonToken(JsonWebResponse jsonToken) {
		this.jsonToken = jsonToken;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}

@@ -1054,21 +1054,27 @@
 nse json
-Token
+WebResponse
 ;%0A%09priva
@@ -1175,21 +1175,27 @@
 nse json
-Token
+WebResponse
 , User u
@@ -1275,33 +1275,45 @@
 his.json
-Token = jsonToken
+WebResponse = jsonWebResponse
 ;%0A    %09t
@@ -1539,21 +1539,27 @@
  getJson
-Token
+WebResponse
 () %7B%0A%09%09r
@@ -1564,29 +1564,35 @@
 %09return json
-Token
+WebResponse
 ;%0A%09%7D%0A%0A%09publi
@@ -1605,21 +1605,27 @@
  setJson
-Token
+WebResponse
 (JsonWeb
@@ -1637,21 +1637,27 @@
 nse json
-Token
+WebResponse
 ) %7B%0A%09%09th
@@ -1667,25 +1667,37 @@
 json
-Token = jsonToken
+WebResponse = jsonWebResponse
 ;%0A%09%7D

Update DynamicScopeExternalContext method names