Author: keith Date: Thu Jul 10 07:16:06 2008 New Revision: 19101 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=19101
Log: Using the keystorename from the server.xml directly without using the first keystore. Its better to do it this way Modified: trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java Modified: trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java?rev=19101&r1=19100&r2=19101&view=diff ============================================================================== --- trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java (original) +++ trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java Thu Jul 10 07:16:06 2008 @@ -30,10 +30,10 @@ import org.wso2.registry.users.UserStoreAdmin; import org.wso2.registry.users.UserStoreException; import org.wso2.utils.ServerException; +import org.wso2.utils.ServerConfiguration; import org.wso2.wsas.ServerInitializer; import org.wso2.wsas.admin.service.SecurityScenarioConfigAdmin; import org.wso2.wsas.persistence.PersistenceManager; -import org.wso2.wsas.persistence.dataobject.KeyStoreDO; import org.wso2.wsas.persistence.dataobject.ServiceDO; import org.wso2.wsas.persistence.dataobject.ServiceGroupDO; import org.wso2.wsas.persistence.dataobject.ServiceIdentifierDO; @@ -43,6 +43,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.io.File; public class MashupServerInitializer implements ServerInitializer { @@ -86,10 +87,17 @@ SecurityScenarioConfigAdmin admin = new SecurityScenarioConfigAdmin(); + ServerConfiguration serverConfig = ServerConfiguration.getInstance(); + + String keyStoreLocation = + serverConfig.getFirstProperty(MashupConstants.SECURITY_CONFIG + "." + + MashupConstants.SECURITY_CONFIG_KEYSTORE + "." + MashupConstants + .SECURITY_CONFIG_KEYSTORE_LOCATION); + // We need the name of the KeyStore in order to give its details for the policy. // Although there can be many keystores we use the default one - KeyStoreDO[] storeDOs = persistenceMgr.getKeyStores(); - String keyStoreName = storeDOs[0].getKeyStoreName(); + File file = new File(keyStoreLocation); + String keyStoreName = file.getName(); admin.assignUsersAndRolesAndKeyStores(MashupConstants.MASHUP_LOGIN_SERVICEUT, null, "scenario21", _______________________________________________ Mashup-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev
