This commit is contained in:
Lucio Lelii 2008-10-09 23:14:51 +00:00
parent 0f21b3a936
commit 1f6381d20f
1 changed files with 6 additions and 6 deletions

View File

@ -117,10 +117,8 @@ public class RegistryFactory{
* @throws ProfileAlreadyRegisteredFault
*/
public String createResource(CreateResourceMessage mess) throws SchemaValidationFault,RemoteException,ProfileAlreadyRegisteredFault {
GCUBEResource resource;
try {
resource = GHNContext.getImplementation(GCUBEResource.class);
}catch(Exception e) {throw new RemoteException("Error in GHNContext");}
GCUBEResource resource=null;
logger.info("CreateResource operation invoked");
logSecurityInfo("createResource");
@ -133,13 +131,15 @@ public class RegistryFactory{
throw new RemoteException(msg);
}
System.out.println("profile:" +profile);
try {
ResourceType.valueOf(mess.getType()).getResourceClass().getClass().cast(resource);
resource=ResourceType.valueOf(mess.getType()).getResourceClass();
resource.load(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(profile.getBytes("UTF-8")), "UTF-8")));
if (mess.getType().compareTo(GCUBEGenericResource.TYPE)==0){
System.out.println("profile:" +profile);
System.out.println("------------");
System.out.println(((GCUBEGenericResource) resource).getBody());
}
//the parse Profile class allows to extract from profiles information about type/SCOPE/UniqueID