Methods Summary |
---|
public static WSTrustClientContract | createWSTrustClientContract(Configuration config)return a concrete implementor for WS-Trust Client Contract
return new WSTrustClientContractImpl(config);
|
public static com.sun.xml.ws.api.security.trust.config.STSConfiguration | getRuntimeSTSConfiguration()
STSConfigurationProvider configProvider = null;
final ServiceFinder<STSConfigurationProvider> finder =
ServiceFinder.find(STSConfigurationProvider.class);
if (finder != null && finder.toArray().length > 0) {
configProvider = finder.toArray()[0];
}
if (configProvider != null){
return configProvider.getSTSConfiguration();
}
return null;
|
public static com.sun.xml.ws.api.security.trust.STSAttributeProvider | getSTSAttributeProvider()Returns the single instance of STSAttributeProvider
Use the usual services mechanism to find implementing class. If not
found, use com.sun.xml.ws.security.trust.impl.DefaultSTSAttributeProvider
by default.
STSAttributeProvider attrProvider = null;
final ServiceFinder<STSAttributeProvider> finder =
ServiceFinder.find(STSAttributeProvider.class);
if (finder != null && finder.toArray().length > 0) {
attrProvider = finder.toArray()[0];
} else {
attrProvider = new DefaultSTSAttributeProvider();
}
return attrProvider;
|
public static com.sun.xml.ws.api.security.trust.STSAuthorizationProvider | getSTSAuthorizationProvider()Returns the single instance of STSAuthorizationProvider
Use the usual services mechanism to find implementing class. If not
found, use com.sun.xml.ws.security.trust.impl.DefaultSTSAuthorizationProvider
by default.
STSAuthorizationProvider authzProvider = null;
final ServiceFinder<STSAuthorizationProvider> finder =
ServiceFinder.find(STSAuthorizationProvider.class);
if (finder != null && finder.toArray().length > 0) {
authzProvider = finder.toArray()[0];
} else {
authzProvider = new DefaultSTSAuthorizationProvider();
}
return authzProvider;
|
public static TrustPlugin | newTrustPlugin(Configuration config)return a concrete implementation for the TrustPlugin.
return new TrustPluginImpl(config);
|
public static com.sun.xml.ws.api.security.trust.WSTrustContract | newWSTrustContract(com.sun.xml.ws.api.security.trust.config.STSConfiguration config, java.lang.String appliesTo)Return a concrete implementor of WSTrustContract.
Note: This contract is based on JAXB Beans generated for ws-trust.xsd schema elements
//final STSConfiguration stsConfig = (STSConfiguration)config;
//TrustSPMetadata spMetadata = stsConfig.getTrustSPMetadata(appliesTo);
// if(spMetadata == null){
// spMetadata = stsConfig.getTrustSPMetadata(WSTrustConstants.DEFAULT_APPLIESTO);
// }
//if (config. == null){
// log.log(Level.SEVERE,
// LogStringsMessages.WST_0004_UNKNOWN_SERVICEPROVIDER(appliesTo));
// throw new WSTrustException(LogStringsMessages.WST_0004_UNKNOWN_SERVICEPROVIDER(appliesTo));
// }
String type = config.getType();
if(log.isLoggable(Level.FINE)) {
log.log(Level.FINE,
LogStringsMessages.WST_1002_PROVIDER_TYPE(type));
}
WSTrustContract<RequestSecurityToken, RequestSecurityTokenResponse> contract = null;
try {
Class clazz = null;
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
clazz = Class.forName(type);
} else {
clazz = loader.loadClass(type);
}
if (clazz != null) {
contract = (WSTrustContract<RequestSecurityToken, RequestSecurityTokenResponse>) clazz.newInstance();
contract.init(config);
}
} catch (ClassNotFoundException ex) {
contract = null;
log.log(Level.SEVERE,
LogStringsMessages.WST_0005_CLASSNOTFOUND_NULL_CONTRACT(type), ex);
throw new WSTrustException(LogStringsMessages.WST_0005_CLASSNOTFOUND_NULL_CONTRACT(type), ex);
} catch (Exception ex) {
log.log(Level.SEVERE,
LogStringsMessages.WST_0038_INIT_CONTRACT_FAIL(), ex);
throw new WSTrustException(LogStringsMessages.WST_0038_INIT_CONTRACT_FAIL(), ex);
}
return contract;
|