Early implementation of the new design

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@34300 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2011-01-27 01:52:11 +00:00
parent 106e858284
commit 5747a6b48f
13 changed files with 244 additions and 433 deletions

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="src/|build/|schema/|etc/|src/|lib/" kind="src" path=""/>
<classpathentry excluding="src/|build/|schema/|etc/|src/|lib/|test/" kind="src" path=""/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIBS"/>
<classpathentry combineaccessrules="false" kind="src" path="/DISTRO.RESOURCES"/>

View File

@ -48,7 +48,7 @@
</parameter>
<parameter>
<name>mode</name>
<value>pull</value>
<value>push</value>
</parameter>
<parameter>
<name>fileName</name>
@ -69,12 +69,7 @@
<name>resourceClass</name>
<value>org.gcube.informationsystem.registry.impl.state.ProfileResource
</value>
</parameter>
<parameter>
<name>persistenceDelegateClass</name>
<value>org.gcube.informationsystem.registry.impl.persistence.RegistryPersistenceDelegate
</value>
</parameter>
</parameter>
<parameter>
<name>sweeperDelay</name>
<value>10000</value>
@ -106,12 +101,7 @@
<name>resourceClass</name>
<value>org.gcube.informationsystem.registry.impl.state.RegistryFactoryResource
</value>
</parameter>
<parameter>
<name>persistenceDelegateClass</name>
<value>org.gcube.informationsystem.registry.impl.persistence.RegistryFactoryPersistenceDelegate
</value>
</parameter>
</parameter>
</resourceParams>

View File

@ -12,7 +12,7 @@
<parameter name="handlerClass" value="org.globus.axis.providers.RPCProvider"/>
<parameter name="scope" value="Application"/>
<parameter name="providers" value="GCUBEProvider SubscribeProvider DestroyProvider GetCurrentMessageProvider "/>
<parameter name="loadOnStartup" value="false"/>
<parameter name="loadOnStartup" value="true"/>
<!-- <parameter name="securityDescriptor" value="@config.dir@/security-descriptor-Service.xml"/> -->
</service>

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<securityConfig xmlns="http://www.globus.org" >
<authz value="none"/>
<method name="createResource">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="updateResource">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="removeResource">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="updateProfileWithDL">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="removeProfileWithDL">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="updateState">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="startRegistration">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="validateProfile">
<auth-method>
<GSISecureConversation>
</GSISecureConversation>
</auth-method>
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="getMultipleResourceProperties">
<auth-method>
<none/>
</auth-method>
</method>
<method name="queryResourceProperties">
<auth-method>
<none/>
</auth-method>
</method>
<method name="subscribe">
<auth-method>
<none/>
</auth-method>
</method>
<method name="getCurrentMessage">
<auth-method>
<none/>
</auth-method>
</method>
</securityConfig>

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<securityConfig xmlns="http://www.globus.org" >
<authz value="none"/>
<method name="getMultipleResourceProperties">
<auth-method>
<none/>
</auth-method>
</method>
<method name="queryResourceProperties">
<auth-method>
<none/>
</auth-method>
</method>
<method name="subscribe">
<auth-method>
<none/>
</auth-method>
</method>
<method name="getCurrentMessage">
<auth-method>
<none/>
</auth-method>
</method>
</securityConfig>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Registry"
targetNamespace="http://gcube-system.org/namespaces/informationsystem/registry"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/registry"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:provider="http://gcube-system.org/namespaces/common/core/porttypes/GCUBEProvider"
xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="http://gcube-system.org/namespaces/informationsystem/registry"
xmlns:tns="http://gcube-system.org/namespaces/informationsystem/registry"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="SchemaValidationFaultType"/>
<xsd:element name="SchemaValidationFault" type="SchemaValidationFaultType"/>
<xsd:complexType name="ResourceNotAcceptedFaultType"/>
<xsd:element name="ResourceNotAcceptedFault" type="ResourceNotAcceptedFaultType"/>
<xsd:complexType name="CreateFaultType"/>
<xsd:element name="CreateFault" type="CreateFaultType"/>
<xsd:complexType name="UpdateFaultType"/>
<xsd:element name="UpdateFault" type="UpdateFaultType"/>
<xsd:complexType name="RemoveFaultType"/>
<xsd:element name="RemoveFault" type="RemoveFaultType"/>
<xsd:complexType name="ResourceDoesNotExistFaultType"/>
<xsd:element name="ResourceDoesNotExistFault" type="ResourceDoesNotExistFaultType"/>
</xsd:schema>
</types>
<message name="CreateRequest">
<part name="request" element="tns:createResource"/>
</message>
<message name="CreateResponse">
<part name="response" element="tns:createResponse"/>
</message>
<message name="UpdateRequest">
<part name="request" element="tns:updateResource"/>
</message>
<message name="UpdateResponse">
<part name="response" element="tns:updateResponse"/>
</message>
<message name="RemoveRequest">
<part name="request" element="tns:removeResource"/>
</message>
<message name="RemoveResponse">
<part name="response" element="tns:removeResponse"/>
</message>
<message name="SchemaValidationFaultMessage">
<part name="fault" element="tns:SchemaValidationFault"/>
</message>
<message name="ResourceNotAcceptedFaultMessage">
<part name="fault" element="tns:ResourceNotAcceptedFault"/>
</message>
<message name="CreateFaultMessage">
<part name="fault" element="tns:CreateFault"/>
</message>
<message name="UpdateFaultMessage">
<part name="fault" element="tns:UpdateFault"/>
</message>
<message name="RemoveFaultMessage">
<part name="fault" element="tns:RemoveFault"/>
</message>
<message name="ResourceDoesNotExistFaultMessage">
<part name="fault" element="tns:ResourceDoesNotExistFault"/>
</message>
<!--============================================================
P O R T T Y P E
============================================================-->
<portType name="ResourceRegistrationPortType">
<operation name="create">
<input message="tns:CreateRequest"/>
<output message="tns:CreateResponse"/>
<fault name="fault" message="tns:SchemaValidationFaultMessage"/>
<fault name="fault" message="tns:ResourceNotAcceptedFaultMessage"/>
<fault name="fault" message="tns:CreateFaultMessage"/>
</operation>
<operation name="update">
<input message="tns:UpdateRequest"/>
<output message="tns:UpdateResponse"/>
<fault name="fault" message="tns:SchemaValidationFaultMessage"/>
<fault name="fault" message="tns:ResourceNotAcceptedFaultMessage"/>
<fault name="fault" message="tns:UpdateFaultMessage"/>
</operation>
<operation name="remove">
<input message="tns:RemoveRequest"/>
<output message="tns:RemoveResponse"/>
<fault name="fault" message="tns:RemoveFaultMessage"/>
<fault name="fault" message="tns:ResourceDoesNotExistFaultMessage"/>
</operation>
</portType>
</definitions>

