Package org.apache.airavata.persistance.registry.jpa.resources

Examples of org.apache.airavata.persistance.registry.jpa.resources.ApplicationDescriptorResource


            String applicationName = descriptor.getType().getApplicationName().getStringValue();
            applicationName = createAppName(serviceName, hostName, applicationName);
            if (!isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
                throw new DescriptorDoesNotExistsException(applicationName);
            }
            ApplicationDescriptorResource serviceDescriptorResource = gateway.getApplicationDescriptorResource(applicationName);
            serviceDescriptorResource.setContent(descriptor.toXML());
            serviceDescriptorResource.save();
        }
    }
View Full Code Here


            String applicationName = descriptor.getType().getApplicationName().getStringValue();
            applicationName = createAppName(serviceName, hostName, applicationName);
            if (isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
                throw new DescriptorAlreadyExistsException(applicationName);
            }
            ApplicationDescriptorResource applicationDescriptorResource = gateway.createApplicationDescriptorResource(applicationName);
            applicationDescriptorResource.setUpdatedUser(workerResource.getUser());
            applicationDescriptorResource.setServiceDescName(serviceName);
            applicationDescriptorResource.setHostDescName(hostName);
            applicationDescriptorResource.setContent(descriptor.toXML());
            applicationDescriptorResource.save();
        }
    }
View Full Code Here

        gatewayResource = super.getGatewayResource();
    }

    @Test
    public void testSave() throws Exception {
        ApplicationDescriptorResource applicationDescriptorResouce = (ApplicationDescriptorResource) gatewayResource.create(ResourceType.APPLICATION_DESCRIPTOR);
        applicationDescriptorResouce.setHostDescName("testHostDesc");
        applicationDescriptorResouce.setServiceDescName("testServiceDesc");
        applicationDescriptorResouce.setName("testAppDesc");
        applicationDescriptorResouce.setContent("testContent");
        applicationDescriptorResouce.setUpdatedUser("admin");
        applicationDescriptorResouce.save();

        assertTrue("application descriptor saved successfully", gatewayResource.isExists(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));

        gatewayResource.remove(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc");
    }
View Full Code Here

            String applicationName = descriptor.getType().getApplicationName().getStringValue();
            applicationName = createAppName(serviceName, hostName, applicationName);
            if (isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
                throw new DescriptorAlreadyExistsException(applicationName);
            }
            ApplicationDescriptorResource applicationDescriptorResource = gateway.createApplicationDescriptorResource(applicationName);
            applicationDescriptorResource.setUpdatedUser(workerResource.getUser());
            applicationDescriptorResource.setServiceDescName(serviceName);
            applicationDescriptorResource.setHostDescName(hostName);
            applicationDescriptorResource.setContent(descriptor.toXML());
            applicationDescriptorResource.save();
        }
    }
View Full Code Here

            String applicationName = descriptor.getType().getApplicationName().getStringValue();
            applicationName = createAppName(serviceName, hostName, applicationName);
            if (!isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
                throw new DescriptorDoesNotExistsException(applicationName);
            }
            ApplicationDescriptorResource serviceDescriptorResource = gateway.getApplicationDescriptorResource(applicationName);
            serviceDescriptorResource.setContent(descriptor.toXML());
            serviceDescriptorResource.save();
        }
    }
View Full Code Here

        super.setUp();
        gatewayResource = super.getGatewayResource();
    }

    public void testSave() throws Exception {
        ApplicationDescriptorResource applicationDescriptorResouce = (ApplicationDescriptorResource) gatewayResource.create(ResourceType.APPLICATION_DESCRIPTOR);
        applicationDescriptorResouce.setHostDescName("testHostDesc");
        applicationDescriptorResouce.setServiceDescName("testServiceDesc");
        applicationDescriptorResouce.setName("testAppDesc");
        applicationDescriptorResouce.setContent("testContent");
        applicationDescriptorResouce.setUpdatedUser("admin");
        applicationDescriptorResouce.save();

        assertTrue("application descriptor saved successfully", gatewayResource.isExists(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));

        gatewayResource.remove(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc");
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.resources.ApplicationDescriptorResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.