Package org.apache.airavata.rest.mappings.resourcemappings

Examples of org.apache.airavata.rest.mappings.resourcemappings.HostDescriptor


        List<String> gridFTPEndPoint = new ArrayList<String>();
        List<String> gateKeeperEndPoint  = new ArrayList<String>();
        List<String> imageID  = new ArrayList<String>();
        List<String> instanceID  = new ArrayList<String>();

        HostDescriptor hostDescriptor = new HostDescriptor();
        hostDescriptor.setHostname(hostDescription.getType().getHostName());
        hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());

        HostDescriptionType hostDescriptionType = hostDescription.getType();
        if (hostDescriptionType instanceof GlobusHostType){
            GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
            hostType.add(HostTypes.GLOBUS_HOST_TYPE);
            String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
            for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
                gateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
            }

            String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }else if (hostDescriptionType instanceof GsisshHostType){
            GsisshHostType gsisshHostType = (GsisshHostType) hostDescriptionType;
            hostType.add(HostTypes.GSISSH_HOST_TYPE);

            String[] gridFTPEndPointArray = gsisshHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }  else if (hostDescriptionType instanceof  SSHHostType) {
            hostType.add(HostTypes.SSH_HOST_TYPE);
        } else if (hostDescriptionType instanceof  UnicoreHostType) {
          UnicoreHostType unicoreHostType = (UnicoreHostType) hostDescriptionType;
             hostType.add(HostTypes.UNICORE_HOST_TYPE);
             String[] unicoreGateKeeperEndPointArray = unicoreHostType.getUnicoreHostAddressArray();
             for (int i = 0; i < unicoreGateKeeperEndPointArray.length ; i++){
                 gateKeeperEndPoint.add(unicoreGateKeeperEndPointArray[i]);
             }

             String[] gridFTPEndPointArray = unicoreHostType.getGridFTPEndPointArray();
             for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                 gridFTPEndPoint.add(gridFTPEndPointArray[i]);
             }
        }  else if (hostDescriptionType instanceof  Ec2HostType) {
            hostType.add(HostTypes.EC2_HOST_TYPE);
        } else {
            hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
        }
        hostDescriptor.setGateKeeperEndPoint(gateKeeperEndPoint);
        hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
        hostDescriptor.setImageID(imageID);
        hostDescriptor.setInstanceID(instanceID);
        hostDescriptor.setHostType(hostType);
        return hostDescriptor;
    }
View Full Code Here


        List<String> gridFTPEndPoint = new ArrayList<String>();
        List<String> globusGateKeeperEndPoint  = new ArrayList<String>();
        List<String> imageID  = new ArrayList<String>();
        List<String> instanceID  = new ArrayList<String>();

        HostDescriptor hostDescriptor = new HostDescriptor();
        hostDescriptor.setHostname(hostDescription.getType().getHostName());
        hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());

        HostDescriptionType hostDescriptionType = hostDescription.getType();
        if (hostDescriptionType instanceof GlobusHostType){
            GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
            hostType.add(HostTypes.GLOBUS_HOST_TYPE);
            String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
            for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
                globusGateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
            }

            String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }else if (hostDescriptionType instanceof GsisshHostType){
            GsisshHostType gsisshHostType = (GsisshHostType) hostDescriptionType;
            hostType.add(HostTypes.GSISSH_HOST_TYPE);

            String[] gridFTPEndPointArray = gsisshHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }  else if (hostDescriptionType instanceof  Ec2HostType) {
            Ec2HostType ec2HostType = (Ec2HostType) hostDescriptionType;
            hostType.add(HostTypes.EC2_HOST_TYPE);

            String[] imageIDArray = ec2HostType.getImageIDArray();
            for (int i = 0; i < imageIDArray.length ; i++){
                imageID.add(imageIDArray[i]);
            }

            String[] instanceIDArray = ec2HostType.getInstanceIDArray();
            for (int i = 0; i < instanceIDArray.length ; i++){
                instanceID.add(instanceIDArray[i]);
            }
        } else {
            hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
        }
        hostDescriptor.setGlobusGateKeeperEndPoint(globusGateKeeperEndPoint);
        hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
        hostDescriptor.setImageID(imageID);
        hostDescriptor.setInstanceID(instanceID);
        hostDescriptor.setHostType(hostType);
        return hostDescriptor;
    }
