public String saveHostDescription(HostDescription host) { Session session = null; String result = null; try { session = getSession(); Node hostNode = getHostNode(session); Node node = getOrAddNode(hostNode, host.getType().getHostName()); node.setProperty(XML_PROPERTY_NAME, host.toXML()); session.save(); result = node.getIdentifier(); triggerObservers(this); } catch (Exception e) { System.out.println(e); e.printStackTrace(); // TODO propagate } finally { closeSession(session); } return result; }
public static HostDescription createHostDescription(String hostName, String hostAddress, String hostEndpoint, String gatekeeperEndpoint, String providerType) { HostDescription host = new HostDescription(); host.getType().setHostName(hostName); host.getType().setHostAddress(hostAddress); if(providerType.equalsIgnoreCase(HostTypes.GLOBUS_HOST_TYPE)){ host.getType().changeType(GlobusHostType.type); ((GlobusHostType) host.getType()). setGridFTPEndPointArray(new String[]{hostEndpoint}); ((GlobusHostType) host.getType()). setGlobusGateKeeperEndPointArray(new String[]{gatekeeperEndpoint}); }else if (providerType.equalsIgnoreCase(HostTypes.SSH_HOST_TYPE)){ host.getType().changeType(SSHHostType.type); }else if (providerType.equalsIgnoreCase(HostTypes.UNICORE_HOST_TYPE)){ host.getType().changeType(GlobusHostType.type); ((UnicoreHostType) host.getType()). setGridFTPEndPointArray(new String[]{hostEndpoint}); ((UnicoreHostType) host.getType()). setUnicoreBESEndPointArray(new String[]{gatekeeperEndpoint}); } return host; }
for (HostDescription hostDesc : deploymentDescription.keySet()) { result = hostDesc; log.info("Found service on: " + result.getType().getHostAddress());
hostDescriptor.setHostname(hostDescription.getType().getHostName()); hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());
public HostDescription(SchemaType type) { this(); this.hostDocument.getHostDescription().changeType(type); }
/** * Sets the "hostDescription" element */ public void setHostDescription(org.apache.airavata.schemas.gfac.HostDescriptionType hostDescription) { synchronized (monitor()) { check_orphaned(); org.apache.airavata.schemas.gfac.HostDescriptionType target = null; target = (org.apache.airavata.schemas.gfac.HostDescriptionType)get_store().find_element_user(HOSTDESCRIPTION$0, 0); if (target == null) { target = (org.apache.airavata.schemas.gfac.HostDescriptionType)get_store().add_element_user(HOSTDESCRIPTION$0); } target.set(hostDescription); } }
app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName()); } catch (RegistryException e2) { e2.printStackTrace(); String hostName = host.getType().getHostAddress(); try { if (GfacUtils.isLocalHost(hostName)) {
public HostDescription(SchemaType type) { this(); this.hostDocument.getHostDescription().changeType(type); }
throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName()); } else { logger.error(response.getEntity(String.class)); throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName());
public static HostDescription createHostDescription (HostDescriptor hostDescriptor){ HostDescription hostDescription = new HostDescription(HostDescriptionType.type); hostDescription.getType().setHostAddress(hostDescriptor.getHostAddress()); hostDescription.getType().setHostName(hostDescriptor.getHostname()); hostDescription.getType().changeType(GlobusHostType.type); if (!hostDescriptor.getGateKeeperEndPoint().isEmpty() && hostDescriptor.getGateKeeperEndPoint() != null){ ((GlobusHostType) hostDescription.getType()).addGlobusGateKeeperEndPoint(hostDescriptor.getGateKeeperEndPoint().get(0)); hostDescription.getType().changeType(GsisshHostType.type); } else if (hostDescriptor.getHostType().get(0).equals(HostTypes.EC2_HOST_TYPE)) { hostDescription.getType().changeType(Ec2HostType.type); if (!hostDescriptor.getImageID().isEmpty() && hostDescriptor.getImageID() != null ){ ((Ec2HostType) hostDescription).addImageID(hostDescriptor.getImageID().get(0)); hostDescription.getType().changeType(SSHHostType.type); ((SSHHostType)hostDescription.getType()).setHpcResource(hostDescriptor.isHpcResource()); } else if (hostDescriptor.getHostType().get(0).equals(HostTypes.UNICORE_HOST_TYPE)) { hostDescription.getType().changeType(UnicoreHostType.type); if (!hostDescriptor.getGateKeeperEndPoint().isEmpty() && hostDescriptor.getGateKeeperEndPoint() != null){ ((UnicoreHostType) hostDescription.getType()).addUnicoreBESEndPoint(hostDescriptor.getGateKeeperEndPoint().get(0));
if (hostDescription instanceof GlobusHostType) { gridFTPTransfer(context, uri, srcFilePath); } else if (GfacUtils.isLocalHost(hostDescription.getHostAddress())) { updateFile(context, uri, srcFilePath);
ApplicationDescription descriptor) { ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor); applicationDescriptor.setHostdescName(hostDescriptor.getType().getHostName()); ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription); applicationDescriptor.setServiceDescriptor(serviceDescriptor);
if (hostDescription instanceof GlobusHostType) { gridFTPTransfer(context, uri, destFilePath); } else if (GfacUtils.isLocalHost(hostDescription.getHostAddress())) { downloadFile(context, uri, destFilePath);
ApplicationDescription descriptor) throws DescriptorAlreadyExistsException { ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor); applicationDescriptor.setHostdescName(hostDescriptor.getType().getHostName()); ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription); applicationDescriptor.setServiceDescriptor(serviceDescriptor);
private Session getSession(InvocationContext context) throws IOException { try { /* * if it is connected, create a session Note: one client can have multiple session (on one channel) */ if (ssh.isConnected()) return ssh.startSession(); if (sshContext == null) { sshContext = ((SSHSecurityContextImpl) context.getSecurityContext(SSH_SECURITY_CONTEXT)); } KeyProvider pkey = ssh.loadKeys(sshContext.getPrivateKeyLoc(), sshContext.getKeyPass()); ssh.loadKnownHosts(); ssh.authPublickey(sshContext.getUsername(), pkey); ssh.connect(context.getExecutionDescription().getHost().getType().getHostAddress()); return ssh.startSession(); } catch (NullPointerException ne) { throw new SecurityException("Cannot load security context for SSH", ne); } }
gridFTPEndpointArray = new String[]{hostType.getHostAddress()};