Repository: airavata Updated Branches: refs/heads/master b393df565 -> de8487878
Remove axis2 script form distribution and move AbstractSecurityContext to context sub package Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/de848787 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/de848787 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/de848787 Branch: refs/heads/master Commit: de8487878e90d5d16a89428c144a25f2b5c34a17 Parents: b393df5 Author: Shameera Rathanyaka <[email protected]> Authored: Fri Jun 5 15:20:38 2015 -0400 Committer: Shameera Rathanyaka <[email protected]> Committed: Fri Jun 5 15:20:38 2015 -0400 ---------------------------------------------------------------------- distribution/src/main/assembly/bin-assembly.xml | 20 - .../gfac/bes/security/X509SecurityContext.java | 2 +- .../gfac/core/AbstractSecurityContext.java | 57 --- ...ava~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa | 475 ------------------- .../airavata/gfac/core/JobDescriptor.java~HEAD | 475 ------------------- ...ava~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa | 52 -- .../gfac/core/JobManagerConfiguration.java~HEAD | 52 -- ...ava~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa | 34 -- .../gfac/core/cluster/CommandInfo.java~HEAD | 34 -- ...ava~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa | 49 -- .../gfac/core/cluster/CommandOutput.java~HEAD | 49 -- ...ava~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa | 65 --- .../gfac/core/cluster/ServerInfo.java~HEAD | 65 --- .../core/context/AbstractSecurityContext.java | 59 +++ .../gsissh/security/GSISecurityContext.java | 2 +- 15 files changed, 61 insertions(+), 1429 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/distribution/src/main/assembly/bin-assembly.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/assembly/bin-assembly.xml b/distribution/src/main/assembly/bin-assembly.xml index 498f6c3..86a7315 100644 --- a/distribution/src/main/assembly/bin-assembly.xml +++ b/distribution/src/main/assembly/bin-assembly.xml @@ -106,26 +106,6 @@ </includes> </fileSet> - <!-- ********************** Copy Axis2 startup scripts to stand alone server - ********************** --> - <fileSet> - <directory>src/main/resources/axis2-standalone-bin</directory> - <outputDirectory>bin</outputDirectory> - <fileMode>777</fileMode> - <includes> - <include>*.sh</include> - <include>*.bat</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/resources/conf</directory> - <outputDirectory>bin</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - <!-- ********************** Copy samples ********************** --> <fileSet> <directory>${project.build.directory}/samples/applications http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/X509SecurityContext.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/X509SecurityContext.java b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/X509SecurityContext.java index 7d9c754..ff60e99 100644 --- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/X509SecurityContext.java +++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/X509SecurityContext.java @@ -26,7 +26,7 @@ import org.apache.airavata.common.utils.ServerSettings; import org.apache.airavata.credential.store.credential.Credential; import org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential; import org.apache.airavata.credential.store.store.CredentialReader; -import org.apache.airavata.gfac.core.AbstractSecurityContext; +import org.apache.airavata.gfac.core.context.AbstractSecurityContext; import org.apache.airavata.gfac.core.Constants; import org.apache.airavata.gfac.core.GFacException; import org.apache.airavata.gfac.core.RequestData; http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/AbstractSecurityContext.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/AbstractSecurityContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/AbstractSecurityContext.java deleted file mode 100644 index bc9c21a..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/AbstractSecurityContext.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.airavata.gfac.core; - -/** - * User: AmilaJ ([email protected]) - * Date: 6/26/13 - * Time: 4:33 PM - */ - -import java.io.Serializable; - -import org.apache.airavata.credential.store.store.CredentialReader; - -/** - * Abstract implementation of the security context. - */ -public abstract class AbstractSecurityContext implements SecurityContext, Serializable { - - private CredentialReader credentialReader; - private RequestData requestData; - - public AbstractSecurityContext(CredentialReader credentialReader, RequestData requestData) { - this.credentialReader = credentialReader; - this.requestData = requestData; - } - public AbstractSecurityContext() { - - } - - public CredentialReader getCredentialReader() { - return credentialReader; - } - - public RequestData getRequestData() { - return requestData; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa deleted file mode 100644 index 678f41f..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa +++ /dev/null @@ -1,475 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ -package org.apache.airavata.gfac.core; - -import org.apache.airavata.gfac.core.cluster.CommandOutput; -import org.apache.airavata.gfac.core.x2012.x12.AfterAnyList; -import org.apache.airavata.gfac.core.x2012.x12.AfterOKList; -import org.apache.airavata.gfac.core.x2012.x12.InputList; -import org.apache.airavata.gfac.core.x2012.x12.JobDescriptorDocument; -import org.apache.xmlbeans.XmlException; - -import java.util.List; - -/** - * This class define a job with required parameters, based on this configuration API is generating a Pbs script and - * submit the job to the computing resource - */ -public class JobDescriptor { - - private JobDescriptorDocument jobDescriptionDocument; - - - public JobDescriptor() { - jobDescriptionDocument = JobDescriptorDocument.Factory.newInstance(); - jobDescriptionDocument.addNewJobDescriptor(); - } - - public JobDescriptor(JobDescriptorDocument jobDescriptorDocument) { - this.jobDescriptionDocument = jobDescriptorDocument; - } - - - public JobDescriptor(CommandOutput commandOutput) { - jobDescriptionDocument = JobDescriptorDocument.Factory.newInstance(); - jobDescriptionDocument.addNewJobDescriptor(); - } - - - public String toXML() { - return jobDescriptionDocument.xmlText(); - } - - public JobDescriptorDocument getJobDescriptorDocument() { - return this.jobDescriptionDocument; - } - - /** - * With new app catalog thrift object integration, we don't use this - * @param xml - * @return - * @throws XmlException - */ - @Deprecated - public static JobDescriptor fromXML(String xml) - throws XmlException { - JobDescriptorDocument parse = JobDescriptorDocument.Factory - .parse(xml); - JobDescriptor jobDescriptor = new JobDescriptor(parse); - return jobDescriptor; - } - - - //todo write bunch of setter getters to set and get jobdescription parameters - public void setWorkingDirectory(String workingDirectory) { - this.getJobDescriptorDocument().getJobDescriptor().setWorkingDirectory(workingDirectory); - } - - public String getWorkingDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getWorkingDirectory(); - } - - public void setShellName(String shellName) { - this.getJobDescriptorDocument().getJobDescriptor().setShellName(shellName); - } - - public void setJobName(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setJobName(name); - } - - public void setExecutablePath(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setExecutablePath(name); - } - - public void setAllEnvExport(boolean name) { - this.getJobDescriptorDocument().getJobDescriptor().setAllEnvExport(name); - } - - public void setMailOptions(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setMailOptions(name); - } - - public void setStandardOutFile(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setStandardOutFile(name); - } - - public void setStandardErrorFile(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setStandardErrorFile(name); - } - - public void setNodes(int name) { - this.getJobDescriptorDocument().getJobDescriptor().setNodes(name); - } - - public void setProcessesPerNode(int name) { - this.getJobDescriptorDocument().getJobDescriptor().setProcessesPerNode(name); - } - - public String getOutputDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getOutputDirectory(); - } - - public String getInputDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getInputDirectory(); - } - public void setOutputDirectory(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setOutputDirectory(name); - } - - public void setInputDirectory(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setInputDirectory(name); - } - - /** - * Users can pass the minute count for maxwalltime - * @param minutes - */ - public void setMaxWallTime(String minutes) { - this.getJobDescriptorDocument().getJobDescriptor().setMaxWallTime( - GFacUtils.maxWallTimeCalculator(Integer.parseInt(minutes))); - - } - - - public void setMaxWallTimeForLSF(String minutes) { - this.getJobDescriptorDocument().getJobDescriptor().setMaxWallTime( - GFacUtils.maxWallTimeCalculatorForLSF(Integer.parseInt(minutes))); - - } - public void setAcountString(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setAcountString(name); - } - - public void setInputValues(List<String> inputValue) { - InputList inputList = this.getJobDescriptorDocument().getJobDescriptor().addNewInputs(); - inputList.setInputArray(inputValue.toArray(new String[inputValue.size()])); - } - - public void setJobID(String jobID) { - this.getJobDescriptorDocument().getJobDescriptor().setJobID(jobID); - } - - public void setQueueName(String queueName) { - this.getJobDescriptorDocument().getJobDescriptor().setQueueName(queueName); - } - - public void setStatus(String queueName) { - this.getJobDescriptorDocument().getJobDescriptor().setStatus(queueName); - } - - public void setAfterAnyList(String[] afterAnyList) { - AfterAnyList afterAny = this.getJobDescriptorDocument().getJobDescriptor().addNewAfterAny(); - afterAny.setAfterAnyArray(afterAnyList); - } - - public void setAfterOKList(String[] afterOKList) { - AfterOKList afterAnyList = this.getJobDescriptorDocument().getJobDescriptor().addNewAfterOKList(); - afterAnyList.setAfterOKListArray(afterOKList); - } - public void setCTime(String cTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCTime(cTime); - } - public void setQTime(String qTime) { - this.getJobDescriptorDocument().getJobDescriptor().setQTime(qTime); - } - public void setMTime(String mTime) { - this.getJobDescriptorDocument().getJobDescriptor().setMTime(mTime); - } - public void setSTime(String sTime) { - this.getJobDescriptorDocument().getJobDescriptor().setSTime(sTime); - } - public void setCompTime(String compTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCompTime(compTime); - } - public void setOwner(String owner) { - this.getJobDescriptorDocument().getJobDescriptor().setOwner(owner); - } - public void setExecuteNode(String executeNode) { - this.getJobDescriptorDocument().getJobDescriptor().setExecuteNode(executeNode); - } - public void setEllapsedTime(String ellapsedTime) { - this.getJobDescriptorDocument().getJobDescriptor().setEllapsedTime(ellapsedTime); - } - - public void setUsedCPUTime(String usedCPUTime) { - this.getJobDescriptorDocument().getJobDescriptor().setUsedCPUTime(usedCPUTime); - } - public void setCPUCount(int usedCPUTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCpuCount(usedCPUTime); - } - public void setUsedMemory(String usedMemory) { - this.getJobDescriptorDocument().getJobDescriptor().setUsedMem(usedMemory); - } - public void setVariableList(String variableList) { - this.getJobDescriptorDocument().getJobDescriptor().setVariableList(variableList); - } - public void setSubmitArgs(String submitArgs) { - this.getJobDescriptorDocument().getJobDescriptor().setSubmitArgs(submitArgs); - } - - public void setPreJobCommands(String[] commands){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPreJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().setCommandArray(commands); - } - - public void setPostJobCommands(String[] commands){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPostJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().setCommandArray(commands); - } - - public void setModuleLoadCommands(String[] commands) { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() == null) { - this.getJobDescriptorDocument().getJobDescriptor().addNewModuleLoadCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().setCommandArray(commands); - } - - public void addModuleLoadCommands(String command) { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() == null) { - this.getJobDescriptorDocument().getJobDescriptor().addNewModuleLoadCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().addCommand(command); - } - - public void addPreJobCommand(String command){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPreJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().addCommand(command); - } - - public void addPostJobCommand(String command){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPostJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().addCommand(command); - } - - public void setPartition(String partition){ - this.getJobDescriptorDocument().getJobDescriptor().setPartition(partition); - } - - public void setUserName(String userName){ - this.getJobDescriptorDocument().getJobDescriptor().setUserName(userName); - } - public void setNodeList(String nodeList){ - this.getJobDescriptorDocument().getJobDescriptor().setNodeList(nodeList); - } - public void setJobSubmitter(String jobSubmitter){ - this.getJobDescriptorDocument().getJobDescriptor().setJobSubmitterCommand(jobSubmitter); - } - public String getNodeList(){ - return this.getJobDescriptorDocument().getJobDescriptor().getNodeList(); - } - public String getExecutablePath() { - return this.getJobDescriptorDocument().getJobDescriptor().getExecutablePath(); - } - - public boolean getAllEnvExport() { - return this.getJobDescriptorDocument().getJobDescriptor().getAllEnvExport(); - } - - public String getMailOptions() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailOptions(); - } - - public String getStandardOutFile() { - return this.getJobDescriptorDocument().getJobDescriptor().getStandardOutFile(); - } - - public String getStandardErrorFile() { - return this.getJobDescriptorDocument().getJobDescriptor().getStandardErrorFile(); - } - - public int getNodes(int name) { - return this.getJobDescriptorDocument().getJobDescriptor().getNodes(); - } - - public int getCPUCount(int name) { - return this.getJobDescriptorDocument().getJobDescriptor().getCpuCount(); - } - - public int getProcessesPerNode() { - return this.getJobDescriptorDocument().getJobDescriptor().getProcessesPerNode(); - } - - public String getMaxWallTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getMaxWallTime(); - } - - public String getAcountString() { - return this.getJobDescriptorDocument().getJobDescriptor().getAcountString(); - } - - public String[] getInputValues() { - return this.getJobDescriptorDocument().getJobDescriptor().getInputs().getInputArray(); - } - - public String getJobID() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - public String getQueueName() { - return this.getJobDescriptorDocument().getJobDescriptor().getQueueName(); - } - - public String getStatus() { - return this.getJobDescriptorDocument().getJobDescriptor().getStatus(); - } - - public String[] getAfterAnyList() { - return this.getJobDescriptorDocument().getJobDescriptor().getAfterAny().getAfterAnyArray(); - } - - public String[] getAfterOKList() { - return this.getJobDescriptorDocument().getJobDescriptor().getAfterOKList().getAfterOKListArray(); - } - public String getCTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getCTime(); - } - public String getQTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getQTime(); - } - public String getMTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getMTime(); - } - public String getSTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getSTime(); - } - public String getCompTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getCompTime(); - } - public String getOwner() { - return this.getJobDescriptorDocument().getJobDescriptor().getOwner(); - } - public String getExecuteNode() { - return this.getJobDescriptorDocument().getJobDescriptor().getExecuteNode(); - } - public String getEllapsedTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getEllapsedTime(); - } - - public String getUsedCPUTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getUsedCPUTime(); - } - - public String getUsedMemory() { - return this.getJobDescriptorDocument().getJobDescriptor().getUsedMem(); - } - public void getShellName() { - this.getJobDescriptorDocument().getJobDescriptor().getShellName(); - } - - public String getJobName() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobName(); - } - - public String getJobId() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - - public String getVariableList() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - public String getSubmitArgs() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - public String[] getPostJobCommands(){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().getCommandArray(); - } - return null; - } - - public String[] getModuleCommands() { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().getCommandArray(); - } - return null; - } - - public String[] getPreJobCommands(){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().getCommandArray(); - } - return null; - } - - public String getJobSubmitterCommand(){ - return this.getJobDescriptorDocument().getJobDescriptor().getJobSubmitterCommand(); - } - - public String getPartition(){ - return this.getJobDescriptorDocument().getJobDescriptor().getPartition(); - } - - public String getUserName(){ - return this.getJobDescriptorDocument().getJobDescriptor().getUserName(); - } - - public void setCallBackIp(String ip){ - this.jobDescriptionDocument.getJobDescriptor().setCallBackIp(ip); - } - - public void setCallBackPort(String ip){ - this.jobDescriptionDocument.getJobDescriptor().setCallBackPort(ip); - } - - - public String getCallBackIp(){ - return this.jobDescriptionDocument.getJobDescriptor().getCallBackIp(); - } - public String getCallBackPort(){ - return this.jobDescriptionDocument.getJobDescriptor().getCallBackPort(); - } - - public void setMailType(String emailType) { - this.getJobDescriptorDocument().getJobDescriptor().setMailType(emailType); - } - - public String getMailType() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailType(); - } - public void setMailAddress(String emailAddress) { - this.getJobDescriptorDocument().getJobDescriptor().setMailAddress(emailAddress); - } - - public String getMailAddress() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailAddress(); - } - - public String getChassisName() { - return this.getJobDescriptorDocument().getJobDescriptor().getChassisName(); - } - - public void setChassisName(String chassisName){ - this.getJobDescriptorDocument().getJobDescriptor().setChassisName(chassisName); - } - - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~HEAD ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~HEAD b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~HEAD deleted file mode 100644 index 678f41f..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobDescriptor.java~HEAD +++ /dev/null @@ -1,475 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ -package org.apache.airavata.gfac.core; - -import org.apache.airavata.gfac.core.cluster.CommandOutput; -import org.apache.airavata.gfac.core.x2012.x12.AfterAnyList; -import org.apache.airavata.gfac.core.x2012.x12.AfterOKList; -import org.apache.airavata.gfac.core.x2012.x12.InputList; -import org.apache.airavata.gfac.core.x2012.x12.JobDescriptorDocument; -import org.apache.xmlbeans.XmlException; - -import java.util.List; - -/** - * This class define a job with required parameters, based on this configuration API is generating a Pbs script and - * submit the job to the computing resource - */ -public class JobDescriptor { - - private JobDescriptorDocument jobDescriptionDocument; - - - public JobDescriptor() { - jobDescriptionDocument = JobDescriptorDocument.Factory.newInstance(); - jobDescriptionDocument.addNewJobDescriptor(); - } - - public JobDescriptor(JobDescriptorDocument jobDescriptorDocument) { - this.jobDescriptionDocument = jobDescriptorDocument; - } - - - public JobDescriptor(CommandOutput commandOutput) { - jobDescriptionDocument = JobDescriptorDocument.Factory.newInstance(); - jobDescriptionDocument.addNewJobDescriptor(); - } - - - public String toXML() { - return jobDescriptionDocument.xmlText(); - } - - public JobDescriptorDocument getJobDescriptorDocument() { - return this.jobDescriptionDocument; - } - - /** - * With new app catalog thrift object integration, we don't use this - * @param xml - * @return - * @throws XmlException - */ - @Deprecated - public static JobDescriptor fromXML(String xml) - throws XmlException { - JobDescriptorDocument parse = JobDescriptorDocument.Factory - .parse(xml); - JobDescriptor jobDescriptor = new JobDescriptor(parse); - return jobDescriptor; - } - - - //todo write bunch of setter getters to set and get jobdescription parameters - public void setWorkingDirectory(String workingDirectory) { - this.getJobDescriptorDocument().getJobDescriptor().setWorkingDirectory(workingDirectory); - } - - public String getWorkingDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getWorkingDirectory(); - } - - public void setShellName(String shellName) { - this.getJobDescriptorDocument().getJobDescriptor().setShellName(shellName); - } - - public void setJobName(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setJobName(name); - } - - public void setExecutablePath(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setExecutablePath(name); - } - - public void setAllEnvExport(boolean name) { - this.getJobDescriptorDocument().getJobDescriptor().setAllEnvExport(name); - } - - public void setMailOptions(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setMailOptions(name); - } - - public void setStandardOutFile(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setStandardOutFile(name); - } - - public void setStandardErrorFile(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setStandardErrorFile(name); - } - - public void setNodes(int name) { - this.getJobDescriptorDocument().getJobDescriptor().setNodes(name); - } - - public void setProcessesPerNode(int name) { - this.getJobDescriptorDocument().getJobDescriptor().setProcessesPerNode(name); - } - - public String getOutputDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getOutputDirectory(); - } - - public String getInputDirectory() { - return this.getJobDescriptorDocument().getJobDescriptor().getInputDirectory(); - } - public void setOutputDirectory(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setOutputDirectory(name); - } - - public void setInputDirectory(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setInputDirectory(name); - } - - /** - * Users can pass the minute count for maxwalltime - * @param minutes - */ - public void setMaxWallTime(String minutes) { - this.getJobDescriptorDocument().getJobDescriptor().setMaxWallTime( - GFacUtils.maxWallTimeCalculator(Integer.parseInt(minutes))); - - } - - - public void setMaxWallTimeForLSF(String minutes) { - this.getJobDescriptorDocument().getJobDescriptor().setMaxWallTime( - GFacUtils.maxWallTimeCalculatorForLSF(Integer.parseInt(minutes))); - - } - public void setAcountString(String name) { - this.getJobDescriptorDocument().getJobDescriptor().setAcountString(name); - } - - public void setInputValues(List<String> inputValue) { - InputList inputList = this.getJobDescriptorDocument().getJobDescriptor().addNewInputs(); - inputList.setInputArray(inputValue.toArray(new String[inputValue.size()])); - } - - public void setJobID(String jobID) { - this.getJobDescriptorDocument().getJobDescriptor().setJobID(jobID); - } - - public void setQueueName(String queueName) { - this.getJobDescriptorDocument().getJobDescriptor().setQueueName(queueName); - } - - public void setStatus(String queueName) { - this.getJobDescriptorDocument().getJobDescriptor().setStatus(queueName); - } - - public void setAfterAnyList(String[] afterAnyList) { - AfterAnyList afterAny = this.getJobDescriptorDocument().getJobDescriptor().addNewAfterAny(); - afterAny.setAfterAnyArray(afterAnyList); - } - - public void setAfterOKList(String[] afterOKList) { - AfterOKList afterAnyList = this.getJobDescriptorDocument().getJobDescriptor().addNewAfterOKList(); - afterAnyList.setAfterOKListArray(afterOKList); - } - public void setCTime(String cTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCTime(cTime); - } - public void setQTime(String qTime) { - this.getJobDescriptorDocument().getJobDescriptor().setQTime(qTime); - } - public void setMTime(String mTime) { - this.getJobDescriptorDocument().getJobDescriptor().setMTime(mTime); - } - public void setSTime(String sTime) { - this.getJobDescriptorDocument().getJobDescriptor().setSTime(sTime); - } - public void setCompTime(String compTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCompTime(compTime); - } - public void setOwner(String owner) { - this.getJobDescriptorDocument().getJobDescriptor().setOwner(owner); - } - public void setExecuteNode(String executeNode) { - this.getJobDescriptorDocument().getJobDescriptor().setExecuteNode(executeNode); - } - public void setEllapsedTime(String ellapsedTime) { - this.getJobDescriptorDocument().getJobDescriptor().setEllapsedTime(ellapsedTime); - } - - public void setUsedCPUTime(String usedCPUTime) { - this.getJobDescriptorDocument().getJobDescriptor().setUsedCPUTime(usedCPUTime); - } - public void setCPUCount(int usedCPUTime) { - this.getJobDescriptorDocument().getJobDescriptor().setCpuCount(usedCPUTime); - } - public void setUsedMemory(String usedMemory) { - this.getJobDescriptorDocument().getJobDescriptor().setUsedMem(usedMemory); - } - public void setVariableList(String variableList) { - this.getJobDescriptorDocument().getJobDescriptor().setVariableList(variableList); - } - public void setSubmitArgs(String submitArgs) { - this.getJobDescriptorDocument().getJobDescriptor().setSubmitArgs(submitArgs); - } - - public void setPreJobCommands(String[] commands){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPreJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().setCommandArray(commands); - } - - public void setPostJobCommands(String[] commands){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPostJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().setCommandArray(commands); - } - - public void setModuleLoadCommands(String[] commands) { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() == null) { - this.getJobDescriptorDocument().getJobDescriptor().addNewModuleLoadCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().setCommandArray(commands); - } - - public void addModuleLoadCommands(String command) { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() == null) { - this.getJobDescriptorDocument().getJobDescriptor().addNewModuleLoadCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().addCommand(command); - } - - public void addPreJobCommand(String command){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPreJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().addCommand(command); - } - - public void addPostJobCommand(String command){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() == null){ - this.getJobDescriptorDocument().getJobDescriptor().addNewPostJobCommands(); - } - this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().addCommand(command); - } - - public void setPartition(String partition){ - this.getJobDescriptorDocument().getJobDescriptor().setPartition(partition); - } - - public void setUserName(String userName){ - this.getJobDescriptorDocument().getJobDescriptor().setUserName(userName); - } - public void setNodeList(String nodeList){ - this.getJobDescriptorDocument().getJobDescriptor().setNodeList(nodeList); - } - public void setJobSubmitter(String jobSubmitter){ - this.getJobDescriptorDocument().getJobDescriptor().setJobSubmitterCommand(jobSubmitter); - } - public String getNodeList(){ - return this.getJobDescriptorDocument().getJobDescriptor().getNodeList(); - } - public String getExecutablePath() { - return this.getJobDescriptorDocument().getJobDescriptor().getExecutablePath(); - } - - public boolean getAllEnvExport() { - return this.getJobDescriptorDocument().getJobDescriptor().getAllEnvExport(); - } - - public String getMailOptions() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailOptions(); - } - - public String getStandardOutFile() { - return this.getJobDescriptorDocument().getJobDescriptor().getStandardOutFile(); - } - - public String getStandardErrorFile() { - return this.getJobDescriptorDocument().getJobDescriptor().getStandardErrorFile(); - } - - public int getNodes(int name) { - return this.getJobDescriptorDocument().getJobDescriptor().getNodes(); - } - - public int getCPUCount(int name) { - return this.getJobDescriptorDocument().getJobDescriptor().getCpuCount(); - } - - public int getProcessesPerNode() { - return this.getJobDescriptorDocument().getJobDescriptor().getProcessesPerNode(); - } - - public String getMaxWallTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getMaxWallTime(); - } - - public String getAcountString() { - return this.getJobDescriptorDocument().getJobDescriptor().getAcountString(); - } - - public String[] getInputValues() { - return this.getJobDescriptorDocument().getJobDescriptor().getInputs().getInputArray(); - } - - public String getJobID() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - public String getQueueName() { - return this.getJobDescriptorDocument().getJobDescriptor().getQueueName(); - } - - public String getStatus() { - return this.getJobDescriptorDocument().getJobDescriptor().getStatus(); - } - - public String[] getAfterAnyList() { - return this.getJobDescriptorDocument().getJobDescriptor().getAfterAny().getAfterAnyArray(); - } - - public String[] getAfterOKList() { - return this.getJobDescriptorDocument().getJobDescriptor().getAfterOKList().getAfterOKListArray(); - } - public String getCTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getCTime(); - } - public String getQTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getQTime(); - } - public String getMTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getMTime(); - } - public String getSTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getSTime(); - } - public String getCompTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getCompTime(); - } - public String getOwner() { - return this.getJobDescriptorDocument().getJobDescriptor().getOwner(); - } - public String getExecuteNode() { - return this.getJobDescriptorDocument().getJobDescriptor().getExecuteNode(); - } - public String getEllapsedTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getEllapsedTime(); - } - - public String getUsedCPUTime() { - return this.getJobDescriptorDocument().getJobDescriptor().getUsedCPUTime(); - } - - public String getUsedMemory() { - return this.getJobDescriptorDocument().getJobDescriptor().getUsedMem(); - } - public void getShellName() { - this.getJobDescriptorDocument().getJobDescriptor().getShellName(); - } - - public String getJobName() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobName(); - } - - public String getJobId() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - - public String getVariableList() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - public String getSubmitArgs() { - return this.getJobDescriptorDocument().getJobDescriptor().getJobID(); - } - - public String[] getPostJobCommands(){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getPostJobCommands().getCommandArray(); - } - return null; - } - - public String[] getModuleCommands() { - if (this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getModuleLoadCommands().getCommandArray(); - } - return null; - } - - public String[] getPreJobCommands(){ - if(this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands() != null) { - return this.getJobDescriptorDocument().getJobDescriptor().getPreJobCommands().getCommandArray(); - } - return null; - } - - public String getJobSubmitterCommand(){ - return this.getJobDescriptorDocument().getJobDescriptor().getJobSubmitterCommand(); - } - - public String getPartition(){ - return this.getJobDescriptorDocument().getJobDescriptor().getPartition(); - } - - public String getUserName(){ - return this.getJobDescriptorDocument().getJobDescriptor().getUserName(); - } - - public void setCallBackIp(String ip){ - this.jobDescriptionDocument.getJobDescriptor().setCallBackIp(ip); - } - - public void setCallBackPort(String ip){ - this.jobDescriptionDocument.getJobDescriptor().setCallBackPort(ip); - } - - - public String getCallBackIp(){ - return this.jobDescriptionDocument.getJobDescriptor().getCallBackIp(); - } - public String getCallBackPort(){ - return this.jobDescriptionDocument.getJobDescriptor().getCallBackPort(); - } - - public void setMailType(String emailType) { - this.getJobDescriptorDocument().getJobDescriptor().setMailType(emailType); - } - - public String getMailType() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailType(); - } - public void setMailAddress(String emailAddress) { - this.getJobDescriptorDocument().getJobDescriptor().setMailAddress(emailAddress); - } - - public String getMailAddress() { - return this.getJobDescriptorDocument().getJobDescriptor().getMailAddress(); - } - - public String getChassisName() { - return this.getJobDescriptorDocument().getJobDescriptor().getChassisName(); - } - - public void setChassisName(String chassisName){ - this.getJobDescriptorDocument().getJobDescriptor().setChassisName(chassisName); - } - - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa deleted file mode 100644 index 661aba0..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.airavata.gfac.core; - -import org.apache.airavata.gfac.core.cluster.OutputParser; -import org.apache.airavata.gfac.core.cluster.RawCommandInfo; - -public interface JobManagerConfiguration { - - public RawCommandInfo getCancelCommand(String jobID); - - public String getJobDescriptionTemplateName(); - - public RawCommandInfo getMonitorCommand(String jobID); - - public RawCommandInfo getUserBasedMonitorCommand(String userName); - - public RawCommandInfo getJobIdMonitorCommand(String jobName , String userName); - - public String getScriptExtension(); - - public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath); - - public OutputParser getParser(); - - public String getInstalledPath(); - - public String getBaseCancelCommand(); - - public String getBaseMonitorCommand(); - - public String getBaseSubmitCommand(); - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~HEAD ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~HEAD b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~HEAD deleted file mode 100644 index 661aba0..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/JobManagerConfiguration.java~HEAD +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.airavata.gfac.core; - -import org.apache.airavata.gfac.core.cluster.OutputParser; -import org.apache.airavata.gfac.core.cluster.RawCommandInfo; - -public interface JobManagerConfiguration { - - public RawCommandInfo getCancelCommand(String jobID); - - public String getJobDescriptionTemplateName(); - - public RawCommandInfo getMonitorCommand(String jobID); - - public RawCommandInfo getUserBasedMonitorCommand(String userName); - - public RawCommandInfo getJobIdMonitorCommand(String jobName , String userName); - - public String getScriptExtension(); - - public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath); - - public OutputParser getParser(); - - public String getInstalledPath(); - - public String getBaseCancelCommand(); - - public String getBaseMonitorCommand(); - - public String getBaseSubmitCommand(); - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa deleted file mode 100644 index 18e3e4e..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa +++ /dev/null @@ -1,34 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * Encapsulates information about - */ -public interface CommandInfo { - - /** - * Gets the executable command as a string. - * @return String encoded command. Should be able to execute - * directly on remote shell. Should includes appropriate parameters. - */ - String getCommand(); - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~HEAD ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~HEAD b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~HEAD deleted file mode 100644 index 18e3e4e..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandInfo.java~HEAD +++ /dev/null @@ -1,34 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * Encapsulates information about - */ -public interface CommandInfo { - - /** - * Gets the executable command as a string. - * @return String encoded command. Should be able to execute - * directly on remote shell. Should includes appropriate parameters. - */ - String getCommand(); - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa deleted file mode 100644 index e50d25a..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - -import com.jcraft.jsch.Channel; - -import java.io.OutputStream; - -/** - * Output of a certain command. TODO rethink - */ -public interface CommandOutput { - - /** - * Gets the output of the command as a stream. - * @param channel Command output as a stream. - */ - void onOutput(Channel channel); - - /** - * Gets standard error as a output stream. - * @return Command error as a stream. - */ - OutputStream getStandardError(); - - /** - * The command exit code. - * @param code The program exit code - */ - void exitCode(int code); -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~HEAD ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~HEAD b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~HEAD deleted file mode 100644 index e50d25a..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/CommandOutput.java~HEAD +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - -import com.jcraft.jsch.Channel; - -import java.io.OutputStream; - -/** - * Output of a certain command. TODO rethink - */ -public interface CommandOutput { - - /** - * Gets the output of the command as a stream. - * @param channel Command output as a stream. - */ - void onOutput(Channel channel); - - /** - * Gets standard error as a output stream. - * @return Command error as a stream. - */ - OutputStream getStandardError(); - - /** - * The command exit code. - * @param code The program exit code - */ - void exitCode(int code); -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa deleted file mode 100644 index 183f60b..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~30f9d70adbd9ee7dd6f7d3eccbfca4baf19b09fa +++ /dev/null @@ -1,65 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * Encapsulate server information. - */ -public class ServerInfo { - - private String host; - private String userName; - private int port = 22; - - public ServerInfo(String userName, String host) { - this.userName = userName; - this.host = host; - } - - public ServerInfo(String userName,String host, int port) { - this.host = host; - this.userName = userName; - this.port = port; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~HEAD ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~HEAD b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~HEAD deleted file mode 100644 index 183f60b..0000000 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/ServerInfo.java~HEAD +++ /dev/null @@ -1,65 +0,0 @@ -package org.apache.airavata.gfac.core.cluster;/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * Encapsulate server information. - */ -public class ServerInfo { - - private String host; - private String userName; - private int port = 22; - - public ServerInfo(String userName, String host) { - this.userName = userName; - this.host = host; - } - - public ServerInfo(String userName,String host, int port) { - this.host = host; - this.userName = userName; - this.port = port; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/AbstractSecurityContext.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/AbstractSecurityContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/AbstractSecurityContext.java new file mode 100644 index 0000000..38d11ee --- /dev/null +++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/AbstractSecurityContext.java @@ -0,0 +1,59 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.airavata.gfac.core.context; + +/** + * User: AmilaJ ([email protected]) + * Date: 6/26/13 + * Time: 4:33 PM + */ + +import java.io.Serializable; + +import org.apache.airavata.credential.store.store.CredentialReader; +import org.apache.airavata.gfac.core.RequestData; +import org.apache.airavata.gfac.core.SecurityContext; + +/** + * Abstract implementation of the security context. + */ +public abstract class AbstractSecurityContext implements SecurityContext, Serializable { + + private CredentialReader credentialReader; + private RequestData requestData; + + public AbstractSecurityContext(CredentialReader credentialReader, RequestData requestData) { + this.credentialReader = credentialReader; + this.requestData = requestData; + } + public AbstractSecurityContext() { + + } + + public CredentialReader getCredentialReader() { + return credentialReader; + } + + public RequestData getRequestData() { + return requestData; + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/de848787/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java index dcdb3b0..85216b4 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/gsissh/security/GSISecurityContext.java @@ -21,7 +21,7 @@ package org.apache.airavata.gfac.gsissh.security; import org.apache.airavata.credential.store.store.CredentialReader; -import org.apache.airavata.gfac.core.AbstractSecurityContext; +import org.apache.airavata.gfac.core.context.AbstractSecurityContext; import org.apache.airavata.gfac.core.RequestData; import org.apache.airavata.gfac.core.cluster.RemoteCluster; import org.slf4j.Logger;