View Full Code Here

        List<String> gridFTPEndPoint = new ArrayList<String>();
        List<String> gateKeeperEndPoint  = new ArrayList<String>();
        List<String> imageID  = new ArrayList<String>();
        List<String> instanceID  = new ArrayList<String>();

        HostDescriptor hostDescriptor = new HostDescriptor();
        hostDescriptor.setHostname(hostDescription.getType().getHostName());
        hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());

        HostDescriptionType hostDescriptionType = hostDescription.getType();
        if (hostDescriptionType instanceof GlobusHostType){
            GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
            hostType.add(HostTypes.GLOBUS_HOST_TYPE);
            String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
            for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
                gateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
            }

            String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }else if (hostDescriptionType instanceof GsisshHostType){
            GsisshHostType gsisshHostType = (GsisshHostType) hostDescriptionType;
            hostType.add(HostTypes.GSISSH_HOST_TYPE);

            String[] gridFTPEndPointArray = gsisshHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }  else if (hostDescriptionType instanceof  SSHHostType) {
            hostType.add(HostTypes.SSH_HOST_TYPE);
        } else if (hostDescriptionType instanceof  UnicoreHostType) {
          UnicoreHostType unicoreHostType = (UnicoreHostType) hostDescriptionType;
             hostType.add(HostTypes.UNICORE_HOST_TYPE);
             String[] unicoreGateKeeperEndPointArray = unicoreHostType.getUnicoreBESEndPointArray();
             for (int i = 0; i < unicoreGateKeeperEndPointArray.length ; i++){
                 gateKeeperEndPoint.add(unicoreGateKeeperEndPointArray[i]);
             }

             String[] gridFTPEndPointArray = unicoreHostType.getGridFTPEndPointArray();
             for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                 gridFTPEndPoint.add(gridFTPEndPointArray[i]);
             }
        }  else if (hostDescriptionType instanceof  Ec2HostType) {
            hostType.add(HostTypes.EC2_HOST_TYPE);
        } else {
            hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
        }
        hostDescriptor.setGateKeeperEndPoint(gateKeeperEndPoint);
        hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
        hostDescriptor.setImageID(imageID);
        hostDescriptor.setInstanceID(instanceID);
        hostDescriptor.setHostType(hostType);
        return hostDescriptor;
    }
View Full Code Here

        List<String> gridFTPEndPoint = new ArrayList<String>();
        List<String> gateKeeperEndPoint  = new ArrayList<String>();
        List<String> imageID  = new ArrayList<String>();
        List<String> instanceID  = new ArrayList<String>();

        HostDescriptor hostDescriptor = new HostDescriptor();
        hostDescriptor.setHostname(hostDescription.getType().getHostName());
        hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());

        HostDescriptionType hostDescriptionType = hostDescription.getType();
        if (hostDescriptionType instanceof GlobusHostType){
            GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
            hostType.add(HostTypes.GLOBUS_HOST_TYPE);
            String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
            for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
                gateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
            }

            String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        }else if (hostDescriptionType instanceof GsisshHostType) {
            hostType.add(HostTypes.GSISSH_HOST_TYPE);
        } else if (hostDescriptionType instanceof SSHHostType) {
            hostType.add(HostTypes.SSH_HOST_TYPE);
            SSHHostType sshHostType = (SSHHostType) hostDescriptionType;
            hostDescriptor.setHpcResource(sshHostType.getHpcResource());
        } else if (hostDescriptionType instanceof UnicoreHostType) {
            UnicoreHostType unicoreHostType = (UnicoreHostType) hostDescriptionType;
            hostType.add(HostTypes.UNICORE_HOST_TYPE);
            String[] unicoreGateKeeperEndPointArray = unicoreHostType.getUnicoreBESEndPointArray();
            for (int i = 0; i < unicoreGateKeeperEndPointArray.length; i++) {
                gateKeeperEndPoint.add(unicoreGateKeeperEndPointArray[i]);
            }

            String[] gridFTPEndPointArray = unicoreHostType.getGridFTPEndPointArray();
            for (int i = 0; i < gridFTPEndPointArray.length; i++) {
                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
            }
        } else if (hostDescriptionType instanceof Ec2HostType) {
            hostType.add(HostTypes.EC2_HOST_TYPE);
        } else {
            hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
        }
        hostDescriptor.setGateKeeperEndPoint(gateKeeperEndPoint);
        hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
        hostDescriptor.setImageID(imageID);
        hostDescriptor.setInstanceID(instanceID);
        hostDescriptor.setHostType(hostType);
        return hostDescriptor;
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.rest.mappings.resourcemappings.HostDescriptor

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.