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

公開メンバ関数

 ExternalUmaClaimsGatheringService ()
 
CustomScriptConfiguration determineScript (String[] scriptNames)
 
CustomScriptConfiguration getScriptByDn (String scriptDn)
 
CustomScriptConfiguration getScriptByInum (String inum)
 
boolean gather (CustomScriptConfiguration script, int step, UmaGatherContext context)
 
int getNextStep (CustomScriptConfiguration script, int step, UmaGatherContext context)
 
boolean prepareForStep (CustomScriptConfiguration script, int step, UmaGatherContext context)
 
int getStepsCount (CustomScriptConfiguration script, UmaGatherContext context)
 
String getPageForStep (CustomScriptConfiguration script, int step, UmaGatherContext context)
 

限定公開メンバ関数

void reloadExternal ()
 

限定公開変数類

Map< String, CustomScriptConfiguration > scriptInumMap
 

非公開メンバ関数

Map< String, CustomScriptConfiguration > buildExternalConfigurationsInumMap (List< CustomScriptConfiguration > customScriptConfigurations)
 
UmaClaimsGatheringType gatherScript (CustomScriptConfiguration script)
 

非公開変数類

Logger log
 
LookupService lookupService
 
CustomScriptManager scriptManager
 

詳解

著者
yuriyz on 06/18/2017.

構築子と解体子

◆ ExternalUmaClaimsGatheringService()

org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.ExternalUmaClaimsGatheringService ( )
inline
43  {
44  super(CustomScriptType.UMA_CLAIMS_GATHERING);
45  }

関数詳解

◆ buildExternalConfigurationsInumMap()

Map<String, CustomScriptConfiguration> org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.buildExternalConfigurationsInumMap ( List< CustomScriptConfiguration >  customScriptConfigurations)
inlineprivate
80  {
81  Map<String, CustomScriptConfiguration> reloadedExternalConfigurations = new HashMap<String, CustomScriptConfiguration>(customScriptConfigurations.size());
82 
83  for (CustomScriptConfiguration customScriptConfiguration : customScriptConfigurations) {
84  reloadedExternalConfigurations.put(customScriptConfiguration.getInum(), customScriptConfiguration);
85  }
86 
87  return reloadedExternalConfigurations;
88  }

◆ determineScript()

