removed new is call to create context

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/vre-deploy@183526 82a268e6-3cf1-43bd-a215-b396298e98cf
master
Massimiliano Assante 4 years ago
parent 16c47d31ca
commit 3ea6221167

@ -46,11 +46,6 @@
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-context-client</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>

@ -2,14 +2,8 @@ package org.gcube.portlets.admin.vredeployer.server;
import java.util.List;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.portal.mailing.EmailNotification;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.informationsystem.model.impl.entity.ContextImpl;
import org.gcube.informationsystem.model.reference.entity.Context;
import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClient;
import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClientFactory;
import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.RoleManager;
import org.gcube.vomanagement.usermanagement.UserManager;
@ -17,7 +11,6 @@ import org.gcube.vomanagement.usermanagement.exception.RoleRetrievalFault;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayRoleManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.gcube.vomanagement.usermanagement.model.GatewayRolesNames;
import org.slf4j.Logger;
@ -53,36 +46,36 @@ public class NewVRECreatedThread implements Runnable {
@Override
public void run() {
handleVRECreatedNotificationEmail(creatorUserName, creatorFullName, vreScope);
handleVRECreatedContextAddonResourceRegistry(vreScope, vreName, currentScopeGroupId);
//handleVRECreatedContextAddonResourceRegistry(vreScope, vreName, currentScopeGroupId);
}
private void handleVRECreatedContextAddonResourceRegistry(String vreScope, String vreName, long currentScopeGroupId) {
try {
final GCubeGroup voGroup = gm.getGroup(currentScopeGroupId);
String currentScope = gm.getInfrastructureScope(currentScopeGroupId);
_log.debug("handleVRECreatedContextAddonResourceRegistry, VO Scope= " + currentScope);
ScopeProvider.instance.set(currentScope);
ResourceRegistryContextClient rrClient = ResourceRegistryContextClientFactory.create();
Context context = new ContextImpl(vreName);
List<Context> contexts = rrClient.all();
Context parent = null;
for(Context c : contexts){
if(c.getName().compareTo(voGroup.getGroupName()) == 0){
parent = c;
break;
}
}
_log.debug("setting parent as= " + parent.getName());
context.setParent(parent);
_log.debug("creating context: " + context.toString());
rrClient.create(context);
_log.debug("created context OK");
} catch (Exception e) {
_log.error("an error occurred wehn creating new context on Resource Registry" , e);
}
}
// private void handleVRECreatedContextAddonResourceRegistry(String vreScope, String vreName, long currentScopeGroupId) {
// try {
// final GCubeGroup voGroup = gm.getGroup(currentScopeGroupId);
//
// String currentScope = gm.getInfrastructureScope(currentScopeGroupId);
// _log.debug("handleVRECreatedContextAddonResourceRegistry, VO Scope= " + currentScope);
// ScopeProvider.instance.set(currentScope);
// ResourceRegistryContextClient rrClient = ResourceRegistryContextClientFactory.create();
// Context context = new ContextImpl(vreName);
//
// List<Context> contexts = rrClient.all();
// Context parent = null;
// for(Context c : contexts){
// if(c.getName().compareTo(voGroup.getGroupName()) == 0){
// parent = c;
// break;
// }
// }
// _log.debug("setting parent as= " + parent.getName());
// context.setParent(parent);
// _log.debug("creating context: " + context.toString());
// rrClient.create(context);
// _log.debug("created context OK");
// } catch (Exception e) {
// _log.error("an error occurred wehn creating new context on Resource Registry" , e);
// }
// }
private void handleVRECreatedNotificationEmail(String newUserUserName, String newUserFullName, String vreScope) {

Loading…
Cancel
Save