gluu
公開メンバ関数 | 非公開メンバ関数 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.service.external.ExternalDynamicScopeService クラス
org.xdi.oxauth.service.external.ExternalDynamicScopeService の継承関係図
Inheritance graph
org.xdi.oxauth.service.external.ExternalDynamicScopeService 連携図
Collaboration graph

公開メンバ関数

 ExternalDynamicScopeService ()
 
boolean executeExternalUpdateMethod (CustomScriptConfiguration customScriptConfiguration, DynamicScopeExternalContext dynamicScopeContext)
 
List< String > executeExternalGetSupportedClaimsMethod (CustomScriptConfiguration customScriptConfiguration)
 
boolean executeExternalUpdateMethods (DynamicScopeExternalContext dynamicScopeContext)
 
List< String > executeExternalGetSupportedClaimsMethods (List< Scope > dynamicScope)
 

非公開メンバ関数

Set< CustomScriptConfiguration > getScriptsToExecute (DynamicScopeExternalContext context)
 

静的非公開変数類

static final long serialVersionUID = 1416361273036208685L
 

詳解

Provides factory methods needed to create dynamic scope extension

著者
Yuriy Movchan Date: 01/08/2015

構築子と解体子

◆ ExternalDynamicScopeService()

org.xdi.oxauth.service.external.ExternalDynamicScopeService.ExternalDynamicScopeService ( )
inline
41  {
42  super(CustomScriptType.DYNAMIC_SCOPE);
43  }

関数詳解

◆ executeExternalGetSupportedClaimsMethod()

List<String> org.xdi.oxauth.service.external.ExternalDynamicScopeService.executeExternalGetSupportedClaimsMethod ( CustomScriptConfiguration  customScriptConfiguration)
inline
59  {
60  int apiVersion = executeExternalGetApiVersion(customScriptConfiguration);
61 
62  if (apiVersion > 1) {
63  try {
64  log.debug("Executing python 'get supported claims' method");
65  DynamicScopeType dynamicScopeType = (DynamicScopeType) customScriptConfiguration.getExternalType();
66  Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
67  return dynamicScopeType.getSupportedClaims(configurationAttributes);
68  } catch (Exception ex) {
69  log.error(ex.getMessage(), ex);
70  saveScriptError(customScriptConfiguration.getCustomScript(), ex);
71  }
72  }
73 
74  return null;
75  }

◆ executeExternalGetSupportedClaimsMethods()

List<String> org.xdi.oxauth.service.external.ExternalDynamicScopeService.executeExternalGetSupportedClaimsMethods ( List< Scope dynamicScope)
inline
107  {
108  DynamicScopeExternalContext context = new DynamicScopeExternalContext(dynamicScope, null, null);
109 
110  Set<String> result = new HashSet<String>();
111  for (CustomScriptConfiguration customScriptConfiguration : getScriptsToExecute(context)) {
112  List<String> scriptResult = executeExternalGetSupportedClaimsMethod(customScriptConfiguration);
113  if (scriptResult != null) {
114  result.addAll(scriptResult);
115  }
116  }
117 
118  return new ArrayList<String>(result);
119  }
Set< CustomScriptConfiguration > getScriptsToExecute(DynamicScopeExternalContext context)
Definition: ExternalDynamicScopeService.java:77
List< String > executeExternalGetSupportedClaimsMethod(CustomScriptConfiguration customScriptConfiguration)
Definition: ExternalDynamicScopeService.java:59

◆ executeExternalUpdateMethod()

boolean org.xdi.oxauth.service.external.ExternalDynamicScopeService.executeExternalUpdateMethod ( CustomScriptConfiguration  customScriptConfiguration,
DynamicScopeExternalContext  dynamicScopeContext 
)
inline
45  {
46  try {
47  log.debug("Executing python 'update' method");
48  DynamicScopeType dynamicScopeType = (DynamicScopeType) customScriptConfiguration.getExternalType();
49  Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
50  return dynamicScopeType.update(dynamicScopeContext, configurationAttributes);
51  } catch (Exception ex) {
52  log.error(ex.getMessage(), ex);
53  saveScriptError(customScriptConfiguration.getCustomScript(), ex);
54  }
55 
56  return false;
57  }

◆ executeExternalUpdateMethods()

boolean org.xdi.oxauth.service.external.ExternalDynamicScopeService.executeExternalUpdateMethods ( DynamicScopeExternalContext  dynamicScopeContext)
inline
95  {
96  boolean result = true;
97  for (CustomScriptConfiguration customScriptConfiguration : getScriptsToExecute(dynamicScopeContext)) {
98  result &= executeExternalUpdateMethod(customScriptConfiguration, dynamicScopeContext);
99  if (!result) {
100  return result;
101  }
102  }
103 
104  return result;
105  }
Set< CustomScriptConfiguration > getScriptsToExecute(DynamicScopeExternalContext context)
Definition: ExternalDynamicScopeService.java:77
boolean executeExternalUpdateMethod(CustomScriptConfiguration customScriptConfiguration, DynamicScopeExternalContext dynamicScopeContext)
Definition: ExternalDynamicScopeService.java:45

◆ getScriptsToExecute()

Set<CustomScriptConfiguration> org.xdi.oxauth.service.external.ExternalDynamicScopeService.getScriptsToExecute ( DynamicScopeExternalContext  context)
inlineprivate
77  {
78  Set<String> allowedScripts = Sets.newHashSet();
79  for (org.xdi.oxauth.model.common.Scope scope : context.getScopes()) {
80  List<String> scopeScripts = scope.getDynamicScopeScripts();
81  if (scopeScripts != null) {
82  allowedScripts.addAll(scopeScripts);
83  }
84  }
85 
86  Set<CustomScriptConfiguration> result = Sets.newHashSet();
87  for (CustomScriptConfiguration script : this.customScriptConfigurations) {
88  if (allowedScripts.contains(script.getCustomScript().getDn())) {
89  result.add(script);
90  }
91  }
92  return result;
93  }
Definition: Scope.java:23
Definition: AuthenticationMethod.java:7

メンバ詳解

◆ serialVersionUID

final long org.xdi.oxauth.service.external.ExternalDynamicScopeService.serialVersionUID = 1416361273036208685L
staticprivate

このクラス詳解は次のファイルから抽出されました: