Skip to content

Commit

Permalink
Merge pull request #1 from ruks/1.10.x.4
Browse files Browse the repository at this point in the history
1.10.x.4
  • Loading branch information
ruks committed Oct 28, 2015
2 parents 87afcc6 + 998623f commit ecf9b1c
Show file tree
Hide file tree
Showing 39 changed files with 418 additions and 373 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void initializeAuthenticator() {
authenticatorType = OAuthAuthenticator.class.getName();
}
try {
authenticator = (Authenticator) Class.forName(authenticatorType).newInstance();
authenticator = (Authenticator) APIUtil.getClassForName(authenticatorType);
} catch (Exception e) {
// Just throw it here - Synapse will handle it
throw new SynapseException("Error while initializing authenticator of " +
Expand Down
2 changes: 1 addition & 1 deletion components/apimgt/org.wso2.carbon.apimgt.impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
org.wso2.carbon.registry.ws.client.*,
org.apache.woden.*,
org.wso2.carbon.apimgt.keymgt.client.*;version="${carbon.apimgt.imp.pkg.version}",
org.wso2.carbon.apimgt.handlers.security.stub.*;version="${carbon.apimgt.stub.imp.pkg.version}",
org.wso2.carbon.apimgt.handlers.security.stub.*;version="${carbon.apimgt.imp.pkg.version}",
org.wso2.carbon.apimgt.api.*;version="${carbon.apimgt.imp.pkg.version}",
org.wso2.carbon.apimgt.api.model.xsd;version="${carbon.apimgt.imp.pkg.version}",
javax.servlet;version="${javax.servlet.imp.pkg.version}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,7 @@ public String getGroupIds(String response) throws APIManagementException{
String groupingExtractorClass = APIUtil.getGroupingExtractorImplementation();
if (groupingExtractorClass != null) {
try {
LoginPostExecutor groupingExtractor = (LoginPostExecutor)Class.forName(groupingExtractorClass).newInstance();
LoginPostExecutor groupingExtractor = (LoginPostExecutor)APIUtil.getClassForName(groupingExtractorClass);
return groupingExtractor.getGroupingIdentifiers(response);
} catch (ClassNotFoundException e) {
handleException(groupingExtractorClass+" is not found in run time", e);
Expand Down Expand Up @@ -2974,4 +2974,5 @@ private boolean getTenantConfigValue(String tenantDomain, JSONObject apiTenantCo

return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,7 @@ public boolean changeLifeCycleStatus(APIIdentifier apiIdentifier, String targetS
}
return true;
} catch (GovernanceException e) {
handleException("Failed to change the life cycle status : ", e);
handleException("Failed to change the life cycle status : " + e.getMessage(), e);
return false;
} finally {
PrivilegedCarbonContext.endTenantFlow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@

import java.rmi.RemoteException;

@SuppressWarnings("unused")
public class ApplicationManagementServiceClient {

private static final Log log = LogFactory.getLog(ApplicationManagementServiceClient.class);
boolean debugEnabled = log.isErrorEnabled();
private static final int TIMEOUT_IN_MILLIS = 15 * 60 * 1000;

private IdentityApplicationManagementServiceStub identityApplicationManagementServiceStub;
//String username;

public ApplicationManagementServiceClient() throws APIManagementException {
APIManagerConfiguration config = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService().
Expand All @@ -57,8 +57,8 @@ public ApplicationManagementServiceClient() throws APIManagementException {
try {

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
identityApplicationManagementServiceStub = new IdentityApplicationManagementServiceStub(ctx, serviceURL + "IdentityApplicationManagementService");

identityApplicationManagementServiceStub = new IdentityApplicationManagementServiceStub(ctx, serviceURL
+ "IdentityApplicationManagementService");
ServiceClient client = identityApplicationManagementServiceStub._getServiceClient();
Options options = client.getOptions();
options.setTimeOutInMilliSeconds(TIMEOUT_IN_MILLIS);
Expand All @@ -73,7 +73,10 @@ public ApplicationManagementServiceClient() throws APIManagementException {
}

/**
* @param serviceProvider
* This method is used to create application according to the given sp and user
*
* @param serviceProvider Service Provider
* @param username UserName of the user
* @throws Exception
*/
public void createApplication(ServiceProvider serviceProvider, String username) throws Exception {
Expand All @@ -94,8 +97,11 @@ public void createApplication(ServiceProvider serviceProvider, String username)
}

/**
* @param applicationName
* @return
* This method is used to get application details for given application name
*
* @param applicationName Name of the application
* @param username UserName of the user
* @return service provider
* @throws Exception
*/
public ServiceProvider getApplication(String applicationName, String username) throws Exception {
Expand All @@ -113,7 +119,10 @@ public ServiceProvider getApplication(String applicationName, String username) t
}

/**
* @return
* This method is used to get the application information of a given user
*
* @param username UserName of the user
* @return Basic information of the application as an array
* @throws Exception
*/
public ApplicationBasicInfo[] getAllApplicationBasicInfo(String username) throws Exception {
Expand All @@ -130,7 +139,10 @@ public ApplicationBasicInfo[] getAllApplicationBasicInfo(String username) throws
}

/**
* @param serviceProvider
* This method is used to update the application data
*
* @param serviceProvider Service Provider
* @param username UserName of the user
* @throws Exception
*/
public void updateApplicationData(ServiceProvider serviceProvider, String username) throws Exception {
Expand All @@ -147,7 +159,10 @@ public void updateApplicationData(ServiceProvider serviceProvider, String userna
}

/**
* @param applicationID
* This method is used to delete a given application
*
* @param applicationID application id
* @param username UserName of the user
* @throws Exception
*/
public void deleteApplication(String applicationID, String username) throws Exception {
Expand All @@ -165,7 +180,11 @@ public void deleteApplication(String applicationID, String username) throws Exce
}

/**
* @param identityProviderName
* This method is ued to retrieve federated identity providers
*
* @param identityProviderName Name of the idp
* @param username UserName of the user
* @return Identity Provider
* @throws Exception
*/
public IdentityProvider getFederatedIdentityProvider(String identityProviderName, String username)
Expand All @@ -175,7 +194,10 @@ public IdentityProvider getFederatedIdentityProvider(String identityProviderName
}

/**
* @return
* This method is used to get all request path authenticators
*
* @param username UserName of the user
* @return request path authenticators
* @throws Exception
*/
public RequestPathAuthenticatorConfig[] getAllRequestPathAuthenticators(String username) throws Exception {
Expand All @@ -184,7 +206,10 @@ public RequestPathAuthenticatorConfig[] getAllRequestPathAuthenticators(String u
}

/**
* @return
* This method is used to get all local authenticators
*
* @param username UserName of the user
* @return local authenticators
* @throws Exception
*/
public LocalAuthenticatorConfig[] getAllLocalAuthenticators(String username) throws Exception {
Expand All @@ -193,23 +218,29 @@ public LocalAuthenticatorConfig[] getAllLocalAuthenticators(String username) thr
}

/**
* @return
* This method is used to get all federated identity providers
*
* @param username UserName of the user
* @return federated identity providers
* @throws Exception
*/
public IdentityProvider[] getAllFederatedIdentityProvider(String username) throws Exception {
IdentityProvider[] idps = null;
IdentityProvider[] identityProviders;

try {
Util.setAuthHeaders(identityApplicationManagementServiceStub._getServiceClient(), username);
idps = identityApplicationManagementServiceStub.getAllIdentityProviders();
identityProviders = identityApplicationManagementServiceStub.getAllIdentityProviders();
} catch (Exception e) {
throw new Exception(e.getMessage());
}
return idps;
return identityProviders;
}

/**
* @return
* This method is used to get all claim uris
*
* @param username UserName of the user
* @return all claim uris
* @throws Exception
*/
public String[] getAllClaimUris(String username) throws Exception {
Expand Down

0 comments on commit ecf9b1c

Please sign in to comment.