View File

@ -158,7 +158,10 @@ public class ServiceContext extends GCUBEServiceContext {
/**
* Listeners for local events
* @throws Exception
*/
private void subscribeToLocalRegistrationEvents() throws Exception{
ISLocalPublisher pub = GHNContext.getImplementation(ISLocalPublisher.class);
LocalProfileConsumer cons = new LocalProfileConsumer() {
@ -167,21 +170,29 @@ public class ServiceContext extends GCUBEServiceContext {
* @see org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer#onProfileRegistered(org.gcube.common.core.resources.GCUBEResource)
*/
@Override
protected void onProfileRegistered(GCUBEResource resource, GCUBEScope scope) {
logger.debug("onProfileRegistered event received" );
RegistryFactory factory= new RegistryFactory();
try {
ServiceContext.getContext().setScope(scope);
CreateResourceMessage crm = new CreateResourceMessage();
StringWriter writer = new StringWriter();
resource.store(writer);
crm.setProfile(writer.toString());
crm.setType(resource.getType());
factory.createResource(crm);
logger.trace("create Event handled");
} catch (Exception e) {
logger.error("cannot handle the create resource event"+e);
}
protected void onProfileRegistered(final GCUBEResource resource, final GCUBEScope scope) {
logger.debug("onProfileRegistered event received in scope " + scope );
new Thread() {
@Override
public void run() {
ServiceContext.this.waitUntilReady();
RegistryFactory factory= new RegistryFactory();
try {
ServiceContext.getContext().setScope(scope);
CreateResourceMessage crm = new CreateResourceMessage();
StringWriter writer = new StringWriter();
resource.store(writer);
crm.setProfile(writer.toString());
crm.setType(resource.getType());
//crm.setScopes(new String[] {scope.toString()});
factory.createResource(crm);
} catch (Exception e) {
logger.error("cannot handle the create resource event"+e);
}
}
}.start();
}
@ -189,19 +200,25 @@ public class ServiceContext extends GCUBEServiceContext {
* @see org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer#onProfileRemoved(java.lang.String, java.lang.String)
*/
@Override
protected void onProfileRemoved(String resourceID, String type, GCUBEScope scope) {
ServiceContext.getContext().setScope(scope);
RegistryFactory factory= new RegistryFactory();
RemoveResourceMessage rrm= new RemoveResourceMessage();
rrm.setType(type);
rrm.setUniqueID(resourceID);
logger.trace("remove Event handled");
try {
factory.removeResource(rrm);
} catch (Exception e) {
logger.error("cannot handle the remove resource event"+e);
}
protected void onProfileRemoved(final String resourceID, final String type, final GCUBEScope scope) {
logger.debug("onProfileRemoved event received" );
new Thread() {
@Override
public void run() {
ServiceContext.this.waitUntilReady();
ServiceContext.getContext().setScope(scope);
RegistryFactory factory= new RegistryFactory();
RemoveResourceMessage rrm= new RemoveResourceMessage();
rrm.setType(type);
rrm.setUniqueID(resourceID);
try {
factory.removeResource(rrm);
} catch (Exception e) {
logger.error("cannot handle the remove resource event"+e);
}
}
}.start();
}
@ -209,28 +226,46 @@ public class ServiceContext extends GCUBEServiceContext {
* @see org.gcube.common.core.informationsystem.publisher.ISLocalPublisher.LocalProfileConsumer#onProfileUpdated(org.gcube.common.core.resources.GCUBEResource)
*/
@Override
protected void onProfileUpdated(GCUBEResource resource, GCUBEScope scope) {
protected void onProfileUpdated(final GCUBEResource resource, final GCUBEScope scope) {
logger.debug("onProfileUpdated event received" );
ServiceContext.getContext().setScope(scope);
RegistryFactory factory= new RegistryFactory();
try {
UpdateResourceMessage urm= new UpdateResourceMessage();
StringWriter writer = new StringWriter();
resource.store(writer);
urm.setXmlProfile(writer.toString());
urm.setType(resource.getType());
urm.setUniqueID(resource.getID());
factory.updateResource(urm);
logger.trace("Update Event handled");
} catch (Exception e) {
logger.error("cannot handle the update resource event"+e);
}
new Thread() {
@Override
public void run() {
ServiceContext.this.waitUntilReady();
ServiceContext.getContext().setScope(scope);
RegistryFactory factory= new RegistryFactory();
try {
UpdateResourceMessage urm= new UpdateResourceMessage();
StringWriter writer = new StringWriter();
resource.store(writer);
urm.setXmlProfile(writer.toString());
urm.setType(resource.getType());
urm.setUniqueID(resource.getID());
factory.updateResource(urm);
} catch (Exception e) {
logger.error("cannot handle the update resource event"+e);
}
}
}.start();
}
};
pub.subscribeLocalProfileEvents(cons);
}
private void waitUntilReady() {
while (true) {
if (ServiceContext.getContext().getStatus() != Status.READIED)
break;
else
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
break;
}
}
}
}

View File

@ -1,59 +0,0 @@
package org.gcube.informationsystem.registry.impl.persistence;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate;
import org.gcube.informationsystem.registry.impl.state.RegistryFactoryResource;
import org.gcube.informationsystem.registry.stubs.RegistryProperty;
import org.globus.wsrf.utils.SubscriptionPersistenceUtils;
public class RegistryFactoryPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<RegistryFactoryResource>{
protected void onLoad(RegistryFactoryResource resource, ObjectInputStream ois) throws Exception {
super.onLoad(resource, ois);
resource.setGLiteCE((RegistryProperty)ois.readObject());
resource.setGLiteSE((RegistryProperty)ois.readObject());
resource.setGLiteService((RegistryProperty)ois.readObject());
resource.setGLiteSite((RegistryProperty)ois.readObject());
resource.setCollection((RegistryProperty)ois.readObject());
resource.setCS((RegistryProperty)ois.readObject());
resource.setCSInstance((RegistryProperty)ois.readObject());
resource.setGHN((RegistryProperty)ois.readObject());
resource.setExternalRunningInstance((RegistryProperty)ois.readObject());
resource.setMetadataCollection((RegistryProperty)ois.readObject());
resource.setRunningInstance((RegistryProperty)ois.readObject());
resource.setService((RegistryProperty)ois.readObject());
resource.setVRE((RegistryProperty)ois.readObject());
resource.setGenericResource((RegistryProperty)ois.readObject());
SubscriptionPersistenceUtils.loadSubscriptionListeners(
resource.getTopicList(), ois);
}
protected void onStore(RegistryFactoryResource resource,ObjectOutputStream oos) throws Exception {
super.onStore(resource, oos);
oos.writeObject(resource.getGLiteCE());
oos.writeObject(resource.getGLiteSE());
oos.writeObject(resource.getGLiteService());
oos.writeObject(resource.getGLiteSite());
oos.writeObject(resource.getCollection());
oos.writeObject(resource.getCS());
oos.writeObject(resource.getCSInstance());
oos.writeObject(resource.getGHN());
oos.writeObject(resource.getExternalRunningInstance());
oos.writeObject(resource.getMetadataCollection());
oos.writeObject(resource.getRunningInstance());
oos.writeObject(resource.getService());
oos.writeObject(resource.getVRE());
oos.writeObject(resource.getGenericResource());
SubscriptionPersistenceUtils.storeSubscriptionListeners(
resource.getTopicList(), oos);
}
}

View File

@ -1,25 +0,0 @@
package org.gcube.informationsystem.registry.impl.persistence;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate;
import org.gcube.informationsystem.registry.impl.state.ProfileResource;
import org.w3c.dom.Document;
public class RegistryPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ProfileResource> {
protected void onLoad(ProfileResource resource, ObjectInputStream ois) throws Exception {
super.onLoad(resource, ois);
resource.setProfile((Document)ois.readObject());
//resource.setNotificationProfile(resource.getProfile());
}
protected void onStore(ProfileResource resource,ObjectOutputStream oos) throws Exception {
super.onStore(resource, oos);
oos.writeObject((Document)resource.getProfile());
}
}

View File

@ -20,6 +20,7 @@ import org.gcube.common.core.porttypes.GCUBEPortType;
import org.gcube.common.core.resources.GCUBEHostingNode;
import org.gcube.common.core.resources.GCUBEResource;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.state.GCUBEWSResourceKey;
import org.gcube.common.core.utils.events.GCUBEEvent;
import org.gcube.common.core.utils.logging.GCUBELog;
import org.gcube.informationsystem.registry.impl.contexts.FactoryContext;
@ -41,7 +42,8 @@ import org.gcube.informationsystem.registry.stubs.ResourceNotAcceptedFault;
import org.gcube.informationsystem.registry.stubs.SchemaValidationFault;
import org.gcube.informationsystem.registry.stubs.UpdateResourceMessage;
import org.gcube.informationsystem.registry.stubs.UpdateResourceResponse;
import static org.gcube.informationsystem.registry.impl.core.RegistryConfiguration.ResourceType;
import static org.gcube.informationsystem.registry.impl.state.Definitions.ResourceType;
/**
* Implementation of the <em>Registry Factory</em> portType
@ -112,7 +114,7 @@ public class RegistryFactory extends GCUBEPortType {
GCUBEResource resource = null;
logger.info("CreateResource operation invoked");
logger.info("CreateResource operation invoked in scope " + ServiceContext.getContext().getScope());
// logSecurityInfo("createResource");
String profile = mess.getProfile();
@ -173,9 +175,9 @@ public class RegistryFactory extends GCUBEPortType {
// try to create resource
try {
logger.debug("Creating the stateful resource N."+ ++resourceCounter + " for " + resource.getID());
ProfileResource presource = (ProfileResource) ProfileContext
.getContext().getWSHome().create(ProfileContext.getContext().makeKey(resource.getID()), resource);
GCUBEWSResourceKey key = ProfileContext.getContext().makeKey(resource.getID());
logger.trace("Resource key is " + key);
ProfileResource presource = (ProfileResource) ProfileContext.getContext().getWSHome().create(key, resource);
presource.store();
// Deleting the WSResource created if != from GHN || RI
@ -202,14 +204,15 @@ public class RegistryFactory extends GCUBEPortType {
StringWriter writer = new StringWriter();
try {
logger.debug("Persisting the stateful resource for " + resource.getID());
resource.store(writer);
logger.info("Profile " + resource.getID() + " created ");
return writer.toString();
} catch (Exception e) {
logger.error("Persistence failed for " + resource.getID(), e);
return null;
}
logger.info("Profile " + resource.getID() + " created ");
return writer.toString();
}
/**
@ -324,25 +327,19 @@ public class RegistryFactory extends GCUBEPortType {
String ID = inputMessage.getUniqueID();
String type = inputMessage.getType();
logger.info("RemoveResource operation invoked on resource ID=" + ID
+ ", type=" + type);
logger.info("RemoveResource operation invoked on resource ID=" + ID + ", type=" + type);
if (ID == null || ID.compareTo("") == 0) {
logger.warn("Resource ID is missing, cannot manage the resource");
throw new RemoteException(
"Resource ID is missing, cannot manage the resource");
throw new RemoteException("Resource ID is missing, cannot manage the resource");
}
//TODO: delete the profile with the GCUBEPublisher
try {
logger.debug("Trying to remove the resource from the IS-IC");
new ProfileManager().removeFromISIC(ID, type, ServiceContext
.getContext().getScope(), ServiceContext.getContext());
new ProfileManager().remove(ID, type, ServiceContext.getContext().getScope(), ServiceContext.getContext());
logger.info("Resource removed from the IS-IC");
} catch (Exception e) {
logger.error("Unable to remove the resource", e);
throw ServiceContext
.getContext()
.getDefaultException("", e)
.toFault(
throw ServiceContext.getContext().getDefaultException("", e).toFault(
"Unable to remove the resource: the remote IS-IC returned an error");
}
// if the resource is a GHN, remove also the related RIs
@ -354,16 +351,14 @@ public class RegistryFactory extends GCUBEPortType {
logger.debug("Related RIs removed");
}
} catch (Exception e) {
logger.error("Error while removing RI profiles related to the GHN",
e);
logger.error("Error while removing RI profiles related to the GHN", e);
}
if (this.isResourceCreated(ID)) {
// destroy the resource
try {
logger.debug("Destroying the local stateful Resoruce");
ProfileContext.getContext().getWSHome().remove(
ProfileContext.getContext().makeKey(ID));
ProfileContext.getContext().getWSHome().remove(ProfileContext.getContext().makeKey(ID));
logger.info(" Resource Destroyed");
} catch (Exception e) {
logger.error("Error removing resource for ID ", e);
@ -371,14 +366,11 @@ public class RegistryFactory extends GCUBEPortType {
}
try {
GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource> event = new GCUBEEvent<ServiceContext.RegistryTopic, GCUBEResource>();
GCUBEResource resource = ResourceType.valueOf(type)
.getResourceClass();
GCUBEResource resource = ResourceType.valueOf(type).getResourceClass();
resource.setID(ID);
event.setPayload(resource);
ServiceContext.getContext().getTopicProducer().notify(
ServiceContext.RegistryTopic.REMOVE, event);
updateCounterInfo(ID, ResourceType.valueOf(type),
OperationType.destroy, Calendar.getInstance(), null);
ServiceContext.getContext().getTopicProducer().notify(ServiceContext.RegistryTopic.REMOVE, event);
updateCounterInfo(ID, ResourceType.valueOf(type),OperationType.destroy, Calendar.getInstance(), null);
} catch (Exception e) {
logger.warn(
"Error updating counting info for resource with ID "

View File

@ -0,0 +1,14 @@
package org.gcube.informationsystem.registry.impl.porttypes;
import org.gcube.common.core.contexts.GCUBEServiceContext;
import org.gcube.common.core.porttypes.GCUBEPortType;
import org.gcube.informationsystem.registry.impl.contexts.ServiceContext;
public class ResourceRegistration extends GCUBEPortType {
@Override
protected GCUBEServiceContext getServiceContext() {
return ServiceContext.getContext();
}
}

View File

@ -11,6 +11,7 @@ import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.types.URI;
import org.gcube.common.core.contexts.GCUBERemotePortTypeContext;
import org.gcube.common.core.resources.GCUBEResource;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.core.scope.GCUBEScopeNotSupportedException;
import org.gcube.common.core.scope.ServiceMap;
@ -57,20 +58,21 @@ public class ProfileManager {
VOMapName = scope.getName();
}
public void add(GCUBEResource resource, GCUBEScope scope, GCUBEServiceSecurityManager manager) throws Exception {
}
/**
* Removes from IS-IC a GCUBEResource profile ( not knowing the Resurce Type
* the removal has been done once for every type of GCUBE Resource
* Removes a {@link GCUBEResource} from the IS
*
* @param uniqueID
* the uniqueID to of the GCUBEResource to remove
* @param type
* the type of Profile
* @param uniqueID the uniqueID to of the GCUBEResource to remove
* @param type the type of Profile
*
* @throws Exception
* if the unregistration fails
* @throws Exception if the unregistration fails
*/
public void removeFromISIC(String uniqueID, String type, GCUBEScope scope,
public void remove(String uniqueID, String type, GCUBEScope scope,
GCUBEServiceSecurityManager manager) throws Exception {
for (EndpointReferenceType sink : this.ICEprs) {
@ -94,7 +96,8 @@ public class ProfileManager {
// all the resource types
logger.debug(" trying to remove profile with UniqueID" + uniqueID);
for (int n = 0; n < ResourceTypes.values().length; n++) {
this.removeDocuments(isIcAddress, scope, new URI("gcube://resource"), new URI("gcube://Profiles/"+ ResourceTypes.values()[n].toString()), uniqueID);
this.removeDocuments(isIcAddress, scope, new URI("gcube://resource"),
new URI("gcube://Profiles/"+ ResourceTypes.values()[n].toString()), uniqueID);
}
} catch (Exception e) {
logger.error(
@ -131,7 +134,7 @@ public class ProfileManager {
stubs = new WsdaixServiceAddressingLocator().getXMLCollectionAccessPTPort(new URL(serviceURL));
stubs = GCUBERemotePortTypeContext.getProxy(stubs, scope);
} catch (Exception e) {
logger.error("Failed to get documentes", e);
logger.error("Failed to get documents", e);
}
return stubs.removeDocuments(request);
}

View File

@ -1,4 +1,4 @@
package org.gcube.informationsystem.registry.impl.core;
package org.gcube.informationsystem.registry.impl.state;
import org.gcube.common.core.contexts.GHNContext;
import org.gcube.common.core.resources.GCUBECS;
@ -14,24 +14,13 @@ import org.gcube.common.core.resources.GCUBEService;
/**
*
* Local Configuration of the IS-Registry
*
* @author Andrea Manzi, Manuele Simi (CNR)
* Collection of definitions
*
*/
public class RegistryConfiguration {
public class Definitions {
/** The root service to take care at service's startup */
public static enum ROOT_SERVICES {
ISIC() { public String getClazz() {return "InformationSystem";} public String getName() {return "IS-IC";}},
ISNOTIFIER() {public String getClazz() {return "InformationSystem";} public String getName() {return "IS-Notifier";}},
GHNMANAGER() {public String getClazz() {return "VREManagement";} public String getName() {return "GHNManager";}},
DEPLOYER() {public String getClazz() {return "VREManagement";} public String getName() {return "Deployer";}};
abstract public String getName();
abstract public String getClazz();
}
/** The Resource Type */
public static enum ResourceType {
@ -53,89 +42,6 @@ public class RegistryConfiguration {
};
/**
*
*/
private String profilesBase = null;
/**
*
*/
private String propertiesFile = null;
/**
*
*/
private String registrationType = null;
/**
*
*/
private int registrationRemovalInterval = 140;
/**
* Constructor
*/
public RegistryConfiguration () {}
/**
* Get the profile base folder
* @return the profile base folder
*/
public String getProfilesBase() {
return profilesBase;
}
/**
* Set the profile base folder
*
* @param b the profile base folder
*/
public void setProfilesBase(String b) {
profilesBase = b;
}
/**
* The propertie file dir
* @return The propertie file dir
*/
public String getPropertiesFile() {
return propertiesFile;
}
/**
* Set the propertyFile dir
* @param file the file
*/
public void setPropertiesFile(String file) {
propertiesFile = file;
}
/**
* Get The Registration Type
* @return The registration Type
*/
public String getRegistrationType() {
return registrationType;
}
/**
* Set registration Type
* @param type the registration Type
*/
public void setRegistrationType(String type) {
registrationType = type;
}
/**
* Set the Registration time
* @param sec the interval
*/
public void setRegistrationRemovalInterval(int sec) {
registrationRemovalInterval = sec;
}
/**
* Get the registration time interval
* @return The Registration time
*/
public int getRegistrationRemovalInterval() {
return registrationRemovalInterval;
}
}