Package org.apache.airavata.registry.api

Examples of org.apache.airavata.registry.api.AiravataRegistry2


     */
    @DELETE
    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI)
    @Produces(MediaType.TEXT_PLAIN)
    public Response unsetMessageBoxURI() {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            airavataRegistry.unsetMessageBoxURI();
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity("MessageBox URI deleted successfully...");
            return builder.build();
        } catch (Throwable e) {
            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI, e);
View Full Code Here


     */
    @GET
    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS)
    @Produces(MediaType.TEXT_PLAIN)
    public Response isHostDescriptorExists(@QueryParam("hostDescriptorName") String hostDescriptorName) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        boolean state;
        try {
            state = airavataRegistry.isHostDescriptorExists(hostDescriptorName);
            if (state) {
                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
                builder.entity("True");
                return builder.build();
            } else {
View Full Code Here

    @POST
    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_SAVE)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response addHostDescriptor(HostDescriptor host) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            HostDescription hostDescription = DescriptorUtil.createHostDescription(host);
            airavataRegistry.addHostDescriptor(hostDescription);
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity("Host descriptor saved successfully...");
            return builder.build();
        } catch (DescriptorAlreadyExistsException e) {
            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
View Full Code Here

    @POST
    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_UPDATE)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response updateHostDescriptor(HostDescriptor host) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            HostDescription hostDescription = DescriptorUtil.createHostDescription(host);
            airavataRegistry.updateHostDescriptor(hostDescription);
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity("Host descriptor updated successfully...");
            return builder.build();
        } catch (DescriptorDoesNotExistsException e) {
            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
View Full Code Here

    @GET
    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response getHostDescriptor(@QueryParam("hostName") String hostName) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            HostDescription hostDescription = airavataRegistry.getHostDescriptor(hostName);
            if (hostDescription != null) {
                HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescription);
                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
                builder.entity(hostDescriptor);
                return builder.build();
View Full Code Here

     */
    @DELETE
    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE)
    @Produces(MediaType.TEXT_PLAIN)
    public Response removeHostDescriptor(@QueryParam("hostName") String hostName) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            airavataRegistry.removeHostDescriptor(hostName);
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity("Host descriptor deleted successfully...");
            return builder.build();
        } catch (DescriptorDoesNotExistsException e) {
            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
View Full Code Here

    @GET
    @Path(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response getHostDescriptors() {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            List<HostDescription> hostDescriptionList = airavataRegistry.getHostDescriptors();
            HostDescriptionList list = new HostDescriptionList();
            HostDescriptor[] hostDescriptions = new HostDescriptor[hostDescriptionList.size()];
            for (int i = 0; i < hostDescriptionList.size(); i++) {
                HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescriptionList.get(i));
                hostDescriptions[i] = hostDescriptor;
View Full Code Here

     */
    @GET
    @Path(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS_NAMES)
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response getHostDescriptorNames() {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            List<HostDescription> hostDescriptionList = airavataRegistry.getHostDescriptors();
            List<String> hostDescriptorNames = new ArrayList<String>();
            DescriptorNameList descriptorNameList = new DescriptorNameList();
            for (HostDescription aHostDescriptionList : hostDescriptionList) {
                hostDescriptorNames.add(aHostDescriptionList.getType().getHostName());
            }
View Full Code Here

     */
    @GET
    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS)
    @Produces(MediaType.TEXT_PLAIN)
    public Response isServiceDescriptorExists(@QueryParam("serviceDescriptorName") String serviceDescriptorName) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        boolean state;
        try {
            state = airavataRegistry.isServiceDescriptorExists(serviceDescriptorName);
            if (state) {
                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
                builder.entity("True");
                return builder.build();
            } else {
View Full Code Here

    @POST
    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE)
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response addServiceDescriptor(ServiceDescriptor service) {
        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
        try {
            ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(service);
            airavataRegistry.addServiceDescriptor(serviceDescription);
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity("Service descriptor saved successfully...");
            return builder.build();
        } catch (DescriptorAlreadyExistsException e) {
            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.AiravataRegistry2

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.