use of org.wso2.carbon.identity.api.server.application.management.v1.CustomInboundProtocolMetaData in project identity-api-server by wso2.
the class ServerApplicationMetadataService method getCustomProtocolMetadata.
/**
* Pull property metadata of the custom inbound protocol that matches to the protocol name.
*
* @param inboundProtocolName URL encoded protocol name.
* @return Populated CustomInboundProtocolMetaData object.
*/
public CustomInboundProtocolMetaData getCustomProtocolMetadata(String inboundProtocolName) {
String protocolName = URLDecoder.decode(inboundProtocolName);
Map<String, AbstractInboundAuthenticatorConfig> allCustomAuthenticators = ApplicationManagementServiceHolder.getApplicationManagementService().getAllInboundAuthenticatorConfig();
// Loop through all custom inbound protocols and match the name.
for (Map.Entry<String, AbstractInboundAuthenticatorConfig> entry : allCustomAuthenticators.entrySet()) {
if (entry.getValue().getName().equals(protocolName)) {
return new CustomInboundProtocolMetaData().displayName(entry.getValue().getFriendlyName()).configName(entry.getValue().getConfigName()).properties(getCustomInboundProtocolProperties(entry.getValue().getConfigurationProperties()));
}
}
// Throw 404 error if the protocol not found
throw handleInvalidInboundProtocol(inboundProtocolName);
}
Aggregations