You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
205 lines
6.7 KiB
205 lines
6.7 KiB
package com.fr.plugin.third.party.jsdidig.config; |
|
|
|
import com.fr.config.*; |
|
import com.fr.config.holder.Conf; |
|
import com.fr.config.holder.factory.Holders; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
/** |
|
* 配置数据保存 |
|
*/ |
|
@Visualization(category = "龙光IDM集成登录配置") |
|
public class CustomDataConfig extends DefaultConfiguration { |
|
public String getNameSpace() { |
|
return this.getClass().getName(); |
|
} |
|
|
|
private static volatile CustomDataConfig config = null; |
|
|
|
public static CustomDataConfig getInstance() { |
|
if (config == null) { |
|
config = ConfigContext.getConfigInstance(CustomDataConfig.class); |
|
} |
|
return config; |
|
} |
|
private static ConcurrentHashMap<String, String> URL_MAP = new ConcurrentHashMap<String, String>(); |
|
|
|
/** |
|
* 添加链接 |
|
* @param key |
|
* @param url |
|
*/ |
|
public static synchronized void addUrl(String key, String url) { |
|
URL_MAP.put(key, url); |
|
} |
|
|
|
/** |
|
* 获取链接并销毁保存 |
|
* @param key |
|
* @return |
|
*/ |
|
public static synchronized String getUrlAndDestroy(String key) { |
|
String url = URL_MAP.get(key); |
|
URL_MAP.remove(key); |
|
return url; |
|
} |
|
|
|
@Identifier(value = "idmClientId", name = "客户端id(client_id)", description = "", status = Status.SHOW) |
|
private Conf<String> idmClientId = Holders.simple(""); |
|
|
|
|
|
@Identifier(value = "idmClientSecret", name = "客户端密钥(client_secret)", description = "", status = Status.SHOW) |
|
private Conf<String> idmClientSecret = Holders.simple(""); |
|
|
|
|
|
@Identifier(value = "frUrl", name = "报表地址(redirect_uri)", description = "", status = Status.SHOW) |
|
private Conf<String> frUrl = Holders.simple(""); |
|
|
|
|
|
@Identifier(value = "oAuthCodeUrl", name = "获取临时令牌接口地址", description = "", status = Status.SHOW) |
|
private Conf<String> oAuthCodeUrl = Holders.simple("http://ssotestnew.logan.com.cn:28080/siam/oauth2.0/authorize"); |
|
|
|
|
|
@Identifier(value = "accessTokenUrl", name = "获取Access Token地址(json)", description = "", status = Status.SHOW) |
|
private Conf<String> accessTokenUrl = Holders.simple("http://ssotestnew.logan.com.cn:28080/siam/oauth2.0/accessTokenByJson"); |
|
|
|
|
|
@Identifier(value = "userUrl", name = "获取用户信息地址(json)", description = "", status = Status.SHOW) |
|
private Conf<String> userUrl = Holders.simple("http://ssotestnew.logan.com.cn:28080/siam/oauth2.0/profileByJson"); |
|
|
|
|
|
@Identifier(value = "userSyncUrl", name = "用户同步的地址", description = "", status = Status.SHOW) |
|
private Conf<String> userSyncUrl = Holders.simple(""); |
|
|
|
@Identifier(value = "userSyncUsername", name = "用户同步的用户名", description = "", status = Status.SHOW) |
|
private Conf<String> userSyncUsername = Holders.simple(""); |
|
|
|
@Identifier(value = "userSyncPassword", name = "用户同步的密码", description = "", status = Status.SHOW) |
|
private Conf<String> userSyncPassword = Holders.simple(""); |
|
|
|
@Identifier(value = "logoutUrl", name = "退出登录地址", description = "", status = Status.SHOW) |
|
private Conf<String> logoutUrl = Holders.simple("http://siam.logan.com.cn/siam/logout"); |
|
|
|
|
|
@Identifier(value = "loginTypeNameParameter", name = "登录类型参数名称", description = "", status = Status.HIDE) |
|
private Conf<String> loginTypeNameParameter = Holders.simple("loginType"); |
|
|
|
|
|
@Identifier(value = "loginTypeValue", name = "登录类型值", description = "", status = Status.HIDE) |
|
private Conf<String> loginTypeValue = Holders.simple("OAUTH"); |
|
|
|
public String getLogoutUrl() { |
|
return logoutUrl.get(); |
|
} |
|
|
|
public void setLogoutUrl(String logoutUrl) { |
|
this.logoutUrl.set(logoutUrl); |
|
} |
|
|
|
public String getIdmClientId() { |
|
return idmClientId.get(); |
|
} |
|
|
|
public void setIdmClientId(String idmClientId) { |
|
this.idmClientId.set(idmClientId); |
|
} |
|
|
|
public String getIdmClientSecret() { |
|
return idmClientSecret.get(); |
|
} |
|
|
|
public void setIdmClientSecret(String idmClientSecret) { |
|
this.idmClientSecret.set(idmClientSecret); |
|
} |
|
|
|
public String getFrUrl() { |
|
return frUrl.get(); |
|
} |
|
|
|
public void setFrUrl(String frUrl) { |
|
this.frUrl.set(frUrl); |
|
} |
|
|
|
public String getoAuthCodeUrl() { |
|
return oAuthCodeUrl.get(); |
|
} |
|
|
|
public void setoAuthCodeUrl(String oAuthCodeUrl) { |
|
this.oAuthCodeUrl.set(oAuthCodeUrl); |
|
} |
|
|
|
public String getAccessTokenUrl() { |
|
return accessTokenUrl.get(); |
|
} |
|
|
|
public void setAccessTokenUrl(String accessTokenUrl) { |
|
this.accessTokenUrl.set(accessTokenUrl); |
|
} |
|
|
|
public String getUserUrl() { |
|
return userUrl.get(); |
|
} |
|
|
|
public void setUserUrl(String userUrl) { |
|
this.userUrl.set(userUrl); |
|
} |
|
|
|
public String getLoginTypeNameParameter() { |
|
return loginTypeNameParameter.get(); |
|
} |
|
|
|
public void setLoginTypeNameParameter(String loginTypeNameParameter) { |
|
this.loginTypeNameParameter.set(loginTypeNameParameter); |
|
} |
|
|
|
public String getLoginTypeValue() { |
|
return loginTypeValue.get(); |
|
} |
|
|
|
public void setLoginTypeValue(String loginTypeValue) { |
|
this.loginTypeValue.set(loginTypeValue); |
|
} |
|
|
|
public String getUserSyncUrl() { |
|
return userSyncUrl.get(); |
|
} |
|
|
|
public void setUserSyncUrl(String userSyncUrl) { |
|
this.userSyncUrl.set(userSyncUrl); |
|
} |
|
|
|
public String getUserSyncUsername() { |
|
return userSyncUsername.get(); |
|
} |
|
|
|
public void setUserSyncUsername(String userSyncUsername) { |
|
this.userSyncUsername.set(userSyncUsername); |
|
} |
|
|
|
public String getUserSyncPassword() { |
|
return userSyncPassword.get(); |
|
} |
|
|
|
public void setUserSyncPassword(String userSyncPassword) { |
|
this.userSyncPassword.set(userSyncPassword); |
|
} |
|
|
|
@Override |
|
public Object clone() throws CloneNotSupportedException { |
|
CustomDataConfig cloned = (CustomDataConfig) super.clone(); |
|
cloned.idmClientId = (Conf<String>) idmClientId.clone(); |
|
cloned.idmClientSecret = (Conf<String>) idmClientSecret.clone(); |
|
cloned.frUrl = (Conf<String>) frUrl.clone(); |
|
cloned.oAuthCodeUrl = (Conf<String>) oAuthCodeUrl.clone(); |
|
cloned.accessTokenUrl = (Conf<String>) accessTokenUrl.clone(); |
|
cloned.userUrl = (Conf<String>) userUrl.clone(); |
|
cloned.logoutUrl = (Conf<String>) logoutUrl.clone(); |
|
cloned.loginTypeNameParameter = (Conf<String>) loginTypeNameParameter.clone(); |
|
cloned.loginTypeValue = (Conf<String>) loginTypeValue.clone(); |
|
cloned.userSyncUrl = (Conf<String>) userSyncUrl.clone(); |
|
cloned.userSyncUsername = (Conf<String>) userSyncUsername.clone(); |
|
cloned.userSyncPassword = (Conf<String>) userSyncPassword.clone(); |
|
return cloned; |
|
} |
|
}
|
|
|