CustomScriptConfiguration org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.determineScript ( String []  scriptNames)
inline
52  {
53  log.trace("Trying to determine claims-gathering script, scriptNames: {} ...", Arrays.toString(scriptNames));
54 
55  List<CustomScriptConfiguration> scripts = new ArrayList<CustomScriptConfiguration>();
56 
57  for (String scriptName : scriptNames) {
58  CustomScriptConfiguration script = getCustomScriptConfigurationByName(scriptName);
59  if (script != null) {
60  scripts.add(script);
61  } else {
62  log.error("Failed to load claims-gathering script with name: {}", scriptName);
63  }
64  }
65 
66  if (scripts.isEmpty()) {
67  return null;
68  }
69 
70  CustomScriptConfiguration highestPriority = Collections.max(scripts, new Comparator<CustomScriptConfiguration>() {
71  @Override
72  public int compare(CustomScriptConfiguration o1, CustomScriptConfiguration o2) {
73  return Integer.compare(o1.getLevel(), o2.getLevel());
74  }
75  });
76  log.trace("Determined claims-gathering script successfully. Name: {}, inum: {}", highestPriority.getName(), highestPriority.getInum());
77  return highestPriority;
78  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35

◆ gather()

boolean org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.gather ( CustomScriptConfiguration  script,
int  step,
UmaGatherContext  context 
)
inline
108  {
109  try {
110  log.debug("Executing python 'gather' method, script: " + script.getName());
111  boolean result = gatherScript(script).gather(step, context);
112  log.debug("python 'gather' result: " + result);
113  return result;
114  } catch (Exception ex) {
115  log.error("Failed to execute python 'gather' method, script: " + script.getName() + ", message: " + ex.getMessage(), ex);
116  saveScriptError(script.getCustomScript(), ex);
117  return false;
118  }
119  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35
UmaClaimsGatheringType gatherScript(CustomScriptConfiguration script)
Definition: ExternalUmaClaimsGatheringService.java:104

◆ gatherScript()

UmaClaimsGatheringType org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.gatherScript ( CustomScriptConfiguration  script)
inlineprivate
104  {
105  return ExternalUmaRptPolicyService.HOTSWAP_UMA_SCRIPT ? (UmaClaimsGatheringType) ExternalUmaRptPolicyService.hotswap(scriptManager, script, false) : (UmaClaimsGatheringType) script.getExternalType();
106  }
CustomScriptManager scriptManager
Definition: ExternalUmaClaimsGatheringService.java:39

◆ getNextStep()

int org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.getNextStep ( CustomScriptConfiguration  script,
int  step,
UmaGatherContext  context 
)
inline
121  {
122  try {
123  log.debug("Executing python 'getNextStep' method, script: " + script.getName());
124  int result = gatherScript(script).getNextStep(step, context);
125  log.debug("python 'getNextStep' result: " + result);
126  return result;
127  } catch (Exception ex) {
128  log.error("Failed to execute python 'getNextStep' method, script: " + script.getName() + ", message: " + ex.getMessage(), ex);
129  saveScriptError(script.getCustomScript(), ex);
130  return -1;
131  }
132  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35
UmaClaimsGatheringType gatherScript(CustomScriptConfiguration script)
Definition: ExternalUmaClaimsGatheringService.java:104

◆ getPageForStep()

String org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.getPageForStep ( CustomScriptConfiguration  script,
int  step,
UmaGatherContext  context 
)
inline
160  {
161  try {
162  log.debug("Executing python 'getPageForStep' method, script: " + script.getName());
163  String result = gatherScript(script).getPageForStep(step, context);
164  log.debug("python 'getPageForStep' result: " + result);
165  return result;
166  } catch (Exception ex) {
167  log.error("Failed to execute python 'getPageForStep' method, script: " + script.getName() + ", message: " + ex.getMessage(), ex);
168  saveScriptError(script.getCustomScript(), ex);
169  return "";
170  }
171  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35
UmaClaimsGatheringType gatherScript(CustomScriptConfiguration script)
Definition: ExternalUmaClaimsGatheringService.java:104

◆ getScriptByDn()

CustomScriptConfiguration org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.getScriptByDn ( String  scriptDn)
inline
90  {
91  String authorizationPolicyInum = lookupService.getInumFromDn(scriptDn);
92 
93  return getScriptByInum(authorizationPolicyInum);
94  }
CustomScriptConfiguration getScriptByInum(String inum)
Definition: ExternalUmaClaimsGatheringService.java:96
LookupService lookupService
Definition: ExternalUmaClaimsGatheringService.java:37

◆ getScriptByInum()

CustomScriptConfiguration org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.getScriptByInum ( String  inum)
inline
96  {
97  if (StringHelper.isEmpty(inum)) {
98  return null;
99  }
100 
101  return this.scriptInumMap.get(inum);
102  }
Map< String, CustomScriptConfiguration > scriptInumMap
Definition: ExternalUmaClaimsGatheringService.java:41

◆ getStepsCount()

int org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.getStepsCount ( CustomScriptConfiguration  script,
UmaGatherContext  context 
)
inline
147  {
148  try {
149  log.debug("Executing python 'getStepsCount' method, script: " + script.getName());
150  int result = gatherScript(script).getStepsCount(context);
151  log.debug("python 'getStepsCount' result: " + result);
152  return result;
153  } catch (Exception ex) {
154  log.error("Failed to execute python 'getStepsCount' method, script: " + script.getName() + ", message: " + ex.getMessage(), ex);
155  saveScriptError(script.getCustomScript(), ex);
156  return -1;
157  }
158  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35
UmaClaimsGatheringType gatherScript(CustomScriptConfiguration script)
Definition: ExternalUmaClaimsGatheringService.java:104

◆ prepareForStep()

boolean org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.prepareForStep ( CustomScriptConfiguration  script,
int  step,
UmaGatherContext  context 
)
inline
134  {
135  try {
136  log.debug("Executing python 'prepareForStep' method, script: " + script.getName());
137  boolean result = gatherScript(script).prepareForStep(step, context);
138  log.debug("python 'prepareForStep' result: " + result);
139  return result;
140  } catch (Exception ex) {
141  log.error("Failed to execute python 'prepareForStep' method, script: " + script.getName() + ", message: " + ex.getMessage(), ex);
142  saveScriptError(script.getCustomScript(), ex);
143  return false;
144  }
145  }
Logger log
Definition: ExternalUmaClaimsGatheringService.java:35
UmaClaimsGatheringType gatherScript(CustomScriptConfiguration script)
Definition: ExternalUmaClaimsGatheringService.java:104

◆ reloadExternal()

void org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.reloadExternal ( )
inlineprotected
48  {
49  this.scriptInumMap = buildExternalConfigurationsInumMap(this.customScriptConfigurations);
50  }
Map< String, CustomScriptConfiguration > buildExternalConfigurationsInumMap(List< CustomScriptConfiguration > customScriptConfigurations)
Definition: ExternalUmaClaimsGatheringService.java:80
Map< String, CustomScriptConfiguration > scriptInumMap
Definition: ExternalUmaClaimsGatheringService.java:41

メンバ詳解

◆ log

Logger org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.log
private

◆ lookupService

LookupService org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.lookupService
private

◆ scriptInumMap

Map<String, CustomScriptConfiguration> org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.scriptInumMap
protected

◆ scriptManager

CustomScriptManager org.xdi.oxauth.service.external.ExternalUmaClaimsGatheringService.scriptManager
private

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