index int64 0 0 | repo_id stringlengths 9 205 | file_path stringlengths 31 246 | content stringlengths 1 12.2M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/AbstractProvider.java | /*
*
* 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.core.gfac.provider;
import java.util.Map;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.exception.*;
import org.apache.airavata.core.gfac.notification.GFacNotifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* AbstractProvider wraps up steps of execution for Provider. <br/>
* The steps in execution are <br/>
* - makeDirectory <br/>
* - setupEnvironment <br/>
* - executeApplication <br/>
* - retrieveOutput <br/>
*/
public abstract class AbstractProvider implements Provider {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
public void initialize(InvocationContext invocationContext) throws ProviderException {
/*
* Make a directory on the host
*/
makeDirectory(invocationContext);
}
public void dispose(InvocationContext invocationContext) throws GfacException {
}
public Map<String, ?> execute(InvocationContext invocationContext) throws ProviderException {
processInput(invocationContext);
/*
* Setup necessary environment
*/
setupEnvironment(invocationContext);
GFacNotifier notifier = invocationContext.getExecutionContext().getNotifier();
notifier.startExecution(invocationContext);
/*
* Execution application
*/
executeApplication(invocationContext);
notifier.finishExecution(invocationContext);
/*
* Process output information
*/
return processOutput(invocationContext);
}
protected abstract void makeDirectory(InvocationContext invocationContext) throws ProviderException;
protected abstract void setupEnvironment(InvocationContext invocationContext) throws ProviderException;
protected abstract void executeApplication(InvocationContext invocationContext) throws ProviderException;
protected abstract Map<String, ?> processOutput(InvocationContext invocationContext) throws ProviderException;
protected abstract Map<String, ?> processInput(InvocationContext invocationContext) throws ProviderException;
}
| 9,000 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java | /*
*
* 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.core.gfac.provider.impl;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.message.MessageContext;
import org.apache.airavata.core.gfac.context.message.impl.ParameterContextImpl;
import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
import org.apache.airavata.core.gfac.exception.JobSubmissionFault;
import org.apache.airavata.core.gfac.exception.ProviderException;
import org.apache.airavata.core.gfac.exception.SecurityException;
import org.apache.airavata.core.gfac.exception.ToolsException;
import org.apache.airavata.core.gfac.external.GridFtp;
import org.apache.airavata.core.gfac.provider.AbstractProvider;
import org.apache.airavata.core.gfac.provider.utils.GramRSLGenerator;
import org.apache.airavata.core.gfac.provider.utils.JobSubmissionListener;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
import org.apache.airavata.schemas.gfac.URIArrayType;
import org.apache.airavata.schemas.gfac.URIParameterType;
import org.apache.airavata.schemas.wec.WorkflowOutputDataHandlingDocument;
import org.apache.xmlbeans.XmlException;
import org.globus.gram.GramAttributes;
import org.globus.gram.GramException;
import org.globus.gram.GramJob;
import org.ietf.jgss.GSSCredential;
import org.ietf.jgss.GSSException;
/**
* Provider uses Gram for job submission
*/
public class GramProvider extends AbstractProvider {
public static final String MYPROXY_SECURITY_CONTEXT = "myproxy";
private GSISecurityContext gssContext;
private GramJob job;
private String gateKeeper;
private JobSubmissionListener listener;
public void makeDirectory(InvocationContext invocationContext) throws ProviderException {
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
try {
gssContext = (GSISecurityContext)invocationContext.getSecurityContext(MYPROXY_SECURITY_CONTEXT);
GSSCredential gssCred = gssContext.getGssCredentails();
String[] hostgridFTP = host.getGridFTPEndPointArray();
if (hostgridFTP == null || hostgridFTP.length == 0) {
hostgridFTP = new String[] { host.getHostAddress() };
}
boolean success = false;
ProviderException pe = new ProviderException("");
for (String endpoint : host.getGridFTPEndPointArray()) {
try {
URI tmpdirURI = GfacUtils.createGsiftpURI(endpoint, app.getScratchWorkingDirectory());
URI workingDirURI = GfacUtils.createGsiftpURI(endpoint, app.getStaticWorkingDirectory());
URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory());
URI outputURI = GfacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
log.info("Host FTP = " + hostgridFTP);
log.info("temp directory = " + tmpdirURI);
log.info("Working directory = " + workingDirURI);
log.info("Input directory = " + inputURI);
log.info("Output directory = " + outputURI);
ftp.makeDir(tmpdirURI, gssCred);
ftp.makeDir(workingDirURI, gssCred);
ftp.makeDir(inputURI, gssCred);
ftp.makeDir(outputURI, gssCred);
success = true;
break;
} catch (URISyntaxException e) {
pe = new ProviderException("URI is malformatted:" + e.getMessage(), e);
} catch (ToolsException e) {
pe = new ProviderException(e.getMessage(), e);
}
}
if (success == false) {
throw pe;
}
} catch (SecurityException e) {
throw new ProviderException(e.getMessage(), e);
}
}
public void setupEnvironment(InvocationContext invocationContext) throws ProviderException {
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
log.info("Searching for Gate Keeper");
String tmp[] = host.getGlobusGateKeeperEndPointArray();
if (tmp == null || tmp.length == 0) {
gateKeeper = host.getHostAddress();
}else{
/*
* TODO: algorithm for correct gatekeeper selection
*/
gateKeeper = tmp[0];
}
log.info("Using Globus GateKeeper " + gateKeeper);
try {
GramAttributes jobAttr = GramRSLGenerator.configureRemoteJob(invocationContext);
String rsl = jobAttr.toRSL();
log.info("RSL = " + rsl);
job = new GramJob(rsl);
listener = new JobSubmissionListener(job, invocationContext);
job.addListener(listener);
} catch (ToolsException te) {
throw new ProviderException(te.getMessage(), te);
}
}
public void executeApplication(InvocationContext invocationContext) throws ProviderException {
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
StringBuffer buf = new StringBuffer();
try {
/*
* Set Security
*/
GSSCredential gssCred = gssContext.getGssCredentails();
job.setCredentials(gssCred);
log.info("Request to contact:" + gateKeeper);
buf.append("Finished launching job, Host = ").append(host.getHostAddress()).append(" RSL = ")
.append(job.getRSL()).append(" working directory = ").append(app.getStaticWorkingDirectory())
.append(" temp directory = ").append(app.getScratchWorkingDirectory())
.append(" Globus GateKeeper Endpoint = ").append(gateKeeper);
invocationContext.getExecutionContext().getNotifier().info(invocationContext, buf.toString());
/*
* The first boolean is to specify the job is a batch job - use true for interactive and false for batch.
* The second boolean is to specify to use the full proxy and not delegate a limited proxy.
*/
job.request(gateKeeper, false, false);
String gramJobid = job.getIDAsString();
log.info("JobID = " + gramJobid);
invocationContext.getExecutionContext().getNotifier().info(invocationContext, "JobID=" + gramJobid);
log.info(buf.toString());
invocationContext
.getExecutionContext()
.getNotifier()
.applicationInfo(invocationContext, gramJobid, gateKeeper, null, null,
gssCred.getName().toString(), null, job.getRSL());
/*
* Block untill job is done
*/
listener.waitFor();
/*
* Remove listener
*/
job.removeListener(listener);
/*
* Fail job
*/
int jobStatus = listener.getStatus();
if(job.getExitCode() != 0 || jobStatus == GramJob.STATUS_FAILED){
int errCode = listener.getError();
String errorMsg = "Job " + job.getID() + " on host " + host.getHostAddress() + " Job Exit Code = "
+ listener.getError();
JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST",
gateKeeper, job.getRSL());
errorReason(errCode, error);
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,error,errorMsg);
throw error;
}
} catch (GramException e) {
JobSubmissionFault error = new JobSubmissionFault(this, e, host.getHostAddress(), gateKeeper, job.getRSL());
int errCode = listener.getError();
throw errorReason(errCode, error);
} catch (GSSException e) {
throw new ProviderException(e.getMessage(), e);
} catch (InterruptedException e) {
throw new ProviderException("Thread", e);
} catch (SecurityException e) {
throw new ProviderException(e.getMessage(), e);
} finally {
if (job != null) {
try {
job.cancel();
} catch (Exception e) {
}
}
}
}
private JobSubmissionFault errorReason(int errCode, JobSubmissionFault error) {
if (errCode == 8) {
error.setReason(JobSubmissionFault.JOB_CANCEL);
} else {
error.setReason(JobSubmissionFault.JOB_FAILED + " With Exit Code:" + job.getExitCode());
}
return error;
}
public Map<String, ?> processOutput(InvocationContext invocationContext) throws ProviderException {
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
File localStdErrFile = null;
try {
GSSCredential gssCred = gssContext.getGssCredentails();
String[] hostgridFTP = host.getGridFTPEndPointArray();
if (hostgridFTP == null || hostgridFTP.length == 0) {
hostgridFTP = new String[] { host.getHostAddress() };
}
ProviderException pe = new ProviderException("");
for (String endpoint : host.getGridFTPEndPointArray()) {
try {
/*
* Read Stdout and Stderror
*/
URI stdoutURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardOutput());
URI stderrURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardError());
log.info("STDOUT:" + stdoutURI.toString());
log.info("STDERR:" + stderrURI.toString());
File logDir = new File("./service_logs");
if (!logDir.exists()) {
logDir.mkdir();
}
String timeStampedServiceName = GfacUtils.createUniqueNameForService(invocationContext
.getServiceName());
File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");
String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
Map<String,ActualParameter> stringMap = null;
MessageContext<Object> output = invocationContext.getOutput();
for (Iterator<String> iterator = output.getNames(); iterator.hasNext(); ) {
String paramName = iterator.next();
ActualParameter actualParameter = (ActualParameter) output.getValue(paramName);
if ("URIArray".equals(actualParameter.getType().getType().toString())) {
URI outputURI = GfacUtils.createGsiftpURI(endpoint,app.getOutputDataDirectory());
List<String> outputList = ftp.listDir(outputURI,gssCred);
String[] valueList = outputList.toArray(new String[outputList.size()]);
((URIArrayType) actualParameter.getType()).setValueArray(valueList);
stringMap = new HashMap<String, ActualParameter>();
stringMap.put(paramName, actualParameter);
invocationContext.getExecutionContext().getNotifier().output(invocationContext, actualParameter.toString());
}
else{
// This is to handle exception during the output parsing.
stringMap = OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter>getOutput(), stdout);
String paramValue = output.getStringValue(paramName);
if(paramValue == null || paramValue.isEmpty()){
int errCode = listener.getError();
String errorMsg = "Job " + job.getID() + " on host " + host.getHostAddress();
JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST",
gateKeeper, job.getRSL());
errorReason(errCode, error);
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,error,
readLastLinesofStdOut(localStdErrFile.getPath(), 20));
throw error;
}
}
}
if(stringMap == null || stringMap.isEmpty()){
ProviderException exception = new ProviderException("Error creating job output");
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,exception,exception.getLocalizedMessage());
throw exception;
}
// If users has given an output DAta poth we download the output files in to that directory, this will be apath in the machine where GFac is installed
if(WorkflowContextHeaderBuilder.getCurrentContextHeader() != null &&
WorkflowContextHeaderBuilder.getCurrentContextHeader().getWorkflowOutputDataHandling() != null){
WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling workflowOutputDataHandling =
WorkflowContextHeaderBuilder.getCurrentContextHeader().getWorkflowOutputDataHandling();
if(workflowOutputDataHandling.getApplicationOutputDataHandlingArray().length != 0){
String outputDataDirectory = workflowOutputDataHandling.getApplicationOutputDataHandlingArray()[0].getOutputDataDirectory();
if(outputDataDirectory != null && !"".equals(outputDataDirectory)){
stageOutputFiles(invocationContext,outputDataDirectory);
}
}
}
return stringMap;
}catch (XmlException e) {
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,readLastLinesofStdOut(localStdErrFile.getPath(), 20));
throw new ProviderException(e.getMessage(), e);
}
catch (ToolsException e) {
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,readLastLinesofStdOut(localStdErrFile.getPath(), 20));
throw new ProviderException(e.getMessage(), e);
} catch (URISyntaxException e) {
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,readLastLinesofStdOut(localStdErrFile.getPath(), 20));
throw new ProviderException("URI is malformatted:" + e.getMessage(), e);
}catch (NullPointerException e) {
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,e.getMessage());
throw new ProviderException("Outupt is not produced in stdout:" + e.getMessage(), e);
}
}
/*
* If the execution reach here, all GridFTP Endpoint is failed.
*/
throw pe;
} catch (Exception e) {
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,readLastLinesofStdOut(localStdErrFile.getPath(), 20));
throw new ProviderException(e.getMessage(), e);
}
}
@Override
protected Map<String, ?> processInput(InvocationContext invocationContext)
throws ProviderException {
MessageContext<ActualParameter> inputNew = new ParameterContextImpl();
try {
MessageContext<Object> input = invocationContext.getInput();
for (Iterator<String> iterator = input.getNames(); iterator.hasNext();) {
String paramName = iterator.next();
String paramValue = input.getStringValue(paramName);
ActualParameter actualParameter = (ActualParameter) input
.getValue(paramName);
//TODO: Review this with type
if ("URI".equals(actualParameter.getType().getType().toString())) {
((URIParameterType) actualParameter.getType()).setValue(stageInputFiles(invocationContext, paramValue, actualParameter));
}else if("URIArray".equals(actualParameter.getType().getType().toString())){
List<String> split = Arrays.asList(paramValue.split(","));
List<String> newFiles = new ArrayList<String>();
for (String paramValueEach : split) {
newFiles.add(stageInputFiles(invocationContext, paramValueEach, actualParameter));
}
((URIArrayType) actualParameter.getType()).setValueArray(newFiles.toArray(new String[newFiles.size()]));
}
inputNew.add(paramName, actualParameter);
}
}catch (Exception e){
invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,e,"Error during Input File staging");
throw new ProviderException("Error while input File Staging", e.getCause());
}
invocationContext.setInput(inputNew);
return null;
}
private String stageInputFiles(InvocationContext invocationContext, String paramValue, ActualParameter actualParameter) throws URISyntaxException, SecurityException, ToolsException, IOException {
URI gridftpURL;
gridftpURL = new URI(paramValue);
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
URI destURI = null;
gssContext = (GSISecurityContext) invocationContext.getSecurityContext(MYPROXY_SECURITY_CONTEXT);
GSSCredential gssCred = gssContext.getGssCredentails();
for (String endpoint : host.getGridFTPEndPointArray()) {
URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory());
String fileName = new File(gridftpURL.getPath()).getName();
String s = inputURI.getPath() + File.separator + fileName;
//if user give a url just to refer an endpoint, not a web resource we are not doing any transfer
if (fileName != null && !"".equals(fileName)) {
destURI = GfacUtils.createGsiftpURI(endpoint, s);
if (paramValue.startsWith("gsiftp")) {
ftp.uploadFile(gridftpURL, destURI, gssCred);
} else if (paramValue.startsWith("file")) {
String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
}else if (paramValue.startsWith("http")) {
ftp.uploadFile(destURI,
gssCred, (gridftpURL.toURL().openStream()));
}else {
//todo throw exception telling unsupported protocol
return paramValue;
}
}else{
// When the given input is not a web resource but a URI type input, then we don't do any transfer just keep the same value as it isin the input
return paramValue;
}
}
return destURI.getPath();
}
private void stageOutputFiles(InvocationContext invocationContext,String outputFileStagingPath) throws ProviderException {
MessageContext<ActualParameter> outputNew = new ParameterContextImpl();
MessageContext<Object> input = invocationContext.getOutput();
for (Iterator<String> iterator = input.getNames(); iterator.hasNext(); ) {
String paramName = iterator.next();
String paramValue = input.getStringValue(paramName);
ActualParameter actualParameter = (ActualParameter) input
.getValue(paramName);
//TODO: Review this with type
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
GridFtp ftp = new GridFtp();
gssContext = (GSISecurityContext) invocationContext.getSecurityContext(MYPROXY_SECURITY_CONTEXT);
GSSCredential gssCred = null;
try {
gssCred = gssContext.getGssCredentails();
} catch (SecurityException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
try {
if ("URI".equals(actualParameter.getType().getType().toString())) {
for (String endpoint : host.getGridFTPEndPointArray()) {
((URIParameterType) actualParameter.getType()).setValue(doStaging(outputFileStagingPath,
paramValue, actualParameter, ftp, gssCred, endpoint));
}
} else if ("URIArray".equals(actualParameter.getType().getType().toString())) {
List<String> split = Arrays.asList(paramValue.split(","));
List<String> newFiles = new ArrayList<String>();
for (String endpoint : host.getGridFTPEndPointArray()) {
for (String paramValueEach : split) {
newFiles.add(doStaging(outputFileStagingPath, paramValueEach, actualParameter, ftp, gssCred, endpoint));
}
((URIArrayType) actualParameter.getType()).setValueArray(newFiles.toArray(new String[newFiles.size()]));
}
}
} catch (URISyntaxException e) {
throw new ProviderException(e.getMessage(), e);
} catch (ToolsException e) {
throw new ProviderException(e.getMessage(), e);
}
outputNew.add(paramName, actualParameter);
}
invocationContext.setOutput(outputNew);
}
private String doStaging(String outputFileStagingPath, String paramValue, ActualParameter actualParameter, GridFtp ftp, GSSCredential gssCred, String endpoint) throws URISyntaxException, ToolsException {
URI srcURI = GfacUtils.createGsiftpURI(endpoint, paramValue);
String fileName = new File(srcURI.getPath()).getName();
File outputFile = new File(outputFileStagingPath + File.separator + fileName);
ftp.readRemoteFile(srcURI,
gssCred, outputFile);
return outputFileStagingPath + File.separator + fileName;
}
private String readLastLinesofStdOut(String path, int count) {
StringBuffer buffer = new StringBuffer();
FileInputStream in = null;
try {
in = new FileInputStream(path);
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
BufferedReader br = new BufferedReader(new InputStreamReader(in));
List<String> strLine = new ArrayList<String>();
String tmp = null;
int numberofLines = 0;
try {
while ((tmp = br.readLine()) != null) {
strLine.add(tmp);
numberofLines++;
}
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
for (int i = numberofLines - count; i < numberofLines; i++) {
buffer.append(strLine.get(i));
buffer.append("\n");
}
try {
in.close();
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
return buffer.toString();
}
}
| 9,001 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/SSHProvider.java | /*
*
* 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.core.gfac.provider.impl;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import net.schmizz.sshj.SSHClient;
import net.schmizz.sshj.connection.ConnectionException;
import net.schmizz.sshj.connection.channel.direct.Session;
import net.schmizz.sshj.connection.channel.direct.Session.Command;
import net.schmizz.sshj.transport.TransportException;
import net.schmizz.sshj.userauth.keyprovider.KeyProvider;
import net.schmizz.sshj.xfer.scp.SCPFileTransfer;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.security.impl.SSHSecurityContextImpl;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.ProviderException;
import org.apache.airavata.core.gfac.provider.AbstractProvider;
import org.apache.airavata.core.gfac.utils.GFacConstants;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.InputUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.xmlbeans.XmlException;
/**
* Execute application using remote SSH
*/
public class SSHProvider extends AbstractProvider {
private static final String SPACE = " ";
private static final String SSH_SECURITY_CONTEXT = "ssh";
private static final int COMMAND_EXECUTION_TIMEOUT = 5;
private SSHSecurityContextImpl sshContext;
private String command;
private SSHClient ssh;
public SSHProvider() {
ssh = new SSHClient();
}
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);
}
}
private void closeSession(Session session) {
if (session != null) {
try {
session.close();
} catch (Exception e) {
log.warn("Cannot Close SSH Session");
}
}
}
public void makeDirectory(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
Session session = null;
try {
session = getSession(context);
StringBuilder commandString = new StringBuilder();
commandString.append("mkdir -p ");
commandString.append(app.getScratchWorkingDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getStaticWorkingDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getInputDataDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getOutputDataDirectory());
Command cmd = session.exec(commandString.toString());
cmd.join(COMMAND_EXECUTION_TIMEOUT, TimeUnit.SECONDS);
} catch (ConnectionException e) {
throw new ProviderException(e.getMessage(), e);
} catch (TransportException e) {
throw new ProviderException(e.getMessage(), e);
} catch (IOException e) {
throw new ProviderException(e.getMessage(), e);
} finally {
closeSession(session);
}
}
public void setupEnvironment(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
// input parameter
ArrayList<String> tmp = new ArrayList<String>();
for (Iterator<String> iterator = context.getInput().getNames(); iterator.hasNext();) {
String key = iterator.next();
tmp.add(context.getInput().getStringValue(key));
}
List<String> cmdList = new ArrayList<String>();
/*
* Builder Command
*/
cmdList.add(app.getExecutableLocation());
cmdList.addAll(tmp);
// create process builder from command
command = InputUtils.buildCommand(cmdList);
// redirect StdOut and StdErr
// TODO: Make 1> and 2> into static constants.
// TODO: This only works for the BASH shell. CSH and TCSH will be
// different.
command += SPACE + "1>" + SPACE + app.getStandardOutput();
command += SPACE + "2>" + SPACE + app.getStandardError();
}
public void executeApplication(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
Session session = null;
try {
session = getSession(context);
/*
* Going to working Directory
*/
session.exec("cd " + app.getStaticWorkingDirectory());
// get the env of the host and the application
NameValuePairType[] env = app.getApplicationEnvironmentArray();
Map<String, String> nv = new HashMap<String, String>();
if (env != null) {
for (int i = 0; i < env.length; i++) {
String key = env[i].getName();
String value = env[i].getValue();
nv.put(key, value);
}
}
// extra env's
nv.put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory());
nv.put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
/*
* Set environment
*/
log.info("Command = " + command);
for (Entry<String, String> entry : nv.entrySet()) {
log.info("Env[" + entry.getKey() + "] = " + entry.getValue());
session.setEnvVar(entry.getKey(), entry.getValue());
}
/*
* Execute
*/
Command cmd = session.exec(command);
log.info("stdout=" + GfacUtils.readFromStream(session.getInputStream()));
cmd.join(COMMAND_EXECUTION_TIMEOUT, TimeUnit.SECONDS);
/*
* check return value. usually not very helpful to draw conclusions based on return values so don't bother.
* just provide warning in the log messages
*/
if (cmd.getExitStatus() != 0) {
log.error("Process finished with non zero return value. Process may have failed");
} else {
log.info("Process finished with return value of zero.");
}
} catch (ConnectionException e) {
throw new ProviderException(e.getMessage(), e);
} catch (TransportException e) {
throw new ProviderException(e.getMessage(), e);
} catch (IOException e) {
throw new ProviderException(e.getMessage(), e);
} finally {
closeSession(session);
}
}
public Map<String, ?> processOutput(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
try {
// Get the Stdouts and StdErrs
String timeStampedServiceName = GfacUtils.createUniqueNameForService(context.getServiceName());
File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
File localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");
SCPFileTransfer fileTransfer = ssh.newSCPFileTransfer();
fileTransfer.download(app.getStandardOutput(), localStdOutFile.getAbsolutePath());
fileTransfer.download(app.getStandardError(), localStdErrFile.getAbsolutePath());
String stdOutStr = GfacUtils.readFileToString(localStdOutFile.getAbsolutePath());
String stdErrStr = GfacUtils.readFileToString(localStdErrFile.getAbsolutePath());
return OutputUtils.fillOutputFromStdout(context.<ActualParameter> getOutput(), stdOutStr);
} catch (XmlException e) {
throw new ProviderException("Cannot read output:" + e.getMessage(), e);
} catch (ConnectionException e) {
throw new ProviderException(e.getMessage(), e);
} catch (TransportException e) {
throw new ProviderException(e.getMessage(), e);
} catch (IOException e) {
throw new ProviderException(e.getMessage(), e);
}
}
public void dispose(InvocationContext invocationContext) throws GfacException {
super.dispose(invocationContext);
try {
if (ssh != null && ssh.isConnected()) {
ssh.disconnect();
}
} catch (Exception e) {
log.warn("Cannot Close SSH Connection");
}
}
@Override
protected Map<String, ?> processInput(InvocationContext invocationContext)
throws ProviderException {
// TODO Auto-generated method stub
return null;
}
}
| 9,002 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/LocalProvider.java | /*
*
* 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.core.gfac.provider.impl;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.exception.ProviderException;
import org.apache.airavata.core.gfac.provider.AbstractProvider;
import org.apache.airavata.core.gfac.provider.utils.InputStreamToFileWriter;
import org.apache.airavata.core.gfac.utils.GFacConstants;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.InputUtils;
import org.apache.airavata.core.gfac.utils.OutputUtils;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.xmlbeans.XmlException;
/**
* {@link LocalProvider} will execute jobs (application) on local machine.
*/
public class LocalProvider extends AbstractProvider {
private ProcessBuilder builder;
private List<String> cmdList;
private void makeFileSystemDir(String dir) throws ProviderException {
File f = new File(dir);
if (f.isDirectory() && f.exists()) {
return;
} else if (!new File(dir).mkdir()) {
throw new ProviderException("Cannot make directory");
}
}
public void makeDirectory(InvocationContext invocationContext) throws ProviderException {
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
log.info("working diectroy = " + app.getStaticWorkingDirectory());
log.info("temp directory = " + app.getScratchWorkingDirectory());
makeFileSystemDir(app.getStaticWorkingDirectory());
makeFileSystemDir(app.getScratchWorkingDirectory());
makeFileSystemDir(app.getInputDataDirectory());
makeFileSystemDir(app.getOutputDataDirectory());
}
public void setupEnvironment(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
// input parameter
ArrayList<String> tmp = new ArrayList<String>();
for (Iterator<String> iterator = context.getInput().getNames(); iterator.hasNext(); ) {
String key = iterator.next();
tmp.add(context.getInput().getStringValue(key));
}
cmdList = new ArrayList<String>();
/*
* Builder Command
*/
cmdList.add(app.getExecutableLocation());
cmdList.addAll(tmp);
// create process builder from command
this.builder = new ProcessBuilder(cmdList);
// get the env of the host and the application
NameValuePairType[] env = app.getApplicationEnvironmentArray();
if (env != null) {
Map<String, String> nv = new HashMap<String, String>();
for (int i = 0; i < env.length; i++) {
String key = env[i].getName();
String value = env[i].getValue();
nv.put(key, value);
}
if ((app.getApplicationEnvironmentArray() != null) && (app.getApplicationEnvironmentArray().length != 0)
&& nv.size() > 0) {
builder.environment().putAll(nv);
}
}
// extra env's
builder.environment().put(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory());
builder.environment().put(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
// working directory
builder.directory(new File(app.getStaticWorkingDirectory()));
// log info
log.info("Command = " + InputUtils.buildCommand(cmdList));
log.info("Working dir = " + builder.directory());
for (String key : builder.environment().keySet()) {
log.info("Env[" + key + "] = " + builder.environment().get(key));
}
}
public void executeApplication(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
try {
// running cmd
Process process = builder.start();
Thread t1 = new InputStreamToFileWriter(process.getInputStream(), app.getStandardOutput());
Thread t2 = new InputStreamToFileWriter(process.getErrorStream(), app.getStandardError());
// start output threads
t1.setDaemon(true);
t2.setDaemon(true);
t1.start();
t2.start();
// wait for the process (application) to finish executing
int returnValue = process.waitFor();
// make sure other two threads are done
t1.join();
t2.join();
/*
* check return value. usually not very helpful to draw conclusions based on return values so don't bother.
* just provide warning in the log messages
*/
if (returnValue != 0) {
log.error("Process finished with non zero return value. Process may have failed");
} else {
log.info("Process finished with return value of zero.");
}
StringBuffer buf = new StringBuffer();
buf.append("Executed ").append(InputUtils.buildCommand(cmdList))
.append(" on the localHost, working directory = ").append(app.getStaticWorkingDirectory())
.append(" tempDirectory = ").append(app.getScratchWorkingDirectory()).append(" With the status ")
.append(String.valueOf(returnValue));
log.info(buf.toString());
} catch (IOException io) {
throw new ProviderException(io.getMessage(), io);
} catch (InterruptedException e) {
throw new ProviderException(e.getMessage(), e);
}
}
public Map<String, ?> processOutput(InvocationContext context) throws ProviderException {
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
try {
String stdOutStr = GfacUtils.readFileToString(app.getStandardOutput());
// set to context
return OutputUtils.fillOutputFromStdout(context.<ActualParameter>getOutput(), stdOutStr);
} catch (XmlException e) {
throw new ProviderException("Cannot read output:" + e.getMessage(), e);
} catch (IOException io) {
throw new ProviderException(io.getMessage(), io);
}
}
@Override
protected Map<String, ?> processInput(InvocationContext invocationContext)
throws ProviderException {
// TODO Auto-generated method stub
return null;
}
}
| 9,003 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/EC2Provider.java | /*
*
* 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.core.gfac.provider.impl;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.ec2.AmazonEC2Client;
import com.amazonaws.services.ec2.model.*;
import org.apache.airavata.core.gfac.context.invocation.ExecutionContext;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.security.impl.SSHSecurityContextImpl;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.ProviderException;
import org.apache.airavata.schemas.wec.ContextHeaderDocument;
import org.apache.airavata.schemas.wec.SecurityContextDocument;
import org.apache.axiom.om.OMElement;
import org.apache.xmlbeans.XmlException;
import org.bouncycastle.openssl.PEMWriter;
import javax.xml.stream.XMLStreamException;
import java.io.*;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
// TODO
// import com.sshtools.j2ssh.util.Base64;
public class EC2Provider extends SSHProvider{
//private static MLogger log = MLogger.getLogger(GFacConstants.LOGGER_NAME);
public static final int SLEEP_TIME_SECOND = 120;
public static final String KEY_PAIR_NAME = "gfac";
public static final String KEY_PAIR_FILE = "ec2_rsa";
private static final String SSH_SECURITY_CONTEXT = "ssh";
private static final String privateKeyFilePath = System.getProperty("user.home") + "/.ssh/" + KEY_PAIR_FILE;
private Instance instance;
private String username;
public EC2Provider(InvocationContext invocationContext) throws ProviderException {
ExecutionContext execContext = invocationContext.getExecutionContext();
OMElement omSecurityContextHeader = execContext.getSecurityContextHeader();
ContextHeaderDocument document = null;
try {
document = ContextHeaderDocument.Factory.parse(omSecurityContextHeader.toStringWithConsume());
} catch (XMLStreamException e) {
e.printStackTrace();
} catch (XmlException e) {
e.printStackTrace();
}
SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices =
document.getContextHeader().getSecurityContext().getAmazonWebservices();
String access_key = amazonWebservices.getAccessKeyId();
String secret_key = amazonWebservices.getSecretAccessKey();
String ami_id = amazonWebservices.getAmiId();
String ins_id = amazonWebservices.getInstanceId();
String ins_type = amazonWebservices.getInstanceType();
this.username = amazonWebservices.getUsername();
log.info("ACCESS_KEY:" + access_key);
log.info("SECRET_KEY:" + secret_key);
log.info("AMI_ID:" + ami_id);
log.info("INS_ID:" + ins_id);
log.info("INS_TYPE:" + ins_type);
log.info("USERNAME:" + username);
/*
* Validation
*/
if (access_key == null || access_key.isEmpty())
throw new ProviderException("Access Key is empty");
if (secret_key == null || secret_key.isEmpty())
throw new ProviderException("Secret Key is empty");
if ((ami_id == null && ins_id == null) || (ami_id != null && ami_id.isEmpty()) || (ins_id != null && ins_id.isEmpty()))
throw new ProviderException("AMI or Instance ID is empty");
if (this.username == null || this.username.isEmpty())
throw new ProviderException("Username is empty");
/*
* Need to start EC2 instance before running it
*/
AWSCredentials credential = new BasicAWSCredentials(access_key, secret_key);
AmazonEC2Client ec2client = new AmazonEC2Client(credential);
try {
/*
* Build key pair before start instance
*/
buildKeyPair(ec2client);
// right now, we can run it on one host
if (ami_id != null)
this.instance = startInstances(ec2client, ami_id, ins_type, execContext).get(0);
else {
// already running instance
DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));
if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
throw new GfacException("Instance not found:" + ins_id);
}
this.instance = describeInstancesResult.getReservations().get(0).getInstances().get(0);
// check instance keypair
if (this.instance.getKeyName() == null || !this.instance.getKeyName().equals(KEY_PAIR_NAME))
throw new GfacException("Keypair for instance:" + ins_id + " is not valid");
}
//TODO send out instance id
//execContext.getNotificationService().sendResourceMappingNotifications(this.instance.getPublicDnsName(), "EC2 Instance " + this.instance.getInstanceId() + " is running with public name " + this.instance.getPublicDnsName(), this.instance.getInstanceId());
/*
* Make sure port 22 is connectable
*/
for (GroupIdentifier g : this.instance.getSecurityGroups()) {
IpPermission ip = new IpPermission();
ip.setIpProtocol("tcp");
ip.setFromPort(22);
ip.setToPort(22);
AuthorizeSecurityGroupIngressRequest r = new AuthorizeSecurityGroupIngressRequest();
r = r.withIpPermissions(ip.withIpRanges("0.0.0.0/0"));
r.setGroupId(g.getGroupId());
try {
ec2client.authorizeSecurityGroupIngress(r);
} catch (AmazonServiceException as) {
/*
* If exception is from duplicate room, ignore it.
*/
if (!as.getErrorCode().equals("InvalidPermission.Duplicate"))
throw as;
}
}
} catch (Exception e) {
throw new ProviderException("Invalied Request",e);
}
SSHSecurityContextImpl sshContext = ((SSHSecurityContextImpl) invocationContext.getSecurityContext(SSH_SECURITY_CONTEXT));
if (sshContext == null) {
sshContext = new SSHSecurityContextImpl();
}
sshContext.setUsername(username);
sshContext.setKeyPass("");
sshContext.setPrivateKeyLoc(privateKeyFilePath);
invocationContext.addSecurityContext(SSH_SECURITY_CONTEXT, sshContext);
//set to super class
/*setUsername(username);
setPassword("");
setKnownHostsFileName(null);
setKeyFileName(privateKeyFilePath);*/
// we need to erase gridftp URL since we will forcefully use SFTP
// TODO
/*execContext.setHost(this.instance.getPublicDnsName());
execContext.getHostDesc().getHostConfiguration().setGridFTPArray(null);
execContext.setFileTransferService(new SshFileTransferService(execContext, this.username, privateKeyFilePath));*/
}
private List<Instance> startInstances(AmazonEC2Client ec2, String AMI_ID, String INS_TYPE, ExecutionContext executionContext) throws AmazonServiceException {
// start only 1 instance
RunInstancesRequest request = new RunInstancesRequest(AMI_ID, 1, 1);
request.setKeyName(KEY_PAIR_NAME);
request.setInstanceType(INS_TYPE);
RunInstancesResult result = ec2.runInstances(request);
List<Instance> instances = result.getReservation().getInstances();
while (!allInstancesStateEqual(instances, InstanceStateName.Running)) {
// instance status should not be Terminated
if (anyInstancesStateEqual(instances, InstanceStateName.Terminated)) {
throw new AmazonClientException("Some Instance is terminated before running a job");
}
// notify the status
for (Instance ins: instances) {
// TODO
//executionContext.getNotificationService().info("EC2 Instance " +ins.getInstanceId() + " is " + ins.getState().getName().toString());
}
try {
Thread.sleep(SLEEP_TIME_SECOND * 1000l);
} catch (Exception ex) {
// no op
}
DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
describeInstancesRequest.setInstanceIds(getInstanceIDs(instances));
DescribeInstancesResult describeInstancesResult = ec2.describeInstances(describeInstancesRequest);
instances = describeInstancesResult.getReservations().get(0).getInstances();
}
log.info("All instances is running");
return instances;
}
private void buildKeyPair(AmazonEC2Client ec2) throws NoSuchAlgorithmException, InvalidKeySpecException, AmazonServiceException, AmazonClientException, IOException {
boolean newKey = false;
File privateKeyFile = new File(privateKeyFilePath);
File publicKeyFile = new File(privateKeyFilePath + ".pub");
/*
* Check if Keypair already created on the server
*/
if (!privateKeyFile.exists()) {
// check folder and create if it does not exist
File sshDir = new File(System.getProperty("user.home") + "/.ssh/");
if (!sshDir.exists())
sshDir.mkdir();
// Generate a 1024-bit RSA key pair
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
java.security.KeyPair keypair = keyGen.genKeyPair();
FileOutputStream fos = null;
// Store Public Key.
try {
fos = new FileOutputStream(privateKeyFilePath + ".pub");
// TODO
//fos.write(Base64.encodeBytes(keypair.getPublic().getEncoded(), true).getBytes());
} catch (IOException ioe) {
throw ioe;
} finally {
if (fos != null) {
try {
fos.close();
fos = null;
} catch (IOException ioe) {
throw ioe;
}
}
}
// Store Private Key.
try {
fos = new FileOutputStream(privateKeyFilePath);
StringWriter stringWriter = new StringWriter();
/*
* Write in PEM format (openssl support)
*/
PEMWriter pemFormatWriter = new PEMWriter(stringWriter);
pemFormatWriter.writeObject(keypair.getPrivate());
pemFormatWriter.close();
fos.write(stringWriter.toString().getBytes());
} catch (IOException ioe) {
throw ioe;
} finally {
if (fos != null) {
try {
fos.close();
fos = null;
} catch (IOException ioe) {
throw ioe;
}
}
}
privateKeyFile.setWritable(false, false);
privateKeyFile.setExecutable(false, false);
privateKeyFile.setReadable(false, false);
privateKeyFile.setReadable(true);
privateKeyFile.setWritable(true);
// set that this key is just created
newKey = true;
}
/*
* Read Public Key
*/
String encodedPublicKey = null;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(publicKeyFile));
encodedPublicKey = br.readLine();
} catch (IOException ioe) {
throw ioe;
} finally {
if (br != null) {
try {
br.close();
br = null;
} catch (IOException ioe) {
throw ioe;
}
}
}
/*
* Generate key pair in Amazon if necessary
*/
try {
/*
* Get current key pair in Amazon
*/
DescribeKeyPairsRequest describeKeyPairsRequest = new DescribeKeyPairsRequest();
ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(KEY_PAIR_NAME));
/*
* If key exists and new key is created, delete old key and replace
* with new one. Else, do nothing
*/
if (newKey) {
DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(KEY_PAIR_NAME);
ec2.deleteKeyPair(deleteKeyPairRequest);
ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
ec2.importKeyPair(importKeyPairRequest);
}
} catch (AmazonServiceException ase) {
/*
* Key doesn't exists, import new key.
*/
if(ase.getErrorCode().equals("InvalidKeyPair.NotFound")){
ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(KEY_PAIR_NAME, encodedPublicKey);
ec2.importKeyPair(importKeyPairRequest);
}else{
throw ase;
}
}
}
private boolean anyInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
Instance instance = (Instance) iterator.next();
// if one of instance is not running, return false
if (InstanceStateName.fromValue(instance.getState().getName()) == name) {
return true;
}
}
return false;
}
private boolean allInstancesStateEqual(List<Instance> instances, InstanceStateName name) {
for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
Instance instance = (Instance) iterator.next();
// if one of instance is not running, return false
if (InstanceStateName.fromValue(instance.getState().getName()) != name) {
return false;
}
}
return true;
}
private List<String> getInstanceIDs(List<Instance> instances) {
List<String> ret = new ArrayList<String>();
for (Iterator<Instance> iterator = instances.iterator(); iterator.hasNext();) {
Instance instance = (Instance) iterator.next();
ret.add(instance.getInstanceId());
}
return ret;
}
}
| 9,004 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java | /*
*
* 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.core.gfac.provider.utils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.message.MessageContext;
import org.apache.airavata.core.gfac.exception.ToolsException;
import org.apache.airavata.core.gfac.utils.GFacConstants;
import org.apache.airavata.schemas.gfac.GramApplicationDeploymentType;
import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.airavata.schemas.gfac.URIArrayType;
import org.apache.airavata.schemas.wec.ContextHeaderDocument;
import org.globus.gram.GramAttributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Utilities for generating GRAM RSL
*/
public class GramRSLGenerator {
protected static final Logger log = LoggerFactory.getLogger(GramRSLGenerator.class);
private enum JobType {
SINGLE, MPI, MULTIPLE, CONDOR
};
public static GramAttributes configureRemoteJob(InvocationContext context) throws ToolsException {
GramApplicationDeploymentType app = (GramApplicationDeploymentType) context.getExecutionDescription().getApp().getType();
GramAttributes jobAttr = new GramAttributes();
jobAttr.setExecutable(app.getExecutableLocation());
jobAttr.setDirectory(app.getStaticWorkingDirectory());
jobAttr.setStdout(app.getStandardOutput());
jobAttr.setStderr(app.getStandardError());
/*
* The env here contains the env of the host and the application. i.e the env specified in the host description
* and application description documents
*/
NameValuePairType[] env = app.getApplicationEnvironmentArray();
if(env.length != 0){
Map<String, String> nv =new HashMap<String, String>();
for (int i = 0; i < env.length; i++) {
String key = env[i].getName();
String value = env[i].getValue();
nv.put(key, value);
}
for (Entry<String, String> entry : nv.entrySet()) {
jobAttr.addEnvVariable(entry.getKey(), entry.getValue());
}
}
jobAttr.addEnvVariable(GFacConstants.INPUT_DATA_DIR_VAR_NAME, app.getInputDataDirectory());
jobAttr.addEnvVariable(GFacConstants.OUTPUT_DATA_DIR_VAR_NAME, app.getOutputDataDirectory());
if (app.getMaxWallTime() > 0) {
log.info("Setting max wall clock time to " + app.getMaxWallTime());
if (app.getMaxWallTime() > 30 && app.getQueue() != null && app.getQueue().getQueueName().equals("debug")) {
throw new ToolsException("NCSA debug Queue only support jobs < 30 minutes");
}
jobAttr.setMaxWallTime(app.getMaxWallTime());
jobAttr.set("proxy_timeout", "1");
} else {
jobAttr.setMaxWallTime(30);
}
if (app.getStandardInput() != null && !"".equals(app.getStandardInput())) {
jobAttr.setStdin(app.getStandardInput());
} else {
MessageContext<Object> input = context.getInput();
for (Iterator<String> iterator = input.getNames(); iterator.hasNext();) {
String paramName = iterator.next();
ActualParameter actualParameter = (ActualParameter) input.getValue(paramName);
if ("URIArray".equals(actualParameter.getType().getType().toString())) {
String[] values = ((URIArrayType) actualParameter.getType()).getValueArray();
for (String value : values) {
jobAttr.addArgument(value);
}
} else {
String paramValue = input.getStringValue(paramName);
jobAttr.addArgument(paramValue);
}
}
}
// Using the workflowContext Header values if user provided them in the request and overwrite the default values in DD
ContextHeaderDocument.ContextHeader currentContextHeader = WorkflowContextHeaderBuilder.getCurrentContextHeader();
if (currentContextHeader != null &&
currentContextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray() != null &&
currentContextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray().length > 0) {
try {
int cpuCount = currentContextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray()[0].getCpuCount();
app.setCpuCount(cpuCount);
} catch (NullPointerException e) {
log.info("No Value sent in WorkflowContextHeader for CPU Count, value in the Deployment Descriptor will be used");
}
try {
int nodeCount = currentContextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray()[0].getNodeCount();
app.setNodeCount(nodeCount);
} catch (NullPointerException e) {
log.info("No Value sent in WorkflowContextHeader for Node Count, value in the Deployment Descriptor will be used");
}
}
if (app.getNodeCount() > 0) {
jobAttr.set("hostCount", String.valueOf(app.getNodeCount()));
}
if (app.getCpuCount() > 0) {
log.info("Setting number of procs to " + app.getCpuCount());
jobAttr.setNumProcs(app.getCpuCount());
}
if (app.getMinMemory() > 0) {
log.info("Setting minimum memory to " + app.getMinMemory());
jobAttr.setMinMemory(app.getMinMemory());
}
if (app.getMaxMemory() > 0) {
log.info("Setting maximum memory to " + app.getMaxMemory());
jobAttr.setMaxMemory(app.getMaxMemory());
}
if (app.getProjectAccount() != null) {
if (app.getProjectAccount().getProjectAccountNumber() != null) {
log.info("Setting project to " + app.getProjectAccount().getProjectAccountNumber());
jobAttr.setProject(app.getProjectAccount().getProjectAccountNumber());
}
}
if(app.getQueue() != null){
if (app.getQueue().getQueueName() != null) {
System.out.println("Testing");
log.info("Setting job queue to " + app.getQueue().getQueueName());
jobAttr.setQueue(app.getQueue().getQueueName());
}
}
String jobType = JobType.SINGLE.toString();
if (app.getJobType() != null) {
jobType = app.getJobType().toString();
}
if (jobType.equalsIgnoreCase(JobType.SINGLE.toString())) {
log.info("Setting job type to single");
jobAttr.setJobType(GramAttributes.JOBTYPE_SINGLE);
} else if (jobType.equalsIgnoreCase(JobType.MPI.toString())) {
log.info("Setting job type to mpi");
jobAttr.setJobType(GramAttributes.JOBTYPE_MPI);
} else if (jobType.equalsIgnoreCase(JobType.MULTIPLE.toString())) {
log.info("Setting job type to multiple");
jobAttr.setJobType(GramAttributes.JOBTYPE_MULTIPLE);
} else if (jobType.equalsIgnoreCase(JobType.CONDOR.toString())) {
jobAttr.setJobType(GramAttributes.JOBTYPE_CONDOR);
}
return jobAttr;
}
}
| 9,005 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/InputStreamToFileWriter.java | package org.apache.airavata.core.gfac.provider.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
public class InputStreamToFileWriter extends Thread {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
private BufferedReader in;
private BufferedWriter out;
public InputStreamToFileWriter(InputStream in, String out) throws IOException {
this.in = new BufferedReader(new InputStreamReader(in));
this.out = new BufferedWriter(new FileWriter(out));
}
public void run() {
try {
String line = null;
while ((line = in.readLine()) != null) {
if (log.isDebugEnabled()) {
log.debug(line);
}
out.write(line);
out.newLine();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
| 9,006 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/JobSubmissionListener.java | /*
*
* 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.core.gfac.provider.utils;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
import org.apache.airavata.core.gfac.exception.SecurityException;
import org.globus.gram.GramException;
import org.globus.gram.GramJob;
import org.globus.gram.GramJobListener;
import org.ietf.jgss.GSSCredential;
import org.ietf.jgss.GSSException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Gram job listener to check for status changed in job submission
*
*/
public class JobSubmissionListener implements GramJobListener {
public static final String MYPROXY_SECURITY_CONTEXT = "myproxy";
private static final int JOB_PROXY_REMAINING_TIME_LIMIT = 900;
private static final long JOB_FINISH_WAIT_TIME = 60 * 1000l;
private boolean finished;
private int error;
private int status;
private InvocationContext context;
private GramJob job;
private final Logger log = LoggerFactory.getLogger(JobSubmissionListener.class);
public JobSubmissionListener(GramJob job, InvocationContext context) {
this.job = job;
this.context = context;
}
/**
* This method is used to block the process until the status of the job is DONE or FAILED
*
* @throws InterruptedException
* @throws GSSException
* @throws GramException
* @throws SecurityException
*/
public void waitFor() throws InterruptedException, GSSException, GramException, SecurityException {
while (!isFinished()) {
int proxyExpTime = job.getCredentials().getRemainingLifetime();
if (proxyExpTime < JOB_PROXY_REMAINING_TIME_LIMIT) {
log.info("Job proxy expired. Trying to renew proxy");
GSSCredential gssCred = ((GSISecurityContext) context.getSecurityContext(MYPROXY_SECURITY_CONTEXT))
.getGssCredentails();
job.renew(gssCred);
log.info("Myproxy renewed");
}
synchronized (this) {
/*
* job status is changed but method isn't invoked
*/
if (status != 0) {
if (job.getStatus() != status) {
log.info("Change job status manually");
if (setStatus(job.getStatus(), job.getError())) {
break;
}
} else {
log.info("job " + job.getIDAsString() + " have same status: "
+ GramJob.getStatusAsString(status));
}
} else {
log.info("Status is zero");
}
wait(JOB_FINISH_WAIT_TIME);
}
}
}
private synchronized boolean isFinished() {
return this.finished;
}
private synchronized boolean setStatus(int status, int error) {
this.status = status;
this.error = error;
switch (this.status) {
case GramJob.STATUS_FAILED:
log.info("Job Error Code: " + error);
case GramJob.STATUS_DONE:
this.finished = true;
}
return this.finished;
}
public void statusChanged(GramJob job) {
String jobStatusMessage = "Status of job " + job.getIDAsString() + "is " + job.getStatusAsString();
log.info(jobStatusMessage);
/*
* Notify status change
*/
this.context.getExecutionContext().getNotifier().statusChanged(this.context, jobStatusMessage);
/*
* Set new status if it is finished, notify all wait object
*/
if (setStatus(job.getStatus(), job.getError())) {
notifyAll();
}
}
public synchronized int getError() {
return error;
}
public synchronized int getStatus() {
return status;
}
}
| 9,007 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java | /*
*
* 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.core.gfac.scheduler;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.exception.SchedulerException;
import org.apache.airavata.core.gfac.provider.Provider;
/**
* Scheduler selects a {@link Provider} according to the information.
*
*/
public interface Scheduler {
Provider schedule(InvocationContext context) throws SchedulerException;
}
| 9,008 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java | /*
*
* 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.core.gfac.scheduler.impl;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Map;
import javax.xml.stream.XMLStreamException;
import org.apache.airavata.common.registry.api.exception.RegistryException;
import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionDescription;
import org.apache.airavata.core.gfac.exception.ProviderException;
import org.apache.airavata.core.gfac.exception.SchedulerException;
import org.apache.airavata.core.gfac.provider.Provider;
import org.apache.airavata.core.gfac.provider.impl.EC2Provider;
import org.apache.airavata.core.gfac.provider.impl.GramProvider;
import org.apache.airavata.core.gfac.provider.impl.LocalProvider;
import org.apache.airavata.core.gfac.scheduler.Scheduler;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.registry.api.AiravataRegistry;
import org.apache.airavata.schemas.wec.ContextHeaderDocument;
import org.apache.airavata.schemas.wec.SecurityContextDocument;
import org.apache.axiom.om.OMElement;
import org.apache.xmlbeans.XmlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class selects {@link Provider} based on information in {@link AiravataRegistry}
*/
public class SchedulerImpl implements Scheduler {
private static Logger log = LoggerFactory.getLogger(SchedulerImpl.class);
public Provider schedule(InvocationContext context) throws SchedulerException {
AiravataRegistry registryService = context.getExecutionContext().getRegistryService();
/*
* Load Service
*/
ServiceDescription serviceDesc = null;
try {
serviceDesc = registryService.getServiceDescription(context.getServiceName());
} catch (RegistryException e2) {
e2.printStackTrace();
}
if (serviceDesc == null)
throw new SchedulerException("Service Desciption for " + context.getServiceName()
+ " does not found on resource Catalog " + registryService);
/*
* Load host
*/
HostDescription host = scheduleToHost(registryService, context.getServiceName());
if (host == null)
throw new SchedulerException("Host Desciption for " + context.getServiceName()
+ " does not found on resource Catalog " + registryService);
/*
* Load app
*/
ApplicationDeploymentDescription app = null;
try {
app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName());
} catch (RegistryException e2) {
e2.printStackTrace();
}
if (app == null)
throw new SchedulerException("App Desciption for " + context.getServiceName()
+ " does not found on resource Catalog " + registryService);
/*
* Check class and binding
*/
if (context.getExecutionDescription() == null) {
context.setExecutionDescription(new DefaultExecutionDescription());
}
context.getExecutionDescription().setHost(host);
context.getExecutionDescription().setService(serviceDesc);
context.getExecutionDescription().setApp(app);
OMElement omSecurityContextHeader = context.getExecutionContext().getSecurityContextHeader();
ContextHeaderDocument document = null;
try {
if (omSecurityContextHeader != null) {
document = ContextHeaderDocument.Factory.parse(omSecurityContextHeader.toStringWithConsume());
}
} catch (XMLStreamException e) {
e.printStackTrace();
} catch (XmlException e) {
e.printStackTrace();
}
SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices = null;
if (document != null) {
amazonWebservices = document.getContextHeader().getSecurityContext().getAmazonWebservices();
}
/*
* Determine provider
*/
String hostName = host.getType().getHostAddress();
try {
if (GfacUtils.isLocalHost(hostName)) {
return new LocalProvider();
} else if (amazonWebservices != null && hostName != null) {
log.info("host name: " + hostName);
// Amazon Provider
if (hostName.equalsIgnoreCase("AMAZON")){
log.info("EC2 Provider Selected");
try {
return new EC2Provider(context);
} catch (ProviderException e) {
throw new SchedulerException("Unable to select the EC2Provider", e);
}
}
} else {
return new GramProvider();
}
} catch (UnknownHostException e) {
throw new SchedulerException("Cannot get IP for current host", e);
}
return null;
}
private HostDescription scheduleToHost(AiravataRegistry regService, String serviceName) {
log.info("Searching registry for some deployed application hosts");
HostDescription result = null;
Map<HostDescription, List<ApplicationDeploymentDescription>> deploymentDescription = null;
try {
deploymentDescription = regService.searchDeploymentDescription(serviceName);
for (HostDescription hostDesc : deploymentDescription.keySet()) {
result = hostDesc;
log.info("Found service on: " + result.getType().getHostAddress());
}
} catch (RegistryException e) {
e.printStackTrace();
}
if (result==null){
log.warn("Applcation " + serviceName + " not found in registry");
}
return result;
// List<HostDescription> hosts = regService.getServiceLocation(serviceName);
// if (hosts != null && hosts.size() > 0) {
// HostDescription result = null;
// for (Iterator<HostDescription> iterator = hosts.iterator(); iterator.hasNext();) {
// result = iterator.next();
//
// log.info("Found service on: " + result.getType().getHostAddress());
// }
// return result;
// } else {
// log.warn("Applcation " + serviceName + " not found in registry");
// return null;
// }
}
}
| 9,009 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java | /*
*
* 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.core.gfac.utils;
public class GFacConstants {
public static final String NEWLINE = System.getProperty("line.separator");
public static final String INPUT_DATA_DIR_VAR_NAME = "inputData";
public static final String OUTPUT_DATA_DIR_VAR_NAME = "outputData";
public static final int DEFAULT_GSI_FTP_PORT = 2811;
public static final String _127_0_0_1 = "127.0.0.1";
public static final String LOCALHOST = "localhost";
private GFacConstants() {
}
}
| 9,010 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java | /*
*
* 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.core.gfac.utils;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.UUID;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.schemas.gfac.*;
import org.apache.axiom.om.OMElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GfacUtils {
private final static Logger log = LoggerFactory.getLogger(GfacUtils.class);
private GfacUtils() {
}
/**
* Read data from inputStream and convert it to String.
*
* @param in
* @return String read from inputStream
* @throws IOException
*/
public static String readFromStream(InputStream in) throws IOException {
try {
StringBuffer wsdlStr = new StringBuffer();
int read;
byte[] buf = new byte[1024];
while ((read = in.read(buf)) > 0) {
wsdlStr.append(new String(buf, 0, read));
}
return wsdlStr.toString();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
log.warn("Cannot close InputStream: " + in.getClass().getName(), e);
}
}
}
}
public static String readFileToString(String file) throws FileNotFoundException, IOException {
BufferedReader instream = null;
try {
instream = new BufferedReader(new FileReader(file));
StringBuffer buff = new StringBuffer();
String temp = null;
while ((temp = instream.readLine()) != null) {
buff.append(temp);
buff.append(GFacConstants.NEWLINE);
}
return buff.toString();
} finally {
if (instream != null) {
try {
instream.close();
} catch (IOException e) {
log.warn("Cannot close FileinputStream", e);
}
}
}
}
public static boolean isLocalHost(String appHost) throws UnknownHostException {
String localHost = InetAddress.getLocalHost().getCanonicalHostName();
return (localHost.equals(appHost) || GFacConstants.LOCALHOST.equals(appHost) || GFacConstants._127_0_0_1
.equals(appHost));
}
public static String createUniqueNameForService(String serviceName) {
String date = new Date().toString();
date = date.replaceAll(" ", "_");
date = date.replaceAll(":", "_");
return serviceName + "_" + date + "_" + UUID.randomUUID();
}
public static URI createGsiftpURI(GridFTPContactInfo host, String localPath) throws URISyntaxException {
StringBuffer buf = new StringBuffer();
if (!host.hostName.startsWith("gsiftp://"))
buf.append("gsiftp://");
buf.append(host).append(":").append(host.port);
if (!host.hostName.endsWith("/"))
buf.append("/");
buf.append(localPath);
return new URI(buf.toString());
}
public static URI createGsiftpURI(String host, String localPath) throws URISyntaxException {
StringBuffer buf = new StringBuffer();
if (!host.startsWith("gsiftp://"))
buf.append("gsiftp://");
buf.append(host);
if (!host.endsWith("/"))
buf.append("/");
buf.append(localPath);
return new URI(buf.toString());
}
public static ActualParameter getInputActualParameter(Parameter parameter, OMElement element) {
OMElement innerelement = null;
ActualParameter actualParameter = new ActualParameter();
if ("String".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(StringParameterType.type);
if (!"".equals(element.getText())) {
((StringParameterType) actualParameter.getType()).setValue(element.getText());
} else if(element.getChildrenWithLocalName("value").hasNext()){
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((StringParameterType) actualParameter.getType()).setValue(innerelement.getText());
} else{
((StringParameterType) actualParameter.getType()).setValue("");
}
} else if ("Double".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(DoubleParameterType.type);
if (!"".equals(element.getText())) {
((DoubleParameterType) actualParameter.getType()).setValue(new Double(innerelement.getText()));
} else {
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((DoubleParameterType) actualParameter.getType()).setValue(new Double(innerelement.getText()));
}
} else if ("Integer".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(IntegerParameterType.type);
if (!"".equals(element.getText())) {
((IntegerParameterType) actualParameter.getType()).setValue(new Integer(element.getText()));
} else {
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((IntegerParameterType) actualParameter.getType()).setValue(new Integer(innerelement.getText()));
}
} else if ("Float".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FloatParameterType.type);
if (!"".equals(element.getText())) {
((FloatParameterType) actualParameter.getType()).setValue(new Float(element.getText()));
} else {
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((FloatParameterType) actualParameter.getType()).setValue(new Float(innerelement.getText()));
}
} else if ("Boolean".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(BooleanParameterType.type);
if (!"".equals(element.getText())) {
((BooleanParameterType) actualParameter.getType()).setValue(new Boolean(element.getText()));
} else {
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((BooleanParameterType) actualParameter.getType()).setValue(Boolean.parseBoolean(innerelement.getText()));
}
} else if ("File".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FileParameterType.type);
if (!"".equals(element.getText())) {
((FileParameterType) actualParameter.getType()).setValue(element.getText());
} else {
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
((FileParameterType) actualParameter.getType()).setValue(innerelement.getText());
}
} else if ("URI".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(URIParameterType.type);
if (!"".equals(element.getText())) {
((URIParameterType) actualParameter.getType()).setValue(element.getText());
} else if(element.getChildrenWithLocalName("value").hasNext()){
innerelement = (OMElement) element.getChildrenWithLocalName("value").next();
System.out.println(actualParameter.getType().toString());
log.debug(actualParameter.getType().toString());
((URIParameterType) actualParameter.getType()).setValue(innerelement.getText());
} else{
((URIParameterType) actualParameter.getType()).setValue("");
}
} else if ("StringArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(StringArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((StringArrayType) actualParameter.getType()).insertValue(i++, arrayValue);
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((StringArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
}
} else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(DoubleArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((DoubleArrayType) actualParameter.getType()).insertValue(i++, new Double(arrayValue));
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((DoubleArrayType) actualParameter.getType()).insertValue(i++, new Double(innerelement.getText()));
}
}
} else if ("IntegerArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(IntegerArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((IntegerArrayType) actualParameter.getType()).insertValue(i++, new Integer(arrayValue));
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((IntegerArrayType) actualParameter.getType()).insertValue(i++, new Integer(innerelement.getText()));
}
}
} else if ("FloatArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FloatArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((FloatArrayType) actualParameter.getType()).insertValue(i++, new Float(arrayValue));
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((FloatArrayType) actualParameter.getType()).insertValue(i++, new Float(innerelement.getText()));
}
}
} else if ("BooleanArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(BooleanArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((BooleanArrayType) actualParameter.getType()).insertValue(i++, new Boolean(arrayValue));
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((BooleanArrayType) actualParameter.getType()).insertValue(i++, new Boolean(innerelement.getText()));
}
}
} else if ("FileArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FileArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((FileArrayType) actualParameter.getType()).insertValue(i++, arrayValue);
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((FileArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
}
} else if ("URIArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(URIArrayType.type);
Iterator value = element.getChildrenWithLocalName("value");
int i = 0;
if (!"".equals(element.getText())) {
String[] list = element.getText().split(",");
for(String arrayValue:list){
((URIArrayType) actualParameter.getType()).insertValue(i++,arrayValue);
}
} else {
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((URIArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
}
}
return actualParameter;
}
public static ActualParameter getInputActualParameter(Parameter parameter, String inputVal) {
OMElement innerelement = null;
ActualParameter actualParameter = new ActualParameter();
if ("String".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(StringParameterType.type);
((StringParameterType) actualParameter.getType()).setValue(inputVal);
} else if ("Double".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(DoubleParameterType.type);
((DoubleParameterType) actualParameter.getType()).setValue(new Double(inputVal));
} else if ("Integer".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(IntegerParameterType.type);
((IntegerParameterType) actualParameter.getType()).setValue(new Integer(inputVal));
} else if ("Float".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FloatParameterType.type);
((FloatParameterType) actualParameter.getType()).setValue(new Float(inputVal));
} else if ("Boolean".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(BooleanParameterType.type);
((BooleanParameterType) actualParameter.getType()).setValue(new Boolean(inputVal));
} else if ("File".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FileParameterType.type);
((FileParameterType) actualParameter.getType()).setValue(inputVal);
} else if ("URI".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(URIParameterType.type);
((URIParameterType) actualParameter.getType()).setValue(inputVal);
} else if ("StringArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(StringArrayType.type);
Iterator iterator = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (iterator.hasNext()) {
innerelement = (OMElement) iterator.next();
((StringArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
} else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(DoubleArrayType.type);
Iterator value =Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((DoubleArrayType) actualParameter.getType()).insertValue(i++, new Double(innerelement.getText()));
}
} else if ("IntegerArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(IntegerArrayType.type);
Iterator value = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((IntegerArrayType) actualParameter.getType()).insertValue(i++, new Integer(innerelement.getText()));
}
} else if ("FloatArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FloatArrayType.type);
Iterator value = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((FloatArrayType) actualParameter.getType()).insertValue(i++, new Float(innerelement.getText()));
}
} else if ("BooleanArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(BooleanArrayType.type);
Iterator value = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((BooleanArrayType) actualParameter.getType()).insertValue(i++, new Boolean(innerelement.getText()));
}
} else if ("FileArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(FileArrayType.type);
Iterator value = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((FileArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
} else if ("URIArray".equals(parameter.getParameterType().getName())) {
actualParameter = new ActualParameter(URIArrayType.type);
Iterator value = Arrays.asList(inputVal.split(",")).iterator();
int i = 0;
while (value.hasNext()) {
innerelement = (OMElement) value.next();
((URIArrayType) actualParameter.getType()).insertValue(i++, innerelement.getText());
}
}
return actualParameter;
}
}
| 9,011 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/OutputUtils.java | /*
*
* 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.core.gfac.utils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.core.gfac.context.message.MessageContext;
import org.apache.xmlbeans.XmlException;
public class OutputUtils {
private OutputUtils() {
}
public static Map<String, ActualParameter> fillOutputFromStdout(MessageContext<ActualParameter> outMessage, String stdout) throws XmlException{
Map<String, ActualParameter> result = new HashMap<String, ActualParameter>();
for (Iterator<String> iterator = outMessage.getNames(); iterator.hasNext();) {
String parameterName = iterator.next();
// if parameter value is not already set, we let it go
if (outMessage.getValue(parameterName) == null) {
continue;
}
ActualParameter actual = outMessage.getValue(parameterName);
String parseStdout = parseStdout(stdout, parameterName);
if(parseStdout != null){
MappingFactory.fromString(actual, parseStdout);
result.put(parameterName, actual);
}
}
return result;
}
private static String parseStdout(String stdout, String outParam)throws NullPointerException {
String regex = Pattern.quote(outParam) + "\\s*=\\s*([^\\[\\s'\"][^\\s]*|\"[^\"]*\"|'[^']*'|\\[[^\\[]*\\])";
String match = null;
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(stdout);
while (matcher.find()) {
match = matcher.group(1);
}
if (match != null) {
match = match.trim();
return match;
} else {
throw new NullPointerException();
}
}
}
| 9,012 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/InputUtils.java | /*
*
* 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.core.gfac.utils;
import java.util.List;
public class InputUtils {
private static final String SPACE = " ";
private InputUtils() {
}
public static String buildCommand(List<String> cmdList) {
StringBuffer buff = new StringBuffer();
for (String string : cmdList) {
buff.append(string);
buff.append(SPACE);
}
return buff.toString();
}
}
| 9,013 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GridFTPContactInfo.java | /*
*
* 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.core.gfac.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Class represents GridFTP Endpoint
*
*/
public class GridFTPContactInfo {
protected final static Logger log = LoggerFactory.getLogger(GridFTPContactInfo.class);
public String hostName;
public int port;
public GridFTPContactInfo(String hostName, int port) {
if (port <= 0 || port == 80) {
log.debug(hostName + "port recived " + port + " setting it to " + GFacConstants.DEFAULT_GSI_FTP_PORT);
port = GFacConstants.DEFAULT_GSI_FTP_PORT;
}
this.hostName = hostName;
this.port = port;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof GridFTPContactInfo) {
return hostName.equals(((GridFTPContactInfo) obj).hostName) && port == ((GridFTPContactInfo) obj).port;
} else {
return false;
}
}
@Override
public int hashCode() {
return hostName.hashCode();
}
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(hostName).append(":").append(port);
return buf.toString();
}
}
| 9,014 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/LogUtils.java | /*
*
* 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.core.gfac.utils;
import java.util.Enumeration;
import java.util.Properties;
import org.slf4j.Logger;
public class LogUtils {
private LogUtils() {
}
/**
* Print out properties' items into a log with the format: key = value. Use debug level if it is enabled otherwise
* use info level.
*
* @param log
* @param prop
*/
public static void displayProperties(Logger log, Properties prop) {
Enumeration em = prop.keys();
while (em.hasMoreElements()) {
String key = em.nextElement().toString();
String value = prop.getProperty(key);
String msg = key + " = " + value;
if (log.isDebugEnabled()) {
log.debug(msg);
} else {
log.info(msg);
}
}
}
}
| 9,015 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java | /*
*
* 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.core.gfac.external;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.ToolsException;
import org.apache.airavata.core.gfac.utils.GFacConstants;
import org.apache.airavata.core.gfac.utils.GfacUtils;
import org.apache.airavata.core.gfac.utils.GridFTPContactInfo;
import org.globus.ftp.DataChannelAuthentication;
import org.globus.ftp.DataSourceStream;
import org.globus.ftp.FileInfo;
import org.globus.ftp.GridFTPClient;
import org.globus.ftp.HostPort;
import org.globus.ftp.Marker;
import org.globus.ftp.MarkerListener;
import org.globus.ftp.MlsxEntry;
import org.globus.ftp.Session;
import org.globus.ftp.exception.ClientException;
import org.globus.ftp.exception.ServerException;
import org.globus.gsi.gssapi.auth.HostAuthorization;
import org.ietf.jgss.GSSCredential;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* GridFTP tools
*/
public class GridFtp {
public static final Logger log = LoggerFactory.getLogger(GridFtp.class);
public static final String GSIFTP_SCHEME = "gsiftp";
public static final String HOST = "host";
/**
* Make directory at remote location
*
* @param destURI
* @param gssCred
* @throws ServerException
* @throws IOException
*/
public void makeDir(URI destURI, GSSCredential gssCred) throws ToolsException {
GridFTPClient destClient = null;
GridFTPContactInfo destHost = new GridFTPContactInfo(destURI.getHost(), destURI.getPort());
try {
String destPath = destURI.getPath();
log.info(("Creating Directory = " + destHost + "=" + destPath));
destClient = new GridFTPClient(destHost.hostName, destHost.port);
int tryCount = 0;
while (true) {
try {
destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
destClient.authenticate(gssCred);
destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
if (!destClient.exists(destPath)) {
destClient.makeDir(destPath);
}
break;
} catch (ServerException e) {
tryCount++;
if (tryCount >= 3) {
throw new ToolsException(e.getMessage(), e);
}
Thread.sleep(10000);
} catch (IOException e) {
tryCount++;
if (tryCount >= 3) {
throw new ToolsException(e.getMessage(), e);
}
Thread.sleep(10000);
}
}
} catch (ServerException e) {
throw new ToolsException("Cannot Create GridFTP Client to:" + destHost.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot Create GridFTP Client to:" + destHost.toString(), e);
} catch (InterruptedException e) {
throw new ToolsException("Internal Error cannot sleep", e);
} finally {
if (destClient != null) {
try {
destClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
/**
* Upload file from stream
*
* @param destURI
* @param gsCredential
* @param localFile
* @throws GfacException
*/
public void uploadFile(URI destURI, GSSCredential gsCredential, InputStream io) throws ToolsException {
GridFTPClient ftpClient = null;
GridFTPContactInfo contactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort());
try {
String remoteFile = destURI.getPath();
log.info("The remote file is " + remoteFile);
log.debug("Setup GridFTP Client");
ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
ftpClient.authenticate(gsCredential);
ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
log.debug("Uploading file");
ftpClient.put(remoteFile, new DataSourceStream(io), new MarkerListener() {
public void markerArrived(Marker marker) {
}
});
log.info("Upload file to:" + remoteFile + " is done");
} catch (ServerException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} catch (ClientException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} finally {
if (ftpClient != null) {
try {
ftpClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
public void uploadFile(URI srcURI, URI destURI, GSSCredential gsCredential) throws ToolsException {
GridFTPClient srcClient = null;
GridFTPContactInfo destContactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort());
GridFTPContactInfo srcContactInfo = new GridFTPContactInfo(srcURI.getHost(),srcURI.getPort());
try {
String remoteFile = destURI.getPath();
log.info("The remote file is " + remoteFile);
log.debug("Setup GridFTP Client");
srcClient = new GridFTPClient(srcContactInfo.hostName, srcContactInfo.port);
srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
srcClient.authenticate(gsCredential);
srcClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
GridFTPClient destClient = new GridFTPClient(srcContactInfo.hostName, srcContactInfo.port);
destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
destClient.authenticate(gsCredential);
destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
log.debug("Uploading file");
srcClient.transfer(srcURI.getPath(),destClient, remoteFile, false, null);
log.info("Upload file to:" + remoteFile + " is done");
} catch (ServerException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + destContactInfo.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + destContactInfo.toString(), e);
} catch (ClientException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + destContactInfo.toString(), e);
} finally {
if (srcClient != null) {
try {
srcClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
/**
* Upload file to remote location
*
* @param destURI
* @param gsCredential
* @param localFile
* @throws GfacException
*/
public void uploadFile(URI destURI, GSSCredential gsCredential, File localFile) throws ToolsException {
GridFTPClient ftpClient = null;
GridFTPContactInfo contactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort());
try {
String remoteFile = destURI.getPath();
log.info("The local temp file is " + localFile);
log.info("the remote file is " + remoteFile);
log.debug("Setup GridFTP Client");
ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
ftpClient.authenticate(gsCredential);
ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
log.debug("Uploading file");
ftpClient.put(localFile, remoteFile, false);
log.info("Upload file to:" + remoteFile + " is done");
} catch (ServerException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} catch (ClientException e) {
throw new ToolsException("Cannot upload file to GridFTP:" + contactInfo.toString(), e);
} finally {
if (ftpClient != null) {
try {
ftpClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
/**
* Download File from remote location
*
* @param destURI
* @param gsCredential
* @param localFile
* @throws GfacException
*/
public void downloadFile(URI destURI, GSSCredential gsCredential, File localFile) throws ToolsException {
GridFTPClient ftpClient = null;
GridFTPContactInfo contactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort());
try {
String remoteFile = destURI.getPath();
log.info("The local temp file is " + localFile);
log.info("the remote file is " + remoteFile);
log.debug("Setup GridFTP Client");
ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
ftpClient.authenticate(gsCredential);
ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
log.debug("Downloading file");
ftpClient.get(remoteFile, localFile);
log.info("Download file to:" + remoteFile + " is done");
} catch (ServerException e) {
throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
} catch (ClientException e) {
throw new ToolsException("Cannot download file from GridFTP:" + contactInfo.toString(), e);
} finally {
if (ftpClient != null) {
try {
ftpClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
/**
* Stream remote file
*
* @param destURI
* @param gsCredential
* @param localFile
* @return
* @throws GfacException
*/
public String readRemoteFile(URI destURI, GSSCredential gsCredential, File localFile) throws ToolsException {
BufferedReader instream = null;
File localTempfile = null;
try {
if (localFile == null) {
localTempfile = File.createTempFile("stderr", "err");
} else {
localTempfile = localFile;
}
log.debug("Loca temporary file:" + localTempfile);
downloadFile(destURI, gsCredential, localTempfile);
instream = new BufferedReader(new FileReader(localTempfile));
StringBuffer buff = new StringBuffer();
String temp = null;
while ((temp = instream.readLine()) != null) {
buff.append(temp);
buff.append(GFacConstants.NEWLINE);
}
log.debug("finish read file:" + localTempfile);
return buff.toString();
} catch (FileNotFoundException e) {
throw new ToolsException("Cannot read localfile file:" + localTempfile, e);
} catch (IOException e) {
throw new ToolsException("Cannot read localfile file:" + localTempfile, e);
} finally {
if (instream != null) {
try {
instream.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection",e);
}
}
}
}
/**
* Transfer data from one GridFTp Endpoint to another GridFTP Endpoint
*
* @param srchost
* @param desthost
* @param gssCred
* @param srcActive
* @throws ServerException
* @throws ClientException
* @throws IOException
*/
public void transfer(URI srchost, URI desthost, GSSCredential gssCred, boolean srcActive) throws ToolsException {
GridFTPClient destClient = null;
GridFTPClient srcClient = null;
try {
destClient = new GridFTPClient(desthost.getHost(), desthost.getPort());
destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
destClient.authenticate(gssCred);
destClient.setType(Session.TYPE_IMAGE);
srcClient = new GridFTPClient(srchost.getHost(), srchost.getPort());
srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
srcClient.authenticate(gssCred);
srcClient.setType(Session.TYPE_IMAGE);
if (srcActive) {
log.debug("Set src active");
HostPort hp = destClient.setPassive();
srcClient.setActive(hp);
} else {
log.debug("Set dst active");
HostPort hp = srcClient.setPassive();
destClient.setActive(hp);
}
log.debug("Start transfer file from GridFTP:" + srchost.toString() + " to " + desthost.toString());
/**
* Transfer a file. The transfer() function blocks until the transfer is complete.
*/
srcClient.transfer(srchost.getPath(), destClient, desthost.getPath(), false, null);
if (srcClient.getSize(srchost.getPath()) == destClient.getSize(desthost.getPath())) {
log.debug("CHECK SUM OK");
} else {
log.debug("****CHECK SUM FAILED****");
}
} catch (ServerException e) {
throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
+ desthost.toString(), e);
} catch (IOException e) {
throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
+ desthost.toString(), e);
} catch (ClientException e) {
throw new ToolsException("Cannot transfer file from GridFTP:" + srchost.toString() + " to "
+ desthost.toString(), e);
} finally {
if (destClient != null) {
try {
destClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection at Desitnation:" + desthost.toString());
}
}
if (srcClient != null) {
try {
srcClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection at Source:" + srchost.toString(),e);
}
}
}
}
/**
* List files in a GridFTP directory
* @param dirURI
* @param gssCred
* @return
* @throws ToolsException
*/
@SuppressWarnings("unchecked")
public List<String> listDir(URI dirURI, GSSCredential gssCred) throws ToolsException {
List<String> files = new ArrayList<String>();
GridFTPClient srcClient = null;
try {
GridFTPContactInfo contactInfo = new GridFTPContactInfo(dirURI.getHost(), dirURI.getPort());
srcClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
srcClient.authenticate(gssCred);
srcClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
srcClient.setType(Session.TYPE_ASCII);
srcClient.changeDir(dirURI.getPath());
Vector<Object> fileInfo = null;
try {
fileInfo = srcClient.mlsd();
} catch (Throwable e) {
fileInfo = srcClient.list();
}
if (!fileInfo.isEmpty()) {
for (int j = 0; j < fileInfo.size(); ++j) {
String name = null;
if (fileInfo.get(j) instanceof MlsxEntry) {
name = ((MlsxEntry) fileInfo.get(j)).getFileName();
} else if (fileInfo.get(j) instanceof FileInfo) {
name = ((FileInfo) fileInfo.get(j)).getName();
} else {
throw new ToolsException("Unsupported type returned by gridftp " + fileInfo.get(j));
}
if (!name.equals(".") && !name.equals("..")) {
URI uri = GfacUtils.createGsiftpURI(contactInfo.hostName, dirURI.getPath() + File.separator + name);
files.add(uri.getPath());
}
}
}
return files;
} catch (IOException e) {
throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
} catch (ServerException e) {
throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
} catch (ClientException e) {
throw new ToolsException("Could not list directory: " + dirURI.toString() ,e);
} catch (URISyntaxException e) {
throw new ToolsException("Error creating URL of listed files: " + dirURI.toString() ,e);
} finally {
if (srcClient != null) {
try {
srcClient.close();
} catch (Exception e) {
log.warn("Cannot close GridFTP client connection", e);
}
}
}
}
}
| 9,016 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/ServiceException.java | /*
*
* 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.core.gfac.exception;
/**
* Exception for Service
*
*/
public class ServiceException extends GfacException {
public ServiceException(String message) {
super(message);
}
public ServiceException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,017 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java | /*
*
* 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.core.gfac.exception;
/**
* Exception for all Security related issue.
*
*/
public class SecurityException extends GfacException {
public SecurityException(String message) {
super(message);
}
public SecurityException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,018 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/ProviderException.java | /*
*
* 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.core.gfac.exception;
import org.apache.airavata.core.gfac.provider.Provider;
/**
* The exception for {@link Provider}
*
*/
public class ProviderException extends GfacException {
public ProviderException(String message) {
super(message);
}
public ProviderException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,019 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/ToolsException.java | /*
*
* 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.core.gfac.exception;
/**
* Exception for all utilities
*/
public class ToolsException extends GfacException {
public ToolsException(String message) {
super(message);
}
public ToolsException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,020 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SchedulerException.java | /*
*
* 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.core.gfac.exception;
import org.apache.airavata.core.gfac.scheduler.Scheduler;
/**
* The exception for {@link Scheduler}
*
*/
public class SchedulerException extends GfacException {
public SchedulerException(String message) {
super(message);
}
public SchedulerException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,021 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/GfacException.java | /*
*
* 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.core.gfac.exception;
/**
* The main exception for the GFac Service
*
*/
public class GfacException extends Exception {
private static final long serialVersionUID = 1L;
protected String faultCode;
public GfacException(String message) {
super(message);
}
public GfacException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,022 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/JobSubmissionFault.java | /*
*
* 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.core.gfac.exception;
import org.apache.airavata.core.gfac.provider.Provider;
/**
* JobSubmissionFault represents an error from Provider which uses submission.
*/
public class JobSubmissionFault extends ProviderException {
public static final String JOB_CANCEL = "JOB_CANCEL";
public static final String JOB_FAILED = "JOB_FAILED";
private String reason;
public JobSubmissionFault(Provider provider, Throwable cause, String submitHost, String contact, String rsl) {
super(cause.getMessage(), cause);
}
public void setReason(String reason) {
this.reason = reason;
}
}
| 9,023 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/ExtensionException.java | /*
*
* 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.core.gfac.exception;
/**
* ExtensionException is risen from Extension e.g. file transfer, etc.
*/
public class ExtensionException extends GfacException {
public ExtensionException(String message) {
super(message);
}
public ExtensionException(String message, Throwable cause) {
super(message, cause);
}
}
| 9,024 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/PropertyServiceFactory.java | /*
*
* 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.core.gfac.factory;
import org.apache.airavata.core.gfac.services.GenericService;
import org.apache.airavata.core.gfac.services.impl.PropertiesBasedServiceImpl;
/**
* Factory for {@link PropertiesBasedServiceImpl}
*
*/
public class PropertyServiceFactory extends AbstractServiceFactory {
private GenericService service;
private String fileName;
/**
* Default constructor with used file "service.properties"
*/
public PropertyServiceFactory() {
}
/**
* Construct the {@link PropertiesBasedServiceImpl} with a given property file
*/
public PropertyServiceFactory(String fileName) {
this.fileName = fileName;
}
public GenericService getGenericService() {
if (service == null) {
if (this.fileName == null) {
service = new PropertiesBasedServiceImpl();
} else {
service = new PropertiesBasedServiceImpl(this.fileName);
}
}
return service;
}
}
| 9,025 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/AbstractServiceFactory.java | /*
*
* 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.core.gfac.factory;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.services.GenericService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Abstract Factory to create a generic service
*
*/
public abstract class AbstractServiceFactory {
protected final Logger log = LoggerFactory.getLogger(AbstractServiceFactory.class);
/**
* Create and initialize a generic service
*
* @return the generic service
* @throws GfacException
*/
public final GenericService createService() throws GfacException {
log.debug("Try to get GenericService");
GenericService service = getGenericService();
log.debug("Done get, Try to init GenericService");
service.init();
log.debug("Done init GenericService");
return getGenericService();
}
/**
* Get a service of specific type
*
* @return
* @throws GfacException
*/
protected abstract GenericService getGenericService() throws GfacException;
}
| 9,026 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java | /*
*
* 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.core.gfac.services;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.exception.GfacException;
/**
* The description for generic service in GFAC.
*/
public interface GenericService {
void init() throws GfacException;
void execute(InvocationContext context) throws GfacException;
void dispose() throws GfacException;
}
| 9,027 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/services | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/AbstractSimpleService.java | /*
*
* 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.core.gfac.services.impl;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.exception.ExtensionException;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.ServiceException;
import org.apache.airavata.core.gfac.extension.DataServiceChain;
import org.apache.airavata.core.gfac.extension.ExitableChain;
import org.apache.airavata.core.gfac.extension.PostExecuteChain;
import org.apache.airavata.core.gfac.extension.PreExecuteChain;
import org.apache.airavata.core.gfac.provider.Provider;
import org.apache.airavata.core.gfac.scheduler.Scheduler;
import org.apache.airavata.core.gfac.services.GenericService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The abstract service wraps up steps of execution for {@link GenericService}. Also, it adds input/output plug-ins
* before/after {@link Provider} execution. <br/>
* The steps in execution are <br/>
* - preProcess <br/>
* - Determine Provider (Scheduling) <br/>
* - {@link DataServiceChain} Plugins <br/>
* - {@link Provider} initialization <br/>
* - {@link PreExecuteChain} Plugins <br/>
* - {@link Provider} execution <br/>
* - {@link PostExecuteChain} Plugins <br/>
* - {@link Provider} disposal <br/>
* - postProcess <br/>
* Users who wants built in notification in to their service has to implement this class
*/
public abstract class AbstractSimpleService implements GenericService {
private static Logger log = LoggerFactory.getLogger(AbstractSimpleService.class);
public abstract void preProcess(InvocationContext context) throws ServiceException;
public abstract void postProcess(InvocationContext context) throws ServiceException;
public abstract Scheduler getScheduler(InvocationContext context) throws ServiceException;
public abstract PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws ServiceException;
public abstract PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws ServiceException;
public abstract DataServiceChain[] getDataChains(InvocationContext context) throws ServiceException;
public final void execute(InvocationContext context) throws GfacException {
log.debug("Before preprocess");
/*
* Pre-Process
*/
preProcess(context);
log.debug("After preprocess, try to get Scheduler and schedule");
/*
* Determine provider
*/
Scheduler scheduler = getScheduler(context);
context.getExecutionContext().getNotifier().startSchedule(context);
Provider provider = scheduler.schedule(context);
context.getExecutionContext().getNotifier().finishSchedule(context);
log.debug("After scheduling, try to run data chain");
/*
* Load data necessary data
*/
buildChains(getDataChains(context)).start(context);
log.debug("After data chain, try to init provider");
/*
* Init
*/
provider.initialize(context);
log.debug("After provider initialization, try to run pre-execution chain");
/*
* Pre-Execution
*/
buildChains(getPreExecutionSteps(context)).start(context);
log.debug("After pre-execution chain, try to execute provider");
try {
/*
* Execute
*/
Map<String, ?> result = provider.execute(context);
log.debug("After provider execution, try to run post-execution chain");
/*
* Fill MessageContext with the output from Provider
*/
for (Entry<String, ?> entry : result.entrySet()) {
context.getOutput().setValue(entry.getKey(), entry.getValue());
}
/*
* Post-Execution
*/
buildChains(getPostExecuteSteps(context)).start(context);
log.debug("After pre-execution chain, try to dispose provider");
} finally {
/*
* Destroy
*/
provider.dispose(context);
log.debug("After provider disposal, try to run postprocess");
}
/*
* Pre-Process
*/
postProcess(context);
log.debug("After postprocess");
}
private ExitableChain buildChains(ExitableChain[] list) {
/*
* Validation check and return doing-nothing chain object
*/
if (list == null || list.length == 0) {
return new NullChain();
}
ExitableChain currentPoint = list[0];
for (int i = 1; i < list.length; i++) {
currentPoint = currentPoint.setNext(list[i]);
}
return currentPoint;
}
/**
* Inner class for no chain
*/
private static class NullChain extends ExitableChain {
@Override
protected boolean execute(InvocationContext context) throws ExtensionException {
return true;
}
}
}
| 9,028 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/services | Create_ds/airavata-sandbox/gfac-refactoring/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java | /*
*
* 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.core.gfac.services.impl;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import org.apache.airavata.common.registry.api.impl.JCRRegistry;
import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
import org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
import org.apache.airavata.core.gfac.context.security.impl.SSHSecurityContextImpl;
import org.apache.airavata.core.gfac.exception.GfacException;
import org.apache.airavata.core.gfac.exception.ServiceException;
import org.apache.airavata.core.gfac.extension.DataServiceChain;
import org.apache.airavata.core.gfac.extension.ExitableChain;
import org.apache.airavata.core.gfac.extension.PostExecuteChain;
import org.apache.airavata.core.gfac.extension.PreExecuteChain;
import org.apache.airavata.core.gfac.scheduler.Scheduler;
import org.apache.airavata.core.gfac.utils.LogUtils;
import org.apache.airavata.registry.api.AiravataRegistry;
import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This generic service implementation will load Registry service and Data Catalog from property file using (Apache
* Commons-Configuration). It selects provider and execute it base on execution context.
*
*/
public class PropertiesBasedServiceImpl extends AbstractSimpleService {
private static Logger log = LoggerFactory.getLogger(PropertiesBasedServiceImpl.class);
/*
* default properties file location
*/
private static final String DEFAULT_FILENAME = "service.properties";
/*
* context name
*/
public static final String MYPROXY_SECURITY_CONTEXT = "myproxy";
public static final String SSH_SECURITY_CONTEXT = "ssh";
/*
* Scheduler and chains
*/
public static final String SCHEDULER_CLASS = "scheduler.class";
public static final String DATA_CHAIN_CLASS = "datachain.classes";
public static final String PRE_CHAIN_CLASS = "prechain.classes";
public static final String POST_CHAIN_CLASS = "postchain.classes";
/*
* JCR properties
*/
public static final String JCR_CLASS = "jcr.class";
public static final String JCR_USER = "jcr.user";
public static final String JCR_PASS = "jcr.pass";
/*
* SSH properties
*/
public static final String SSH_PRIVATE_KEY = "ssh.key";
public static final String SSH_PRIVATE_KEY_PASS = "ssh.keypass";
public static final String SSH_USER_NAME = "ssh.username";
/*
* My proxy properties
*/
public static final String MYPROXY_SERVER = "myproxy.server";
public static final String MYPROXY_USER = "myproxy.user";
public static final String MYPROXY_PASS = "myproxy.pass";
public static final String MYPROXY_LIFE = "myproxy.life";
private Scheduler scheduler;
private PreExecuteChain[] preChain;
private PostExecuteChain[] postChain;
private DataServiceChain[] dataChain;
private AiravataRegistry registryService;
private String fileName = DEFAULT_FILENAME;
private Configuration config;
/**
* Default constructor
*/
public PropertiesBasedServiceImpl() {
log.debug("Create Default PropertiesBasedServiceImpl");
}
/**
* Constructor with passing file
*
* @param prop
*/
public PropertiesBasedServiceImpl(String fileName) {
this.fileName = fileName;
log.debug("Create PropertiesBasedServiceImpl with Filename");
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.GenericService#init(org.apache .airavata.core.gfac.context.
* InvocationContext)
*/
public void init() throws GfacException {
try {
/*
* Load properties only it is not loaded
*/
if (this.config == null || this.config.isEmpty()) {
this.config = new PropertiesConfiguration(this.fileName);
log.info("Properties loaded");
LogUtils.displayProperties(log, getProperties());
}
} catch (ConfigurationException e) {
throw new GfacException("Error initialize the PropertiesBasedServiceImpl", e);
}
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.GenericService#dispose(org.apache .airavata.core.gfac.context.
* InvocationContext)
*/
public void dispose() throws GfacException {
}
@Override
public void preProcess(InvocationContext context) throws ServiceException {
/*
* Check Gram header
*/
if (context.getSecurityContext(MYPROXY_SECURITY_CONTEXT) == null) {
String proxyServer = loadFromProperty(MYPROXY_SERVER, false);
String proxyUser = loadFromProperty(MYPROXY_USER, false);
String proxyPass = loadFromProperty(MYPROXY_PASS, false);
String proxyTime = loadFromProperty(MYPROXY_LIFE, false);
if (proxyServer != null && proxyUser != null && proxyPass != null) {
GSISecurityContext gsi = new GSISecurityContext();
gsi.setMyproxyServer(proxyServer);
gsi.setMyproxyUserName(proxyUser);
gsi.setMyproxyPasswd(proxyPass);
if (proxyTime != null) {
gsi.setMyproxyLifetime(Integer.parseInt(proxyTime));
}
context.addSecurityContext(MYPROXY_SECURITY_CONTEXT, gsi);
}
}
/*
* Check SSH properties
*/
if (context.getSecurityContext(SSH_SECURITY_CONTEXT) == null) {
String key = loadFromProperty(SSH_PRIVATE_KEY, false);
String pass = loadFromProperty(SSH_PRIVATE_KEY_PASS, false);
String user = loadFromProperty(SSH_USER_NAME, false);
if (key != null && user != null) {
SSHSecurityContextImpl ssh = new SSHSecurityContextImpl();
ssh.setKeyPass(pass);
ssh.setPrivateKeyLoc(key);
ssh.setUsername(user);
context.addSecurityContext(SSH_SECURITY_CONTEXT, ssh);
}
}
/*
* Check registry
*/
if (context.getExecutionContext() == null || context.getExecutionContext().getRegistryService() == null) {
if (this.registryService == null) {
log.info("try to create default registry service (JCR Implementation)");
// JCR
String jcrClass = loadFromProperty(JCR_CLASS, true);
String userName = loadFromProperty(JCR_USER, false);
String password = loadFromProperty(JCR_PASS, false);
/*
* Remove unnecessary key
*/
Map<String, String> map = new HashMap<String, String>((Map) getProperties());
map.remove(JCR_CLASS);
map.remove(JCR_USER);
map.remove(JCR_PASS);
map.remove(SCHEDULER_CLASS);
map.remove(DATA_CHAIN_CLASS);
map.remove(PRE_CHAIN_CLASS);
map.remove(POST_CHAIN_CLASS);
map.remove(MYPROXY_SERVER);
map.remove(MYPROXY_USER);
map.remove(MYPROXY_PASS);
map.remove(MYPROXY_LIFE);
map.remove(SSH_USER_NAME);
map.remove(SSH_PRIVATE_KEY);
map.remove(SSH_PRIVATE_KEY_PASS);
if (map.size() == 0)
map = null;
try {
// TODO pass the url of the registry as the first parameter
this.registryService = new AiravataJCRRegistry(null, jcrClass, userName, password, map);
} catch (javax.jcr.RepositoryException e) {
e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
}
log.info("Default registry service is created");
}
/*
* If there is no specific registry service, use the default one.
*/
((DefaultExecutionContext) context.getExecutionContext()).setRegistryService(this.registryService);
}
}
@Override
public void postProcess(InvocationContext context) throws ServiceException {
if(this.registryService != null)
((JCRRegistry)this.registryService).closeConnection();
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.GenericService#getScheduler(org .apache.airavata.core.gfac.context
* .InvocationContext)
*/
public Scheduler getScheduler(InvocationContext context) throws ServiceException {
String className = null;
if (this.scheduler == null) {
log.info("try to create scheduler");
/*
* get class names
*/
className = loadFromProperty(SCHEDULER_CLASS, true);
/*
* init instance of that class
*/
try {
Class spiClass = Class.forName(className).asSubclass(Scheduler.class);
this.scheduler = (Scheduler) spiClass.newInstance();
log.info("Scheduler:" + className + " is loaded");
} catch (ClassNotFoundException ex) {
throw new ServiceException("Scheduler " + className + " not found", ex);
} catch (Exception ex) {
throw new ServiceException("Scheduler " + className + " could not be instantiated: " + ex, ex);
}
}
return this.scheduler;
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.GenericService#getPreExecutionSteps (org.ogce.gfac
* .context.InvocationContext)
*/
public PreExecuteChain[] getPreExecutionSteps(InvocationContext context) throws ServiceException {
if (this.preChain == null) {
log.info("try to load pre-execution chain");
this.preChain = loadClassFromProperties(PRE_CHAIN_CLASS, PreExecuteChain.class);
}
return preChain;
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.GenericService#getPostExecuteSteps (org.ogce.gfac
* .context.InvocationContext)
*/
public PostExecuteChain[] getPostExecuteSteps(InvocationContext context) throws ServiceException {
if (this.postChain == null) {
log.info("try to load post-execution chain");
this.postChain = loadClassFromProperties(POST_CHAIN_CLASS, PostExecuteChain.class);
}
return postChain;
}
/*
* (non-Javadoc)
*
* @see org.apache.airavata.core.gfac.services.impl.OGCEGenericService#getDataChains
* (org.apache.airavata.core.gfac.context .InvocationContext)
*/
public DataServiceChain[] getDataChains(InvocationContext context) throws ServiceException {
if (this.dataChain == null) {
log.info("try to load data chain");
this.dataChain = loadClassFromProperties(DATA_CHAIN_CLASS, DataServiceChain.class);
}
return dataChain;
}
private Properties getProperties() {
Properties prop = new Properties();
for (Iterator iterator = this.config.getKeys(); iterator.hasNext();) {
String key = (String) iterator.next();
prop.put(key, this.config.getString(key));
}
return prop;
}
/**
*
* @param propertyName
* @param required
* @return
* @throws GfacException
*/
private String loadFromProperty(String propertyName, boolean required) throws ServiceException {
String propValue = this.config.getString(propertyName);
if (propValue == null) {
if (required)
throw new ServiceException("Property \"" + propertyName + "\" is not found");
return null;
}
return propValue;
}
/**
*
*/
@SuppressWarnings("unchecked")
private <T> T[] loadClassFromProperties(String propertyName, Class<? extends ExitableChain> type)
throws ServiceException {
// property is not set
String propValue = loadFromProperty(propertyName, false);
if (propValue == null) {
return null;
}
/*
* get class names
*/
String classNames[] = this.config.getStringArray(propertyName);
/*
* init instance of that class
*/
T[] chain = (T[]) Array.newInstance(type, classNames.length);
for (int i = 0; i < classNames.length; i++) {
String className = classNames[i].trim();
try {
Class<? extends ExitableChain> spiClass;
spiClass = Class.forName(className).asSubclass(ExitableChain.class);
chain[i] = (T) spiClass.newInstance();
log.info(type.getName() + " : " + className + " is loaded");
} catch (ClassNotFoundException ex) {
throw new ServiceException("Cannot find the class: " + className, ex);
} catch (IllegalAccessException ex) {
throw new ServiceException("Cannot access the class: " + className, ex);
} catch (InstantiationException ex) {
throw new ServiceException("Cannot init the class: " + className, ex);
}
}
return chain;
}
}
| 9,029 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/test/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/test/java/org/apache/airavata/commons/gfac/wsdl/TestWSDLGeneration.java | /*
*
* 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.commons.gfac.wsdl;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
import java.util.Map.Entry;
import javax.xml.namespace.QName;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.schemas.gfac.InputParameterType;
import org.apache.airavata.schemas.gfac.MethodType;
import org.apache.airavata.schemas.gfac.OutputParameterType;
import org.apache.airavata.schemas.gfac.PortTypeType;
import org.apache.airavata.schemas.gfac.ServiceDescriptionDocument;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
import org.apache.airavata.schemas.gfac.StringParameterType;
import org.apache.airavata.schemas.gfac.ServiceType.ServiceName;
import org.apache.xmlbeans.XmlException;
import org.junit.Test;
public class TestWSDLGeneration {
public static String createAwsdl4ServiceMap(String serviceDescAsStr) throws GFacWSDLException {
try {
ServiceDescriptionType serviceDesc = ServiceDescriptionDocument.Factory.parse(serviceDescAsStr)
.getServiceDescription();
WSDLGenerator wsdlGenerator = new WSDLGenerator();
Hashtable serviceTable = wsdlGenerator.generateWSDL(null, null, null, serviceDesc, true);
String wsdl = (String) serviceTable.get(WSDLConstants.AWSDL);
System.out.println("The generated AWSDL is " + wsdl);
return wsdl;
} catch (XmlException e) {
throw new GFacWSDLException(e);
}
}
public static String createCwsdl4ServiceMap(String serviceDescAsStr) throws GFacWSDLException {
try {
ServiceDescriptionType serviceDesc = ServiceDescriptionDocument.Factory.parse(serviceDescAsStr)
.getServiceDescription();
WSDLGenerator wsdlGenerator = new WSDLGenerator();
String security = WSDLConstants.TRANSPORT_LEVEL;
String serviceLocation = "http://localhost:8080/axis2/services/test?wsdl";
Hashtable serviceTable = wsdlGenerator.generateWSDL(serviceLocation, null, security, serviceDesc, false);
String wsdl = (String) serviceTable.get(WSDLConstants.WSDL);
System.out.println("The generated CWSDL is " + wsdl);
return wsdl;
} catch (XmlException e) {
throw new GFacWSDLException(e);
}
}
@Test
public void test() {
/*
* Service
*/
ServiceDescription serv = new ServiceDescription();
serv.getType().setName("SimpleEcho");
serv.getType().addNewService();
ServiceName name = serv.getType().getService().addNewServiceName();
name.setStringValue("SimpleEcho");
PortTypeType portType = serv.getType().addNewPortType();
MethodType methodType = portType.addNewMethod();
methodType.setMethodName("invoke");
List<InputParameterType> inputList = new ArrayList<InputParameterType>();
InputParameterType input = InputParameterType.Factory.newInstance();
input.setParameterName("echo_input");
input.setParameterType(StringParameterType.Factory.newInstance());
inputList.add(input);
InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
OutputParameterType output = OutputParameterType.Factory.newInstance();
output.setParameterName("echo_output");
output.setParameterType(StringParameterType.Factory.newInstance());
outputList.add(output);
OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
serv.getType().setInputParametersArray(inputParamList);
serv.getType().setOutputParametersArray(outputParamList);
try {
WSDLGenerator generator = new WSDLGenerator();
Hashtable table = generator.generateWSDL("http://localhost.com", new QName("xxxx"), "xx", serv.getType(),
true);
Set set = table.entrySet();
for (Object object : set) {
System.out.println(((Entry) object).getKey());
System.out.println(((Entry) object).getValue());
}
System.out.println("DONE");
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 9,030 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/MappingFactory.java | /*
*
* 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.commons.gfac.type;
import org.apache.airavata.schemas.gfac.BooleanArrayType;
import org.apache.airavata.schemas.gfac.BooleanParameterType;
import org.apache.airavata.schemas.gfac.DataType;
import org.apache.airavata.schemas.gfac.DoubleArrayType;
import org.apache.airavata.schemas.gfac.DoubleParameterType;
import org.apache.airavata.schemas.gfac.FileArrayType;
import org.apache.airavata.schemas.gfac.FileParameterType;
import org.apache.airavata.schemas.gfac.FloatArrayType;
import org.apache.airavata.schemas.gfac.FloatParameterType;
import org.apache.airavata.schemas.gfac.IntegerArrayType;
import org.apache.airavata.schemas.gfac.IntegerParameterType;
import org.apache.airavata.schemas.gfac.StringArrayType;
import org.apache.airavata.schemas.gfac.StringParameterType;
import org.apache.airavata.schemas.gfac.URIArrayType;
import org.apache.airavata.schemas.gfac.URIParameterType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*
* TODO use XML meta data instead of static coding
*
*/
public class MappingFactory {
/**
* This method is used to map between ENUM datatype to actual parameter type for example: Enum type String will map
* to StringParameterType in XMLSchema
*
* @param type
* @return
*/
public static String getActualParameterType(DataType.Enum type) {
if (type.equals(DataType.STRING)) {
return StringParameterType.class.getSimpleName();
} else if (type.equals(DataType.INTEGER)) {
return IntegerParameterType.class.getSimpleName();
} else if (type.equals(DataType.DOUBLE)) {
return DoubleParameterType.class.getSimpleName();
} else if (type.equals(DataType.BOOLEAN)) {
return BooleanParameterType.class.getSimpleName();
} else if (type.equals(DataType.FILE)) {
return FileParameterType.class.getSimpleName();
} else if (type.equals(DataType.FLOAT)) {
return FloatParameterType.class.getSimpleName();
} else if (type.equals(DataType.URI)) {
return URIParameterType.class.getSimpleName();
} else if (type.equals(DataType.STRING_ARRAY)) {
return StringArrayType.class.getSimpleName();
} else if (type.equals(DataType.INTEGER_ARRAY)) {
return IntegerArrayType.class.getSimpleName();
} else if (type.equals(DataType.DOUBLE_ARRAY)) {
return DoubleArrayType.class.getSimpleName();
} else if (type.equals(DataType.BOOLEAN_ARRAY)) {
return BooleanArrayType.class.getSimpleName();
} else if (type.equals(DataType.FILE_ARRAY)) {
return FileArrayType.class.getSimpleName();
} else if (type.equals(DataType.FLOAT_ARRAY)) {
return FloatArrayType.class.getSimpleName();
} else if (type.equals(DataType.URI_ARRAY)) {
return URIArrayType.class.getSimpleName();
}
return StringParameterType.class.getSimpleName();
}
/**
* This method is used to map from Actual parameter type to String. It is used for mapping between ParamaterType in
* XML to command-line application arguments
*
* @param param
* @return
*/
public static String toString(ActualParameter param) {
if (param.hasType(DataType.STRING)) {
return ((StringParameterType) param.getType()).getValue();
} else if (param.hasType(DataType.INTEGER)) {
return String.valueOf(((IntegerParameterType) param.getType()).getValue());
} else if (param.hasType(DataType.DOUBLE)) {
return String.valueOf(((DoubleParameterType) param.getType()).getValue());
} else if (param.hasType(DataType.BOOLEAN)) {
return String.valueOf(((BooleanParameterType) param.getType()).getValue());
} else if (param.hasType(DataType.FILE)) {
return ((FileParameterType) param.getType()).getValue();
} else if (param.hasType(DataType.FLOAT)) {
return String.valueOf(((FloatParameterType) param.getType()).getValue());
} else if (param.hasType(DataType.URI)) {
return String.valueOf(((URIParameterType) param.getType()).getValue());
} else if (param.hasType(DataType.STRING_ARRAY)) {
return join(Arrays.asList(((StringArrayType) param.getType()).getValueArray()),",");
} else if (param.hasType(DataType.INTEGER_ARRAY)) {
//todo return proper string array from int,double,boolean arrays
return String.valueOf(((IntegerArrayType) param.getType()).getValueArray());
} else if (param.hasType(DataType.DOUBLE_ARRAY)) {
return String.valueOf(((DoubleArrayType) param.getType()).getValueArray());
} else if (param.hasType(DataType.BOOLEAN_ARRAY)) {
return String.valueOf(((BooleanArrayType) param.getType()).getValueArray());
} else if (param.hasType(DataType.FILE_ARRAY)) {
return join(Arrays.asList(((FileArrayType) param.getType()).getValueArray()),",");
} else if (param.hasType(DataType.FLOAT_ARRAY)) {
return String.valueOf(((FloatArrayType) param.getType()).getValueArray());
} else if (param.hasType(DataType.URI_ARRAY)) {
return join(Arrays.asList(((URIArrayType) param.getType()).getValueArray()),",");
}
return null;
}
/**
* This method is used to map output from command-line application to actual parameter in XML Schema.
*
* @param param
* @param val
*/
public static void fromString(ActualParameter param, String val) {
if (param.hasType(DataType.STRING)) {
((StringParameterType) param.getType()).setValue(val);
} else if (param.hasType(DataType.INTEGER)) {
((IntegerParameterType) param.getType()).setValue(Integer.parseInt(val));
} else if (param.hasType(DataType.DOUBLE)) {
((DoubleParameterType) param.getType()).setValue(Double.parseDouble(val));
} else if (param.hasType(DataType.BOOLEAN)) {
((BooleanParameterType) param.getType()).setValue(Boolean.parseBoolean(val));
} else if (param.hasType(DataType.FILE)) {
((FileParameterType) param.getType()).setValue(val);
} else if (param.hasType(DataType.FLOAT)) {
((FloatParameterType) param.getType()).setValue(Float.parseFloat(val));
} else if (param.hasType(DataType.URI)) {
((URIParameterType) param.getType()).setValue((val));
}
}
public static String join(List<String> list, String delim) {
StringBuilder sb = new StringBuilder();
String loopDelim = "";
for (String s : list) {
sb.append(loopDelim);
sb.append(s);
loopDelim = delim;
}
return sb.toString();
}
}
| 9,031 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/Type.java | /*
*
* 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.commons.gfac.type;
import java.io.Serializable;
public interface Type extends Serializable {
}
| 9,032 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ActualParameter.java | /*
*
* 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.commons.gfac.type;
import org.apache.airavata.commons.gfac.type.Type;
import org.apache.airavata.schemas.gfac.DataType;
import org.apache.airavata.schemas.gfac.GFacParameterDocument;
import org.apache.airavata.schemas.gfac.ParameterType;
import org.apache.airavata.schemas.gfac.StringParameterType;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.XmlException;
public class ActualParameter implements Type {
private static final long serialVersionUID = -6022759981837350675L;
private GFacParameterDocument paramDoc;
public ActualParameter() {
this.paramDoc = GFacParameterDocument.Factory.newInstance();
this.paramDoc.addNewGFacParameter();
// default type is String
this.paramDoc.getGFacParameter().changeType(StringParameterType.type);
}
public ActualParameter(SchemaType type) {
this.paramDoc = GFacParameterDocument.Factory.newInstance();
this.paramDoc.addNewGFacParameter();
this.paramDoc.getGFacParameter().changeType(type);
}
public ParameterType getType() {
return this.paramDoc.getGFacParameter();
}
public boolean hasType(DataType.Enum type) {
return this.paramDoc.getGFacParameter().getType() == type;
}
public String toXML() {
return this.paramDoc.xmlText();
}
public void setParamDoc(GFacParameterDocument paramDoc) {
this.paramDoc = paramDoc;
}
public static ActualParameter fromXML(String xml) throws XmlException {
ActualParameter param = new ActualParameter();
param.paramDoc = GFacParameterDocument.Factory.parse(xml);
return param;
}
} | 9,033 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ServiceDescription.java | /*
*
* 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.commons.gfac.type;
import org.apache.airavata.schemas.gfac.ServiceDescriptionDocument;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
import org.apache.xmlbeans.XmlException;
public class ServiceDescription implements Type {
private static final long serialVersionUID = -4365350045872875217L;
private ServiceDescriptionDocument serviceDocument;
public ServiceDescription() {
this.serviceDocument = ServiceDescriptionDocument.Factory.newInstance();
this.serviceDocument.addNewServiceDescription();
}
public ServiceDescriptionType getType() {
return this.serviceDocument.getServiceDescription();
}
public String toXML() {
return serviceDocument.xmlText();
}
public static ServiceDescription fromXML(String xml) throws XmlException {
ServiceDescription service = new ServiceDescription();
service.serviceDocument = ServiceDescriptionDocument.Factory.parse(xml);
return service;
}
}
| 9,034 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/ApplicationDeploymentDescription.java | /*
*
* 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.commons.gfac.type;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionDocument;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.XmlException;
public class ApplicationDeploymentDescription implements Type {
private ApplicationDeploymentDescriptionDocument appDocument;
public ApplicationDeploymentDescription() {
this.appDocument = ApplicationDeploymentDescriptionDocument.Factory
.newInstance();
this.appDocument.addNewApplicationDeploymentDescription();
}
public ApplicationDeploymentDescription(SchemaType type) {
this();
this.appDocument.getApplicationDeploymentDescription().changeType(type);
}
public ApplicationDeploymentDescriptionType getType() {
return this.appDocument.getApplicationDeploymentDescription();
}
public String toXML() {
return appDocument.xmlText();
}
public static ApplicationDeploymentDescription fromXML(String xml)
throws XmlException {
ApplicationDeploymentDescription app = new ApplicationDeploymentDescription();
app.appDocument = ApplicationDeploymentDescriptionDocument.Factory
.parse(xml);
return app;
}
}
| 9,035 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/HostDescription.java | /*
*
* 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.commons.gfac.type;
import org.apache.airavata.schemas.gfac.HostDescriptionDocument;
import org.apache.airavata.schemas.gfac.HostDescriptionType;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.XmlException;
public class HostDescription implements Type {
private HostDescriptionDocument hostDocument;
public HostDescription() {
this.hostDocument = HostDescriptionDocument.Factory.newInstance();
this.hostDocument.addNewHostDescription();
}
public HostDescription(SchemaType type) {
this();
this.hostDocument.getHostDescription().changeType(type);
}
public HostDescriptionType getType() {
return this.hostDocument.getHostDescription();
}
public String toXML() {
return hostDocument.xmlText();
}
public static HostDescription fromXML(String xml) throws XmlException {
HostDescription host = new HostDescription();
host.hostDocument = HostDescriptionDocument.Factory.parse(xml);
return host;
}
} | 9,036 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/TypesGenerator.java | /*
*
* 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.commons.gfac.wsdl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;
import javax.wsdl.Definition;
import javax.wsdl.Types;
import javax.xml.namespace.QName;
import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.schemas.gfac.InputParameterType;
import org.apache.airavata.schemas.gfac.OutputParameterType;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import com.ibm.wsdl.extensions.schema.SchemaImpl;
public class TypesGenerator implements WSDLConstants {
private static final String ENDPOINT_REFERENCE_TYPE = "EndpointReferenceType";
public static Types addTypes(Definition def, DOMImplementation dImpl, ServiceDescriptionType serviceDesc,
String typens, String globalTypens) {
Element documentation = null;
Document doc = dImpl.createDocument(typens, SCHEMA, null);
Element schema = doc.createElementNS(XSD_NAMESPACE, "schema");
// Element schema = doc.getDocumentElement();
schema.setAttribute(TARGET_NAMESPACE, typens);
schema.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2001/XMLSchema");
// schema.setAttribute(XMLNS,
// XSD_NAMESPACE);
schema.setAttribute(ELEMENT_FORM_DEFAULT, UNQUALIFIED);
Element globalSchema = doc.createElementNS(XSD_NAMESPACE, "schema");
// Element globalSchema = doc.getDocumentElement();
globalSchema.setAttribute(TARGET_NAMESPACE, globalTypens);
globalSchema.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2001/XMLSchema");
// globalSchema.setAttribute(XMLNS,
// XSD_NAMESPACE);
globalSchema.setAttribute(ELEMENT_FORM_DEFAULT, UNQUALIFIED);
Types types = def.createTypes();
InputParameterType[] inputParams = serviceDesc.getInputParametersArray();
Vector inParamNames = new Vector();
Vector inParamDesc = new Vector();
Vector inParamTypes = new Vector();
for (int k = 0; k < inputParams.length; ++k) {
inParamNames.add(inputParams[k].getParameterName());
inParamDesc.add(inputParams[k].getParameterDescription());
// XMLBEANS specific way to get type
inParamTypes.add(MappingFactory.getActualParameterType(inputParams[k].getParameterType().getType()));
inputParams[k].getParameterValueArray();
}
OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();
Vector outParamNames = new Vector();
Vector outParamDesc = new Vector();
Vector outParamTypes = new Vector();
for (int k = 0; k < outputParams.length; ++k) {
outParamNames.add(outputParams[k].getParameterName());
outParamDesc.add(outputParams[k].getParameterDescription());
// XMLBEANS specific way to get type
outParamTypes.add(MappingFactory.getActualParameterType(outputParams[k].getParameterType().getType()));
}
String methodName = serviceDesc.getPortType().getMethod().getMethodName();
WSDLMessageBean wsdlMsgBean = new WSDLMessageBean();
wsdlMsgBean.setNamespace(typens);
// Set the method name in the message object
wsdlMsgBean.setMethodName(methodName);
// === write all the input parameters ========
// Input message name
String inputMessageName = methodName + GFacSchemaConstants.SERVICE_IN_PARAMS_SUFFIX;
// Set the input message name in the message object
wsdlMsgBean.setInElementName(inputMessageName);
// local data types
Element wsdlInputParams = doc.createElement("element");
String inputElementName = methodName + GFacSchemaConstants.SERVICE_IN_PARAMS_SUFFIX;
String inputParametersType = methodName + GFacSchemaConstants.SERVICE_INPUT_PARAMS_TYPE_SUFFIX;
wsdlInputParams.setAttribute("name", inputElementName);
wsdlInputParams.setAttribute("type", TYPENS + ":" + inputParametersType);
schema.appendChild(wsdlInputParams);
// local data types
wsdlMsgBean.setInMsgParamNames(inParamNames);
wsdlMsgBean.setInMsgParamTypes(inParamTypes);
Element first = doc.createElement(COMPLEX_TYPE);
first.setAttribute("name", inputParametersType);
Element sequence = doc.createElement("sequence");
for (int j = 0; j < inParamNames.size(); ++j) {
Element elem = doc.createElement("element");
String paramName = (String) inParamNames.get(j);
paramName = paramName.replaceAll(HYPHEN, HYPHEN_REPLACEMENT);
elem.setAttribute("name", paramName);
String dataType = (String) inParamTypes.get(j);
elem.setAttribute("type", "gfac:" + dataType);
Element annotation = doc.createElement(ANNOTATION);
// TODO create Metadata
WSDLGenerator.createMetadata(inputParams[j], doc, annotation);
documentation = doc.createElement(DOCUMENTATION);
documentation.appendChild(doc.createTextNode((String) inParamDesc.get(j)));
annotation.appendChild(documentation);
elem.appendChild(annotation);
sequence.appendChild(elem);
} // end for inParams
first.appendChild(sequence);
schema.appendChild(first);
// write the enumeration types
for (int j = 0; j < inParamNames.size(); ++j) {
String dataType = (String) inParamTypes.get(j);
if (dataType.equals("StringEnum") || dataType.equals("IntegerEnum") || dataType.equals("FloatEnum")
|| dataType.equals("DoubleEnum")) {
String paramName = (String) inParamNames.get(j);
String[] paramValues = serviceDesc.getInputParametersArray(j).getParameterValueArray();
if (paramValues == null)
continue;
Element elem = doc.createElement(SIMPLE_TYPE);
elem.setAttribute("name", methodName + "_" + paramName + "_" + dataType + "Type");
for (int k = 0; k < paramValues.length; ++k) {
documentation = doc.createElement(DOCUMENTATION);
// documentation.setAttribute(XML_LANG,
// ENGLISH);
Element value = doc.createElement("value");
value.appendChild(doc.createTextNode(paramValues[k]));
documentation.appendChild(value);
elem.appendChild(documentation);
}
Element restriction = doc.createElement("restriction");
if (dataType.equals("StringEnum")) {
restriction.setAttribute("base", "xsd:string");
} else if (dataType.equals("IntegerEnum")) {
restriction.setAttribute("base", "xsd:int");
} else if (dataType.equals("FloatEnum")) {
restriction.setAttribute("base", "xsd:float");
} else if (dataType.equals("DoubleEnum")) {
restriction.setAttribute("base", "xsd:double");
}
for (int k = 0; k < paramValues.length; ++k) {
Element enumeration = doc.createElement("enumeration");
enumeration.setAttribute("value", paramValues[k]);
restriction.appendChild(enumeration);
}
elem.appendChild(restriction);
schema.appendChild(elem);
}
}
// ====== write the output parameters ==============
// Output message name
if (outputParams.length > 0) {
String outputMessageName = methodName + GFacSchemaConstants.SERVICE_OUT_PARAMS_SUFFIX;
// Set the output message name in the message object
wsdlMsgBean.setOutElementName(outputMessageName);
Element wsdlOutputParams = doc.createElement("element");
String outputElementName = methodName + GFacSchemaConstants.SERVICE_OUT_PARAMS_SUFFIX;
String outputParametersType = methodName + GFacSchemaConstants.SERVICE_OUTPUT_PARAMS_TYPE_SUFFIX;
wsdlOutputParams.setAttribute("name", outputElementName);
wsdlOutputParams.setAttribute("type", TYPENS + ":" + outputParametersType);
schema.appendChild(wsdlOutputParams);
wsdlMsgBean.setOutMsgParamNames(outParamNames);
wsdlMsgBean.setOutMsgParamTypes(outParamTypes);
// Now add the output parameters
first = doc.createElement(COMPLEX_TYPE);
first.setAttribute("name", outputParametersType);
sequence = doc.createElement("sequence");
for (int j = 0; j < outParamNames.size(); ++j) {
Element elem = doc.createElement("element");
elem.setAttribute("name", (String) outParamNames.get(j));
String dataType = (String) outParamTypes.get(j);
elem.setAttribute("type", "gfac:" + dataType);
// Create an annotation
Element annotation = doc.createElement(ANNOTATION);
WSDLGenerator.createMetadata(serviceDesc.getOutputParametersArray(j), doc, annotation);
documentation = doc.createElement(DOCUMENTATION);
documentation.appendChild(doc.createTextNode((String) outParamDesc.get(j)));
annotation.appendChild(documentation);
elem.appendChild(annotation);
sequence.appendChild(elem);
} // end for outParamNames.size()
}
first.appendChild(sequence);
schema.appendChild(first);
// types.setDocumentationElement(schema);
SchemaImpl schemaImpl = new SchemaImpl();
// SchemaImportImpl schemaimport = new SchemaImportImpl();
// schemaimport.setNamespaceURI("http://www.extreme.indiana.edu/lead/xsd");
// schemaimport.setSchemaLocationURI("http://www.extreme.indiana.edu/gfac/gfac-simple-types.xsd");
// schemaImpl.addImport(schemaimport);
Element importEle = doc.createElement("import");
importEle.setAttribute("namespace", "http://schemas.airavata.apache.org/gfac/type");
importEle.setAttribute("schemaLocation", "http://people.apache.org/~lahiru/GFacParameterTypes.xsd");
schema.insertBefore(importEle, schema.getFirstChild());
// schema.appendChild();
schemaImpl.setElement(schema);
schemaImpl.setElementType(new QName("http://www.w3.org/2001/XMLSchema", "schema"));
SchemaImpl globalSchemaImpl = new SchemaImpl();
globalSchemaImpl.setElement(globalSchema);
globalSchemaImpl.setElementType(new QName("http://www.w3.org/2001/XMLSchema", "schema"));
globalSchemaImpl.getElement().setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
types.addExtensibilityElement(schemaImpl);
return types;
}
public static Element createAddressingSchema(Document doc) {
Element wsAddressing = doc.createElementNS(XSD_NAMESPACE, "schema");
// Element globalSchema = doc.getDocumentElement();
wsAddressing.setAttribute(TARGET_NAMESPACE, "http://www.w3.org/2005/08/addressing");
wsAddressing.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2001/XMLSchema");
wsAddressing.setAttribute("attributeFormDefault", "unqualified");
wsAddressing.setAttribute(ELEMENT_FORM_DEFAULT, "qualified");
Element type = doc.createElement("complexType");
type.setAttribute("name", ENDPOINT_REFERENCE_TYPE);
Element sequence = doc.createElement("sequence");
Element any = doc.createElement("any");
any.setAttribute("namespace", "##any");
any.setAttribute("minOccurs", "0");
sequence.appendChild(any);
type.appendChild(sequence);
wsAddressing.appendChild(type);
return wsAddressing;
}
} | 9,037 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLGeneratorUtil.java | /*
*
* 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.commons.gfac.wsdl;
import org.apache.airavata.schemas.gfac.MethodType;
import org.apache.airavata.schemas.gfac.PortTypeType;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
public class WSDLGeneratorUtil {
public static MethodType findOperationFromServiceDesc(String methodName, ServiceDescriptionType serviceDescType)
throws GFacWSDLException {
PortTypeType portType = serviceDescType.getPortType();
if (serviceDescType.getPortType().getMethod().getMethodName().equals(methodName)) {
serviceDescType.getPortType().getMethod();
}
if (isInbuiltOperation(methodName)) {
MethodType builtInOperationType = portType.addNewMethod();
builtInOperationType.setMethodName(methodName);
return builtInOperationType;
}
throw new GFacWSDLException("Method name " + methodName + " not found");
}
public static boolean isInbuiltOperation(String name) {
return GFacSchemaConstants.InbuitOperations.OP_KILL.equals(name)
|| GFacSchemaConstants.InbuitOperations.OP_PING.equals(name)
|| GFacSchemaConstants.InbuitOperations.OP_SHUTDOWN.equals(name);
}
} | 9,038 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLMessageBean.java | /*
*
* 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.commons.gfac.wsdl;
import java.util.Vector;
import javax.xml.namespace.QName;
public class WSDLMessageBean {
private QName portType;
private String methodName;
private String namespace = null;
private String inElementName;
private Vector inMsgParamNames;
private Vector inMsgParamTypes;
private String outElementName;
private Vector outMsgParamNames;
private Vector outMsgParamTypes;
/**
* Sets OutMsgParamTypes
*
* @param OutMsgParamTypes
* a Vector
*/
public void setOutMsgParamTypes(Vector outMsgParamTypes) {
this.outMsgParamTypes = outMsgParamTypes;
}
/**
* Returns OutMsgParamTypes
*
* @return a Vector
*/
public Vector getOutMsgParamTypes() {
return outMsgParamTypes;
}
/**
* Sets Namespace
*
* @param Namespace
* a String
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
* Returns Namespace
*
* @return a String
*/
public String getNamespace() {
return namespace;
}
/**
* Sets InMsgParamTypes
*
* @param InMsgParamTypes
* a Vector
*/
public void setInMsgParamTypes(Vector inMsgParamTypes) {
this.inMsgParamTypes = inMsgParamTypes;
}
/**
* Returns InMsgParamTypes
*
* @return a Vector
*/
public Vector getInMsgParamTypes() {
return inMsgParamTypes;
}
/**
* Sets PortType
*
* @param PortType
* a QName
*/
public void setPortType(QName portType) {
this.portType = portType;
}
/**
* Returns PortType
*
* @return a QName
*/
public QName getPortType() {
return portType;
}
/**
* Sets OutputMessageParamNames
*
* @param OutputMessageParamNamesa
* Vector
*/
public void setOutMsgParamNames(Vector outputMessageParamNames) {
this.outMsgParamNames = outputMessageParamNames;
}
/**
* Returns OutputMessageParamNames
*
* @return a Vector
*/
public Vector getOutMsgParamNames() {
return outMsgParamNames;
}
/**
* Sets InputMessagePartNames
*
* @param InputMessagePartNamesa
* Vector
*/
public void setInMsgParamNames(Vector inputMessagePartNames) {
this.inMsgParamNames = inputMessagePartNames;
}
/**
* Returns InputMessagePartNames
*
* @return a Vector
*/
public Vector getInMsgParamNames() {
return inMsgParamNames;
}
/**
* Sets MethodName
*
* @param MethodName
* a String
*/
public void setMethodName(String methodName) {
this.methodName = methodName;
}
/**
* Returns MethodName
*
* @return a String
*/
public String getMethodName() {
return methodName;
}
/**
* Sets OutputMessageName
*
* @param OutputMessageName
* a String
*/
public void setOutElementName(String outputMessageName) {
this.outElementName = outputMessageName;
}
/**
* Returns OutputMessageName
*
* @return a String
*/
public String getOutElementName() {
return outElementName;
}
/**
* Sets InputMessageName
*
* @param InputMessageName
* a String
*/
public void setInElementName(String inputMessageName) {
this.inElementName = inputMessageName;
}
/**
* Returns InputMessageName
*
* @return a String
*/
public String getInElementName() {
return inElementName;
}
} | 9,039 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLConstants.java | /*
*
* 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.commons.gfac.wsdl;
public interface WSDLConstants {
// For wsdl generation
public final static String TYPENS = "typens";
public final static String GLOBAL_TYPENS = "globalTypens";
public final static String WSDLNS = "wsdlns";
public final static String SOAP = "soap";
public final static String XSD = "xsd";
public final static String XMLNS = "xmlns";
public final static String TARGET_NAMESPACE = "targetNamespace";
public static final String TRANSPORT_LEVEL = "TransportLevel";
public final static String SCHEMA = "schema";
public final static String ELEMENT_FORM_DEFAULT = "elementFormDefault";
public final static String UNQUALIFIED = "unqualified";
public final static String ANNOTATION = "annotation";
public final static String WSDL_DOCUMENTATION = "wsdl:documentation";
public final static String DOCUMENTATION = "documentation";
public static final String SERVICE_QNAME = "SERVICE_QNAME";
public final static String AWSDL = "AWSDL";
public static final String WSDL_PORT_SUFFIX = "_Port";
public static final String WSDL_SOAP_BINDING_SUFFIX = "_SoapBinding";
public static final String LITERAL = "literal";
public static final String DOCUMENT = "document";
public static final String XSD_STRING_TYPE = "xsd:string";
public static final String COMPLEX_TYPE = "complexType";
public static final String SIMPLE_TYPE = "simpleType";
public static final String PART_NAME = "parameters";
public final static String WSDL = "WSDL";
public final static String WSDL_QNAME = "WSDL_QNAME";
public static final String XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
public static final String WSDL_NAMEPSPACE = "http://schemas.xmlsoap.org/wsdl/";
public static final String SOAP_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/soap/";
public static final String SOAP_HTTP_NAMESPACE = "http://schemas.xmlsoap.org/soap/http";
public static final String WSP_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/09/policy";
public static final String WSPE_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/09/policy/encoding";
public static final String WSA_NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
public static final String WSU_NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
public static final String SP_NAMESPACE = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";
public static final String WSS10_NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
public static final String WST_NAMESPACE = "http://schemas.xmlsoap.org/ws/2005/02/trust";
public static final String SERVICE_LOCATION = "ServiceLocation";
public static final String HYPHEN_REPLACEMENT = "GFAC_MINUS_REPLACEMENT";
public static final String HYPHEN = "-";
}
| 9,040 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSDLGenerator.java | /*
*
* 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.commons.gfac.wsdl;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Date;
import java.util.Hashtable;
import java.util.Random;
import java.util.UUID;
import javax.wsdl.Binding;
import javax.wsdl.BindingOperation;
import javax.wsdl.Definition;
import javax.wsdl.OperationType;
import javax.wsdl.Types;
import javax.wsdl.WSDLException;
import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLWriter;
import javax.xml.namespace.QName;
import org.apache.airavata.schemas.gfac.InputParameterType;
import org.apache.airavata.schemas.gfac.MethodType;
import org.apache.airavata.schemas.gfac.OutputParameterType;
import org.apache.airavata.schemas.gfac.PortTypeType;
import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Attr;
import org.w3c.dom.Comment;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xmlpull.v1.XmlPullParserException;
import com.ibm.wsdl.BindingInputImpl;
import com.ibm.wsdl.BindingOutputImpl;
import com.ibm.wsdl.InputImpl;
import com.ibm.wsdl.MessageImpl;
import com.ibm.wsdl.OperationImpl;
import com.ibm.wsdl.OutputImpl;
import com.ibm.wsdl.PartImpl;
import com.ibm.wsdl.PortImpl;
import com.ibm.wsdl.PortTypeImpl;
import com.ibm.wsdl.ServiceImpl;
import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
import com.ibm.wsdl.extensions.soap.SOAPBodyImpl;
import com.ibm.wsdl.extensions.soap.SOAPOperationImpl;
public class WSDLGenerator implements WSDLConstants {
public static final String WSA_PREFIX = "wsa";
protected final Logger log = LoggerFactory.getLogger(this.getClass());
public Hashtable generateWSDL(String serviceLocation, QName wsdlQName_, String security,
ServiceDescriptionType serviceDesc, boolean abstractWSDL) throws GFacWSDLException {
Hashtable table = new Hashtable();
QName wsdlQName = null;
String wsdlString = null;
String serviceName = serviceDesc.getService().getServiceName().getStringValue();
String nameSpaceURI = serviceDesc.getService().getServiceName().getTargetNamespace();
QName serviceQName = new QName(nameSpaceURI, serviceName);
if (wsdlQName_ != null && !abstractWSDL) {
wsdlQName = wsdlQName_;
} else if (wsdlQName_ == null && !abstractWSDL) {
String date = (new Date()).toString();
date = date.replaceAll(" ", "_");
date = date.replaceAll(":", "_");
Random rand = new Random();
int rdint = rand.nextInt(1000000);
wsdlQName = new QName(nameSpaceURI, serviceName + "_" + date + "_" + rdint);
}
PortTypeType portType = serviceDesc.getPortType();
MethodType method = portType.getMethod();
QName portTypeName = serviceQName;
String portName = portTypeName.getLocalPart();
try {
WSDLFactory fac = WSDLFactory.newInstance();
WSDLWriter wsWriter = fac.newWSDLWriter();
// =========== start of wsdl definition ===========
Definition def = fac.newDefinition();
String typens = nameSpaceURI + "/" + portName + "/" + "xsd";
String globalTypens = nameSpaceURI + "/" + "xsd";
if (abstractWSDL) {
def.setQName(serviceQName);
log.info("Service QName set to = " + serviceQName);
} else {
def.setQName(wsdlQName);
log.info("WSDL QName set to = " + wsdlQName);
}
// namespaces ===========
def.setTargetNamespace(nameSpaceURI);
def.addNamespace(WSDLNS, nameSpaceURI);
def.addNamespace(TYPENS, typens);
def.addNamespace(GLOBAL_TYPENS, globalTypens);
def.addNamespace(SOAP, SOAP_NAMESPACE);
def.addNamespace(XSD, XSD_NAMESPACE);
def.addNamespace(WSA_PREFIX, "http://www.w3.org/2005/08/addressing");
def.addNamespace("gfac", "http://schemas.airavata.apache.org/gfac/type");
if (GFacSchemaConstants.TRANSPORT_LEVEL.equals(security)
|| GFacSchemaConstants.MESSAGE_SIGNATURE.equals(security)) {
def.addNamespace(WSA_PREFIX, WSA_NAMESPACE);
def.addNamespace("wsp", WSP_NAMESPACE);
def.addNamespace("wsu", WSU_NAMESPACE);
def.addNamespace("wspe", WSPE_NAMESPACE);
def.addNamespace("sp", SP_NAMESPACE);
def.addNamespace("wss10", WSS10_NAMESPACE);
def.addNamespace("sp", SP_NAMESPACE);
def.addNamespace("wst", WST_NAMESPACE);
}
// =========== end of wsdl namespaces ===========
javax.xml.parsers.DocumentBuilderFactory domfactory = javax.xml.parsers.DocumentBuilderFactory
.newInstance();
javax.xml.parsers.DocumentBuilder builder = null;
try {
builder = domfactory.newDocumentBuilder();
} catch (javax.xml.parsers.ParserConfigurationException e) {
throw new GFacWSDLException("Parser configuration exception: " + e.getMessage());
}
DOMImplementation dImpl = builder.getDOMImplementation();
String policyID = portName + "_Policy";
String inputPolicyID = portName + "_operationPolicy";
UnknownExtensibilityElement serviceLevelPolicRef = null;
UnknownExtensibilityElement opLevelPolicRef = null;
String namespace = GFacSchemaConstants.GFAC_NAMESPACE;
Document doc = dImpl.createDocument(namespace, "factoryServices", null);
String description = serviceDesc.getService().getServiceDescription();
if (description != null) {
Element documentation = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "wsdl:documentation");
documentation.appendChild(doc.createTextNode(description));
def.setDocumentationElement(documentation);
}
if (GFacSchemaConstants.TRANSPORT_LEVEL.equals(security)) {
def.addExtensibilityElement(createTransportLevelPolicy(dImpl, policyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
} else if (GFacSchemaConstants.MESSAGE_SIGNATURE.equals(security)) {
def.addExtensibilityElement(WSPolicyGenerator.createServiceLevelPolicy(dImpl, policyID));
serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
opLevelPolicRef = createWSPolicyRef(dImpl, inputPolicyID);
}
// Create types
Types types = TypesGenerator.addTypes(def, dImpl, serviceDesc, typens, globalTypens);
def.setTypes(types);
// if(!abstractWSDL)
// {
// table = createMessageTable(serviceDesc, typens, operation);
// }
// Create port types (only first port type)
PortTypeImpl wsdlPortType = addPortTypes(def, dImpl, portType, serviceQName);
Binding binding = addBinding(def, nameSpaceURI, wsdlPortType, serviceLevelPolicRef, dImpl);
String methodDesc = serviceDesc.getPortType().getMethod().getMethodDescription();
String methodName = serviceDesc.getPortType().getMethod().getMethodName();
OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();
OperationImpl operation = addOperation(def, dImpl, methodName, methodDesc, typens, outputParams);
wsdlPortType.addOperation(operation);
if (!abstractWSDL) {
UnknownExtensibilityElement wsInPolicyRef = null;
UnknownExtensibilityElement wsOutPolicyRef = null;
BindingInputImpl bindingInput = addBindingInput(def, methodName, wsInPolicyRef);
BindingOutputImpl bindingOutput = addBindingOutput(def, methodName, outputParams, wsOutPolicyRef);
BindingOperation bindingOperation = addBindingOperation(def, operation, dImpl);
bindingOperation.setBindingInput(bindingInput);
bindingOperation.setBindingOutput(bindingOutput);
binding.addBindingOperation(bindingOperation);
if (opLevelPolicRef != null) {
binding.addExtensibilityElement(opLevelPolicRef);
}
}
def.addPortType(wsdlPortType);
// =========== end of wsdl binding ===========
// FIXME: This is done as factory information is not needed
// if(abstractWSDL)
// {
//
//
// Element factoryServices = doc.createElement("n:factoryServices");
// factoryServices.setAttribute("xmlns:n", namespace);
// Element factoryService = doc.createElement("n:factoryService");
// factoryService.setAttribute("location",
// "http://rainier.extreme.indiana.edu:12345");
// factoryService.setAttribute("portType", "n:GenericFactory");
// factoryService.setAttribute("operation", "n:CreateService");
// factoryServices.appendChild(factoryService);
// UnknownExtensibilityElement elem = new
// UnknownExtensibilityElement();
// elem.setElement(factoryServices);
// def.addExtensibilityElement(elem);
// }
if (!abstractWSDL) {
def.addBinding(binding);
ServiceImpl service = (ServiceImpl) def.createService();
service.setQName(wsdlQName);
PortImpl port = (PortImpl) def.createPort();
port.setName(wsdlQName.getLocalPart() + WSDL_PORT_SUFFIX);
port.setBinding(binding);
service.addPort(port);
SOAPAddressImpl soapAddress = new SOAPAddressImpl();
soapAddress.setLocationURI(serviceLocation);
port.addExtensibilityElement(soapAddress);
def.addService(service);
}
if (!abstractWSDL) {
table.put(WSDL_QNAME, wsdlQName);
}
table.put(SERVICE_QNAME, serviceQName);
ByteArrayOutputStream bs = new ByteArrayOutputStream();
wsWriter.writeWSDL(def, bs);
wsdlString = bs.toString();
} catch (WSDLException e) {
throw new GFacWSDLException("Error generating WSDL: " + e.getMessage());
}
Reader reader = new StringReader(wsdlString);
Writer writer = new StringWriter();
try {
RoundTrip.roundTrip(reader, writer, " ");
} catch (XmlPullParserException e) {
throw new GFacWSDLException(e);
} catch (IOException e) {
throw new GFacWSDLException(e);
}
wsdlString = writer.toString();
if (abstractWSDL) {
table.put(AWSDL, wsdlString);
} else {
table.put(WSDL, wsdlString);
}
return table;
}
private UnknownExtensibilityElement createWSPolicyRef(DOMImplementation dImpl, String id) {
Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:PolicyReference", null);
Element policyRef = doc.getDocumentElement();
policyRef.setAttribute("URI", "#" + id);
UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
elem.setElement(policyRef);
elem.setElementType(new QName(WSP_NAMESPACE, "PolicyReference"));
return elem;
}
private UnknownExtensibilityElement createTransportLevelPolicy(DOMImplementation dImpl, String policyID) {
Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:Policy", null);
Element policy = doc.getDocumentElement();
policy.setAttribute("wsu:Id", policyID);
Element exactlyOne = doc.createElement("wsp:ExactlyOne");
Element all = doc.createElement("wsp:All");
Element transportBinding = doc.createElement("sp:TransportBinding");
transportBinding.setAttribute("xmlns:sp", SP_NAMESPACE);
Element policy1 = doc.createElement("wsp:Policy");
Element transportToken = doc.createElement("sp:TransportToken");
Element policy2 = doc.createElement("wsp:Policy");
Element httpsToken = doc.createElement("sp:HttpsToken");
httpsToken.setAttribute("RequireClientCertificate", "true");
policy2.appendChild(httpsToken);
transportToken.appendChild(policy2);
policy1.appendChild(transportToken);
/*
* Element algorithmSuite = doc.createElement("sp:AlgorithmSuite"); Element policy3 =
* doc.createElement("wsp:Policy"); Element base256 = doc.createElement("sp:Base256");
* policy3.appendChild(base256); algorithmSuite.appendChild(policy3); policy1.appendChild(algorithmSuite);
*
*
* Element layout = doc.createElement("sp:Layout"); Element policy4 = doc.createElement("wsp:Policy"); Element
* lax = doc.createElement("sp:Lax"); policy4.appendChild(lax); layout.appendChild(policy4);
* policy1.appendChild(layout);
*
* Element includeTimestamp = doc.createElement("sp:includeTimestamp"); policy1.appendChild(includeTimestamp);
*/
/*
* Element signedSupportingTokens = doc.createElement("sp:SignedSupportingTokens"); policy2 =
* doc.createElement("wsp:Policy"); Element usernameToken = doc.createElement("sp:UsernameToken");
* usernameToken.setAttribute("sp:IncludeToken",
* "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" );
* policy2.appendChild(usernameToken); signedSupportingTokens.appendChild(policy2);
* policy1.appendChild(signedSupportingTokens);
*/
Element signedEndorsingSupportingTokens = doc.createElement("sp:SignedEndorsingSupportingTokens");
policy2 = doc.createElement("wsp:Policy");
Element x509V3Token = doc.createElement("sp:X509V3Token");
// x509V3Token.setAttribute("sp:IncludeToken",
// "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Once");
policy2.appendChild(x509V3Token);
signedEndorsingSupportingTokens.appendChild(policy2);
policy1.appendChild(signedEndorsingSupportingTokens);
transportBinding.appendChild(policy1);
all.appendChild(transportBinding);
/*
* Element wss10 = doc.createElement("sp:wss10"); Element requireSignatureConfirmation =
* doc.createElement("sp:RequireSignatureConfirmation"); wss10.appendChild(requireSignatureConfirmation);
* all.appendChild(wss10);
*/
exactlyOne.appendChild(all);
policy.appendChild(exactlyOne);
UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
elem.setElement(policy);
elem.setElementType(new QName(WSP_NAMESPACE, "wsp:Policy"));
return elem;
}
private PortTypeImpl addPortTypes(Definition def, DOMImplementation dImpl, PortTypeType portType, QName serviceQName) {
// create port type
PortTypeImpl wsdlPortType = (PortTypeImpl) def.createPortType();
wsdlPortType.setQName(serviceQName);
wsdlPortType.setUndefined(false);
// create documentation for this port type
Document doc = dImpl.createDocument(WSDL_NAMEPSPACE, WSDL_DOCUMENTATION, null);
Element documentation = doc.getDocumentElement();
documentation.appendChild(doc.createTextNode(portType.getPortDescription()));
wsdlPortType.setDocumentationElement(documentation);
return wsdlPortType;
}
private OperationImpl addOperation(Definition def, DOMImplementation dImpl, String methodName, String methodDesc,
String typens, OutputParameterType[] outputParameterTypes) {
OperationImpl operation = (OperationImpl) def.createOperation();
operation.setUndefined(false);
operation.setName(methodName);
if (outputParameterTypes.length == 0) {
operation.setStyle(OperationType.ONE_WAY);
} else {
operation.setStyle(OperationType.REQUEST_RESPONSE);
}
Document doc = dImpl.createDocument(WSDL_NAMEPSPACE, WSDL_DOCUMENTATION, null);
Element documentation = doc.createElement(WSDL_DOCUMENTATION);
documentation.appendChild(doc.createTextNode(methodDesc));
operation.setDocumentationElement(documentation);
MessageImpl inputMessage = (MessageImpl) def.createMessage();
String inputMessageName = methodName + GFacSchemaConstants.SERVICE_REQ_MSG_SUFFIX + "_" + UUID.randomUUID();
inputMessage.setQName(new QName(def.getTargetNamespace(), inputMessageName));
inputMessage.setUndefined(false);
PartImpl inPart = (PartImpl) def.createPart();
inPart.setName(PART_NAME);
String inputElementName = methodName + GFacSchemaConstants.SERVICE_IN_PARAMS_SUFFIX;
inPart.setElementName(new QName(typens, inputElementName));
inputMessage.addPart(inPart);
def.addMessage(inputMessage);
InputImpl ip = (InputImpl) def.createInput();
ip.setName(inputMessageName);
ip.setMessage(inputMessage);
operation.setInput(ip);
if (outputParameterTypes.length > 0) {
MessageImpl outputMessage = (MessageImpl) def.createMessage();
String outputMessageName = methodName + GFacSchemaConstants.SERVICE_RESP_MSG_SUFFIX + "_"
+ UUID.randomUUID();
outputMessage.setQName(new QName(def.getTargetNamespace(), outputMessageName));
outputMessage.setUndefined(false);
PartImpl part = (PartImpl) def.createPart();
part.setName(PART_NAME);
String outputElementName = methodName + GFacSchemaConstants.SERVICE_OUT_PARAMS_SUFFIX;
part.setElementName(new QName(typens, outputElementName));
outputMessage.addPart(part);
def.addMessage(outputMessage);
OutputImpl op = (OutputImpl) def.createOutput();
op.setName(outputMessageName);
op.setMessage(outputMessage);
operation.setOutput(op);
}
return operation;
}
private BindingInputImpl addBindingInput(Definition def, String methodName, UnknownExtensibilityElement wsPolicyRef) {
BindingInputImpl bindingInput = (BindingInputImpl) def.createBindingInput();
bindingInput.setName(methodName + GFacSchemaConstants.SERVICE_REQ_MSG_SUFFIX);
if (wsPolicyRef != null) {
log.info("policy info is not null");
bindingInput.addExtensibilityElement(wsPolicyRef);
}
SOAPBodyImpl inputExtension = new SOAPBodyImpl();
inputExtension.setUse(LITERAL);
bindingInput.addExtensibilityElement(inputExtension);
return bindingInput;
}
private BindingOutputImpl addBindingOutput(Definition def, String methodName, OutputParameterType[] outputParams,
UnknownExtensibilityElement wsPolicyRef) {
// specify output only if there are output parameters
BindingOutputImpl bindingOutput = null;
if (outputParams.length > 0) {
bindingOutput = (BindingOutputImpl) def.createBindingOutput();
bindingOutput.setName(methodName + GFacSchemaConstants.SERVICE_RESP_MSG_SUFFIX);
if (wsPolicyRef != null) {
log.info("policy info is not null");
bindingOutput.addExtensibilityElement(wsPolicyRef);
}
SOAPBodyImpl outputExtension = new SOAPBodyImpl();
outputExtension.setUse(LITERAL);
bindingOutput.addExtensibilityElement(outputExtension);
}
return bindingOutput;
}
private BindingOperation addBindingOperation(Definition def, OperationImpl operation, DOMImplementation dImpl) {
BindingOperation bindingOperation = def.createBindingOperation();
bindingOperation.setName(operation.getName());
SOAPOperation soapOperation = new SOAPOperationImpl();
bindingOperation.addExtensibilityElement(soapOperation);
bindingOperation.setOperation(operation);
Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);
UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
Element anonymousEle = doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:Anonymous");
anonymousEle.appendChild(doc.createTextNode("optional"));
exEle.setElement(anonymousEle);
exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:Anonymous"));
bindingOperation.addExtensibilityElement(exEle);
return bindingOperation;
}
private Binding addBinding(Definition def, String nameSpaceURI, PortTypeImpl portType,
UnknownExtensibilityElement wsPolicyRef, DOMImplementation dImpl) {
String portName = portType.getQName().getLocalPart();
Binding binding = def.createBinding();
binding.setQName(new QName(nameSpaceURI, portName + WSDL_SOAP_BINDING_SUFFIX));
binding.setUndefined(false);
binding.setPortType(portType);
SOAPBindingImpl soapBindingImpl = new SOAPBindingImpl();
soapBindingImpl.setStyle(DOCUMENT);
soapBindingImpl.setTransportURI(SOAP_HTTP_NAMESPACE);
binding.addExtensibilityElement(soapBindingImpl);
if (wsPolicyRef != null) {
log.info("policy info is not null");
binding.addExtensibilityElement(wsPolicyRef);
}
Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);
UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
exEle.setElement(doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
binding.addExtensibilityElement(exEle);
return binding;
}
public static void createMetadata(InputParameterType inparam, Document doc, Element annotation) {
if (inparam.getAnyMetadata() != null) {
unwrapMetadata(doc, annotation, (Element) inparam.getAnyMetadata());
}
}
public static void createMetadata(OutputParameterType outparam, Document doc, Element annotation) {
if (outparam.getAnyMetadata() != null) {
// GfacUtils.writeDOM((Element)outparam.getMetadata());
unwrapMetadata(doc, annotation, (Element) outparam.getAnyMetadata());
}
}
private static void unwrapMetadata(Document doc, Element annotation, Element base) {
Element appInfo = doc.createElementNS(XSD_NAMESPACE, "appinfo");
annotation.appendChild(appInfo);
NodeList childs = base.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
if (childs.item(i) instanceof Element) {
appInfo.appendChild(cloneElement(doc, (Element) childs.item(i)));
}
}
}
private static Element cloneElement(Document doc, Element base) {
// Element copy = doc.createElementNS(tagretNamespace,prefix+ ":" +
// base.getLocalName());
Element copy = doc.createElementNS(base.getNamespaceURI(), base.getTagName());
NodeList nodes = base.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
switch (node.getNodeType()) {
case Node.COMMENT_NODE:
Comment comment = (Comment) node;
copy.appendChild(doc.createComment(comment.getData()));
break;
case Node.ELEMENT_NODE:
copy.appendChild(cloneElement(doc, (Element) node));
break;
case Node.ATTRIBUTE_NODE:
Attr attr = (Attr) node;
Attr attrCopy = doc.createAttributeNS(attr.getNamespaceURI(), attr.getPrefix() + ":" + attr.getName());
attrCopy.setValue(attr.getValue());
copy.appendChild(attrCopy);
break;
case Node.TEXT_NODE:
copy.appendChild(doc.createTextNode(((Text) node).getNodeValue()));
break;
default:
break;
}
}
return copy;
}
} | 9,041 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/RoundTrip.java | /*
*
* 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.commons.gfac.wsdl;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
/**
* This sample demonstrates how to roundtrip XML document (roundtrip is not exact but infoset level)
*/
public class RoundTrip {
private final static String PROPERTY_XMLDECL_STANDALONE = "http://xmlpull.org/v1/doc/features.html#xmldecl-standalone";
private final static String PROPERTY_SERIALIZER_INDENTATION = "http://xmlpull.org/v1/doc/properties.html#serializer-indentation";
private XmlPullParser parser;
private XmlSerializer serializer;
private RoundTrip(XmlPullParser parser, XmlSerializer serializer) {
this.parser = parser;
this.serializer = serializer;
}
private void writeStartTag() throws XmlPullParserException, IOException {
// check for case when feature xml roundtrip is supported
// if (parser.getFeature (FEATURE_XML_ROUNDTRIP)) {
if (!parser.getFeature(XmlPullParser.FEATURE_REPORT_NAMESPACE_ATTRIBUTES)) {
for (int i = parser.getNamespaceCount(parser.getDepth() - 1); i <= parser.getNamespaceCount(parser
.getDepth()) - 1; i++) {
serializer.setPrefix(parser.getNamespacePrefix(i), parser.getNamespaceUri(i));
}
}
serializer.startTag(parser.getNamespace(), parser.getName());
for (int i = 0; i < parser.getAttributeCount(); i++) {
serializer.attribute(parser.getAttributeNamespace(i), parser.getAttributeName(i),
parser.getAttributeValue(i));
}
// serializer.closeStartTag();
}
private void writeToken(int eventType) throws XmlPullParserException, IOException {
switch (eventType) {
case XmlPullParser.START_DOCUMENT:
// use Boolean.TRUE to make it standalone
Boolean standalone = (Boolean) parser.getProperty(PROPERTY_XMLDECL_STANDALONE);
serializer.startDocument(parser.getInputEncoding(), standalone);
break;
case XmlPullParser.END_DOCUMENT:
serializer.endDocument();
break;
case XmlPullParser.START_TAG:
writeStartTag();
break;
case XmlPullParser.END_TAG:
serializer.endTag(parser.getNamespace(), parser.getName());
break;
case XmlPullParser.IGNORABLE_WHITESPACE:
// comment it to remove ignorable whtespaces from XML infoset
String s = parser.getText();
serializer.ignorableWhitespace(s);
break;
case XmlPullParser.TEXT:
serializer.text(parser.getText());
break;
case XmlPullParser.ENTITY_REF:
serializer.entityRef(parser.getName());
break;
case XmlPullParser.CDSECT:
serializer.cdsect(parser.getText());
break;
case XmlPullParser.PROCESSING_INSTRUCTION:
serializer.processingInstruction(parser.getText());
break;
case XmlPullParser.COMMENT:
serializer.comment(parser.getText());
break;
case XmlPullParser.DOCDECL:
serializer.docdecl(parser.getText());
break;
}
}
private void roundTrip() throws XmlPullParserException, IOException {
parser.nextToken(); // read first token
writeToken(XmlPullParser.START_DOCUMENT); // write optional XMLDecl if
// present
while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
writeToken(parser.getEventType());
parser.nextToken();
}
writeToken(XmlPullParser.END_DOCUMENT);
}
public static void roundTrip(Reader reader, Writer writer, String indent) throws XmlPullParserException,
IOException {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser pp = factory.newPullParser();
pp.setInput(reader);
XmlSerializer serializer = factory.newSerializer();
serializer.setOutput(writer);
if (indent != null) {
serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, indent);
}
(new RoundTrip(pp, serializer)).roundTrip();
}
public static void main(String[] args) throws Exception {
String XML = "<test><foo>fdf</foo></test>";
Reader r = new StringReader(XML);
Writer w = new StringWriter();
roundTrip(r, w, " ");
System.out.println("indented XML=" + w);
}
} | 9,042 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/GFacWSDLException.java | /*
*
* 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.commons.gfac.wsdl;
public class GFacWSDLException extends Exception {
/**
* serialVersionUID
*/
private static final long serialVersionUID = 3146697337237463348L;
public GFacWSDLException(String message, Throwable cause) {
super(message, cause);
}
public GFacWSDLException(String message) {
super(message);
}
public GFacWSDLException(Throwable cause) {
super(cause);
}
} | 9,043 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/GFacSchemaConstants.java | /*
*
* 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.commons.gfac.wsdl;
public class GFacSchemaConstants {
public static final String SHUTDOWN = "Shutdown";
public static final String PING = "Ping";
public static final String KILL = "Kill";
public static final String ARRAY_VALUE = "value";
public static final String _127_0_0_1 = "127.0.0.1";
public static final String GFAC_NAMESPACE = "http://schemas.airavata.apache.org/gfac/type";
public static final String TRANSPORT_LEVEL = "TransportLevel";
public static final String MESSAGE_SIGNATURE = "MessageSignature";
// Specific to application service
public static final String SERVICE_URI = "SERVICE_URI";
public static final String METHOD_NAME = "METHOD_NAME";
public static final String SERVICE_NAME = "SERVICE_NAME";
public static final String APP_SERVICE_STRING_PARAM = "AFAC_STRING_PARAM";
public static final String SERVICE_RESP_MSG_SUFFIX = "_ResponseMessage";
public static final String SERVICE_INPUT_PARAMS_TYPE_SUFFIX = "_InputParamsType";
public static final String SERVICE_OUTPUT_PARAMS_TYPE_SUFFIX = "_OutputParamsType";
public static final String SERVICE_REQ_MSG_SUFFIX = "_RequestMessage";
public static final String SERVICE_IN_PARAMS_SUFFIX = "_InputParams";
public static final String SERVICE_OUT_PARAMS_SUFFIX = "_OutputParams";
public static final String SERVICE_TMP_DIR = "AFAC_TMP_DIR";
public static final String SERVICE_INPUT_MESSAGE_NAME = "AFAC_INPUT_MESSAGE_NAME";
public static final String HOST = "host";
public static final String UTF8 = "UTF-8";
public static final String LOCALHOST = "localhost";
public static interface InbuitOperations {
public static final String OP_KILL = "Kill";
public static final String OP_PING = "Ping";
public static final String OP_SHUTDOWN = "Shutdown";
}
public static class Types {
public static final String TYPE_STRING = "String";
public static final String TYPE_INT = "Integer";
public static final String TYPE_FLOAT = "Float";
public static final String TYPE_DOUBLE = "Double";
public static final String TYPE_BOOLEAN = "Boolean";
public static final String TYPE_QNAME = "QName";
public static final String TYPE_URI = "URI";
public static final String TYPE_STRING_ARRAY = "StringArray";
public static final String TYPE_INT_ARRAY = "IntegerArray";
public static final String TYPE_FLAOT_ARRAY = "FloatArray";
public static final String TYPE_DOUBLE_ARRAY = "DoubleArray";
public static final String TYPE_BOOLEAN_ARRAY = "BooleanArray";
public static final String TYPE_QNAME_ARRAY = "QNameArray";
public static final String TYPE_URI_ARRAY = "URIArray";
public static final String TYPE_STDOUT = "StdOut";
public static final String TYPE_STDERRORs = "StdErr";
public static final String TYPE_DATAID = "DataID";
public static final String TYPE_DATAID_ARRAY = "DataIDArray";
}
} | 9,044 |
0 | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac | Create_ds/airavata-sandbox/gfac-refactoring/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/wsdl/WSPolicyGenerator.java | /*
*
* 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.commons.gfac.wsdl;
import javax.wsdl.extensions.UnknownExtensibilityElement;
import javax.xml.namespace.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class WSPolicyGenerator implements WSDLConstants {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
public static UnknownExtensibilityElement createServiceLevelPolicy(DOMImplementation dImpl, String policyID) {
Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:Policy", null);
Element policy = doc.getDocumentElement();
policy.setAttribute("wsu:Id", policyID);
Element exactlyOne = doc.createElement("wsp:ExactlyOne");
Element all = doc.createElement("wsp:All");
/*
* Element policyEncoding = doc.createElement("wspe:Utf816FFFECharacterEncoding");
* all.appendChild(policyEncoding);
*/
Element asymmBinding = doc.createElement("sp:AsymmetricBinding");
asymmBinding.setAttribute("xmlns:sp", SP_NAMESPACE);
Element policy1 = doc.createElement("wsp:Policy");
Element initiatorToken = doc.createElement("sp:InitiatorToken");
Element policy2 = doc.createElement("wsp:Policy");
Element x509Token = doc.createElement("sp:X509Token");
x509Token.setAttribute("sp:IncludeToken",
"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient");
Element policy3 = doc.createElement("wsp:Policy");
Element x509V3Token10 = doc.createElement("sp:WssX509V3Token10");
policy3.appendChild(x509V3Token10);
x509Token.appendChild(policy3);
policy2.appendChild(x509Token);
initiatorToken.appendChild(policy2);
policy1.appendChild(initiatorToken);
// <sp:RecipientToken>
// <wsp:Policy>
// <sp:X509Token
// sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
// <wsp:Policy>
// <sp:WssX509V3Token10/>
// </wsp:Policy>
// </sp:X509Token>
// </wsp:Policy>
// </sp:RecipientToken>
Element recipientToken = doc.createElement("sp:RecipientToken");
policy2 = doc.createElement("wsp:Policy");
x509Token = doc.createElement("sp:X509Token");
// x509Token.setAttribute(
// "sp:IncludeToken","http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never");
x509Token.setAttribute("sp:IncludeToken",
"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient");
x509Token.appendChild(createEmptyElementHierachy("wsp:Policy", new String[] { "sp:WssX509V3Token10" }, doc));
policy2.appendChild(x509Token);
recipientToken.appendChild(policy2);
policy1.appendChild(recipientToken);
Element algorithmSuite = doc.createElement("sp:AlgorithmSuite");
algorithmSuite.appendChild(createEmptyElementHierachy("wsp:Policy", new String[] { "sp:Basic256",
"sp:InclusiveC14N" }, doc));
policy1.appendChild(algorithmSuite);
Element layout = doc.createElement("sp:Layout");
layout.appendChild(createEmptyElementHierachy("wsp:Policy", new String[] { "sp:Strict" }, doc));
policy1.appendChild(layout);
// Element ts = doc.createElement("sp:IncludeTimestamp");
// policy1.appendChild(ts);
asymmBinding.appendChild(policy1);
all.appendChild(asymmBinding);
/*
* <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy>
* <sp:MustSupportRefKeyIdentifier/> <sp:MustSupportRefIssuerSerial/> </wsp:Policy> </sp:Wss10>
*/
Element wss10 = doc.createElement("sp:Wss10");
wss10.appendChild(createEmptyElementHierachy("wsp:Policy", new String[] { "sp:MustSupportRefKeyIdentifier",
"sp:MustSupportRefIssuerSerial" }, doc));
all.appendChild(wss10);
exactlyOne.appendChild(all);
policy.appendChild(exactlyOne);
UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
elem.setElement(policy);
elem.setElementType(new QName(WSP_NAMESPACE, "wsp:Policy"));
return elem;
}
private static Element createEmptyElementHierachy(String parent, String[] childern, Document doc) {
Element parentEle = doc.createElement(parent);
for (int x = 0; x < childern.length; x++) {
parentEle.appendChild(doc.createElement(childern[x]));
}
return parentEle;
}
private static Element createElementHierachy(String parent, String[] childern, String[] values, Document doc) {
Element parentEle = doc.createElement(parent);
for (int x = 0; x < childern.length; x++) {
Element temp = doc.createElement(childern[x]);
temp.appendChild(doc.createTextNode(values[x]));
parentEle.appendChild(temp);
}
return parentEle;
}
private static UnknownExtensibilityElement createWSPolicyRef(DOMImplementation dImpl, String id) {
Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:PolicyReference", null);
Element policyRef = doc.getDocumentElement();
policyRef.setAttribute("URI", "#" + id);
UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
elem.setElement(policyRef);
elem.setElementType(new QName(WSP_NAMESPACE, "PolicyReference"));
return elem;
}
} | 9,045 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java | /*
*
* 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.framework.impl;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.airavata.gfac.framework.service.GFacService;
import org.apache.airavata.gfac.framework.service.JobInfo;
import java.util.concurrent.ConcurrentHashMap;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 1:26 PM
*/
public class GFacServiceImpl implements GFacService {
private ConcurrentHashMap<String, GFacProviderService> gfacProviders
= new ConcurrentHashMap<String, GFacProviderService>();
public void submitJob(JobInfo jobInfo) {
System.out.println("Submitting job ........");
// TODO invoke in handlers
// TODO invoke provider
// TODO invoke out handlers
}
public void addGFacProvider(String name, GFacProviderService gFacProviderService) {
gfacProviders.put(name, gFacProviderService);
}
public void removeGFacProvider(String name) {
gfacProviders.remove(name);
}
}
| 9,046 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java | /*
*
* 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.framework.activator;
import org.apache.airavata.gfac.framework.impl.GFacServiceImpl;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.airavata.gfac.framework.service.GFacService;
import org.osgi.framework.*;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 12:15 PM
*/
public class GFacActivator implements BundleActivator, ServiceListener
{
// Bundle's context.
private BundleContext bundleContext = null;
// The service reference being used.
private ServiceReference serviceReference = null;
private GFacServiceImpl gFacServiceImpl = new GFacServiceImpl();
/**
* Implements BundleActivator.start(). Prints
* a message and adds itself to the bundle context as a service
* listener.
* @param context the framework context for the bundle.
**/
public void start(BundleContext context) throws InvalidSyntaxException {
System.out.println("Starting to listen for service events.");
this.bundleContext = context;
context.registerService(
GFacService.class.getName(), gFacServiceImpl, null);
synchronized (this)
{
// Listen for events pertaining to dictionary services.
context.addServiceListener(this, "(&(objectClass=" + GFacProviderService.class.getName() + ")" +
"(Provider=*))");
// Query for any service references matching any language.
ServiceReference[] refs = this.bundleContext.getServiceReferences(
GFacProviderService.class.getName(), "(Provider=*)");
// If we found any dictionary services, then just get
// a reference to the first one so we can use it.
if (refs != null)
{
for(ServiceReference serviceRef : refs) {
gFacServiceImpl.addGFacProvider((String)serviceRef.getProperty("Provider"),
(GFacProviderService)this.bundleContext.getService(serviceRef));
}
}
}
}
/**
* Implements BundleActivator.stop(). Prints
* a message and removes itself from the bundle context as a
* service listener.
* @param context the framework context for the bundle.
**/
public void stop(BundleContext context) {
context.removeServiceListener(this);
System.out.println("Stopped listening for service events.");
// Note: It is not required that we remove the listener here,
// since the framework will do it automatically anyway.
}
/**
* Implements ServiceListener.serviceChanged(). Checks
* to see if the service we are using is leaving or tries to get
* a service if we need one.
* @param event the fired service event.
**/
public synchronized void serviceChanged(ServiceEvent event)
{
// If a dictionary service was registered, see if we
// need one. If so, get a reference to it.
if (event.getType() == ServiceEvent.REGISTERED)
{
String providerKey = (String) event.getServiceReference().getProperty("Provider");
GFacProviderService providerService
= (GFacProviderService)this.bundleContext.getService(event.getServiceReference());
gFacServiceImpl.addGFacProvider(providerKey, providerService);
}
// If a dictionary service was unregistered, see if it
// was the one we were using. If so, unget the service
// and try to query to get another one.
else if (event.getType() == ServiceEvent.UNREGISTERING)
{
String providerKey = (String) event.getServiceReference().getProperty("Provider");
this.gFacServiceImpl.removeGFacProvider(providerKey);
this.bundleContext.ungetService(event.getServiceReference());
}
}
}
| 9,047 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java | package org.apache.airavata.gfac.framework.provider;/*
*
* 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 java.util.Map;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 12:05 PM
*/
/**
* GFacProviderService Service injected into framework.
*/
public interface GFacProviderService {
void initProperties(Map<String,String> properties) throws GFacProviderException;
/**
* Initialize environment required for invoking the execute method of the provider. If environment setup is
* done during the in handler execution, validation of environment will go here.
* @param jobExecutionContext containing job execution related information.
* @throws GFacProviderException in case of a error initializing the environment.
*/
void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException;
/**
* Invoke the providers intended functionality using information and data in job execution context.
* @param jobExecutionContext containing job execution related information.
* @throws GFacProviderException in case of a error executing the job.
*/
void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException;
/**
* Cleans up the acquired resources during initialization and execution of the job.
* @param jobExecutionContext containing job execution related information.
* @throws GFacProviderException in case of a error cleaning resources.
*/
void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException;
/**
* Cancels all jobs relevant to an experiment.
* @param experimentId The experiment id
* @param jobExecutionContext The job execution context, contains runtime information.
* @throws GFacProviderException If an error occurred while cancelling the job.
*/
void cancelJob(String experimentId, JobExecutionContext jobExecutionContext) throws GFacProviderException;
/**
* Cancels all jobs relevant to a workflow in an experiment.
* @param experimentId The experiment id
* @param workflowId The workflow id.
* @param jobExecutionContext The job execution context, contains runtime information.
* @throws GFacProviderException If an error occurred while cancelling the job.
*/
void cancelJob(String experimentId, String workflowId,
JobExecutionContext jobExecutionContext) throws GFacProviderException;
/**
* Cancels the job for a given a workflow id and node id in an experiment.
* @param experimentId The experiment id.
* @param workflowId The workflow id.
* @param nodeId The node id.
* @param jobExecutionContext The job execution context relevant to cancel job operation.
* @throws GFacProviderException If an error occurred while cancelling the job.
*/
void cancelJob(String experimentId, String workflowId, String nodeId,
JobExecutionContext jobExecutionContext) throws GFacProviderException;
}
| 9,048 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java | /*
*
* 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.framework.provider;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 12:09 PM
*/
public class JobExecutionContext {
private static final long serialVersionUID = 3L;
}
| 9,049 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java | /*
*
* 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.framework.provider;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 12:09 PM
*/
public class GFacProviderException extends Exception {
private static final long serialVersionUID = 2L;
}
| 9,050 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java | package org.apache.airavata.gfac.framework.service;/*
*
* 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.
*
*/
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 9:42 AM
*/
/**
* Service exposed by framework bundle
*/
public interface GFacService {
void submitJob(JobInfo jobInfo);
}
| 9,051 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java | /*
*
* 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.framework.service;
import java.io.Serializable;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/14/13
* Time: 10:45 AM
*/
public class JobInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String workflowId;
private String contextHeader;
public String getWorkflowId() {
return workflowId;
}
public void setWorkflowId(String workflowId) {
this.workflowId = workflowId;
}
public String getContextHeader() {
return contextHeader;
}
public void setContextHeader(String contextHeader) {
this.contextHeader = contextHeader;
}
}
| 9,052 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java | /*
*
* 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.server.gfac.providers.gram.activator;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.server.gfac.providers.gram.service.GramProvider;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import java.util.Hashtable;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/15/13
* Time: 10:14 AM
*/
/**
* Gram provider activator.
*/
public class GramProviderActivator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put("Provider", "Gram");
bundleContext.registerService(
GFacProviderService.class.getName(), new GramProvider(), properties);
}
public void stop(BundleContext bundleContext) throws Exception {
//To change body of implemented methods use File | Settings | File Templates.
}
}
| 9,053 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java | /*
*
* 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.server.gfac.providers.gram.service;
import org.apache.airavata.gfac.framework.provider.GFacProviderException;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.airavata.gfac.framework.provider.JobExecutionContext;
import java.util.Map;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/15/13
* Time: 9:52 AM
*/
public class GramProvider implements GFacProviderService {
public void initProperties(Map<String, String> properties) throws GFacProviderException {
System.out.println("In Gram initProp");
}
public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Gram init");
}
public void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In gram execute");
}
public void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In gram dispose");
}
public void cancelJob(String experimentId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In gram cancel");
}
public void cancelJob(String experimentId, String workflowId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In gram cancel");
}
public void cancelJob(String experimentId, String workflowId, String nodeId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In gram cancel");
}
}
| 9,054 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java | /*
*
* 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.server.gfac.providers.unicore.activator;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.server.gfac.providers.unicore.service.UnicoreProvider;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import java.util.Hashtable;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/15/13
* Time: 10:27 AM
*/
public class UnicoreProviderActivator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put("Provider", "Unicore");
bundleContext.registerService(
GFacProviderService.class.getName(), new UnicoreProvider(), properties);
}
public void stop(BundleContext bundleContext) throws Exception {
//To change body of implemented methods use File | Settings | File Templates.
}
}
| 9,055 |
0 | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore | Create_ds/airavata-sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java | /*
*
* 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.server.gfac.providers.unicore.service;
import org.apache.airavata.gfac.framework.provider.GFacProviderException;
import org.apache.airavata.gfac.framework.provider.GFacProviderService;
import org.apache.airavata.gfac.framework.provider.JobExecutionContext;
import java.util.Map;
/**
* User: AmilaJ (amilaj@apache.org)
* Date: 7/15/13
* Time: 10:25 AM
*/
public class UnicoreProvider implements GFacProviderService {
public void initProperties(Map<String, String> properties) throws GFacProviderException {
System.out.println("In Unicore initProp");
}
public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore init");
}
public void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore execute");
}
public void dispose(JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore dispose");
}
public void cancelJob(String experimentId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore cancel");
}
public void cancelJob(String experimentId, String workflowId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore cancel");
}
public void cancelJob(String experimentId, String workflowId, String nodeId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
System.out.println("In Unicore cancel");
}
}
| 9,056 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/ApiClient.java | package org.apache.airavata.jupyter.container.magic.api;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
public class ApiClient {
public static void main(String args[]) {
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 9999).usePlaintext().build();
ContainerMagicApiGrpc.ContainerMagicApiBlockingStub containerMagicApiBlockingStub = ContainerMagicApiGrpc.newBlockingStub(channel);
PythonCellExecutionResponse response = containerMagicApiBlockingStub
.executePythonCell(PythonCellExecutionRequest.newBuilder().setCellContent("some content").build());
System.out.println(response);
}
}
| 9,057 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/Application.java | package org.apache.airavata.jupyter.container.magic.api;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan(basePackages = {"org.apache.airavata.jupyter"})
@SpringBootApplication()
public class Application implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| 9,058 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/Configuration.java | package org.apache.airavata.jupyter.container.magic.api;
public class Configuration {
}
| 9,059 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/handler/ContainerMagicApiHandler.java | package org.apache.airavata.jupyter.container.magic.api.handler;
import com.google.protobuf.ByteString;
import io.grpc.stub.StreamObserver;
import org.apache.airavata.jupyter.container.magic.api.ContainerMagicApiGrpc;
import org.apache.airavata.jupyter.container.magic.api.PythonCellExecutionRequest;
import org.apache.airavata.jupyter.container.magic.api.PythonCellExecutionResponse;
import org.apache.commons.text.StringSubstitutor;
import org.lognet.springboot.grpc.GRpcService;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@GRpcService
public class ContainerMagicApiHandler extends ContainerMagicApiGrpc.ContainerMagicApiImplBase {
private String tempDir = "C:\\Users\\dimut\\temp_shuttle";
private String codeTemplate = "import dill as pickle\n" +
"\n" +
"with open('${baseDir}${separator}context.pickle', 'rb') as f:\n" +
" context = pickle.load(f)\n" +
"\n" +
"exec(\"${code}\", None, context)" +
"\n" +
"with open('${baseDir}${separator}final-context.pickle', 'wb') as f:\n" +
" pickle.dump(context, f)\n";
@Override
public void executePythonCell(PythonCellExecutionRequest request, StreamObserver<PythonCellExecutionResponse> responseObserver) {
try {
Path directory = Files.createDirectory(Path.of(tempDir, UUID.randomUUID().toString()));
System.out.println("Directory " + directory.toAbsolutePath().toString());
Path scriptPath = Path.of(directory.toAbsolutePath().toString(), "script.py");
Map<String, String> parameters = new HashMap<>();
parameters.put("code", request.getCellContent().trim());
parameters.put("baseDir", directory.toAbsolutePath().toString().replace("\\", "\\\\"));
parameters.put("separator", File.separator.replace("\\", "\\\\"));
StringSubstitutor sub = new StringSubstitutor(parameters);
Files.write(scriptPath, sub.replace(codeTemplate).getBytes());
Files.write(Path.of(directory.toAbsolutePath().toString(), "context.pickle"), request.getLocalScope().toByteArray());
Runtime rt = Runtime.getRuntime();
String[] commands = {"python3", scriptPath.toAbsolutePath().toString()};
Process proc = rt.exec(commands);
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(proc.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(proc.getErrorStream()));
System.out.println("Here is the standard output of the command:\n");
String s = null;
StringBuilder stdOut = new StringBuilder();
StringBuilder stdErr = new StringBuilder();
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
stdOut.append(s).append("\n");
}
System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
stdErr.append(s).append("\n");
}
byte[] finalContext = Files.readAllBytes(Path.of(directory.toAbsolutePath().toString(), "final-context.pickle"));
PythonCellExecutionResponse executionResponse = PythonCellExecutionResponse.newBuilder()
.setStdOut(stdOut.toString())
.setStdErr(stdErr.toString())
.setLocalScope(ByteString.copyFrom(finalContext)).build();
responseObserver.onNext(executionResponse);
responseObserver.onCompleted();
} catch (IOException e) {
e.printStackTrace();
responseObserver.onError(e);
}
}
}
| 9,060 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/handler/FileUploadHandler.java | package org.apache.airavata.jupyter.container.magic.api.handler;
import org.apache.airavata.jupyter.container.magic.api.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
public class FileUploadHandler {
@Autowired
private StorageService storageService;
@PostMapping("/upload")
public ResponseEntity<String> handleFileUpload(@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes) {
try {
String uploadPath = storageService.store(file);
System.out.println("Uploaded to " + uploadPath);
return new ResponseEntity<String>(uploadPath, HttpStatus.OK);
} catch (Exception e) {
return new ResponseEntity<String>("Failed", HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
| 9,061 |
0 | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api | Create_ds/airavata-sandbox/jupyter-container-magic/magic-api/src/main/java/org/apache/airavata/jupyter/container/magic/api/service/StorageService.java | package org.apache.airavata.jupyter.container.magic.api.service;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
@Service
public class StorageService {
private final Path rootLocation = Files.createTempDirectory("temproot");
public StorageService() throws IOException {
}
public String store(MultipartFile file) throws Exception {
try {
if (file.isEmpty()) {
throw new Exception("Failed to store empty file.");
}
Path destinationFile = this.rootLocation.resolve(
Paths.get(file.getOriginalFilename()))
.normalize().toAbsolutePath();
if (!destinationFile.getParent().equals(this.rootLocation.toAbsolutePath())) {
// This is a security check
throw new Exception(
"Cannot store file outside current directory.");
}
try (InputStream inputStream = file.getInputStream()) {
Files.copy(inputStream, destinationFile, StandardCopyOption.REPLACE_EXISTING);
}
return destinationFile.toAbsolutePath().toString();
}
catch (IOException e) {
throw new Exception("Failed to store file.", e);
}
}
}
| 9,062 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/models/ProjectReviewer.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.models;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
* <p>Allocation Request status details</p>
* <li>projectId: Unique id of the project</li>
* <li>awardAllocation: Allocation awarded</li>
* <li>endDate: End date of the request</li>
* <li>reviewers: reviewers of the request</li>
* <li>startDate: Start date of the allocation</li>
* <li>status: Status of the allocation request</li>
*
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class ProjectReviewer implements org.apache.thrift.TBase<ProjectReviewer, ProjectReviewer._Fields>, java.io.Serializable, Cloneable, Comparable<ProjectReviewer> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ProjectReviewer");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField REVIEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("reviewer", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ProjectReviewerStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ProjectReviewerTupleSchemeFactory();
public java.lang.String projectId; // optional
public java.lang.String reviewer; // optional
public long id; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
REVIEWER((short)2, "reviewer"),
ID((short)3, "id");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // REVIEWER
return REVIEWER;
case 3: // ID
return ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PROJECT_ID,_Fields.REVIEWER,_Fields.ID};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.REVIEWER, new org.apache.thrift.meta_data.FieldMetaData("reviewer", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProjectReviewer.class, metaDataMap);
}
public ProjectReviewer() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ProjectReviewer(ProjectReviewer other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetReviewer()) {
this.reviewer = other.reviewer;
}
this.id = other.id;
}
public ProjectReviewer deepCopy() {
return new ProjectReviewer(this);
}
@Override
public void clear() {
this.projectId = null;
this.reviewer = null;
setIdIsSet(false);
this.id = 0;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public ProjectReviewer setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getReviewer() {
return this.reviewer;
}
public ProjectReviewer setReviewer(java.lang.String reviewer) {
this.reviewer = reviewer;
return this;
}
public void unsetReviewer() {
this.reviewer = null;
}
/** Returns true if field reviewer is set (has been assigned a value) and false otherwise */
public boolean isSetReviewer() {
return this.reviewer != null;
}
public void setReviewerIsSet(boolean value) {
if (!value) {
this.reviewer = null;
}
}
public long getId() {
return this.id;
}
public ProjectReviewer setId(long id) {
this.id = id;
setIdIsSet(true);
return this;
}
public void unsetId() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case REVIEWER:
if (value == null) {
unsetReviewer();
} else {
setReviewer((java.lang.String)value);
}
break;
case ID:
if (value == null) {
unsetId();
} else {
setId((java.lang.Long)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case REVIEWER:
return getReviewer();
case ID:
return getId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case REVIEWER:
return isSetReviewer();
case ID:
return isSetId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof ProjectReviewer)
return this.equals((ProjectReviewer)that);
return false;
}
public boolean equals(ProjectReviewer that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_reviewer = true && this.isSetReviewer();
boolean that_present_reviewer = true && that.isSetReviewer();
if (this_present_reviewer || that_present_reviewer) {
if (!(this_present_reviewer && that_present_reviewer))
return false;
if (!this.reviewer.equals(that.reviewer))
return false;
}
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (this.id != that.id)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetReviewer()) ? 131071 : 524287);
if (isSetReviewer())
hashCode = hashCode * 8191 + reviewer.hashCode();
hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
if (isSetId())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id);
return hashCode;
}
@Override
public int compareTo(ProjectReviewer other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetReviewer()).compareTo(other.isSetReviewer());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReviewer()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reviewer, other.reviewer);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("ProjectReviewer(");
boolean first = true;
if (isSetProjectId()) {
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
}
if (isSetReviewer()) {
if (!first) sb.append(", ");
sb.append("reviewer:");
if (this.reviewer == null) {
sb.append("null");
} else {
sb.append(this.reviewer);
}
first = false;
}
if (isSetId()) {
if (!first) sb.append(", ");
sb.append("id:");
sb.append(this.id);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ProjectReviewerStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ProjectReviewerStandardScheme getScheme() {
return new ProjectReviewerStandardScheme();
}
}
private static class ProjectReviewerStandardScheme extends org.apache.thrift.scheme.StandardScheme<ProjectReviewer> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ProjectReviewer struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // REVIEWER
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.reviewer = iprot.readString();
struct.setReviewerIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ProjectReviewer struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
if (struct.isSetProjectId()) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
}
if (struct.reviewer != null) {
if (struct.isSetReviewer()) {
oprot.writeFieldBegin(REVIEWER_FIELD_DESC);
oprot.writeString(struct.reviewer);
oprot.writeFieldEnd();
}
}
if (struct.isSetId()) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeI64(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ProjectReviewerTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ProjectReviewerTupleScheme getScheme() {
return new ProjectReviewerTupleScheme();
}
}
private static class ProjectReviewerTupleScheme extends org.apache.thrift.scheme.TupleScheme<ProjectReviewer> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ProjectReviewer struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetProjectId()) {
optionals.set(0);
}
if (struct.isSetReviewer()) {
optionals.set(1);
}
if (struct.isSetId()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetProjectId()) {
oprot.writeString(struct.projectId);
}
if (struct.isSetReviewer()) {
oprot.writeString(struct.reviewer);
}
if (struct.isSetId()) {
oprot.writeI64(struct.id);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ProjectReviewer struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
if (incoming.get(1)) {
struct.reviewer = iprot.readString();
struct.setReviewerIsSet(true);
}
if (incoming.get(2)) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| 9,063 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/models/ReviewerAllocationDetail.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.models;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class ReviewerAllocationDetail implements org.apache.thrift.TBase<ReviewerAllocationDetail, ReviewerAllocationDetail._Fields>, java.io.Serializable, Cloneable, Comparable<ReviewerAllocationDetail> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReviewerAllocationDetail");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField APPLICATIONS_TO_BE_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationsToBeUsed", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField DISK_USAGE_RANGE_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("diskUsageRangePerJob", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField DOCUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("documents", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField FIELD_OF_SCIENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("fieldOfScience", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField KEYWORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("keywords", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField MAX_MEMORY_PER_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("maxMemoryPerCpu", org.apache.thrift.protocol.TType.I64, (short)7);
private static final org.apache.thrift.protocol.TField NUMBER_OF_CPU_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("numberOfCpuPerJob", org.apache.thrift.protocol.TType.I64, (short)8);
private static final org.apache.thrift.protocol.TField PROJECT_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projectDescription", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField PROJECT_REVIEWED_AND_FUNDED_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("projectReviewedAndFundedBy", org.apache.thrift.protocol.TType.STRING, (short)10);
private static final org.apache.thrift.protocol.TField REQUESTED_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestedDate", org.apache.thrift.protocol.TType.I64, (short)11);
private static final org.apache.thrift.protocol.TField SERVICE_UNITS_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceUnits", org.apache.thrift.protocol.TType.I64, (short)12);
private static final org.apache.thrift.protocol.TField SPECIFIC_RESOURCE_SELECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("specificResourceSelection", org.apache.thrift.protocol.TType.STRING, (short)13);
private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)14);
private static final org.apache.thrift.protocol.TField TYPE_OF_ALLOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("typeOfAllocation", org.apache.thrift.protocol.TType.STRING, (short)15);
private static final org.apache.thrift.protocol.TField TYPICAL_SU_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("typicalSuPerJob", org.apache.thrift.protocol.TType.I64, (short)16);
private static final org.apache.thrift.protocol.TField AWARD_ALLOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("awardAllocation", org.apache.thrift.protocol.TType.I64, (short)17);
private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)18);
private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)19);
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)20);
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)21);
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)22);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ReviewerAllocationDetailStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ReviewerAllocationDetailTupleSchemeFactory();
public java.lang.String projectId; // optional
public java.lang.String applicationsToBeUsed; // optional
public long diskUsageRangePerJob; // optional
public java.nio.ByteBuffer documents; // optional
public java.lang.String fieldOfScience; // optional
public java.lang.String keywords; // optional
public long maxMemoryPerCpu; // optional
public long numberOfCpuPerJob; // optional
public java.lang.String projectDescription; // optional
public java.lang.String projectReviewedAndFundedBy; // optional
public long requestedDate; // optional
public long serviceUnits; // optional
public java.lang.String specificResourceSelection; // optional
public java.lang.String title; // optional
public java.lang.String typeOfAllocation; // optional
public long typicalSuPerJob; // optional
public long awardAllocation; // optional
public long startDate; // optional
public long endDate; // optional
public java.lang.String status; // optional
public java.lang.String username; // optional
public long id; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
APPLICATIONS_TO_BE_USED((short)2, "applicationsToBeUsed"),
DISK_USAGE_RANGE_PER_JOB((short)3, "diskUsageRangePerJob"),
DOCUMENTS((short)4, "documents"),
FIELD_OF_SCIENCE((short)5, "fieldOfScience"),
KEYWORDS((short)6, "keywords"),
MAX_MEMORY_PER_CPU((short)7, "maxMemoryPerCpu"),
NUMBER_OF_CPU_PER_JOB((short)8, "numberOfCpuPerJob"),
PROJECT_DESCRIPTION((short)9, "projectDescription"),
PROJECT_REVIEWED_AND_FUNDED_BY((short)10, "projectReviewedAndFundedBy"),
REQUESTED_DATE((short)11, "requestedDate"),
SERVICE_UNITS((short)12, "serviceUnits"),
SPECIFIC_RESOURCE_SELECTION((short)13, "specificResourceSelection"),
TITLE((short)14, "title"),
TYPE_OF_ALLOCATION((short)15, "typeOfAllocation"),
TYPICAL_SU_PER_JOB((short)16, "typicalSuPerJob"),
AWARD_ALLOCATION((short)17, "awardAllocation"),
START_DATE((short)18, "startDate"),
END_DATE((short)19, "endDate"),
STATUS((short)20, "status"),
USERNAME((short)21, "username"),
ID((short)22, "id");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // APPLICATIONS_TO_BE_USED
return APPLICATIONS_TO_BE_USED;
case 3: // DISK_USAGE_RANGE_PER_JOB
return DISK_USAGE_RANGE_PER_JOB;
case 4: // DOCUMENTS
return DOCUMENTS;
case 5: // FIELD_OF_SCIENCE
return FIELD_OF_SCIENCE;
case 6: // KEYWORDS
return KEYWORDS;
case 7: // MAX_MEMORY_PER_CPU
return MAX_MEMORY_PER_CPU;
case 8: // NUMBER_OF_CPU_PER_JOB
return NUMBER_OF_CPU_PER_JOB;
case 9: // PROJECT_DESCRIPTION
return PROJECT_DESCRIPTION;
case 10: // PROJECT_REVIEWED_AND_FUNDED_BY
return PROJECT_REVIEWED_AND_FUNDED_BY;
case 11: // REQUESTED_DATE
return REQUESTED_DATE;
case 12: // SERVICE_UNITS
return SERVICE_UNITS;
case 13: // SPECIFIC_RESOURCE_SELECTION
return SPECIFIC_RESOURCE_SELECTION;
case 14: // TITLE
return TITLE;
case 15: // TYPE_OF_ALLOCATION
return TYPE_OF_ALLOCATION;
case 16: // TYPICAL_SU_PER_JOB
return TYPICAL_SU_PER_JOB;
case 17: // AWARD_ALLOCATION
return AWARD_ALLOCATION;
case 18: // START_DATE
return START_DATE;
case 19: // END_DATE
return END_DATE;
case 20: // STATUS
return STATUS;
case 21: // USERNAME
return USERNAME;
case 22: // ID
return ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __DISKUSAGERANGEPERJOB_ISSET_ID = 0;
private static final int __MAXMEMORYPERCPU_ISSET_ID = 1;
private static final int __NUMBEROFCPUPERJOB_ISSET_ID = 2;
private static final int __REQUESTEDDATE_ISSET_ID = 3;
private static final int __SERVICEUNITS_ISSET_ID = 4;
private static final int __TYPICALSUPERJOB_ISSET_ID = 5;
private static final int __AWARDALLOCATION_ISSET_ID = 6;
private static final int __STARTDATE_ISSET_ID = 7;
private static final int __ENDDATE_ISSET_ID = 8;
private static final int __ID_ISSET_ID = 9;
private short __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PROJECT_ID,_Fields.APPLICATIONS_TO_BE_USED,_Fields.DISK_USAGE_RANGE_PER_JOB,_Fields.DOCUMENTS,_Fields.FIELD_OF_SCIENCE,_Fields.KEYWORDS,_Fields.MAX_MEMORY_PER_CPU,_Fields.NUMBER_OF_CPU_PER_JOB,_Fields.PROJECT_DESCRIPTION,_Fields.PROJECT_REVIEWED_AND_FUNDED_BY,_Fields.REQUESTED_DATE,_Fields.SERVICE_UNITS,_Fields.SPECIFIC_RESOURCE_SELECTION,_Fields.TITLE,_Fields.TYPE_OF_ALLOCATION,_Fields.TYPICAL_SU_PER_JOB,_Fields.AWARD_ALLOCATION,_Fields.START_DATE,_Fields.END_DATE,_Fields.STATUS,_Fields.USERNAME,_Fields.ID};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.APPLICATIONS_TO_BE_USED, new org.apache.thrift.meta_data.FieldMetaData("applicationsToBeUsed", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DISK_USAGE_RANGE_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("diskUsageRangePerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.DOCUMENTS, new org.apache.thrift.meta_data.FieldMetaData("documents", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.FIELD_OF_SCIENCE, new org.apache.thrift.meta_data.FieldMetaData("fieldOfScience", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.KEYWORDS, new org.apache.thrift.meta_data.FieldMetaData("keywords", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MAX_MEMORY_PER_CPU, new org.apache.thrift.meta_data.FieldMetaData("maxMemoryPerCpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.NUMBER_OF_CPU_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("numberOfCpuPerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.PROJECT_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("projectDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PROJECT_REVIEWED_AND_FUNDED_BY, new org.apache.thrift.meta_data.FieldMetaData("projectReviewedAndFundedBy", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.REQUESTED_DATE, new org.apache.thrift.meta_data.FieldMetaData("requestedDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SERVICE_UNITS, new org.apache.thrift.meta_data.FieldMetaData("serviceUnits", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SPECIFIC_RESOURCE_SELECTION, new org.apache.thrift.meta_data.FieldMetaData("specificResourceSelection", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TYPE_OF_ALLOCATION, new org.apache.thrift.meta_data.FieldMetaData("typeOfAllocation", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TYPICAL_SU_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("typicalSuPerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.AWARD_ALLOCATION, new org.apache.thrift.meta_data.FieldMetaData("awardAllocation", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReviewerAllocationDetail.class, metaDataMap);
}
public ReviewerAllocationDetail() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ReviewerAllocationDetail(ReviewerAllocationDetail other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetApplicationsToBeUsed()) {
this.applicationsToBeUsed = other.applicationsToBeUsed;
}
this.diskUsageRangePerJob = other.diskUsageRangePerJob;
if (other.isSetDocuments()) {
this.documents = org.apache.thrift.TBaseHelper.copyBinary(other.documents);
}
if (other.isSetFieldOfScience()) {
this.fieldOfScience = other.fieldOfScience;
}
if (other.isSetKeywords()) {
this.keywords = other.keywords;
}
this.maxMemoryPerCpu = other.maxMemoryPerCpu;
this.numberOfCpuPerJob = other.numberOfCpuPerJob;
if (other.isSetProjectDescription()) {
this.projectDescription = other.projectDescription;
}
if (other.isSetProjectReviewedAndFundedBy()) {
this.projectReviewedAndFundedBy = other.projectReviewedAndFundedBy;
}
this.requestedDate = other.requestedDate;
this.serviceUnits = other.serviceUnits;
if (other.isSetSpecificResourceSelection()) {
this.specificResourceSelection = other.specificResourceSelection;
}
if (other.isSetTitle()) {
this.title = other.title;
}
if (other.isSetTypeOfAllocation()) {
this.typeOfAllocation = other.typeOfAllocation;
}
this.typicalSuPerJob = other.typicalSuPerJob;
this.awardAllocation = other.awardAllocation;
this.startDate = other.startDate;
this.endDate = other.endDate;
if (other.isSetStatus()) {
this.status = other.status;
}
if (other.isSetUsername()) {
this.username = other.username;
}
this.id = other.id;
}
public ReviewerAllocationDetail deepCopy() {
return new ReviewerAllocationDetail(this);
}
@Override
public void clear() {
this.projectId = null;
this.applicationsToBeUsed = null;
setDiskUsageRangePerJobIsSet(false);
this.diskUsageRangePerJob = 0;
this.documents = null;
this.fieldOfScience = null;
this.keywords = null;
setMaxMemoryPerCpuIsSet(false);
this.maxMemoryPerCpu = 0;
setNumberOfCpuPerJobIsSet(false);
this.numberOfCpuPerJob = 0;
this.projectDescription = null;
this.projectReviewedAndFundedBy = null;
setRequestedDateIsSet(false);
this.requestedDate = 0;
setServiceUnitsIsSet(false);
this.serviceUnits = 0;
this.specificResourceSelection = null;
this.title = null;
this.typeOfAllocation = null;
setTypicalSuPerJobIsSet(false);
this.typicalSuPerJob = 0;
setAwardAllocationIsSet(false);
this.awardAllocation = 0;
setStartDateIsSet(false);
this.startDate = 0;
setEndDateIsSet(false);
this.endDate = 0;
this.status = null;
this.username = null;
setIdIsSet(false);
this.id = 0;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public ReviewerAllocationDetail setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getApplicationsToBeUsed() {
return this.applicationsToBeUsed;
}
public ReviewerAllocationDetail setApplicationsToBeUsed(java.lang.String applicationsToBeUsed) {
this.applicationsToBeUsed = applicationsToBeUsed;
return this;
}
public void unsetApplicationsToBeUsed() {
this.applicationsToBeUsed = null;
}
/** Returns true if field applicationsToBeUsed is set (has been assigned a value) and false otherwise */
public boolean isSetApplicationsToBeUsed() {
return this.applicationsToBeUsed != null;
}
public void setApplicationsToBeUsedIsSet(boolean value) {
if (!value) {
this.applicationsToBeUsed = null;
}
}
public long getDiskUsageRangePerJob() {
return this.diskUsageRangePerJob;
}
public ReviewerAllocationDetail setDiskUsageRangePerJob(long diskUsageRangePerJob) {
this.diskUsageRangePerJob = diskUsageRangePerJob;
setDiskUsageRangePerJobIsSet(true);
return this;
}
public void unsetDiskUsageRangePerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID);
}
/** Returns true if field diskUsageRangePerJob is set (has been assigned a value) and false otherwise */
public boolean isSetDiskUsageRangePerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID);
}
public void setDiskUsageRangePerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID, value);
}
public byte[] getDocuments() {
setDocuments(org.apache.thrift.TBaseHelper.rightSize(documents));
return documents == null ? null : documents.array();
}
public java.nio.ByteBuffer bufferForDocuments() {
return org.apache.thrift.TBaseHelper.copyBinary(documents);
}
public ReviewerAllocationDetail setDocuments(byte[] documents) {
this.documents = documents == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(documents.clone());
return this;
}
public ReviewerAllocationDetail setDocuments(java.nio.ByteBuffer documents) {
this.documents = org.apache.thrift.TBaseHelper.copyBinary(documents);
return this;
}
public void unsetDocuments() {
this.documents = null;
}
/** Returns true if field documents is set (has been assigned a value) and false otherwise */
public boolean isSetDocuments() {
return this.documents != null;
}
public void setDocumentsIsSet(boolean value) {
if (!value) {
this.documents = null;
}
}
public java.lang.String getFieldOfScience() {
return this.fieldOfScience;
}
public ReviewerAllocationDetail setFieldOfScience(java.lang.String fieldOfScience) {
this.fieldOfScience = fieldOfScience;
return this;
}
public void unsetFieldOfScience() {
this.fieldOfScience = null;
}
/** Returns true if field fieldOfScience is set (has been assigned a value) and false otherwise */
public boolean isSetFieldOfScience() {
return this.fieldOfScience != null;
}
public void setFieldOfScienceIsSet(boolean value) {
if (!value) {
this.fieldOfScience = null;
}
}
public java.lang.String getKeywords() {
return this.keywords;
}
public ReviewerAllocationDetail setKeywords(java.lang.String keywords) {
this.keywords = keywords;
return this;
}
public void unsetKeywords() {
this.keywords = null;
}
/** Returns true if field keywords is set (has been assigned a value) and false otherwise */
public boolean isSetKeywords() {
return this.keywords != null;
}
public void setKeywordsIsSet(boolean value) {
if (!value) {
this.keywords = null;
}
}
public long getMaxMemoryPerCpu() {
return this.maxMemoryPerCpu;
}
public ReviewerAllocationDetail setMaxMemoryPerCpu(long maxMemoryPerCpu) {
this.maxMemoryPerCpu = maxMemoryPerCpu;
setMaxMemoryPerCpuIsSet(true);
return this;
}
public void unsetMaxMemoryPerCpu() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID);
}
/** Returns true if field maxMemoryPerCpu is set (has been assigned a value) and false otherwise */
public boolean isSetMaxMemoryPerCpu() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID);
}
public void setMaxMemoryPerCpuIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID, value);
}
public long getNumberOfCpuPerJob() {
return this.numberOfCpuPerJob;
}
public ReviewerAllocationDetail setNumberOfCpuPerJob(long numberOfCpuPerJob) {
this.numberOfCpuPerJob = numberOfCpuPerJob;
setNumberOfCpuPerJobIsSet(true);
return this;
}
public void unsetNumberOfCpuPerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID);
}
/** Returns true if field numberOfCpuPerJob is set (has been assigned a value) and false otherwise */
public boolean isSetNumberOfCpuPerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID);
}
public void setNumberOfCpuPerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID, value);
}
public java.lang.String getProjectDescription() {
return this.projectDescription;
}
public ReviewerAllocationDetail setProjectDescription(java.lang.String projectDescription) {
this.projectDescription = projectDescription;
return this;
}
public void unsetProjectDescription() {
this.projectDescription = null;
}
/** Returns true if field projectDescription is set (has been assigned a value) and false otherwise */
public boolean isSetProjectDescription() {
return this.projectDescription != null;
}
public void setProjectDescriptionIsSet(boolean value) {
if (!value) {
this.projectDescription = null;
}
}
public java.lang.String getProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy;
}
public ReviewerAllocationDetail setProjectReviewedAndFundedBy(java.lang.String projectReviewedAndFundedBy) {
this.projectReviewedAndFundedBy = projectReviewedAndFundedBy;
return this;
}
public void unsetProjectReviewedAndFundedBy() {
this.projectReviewedAndFundedBy = null;
}
/** Returns true if field projectReviewedAndFundedBy is set (has been assigned a value) and false otherwise */
public boolean isSetProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy != null;
}
public void setProjectReviewedAndFundedByIsSet(boolean value) {
if (!value) {
this.projectReviewedAndFundedBy = null;
}
}
public long getRequestedDate() {
return this.requestedDate;
}
public ReviewerAllocationDetail setRequestedDate(long requestedDate) {
this.requestedDate = requestedDate;
setRequestedDateIsSet(true);
return this;
}
public void unsetRequestedDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID);
}
/** Returns true if field requestedDate is set (has been assigned a value) and false otherwise */
public boolean isSetRequestedDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID);
}
public void setRequestedDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID, value);
}
public long getServiceUnits() {
return this.serviceUnits;
}
public ReviewerAllocationDetail setServiceUnits(long serviceUnits) {
this.serviceUnits = serviceUnits;
setServiceUnitsIsSet(true);
return this;
}
public void unsetServiceUnits() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID);
}
/** Returns true if field serviceUnits is set (has been assigned a value) and false otherwise */
public boolean isSetServiceUnits() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID);
}
public void setServiceUnitsIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID, value);
}
public java.lang.String getSpecificResourceSelection() {
return this.specificResourceSelection;
}
public ReviewerAllocationDetail setSpecificResourceSelection(java.lang.String specificResourceSelection) {
this.specificResourceSelection = specificResourceSelection;
return this;
}
public void unsetSpecificResourceSelection() {
this.specificResourceSelection = null;
}
/** Returns true if field specificResourceSelection is set (has been assigned a value) and false otherwise */
public boolean isSetSpecificResourceSelection() {
return this.specificResourceSelection != null;
}
public void setSpecificResourceSelectionIsSet(boolean value) {
if (!value) {
this.specificResourceSelection = null;
}
}
public java.lang.String getTitle() {
return this.title;
}
public ReviewerAllocationDetail setTitle(java.lang.String title) {
this.title = title;
return this;
}
public void unsetTitle() {
this.title = null;
}
/** Returns true if field title is set (has been assigned a value) and false otherwise */
public boolean isSetTitle() {
return this.title != null;
}
public void setTitleIsSet(boolean value) {
if (!value) {
this.title = null;
}
}
public java.lang.String getTypeOfAllocation() {
return this.typeOfAllocation;
}
public ReviewerAllocationDetail setTypeOfAllocation(java.lang.String typeOfAllocation) {
this.typeOfAllocation = typeOfAllocation;
return this;
}
public void unsetTypeOfAllocation() {
this.typeOfAllocation = null;
}
/** Returns true if field typeOfAllocation is set (has been assigned a value) and false otherwise */
public boolean isSetTypeOfAllocation() {
return this.typeOfAllocation != null;
}
public void setTypeOfAllocationIsSet(boolean value) {
if (!value) {
this.typeOfAllocation = null;
}
}
public long getTypicalSuPerJob() {
return this.typicalSuPerJob;
}
public ReviewerAllocationDetail setTypicalSuPerJob(long typicalSuPerJob) {
this.typicalSuPerJob = typicalSuPerJob;
setTypicalSuPerJobIsSet(true);
return this;
}
public void unsetTypicalSuPerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID);
}
/** Returns true if field typicalSuPerJob is set (has been assigned a value) and false otherwise */
public boolean isSetTypicalSuPerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID);
}
public void setTypicalSuPerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID, value);
}
public long getAwardAllocation() {
return this.awardAllocation;
}
public ReviewerAllocationDetail setAwardAllocation(long awardAllocation) {
this.awardAllocation = awardAllocation;
setAwardAllocationIsSet(true);
return this;
}
public void unsetAwardAllocation() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
/** Returns true if field awardAllocation is set (has been assigned a value) and false otherwise */
public boolean isSetAwardAllocation() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
public void setAwardAllocationIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID, value);
}
public long getStartDate() {
return this.startDate;
}
public ReviewerAllocationDetail setStartDate(long startDate) {
this.startDate = startDate;
setStartDateIsSet(true);
return this;
}
public void unsetStartDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
/** Returns true if field startDate is set (has been assigned a value) and false otherwise */
public boolean isSetStartDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
public void setStartDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTDATE_ISSET_ID, value);
}
public long getEndDate() {
return this.endDate;
}
public ReviewerAllocationDetail setEndDate(long endDate) {
this.endDate = endDate;
setEndDateIsSet(true);
return this;
}
public void unsetEndDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
/** Returns true if field endDate is set (has been assigned a value) and false otherwise */
public boolean isSetEndDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
public void setEndDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDDATE_ISSET_ID, value);
}
public java.lang.String getStatus() {
return this.status;
}
public ReviewerAllocationDetail setStatus(java.lang.String status) {
this.status = status;
return this;
}
public void unsetStatus() {
this.status = null;
}
/** Returns true if field status is set (has been assigned a value) and false otherwise */
public boolean isSetStatus() {
return this.status != null;
}
public void setStatusIsSet(boolean value) {
if (!value) {
this.status = null;
}
}
public java.lang.String getUsername() {
return this.username;
}
public ReviewerAllocationDetail setUsername(java.lang.String username) {
this.username = username;
return this;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public long getId() {
return this.id;
}
public ReviewerAllocationDetail setId(long id) {
this.id = id;
setIdIsSet(true);
return this;
}
public void unsetId() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case APPLICATIONS_TO_BE_USED:
if (value == null) {
unsetApplicationsToBeUsed();
} else {
setApplicationsToBeUsed((java.lang.String)value);
}
break;
case DISK_USAGE_RANGE_PER_JOB:
if (value == null) {
unsetDiskUsageRangePerJob();
} else {
setDiskUsageRangePerJob((java.lang.Long)value);
}
break;
case DOCUMENTS:
if (value == null) {
unsetDocuments();
} else {
if (value instanceof byte[]) {
setDocuments((byte[])value);
} else {
setDocuments((java.nio.ByteBuffer)value);
}
}
break;
case FIELD_OF_SCIENCE:
if (value == null) {
unsetFieldOfScience();
} else {
setFieldOfScience((java.lang.String)value);
}
break;
case KEYWORDS:
if (value == null) {
unsetKeywords();
} else {
setKeywords((java.lang.String)value);
}
break;
case MAX_MEMORY_PER_CPU:
if (value == null) {
unsetMaxMemoryPerCpu();
} else {
setMaxMemoryPerCpu((java.lang.Long)value);
}
break;
case NUMBER_OF_CPU_PER_JOB:
if (value == null) {
unsetNumberOfCpuPerJob();
} else {
setNumberOfCpuPerJob((java.lang.Long)value);
}
break;
case PROJECT_DESCRIPTION:
if (value == null) {
unsetProjectDescription();
} else {
setProjectDescription((java.lang.String)value);
}
break;
case PROJECT_REVIEWED_AND_FUNDED_BY:
if (value == null) {
unsetProjectReviewedAndFundedBy();
} else {
setProjectReviewedAndFundedBy((java.lang.String)value);
}
break;
case REQUESTED_DATE:
if (value == null) {
unsetRequestedDate();
} else {
setRequestedDate((java.lang.Long)value);
}
break;
case SERVICE_UNITS:
if (value == null) {
unsetServiceUnits();
} else {
setServiceUnits((java.lang.Long)value);
}
break;
case SPECIFIC_RESOURCE_SELECTION:
if (value == null) {
unsetSpecificResourceSelection();
} else {
setSpecificResourceSelection((java.lang.String)value);
}
break;
case TITLE:
if (value == null) {
unsetTitle();
} else {
setTitle((java.lang.String)value);
}
break;
case TYPE_OF_ALLOCATION:
if (value == null) {
unsetTypeOfAllocation();
} else {
setTypeOfAllocation((java.lang.String)value);
}
break;
case TYPICAL_SU_PER_JOB:
if (value == null) {
unsetTypicalSuPerJob();
} else {
setTypicalSuPerJob((java.lang.Long)value);
}
break;
case AWARD_ALLOCATION:
if (value == null) {
unsetAwardAllocation();
} else {
setAwardAllocation((java.lang.Long)value);
}
break;
case START_DATE:
if (value == null) {
unsetStartDate();
} else {
setStartDate((java.lang.Long)value);
}
break;
case END_DATE:
if (value == null) {
unsetEndDate();
} else {
setEndDate((java.lang.Long)value);
}
break;
case STATUS:
if (value == null) {
unsetStatus();
} else {
setStatus((java.lang.String)value);
}
break;
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((java.lang.String)value);
}
break;
case ID:
if (value == null) {
unsetId();
} else {
setId((java.lang.Long)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case APPLICATIONS_TO_BE_USED:
return getApplicationsToBeUsed();
case DISK_USAGE_RANGE_PER_JOB:
return getDiskUsageRangePerJob();
case DOCUMENTS:
return getDocuments();
case FIELD_OF_SCIENCE:
return getFieldOfScience();
case KEYWORDS:
return getKeywords();
case MAX_MEMORY_PER_CPU:
return getMaxMemoryPerCpu();
case NUMBER_OF_CPU_PER_JOB:
return getNumberOfCpuPerJob();
case PROJECT_DESCRIPTION:
return getProjectDescription();
case PROJECT_REVIEWED_AND_FUNDED_BY:
return getProjectReviewedAndFundedBy();
case REQUESTED_DATE:
return getRequestedDate();
case SERVICE_UNITS:
return getServiceUnits();
case SPECIFIC_RESOURCE_SELECTION:
return getSpecificResourceSelection();
case TITLE:
return getTitle();
case TYPE_OF_ALLOCATION:
return getTypeOfAllocation();
case TYPICAL_SU_PER_JOB:
return getTypicalSuPerJob();
case AWARD_ALLOCATION:
return getAwardAllocation();
case START_DATE:
return getStartDate();
case END_DATE:
return getEndDate();
case STATUS:
return getStatus();
case USERNAME:
return getUsername();
case ID:
return getId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case APPLICATIONS_TO_BE_USED:
return isSetApplicationsToBeUsed();
case DISK_USAGE_RANGE_PER_JOB:
return isSetDiskUsageRangePerJob();
case DOCUMENTS:
return isSetDocuments();
case FIELD_OF_SCIENCE:
return isSetFieldOfScience();
case KEYWORDS:
return isSetKeywords();
case MAX_MEMORY_PER_CPU:
return isSetMaxMemoryPerCpu();
case NUMBER_OF_CPU_PER_JOB:
return isSetNumberOfCpuPerJob();
case PROJECT_DESCRIPTION:
return isSetProjectDescription();
case PROJECT_REVIEWED_AND_FUNDED_BY:
return isSetProjectReviewedAndFundedBy();
case REQUESTED_DATE:
return isSetRequestedDate();
case SERVICE_UNITS:
return isSetServiceUnits();
case SPECIFIC_RESOURCE_SELECTION:
return isSetSpecificResourceSelection();
case TITLE:
return isSetTitle();
case TYPE_OF_ALLOCATION:
return isSetTypeOfAllocation();
case TYPICAL_SU_PER_JOB:
return isSetTypicalSuPerJob();
case AWARD_ALLOCATION:
return isSetAwardAllocation();
case START_DATE:
return isSetStartDate();
case END_DATE:
return isSetEndDate();
case STATUS:
return isSetStatus();
case USERNAME:
return isSetUsername();
case ID:
return isSetId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof ReviewerAllocationDetail)
return this.equals((ReviewerAllocationDetail)that);
return false;
}
public boolean equals(ReviewerAllocationDetail that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_applicationsToBeUsed = true && this.isSetApplicationsToBeUsed();
boolean that_present_applicationsToBeUsed = true && that.isSetApplicationsToBeUsed();
if (this_present_applicationsToBeUsed || that_present_applicationsToBeUsed) {
if (!(this_present_applicationsToBeUsed && that_present_applicationsToBeUsed))
return false;
if (!this.applicationsToBeUsed.equals(that.applicationsToBeUsed))
return false;
}
boolean this_present_diskUsageRangePerJob = true && this.isSetDiskUsageRangePerJob();
boolean that_present_diskUsageRangePerJob = true && that.isSetDiskUsageRangePerJob();
if (this_present_diskUsageRangePerJob || that_present_diskUsageRangePerJob) {
if (!(this_present_diskUsageRangePerJob && that_present_diskUsageRangePerJob))
return false;
if (this.diskUsageRangePerJob != that.diskUsageRangePerJob)
return false;
}
boolean this_present_documents = true && this.isSetDocuments();
boolean that_present_documents = true && that.isSetDocuments();
if (this_present_documents || that_present_documents) {
if (!(this_present_documents && that_present_documents))
return false;
if (!this.documents.equals(that.documents))
return false;
}
boolean this_present_fieldOfScience = true && this.isSetFieldOfScience();
boolean that_present_fieldOfScience = true && that.isSetFieldOfScience();
if (this_present_fieldOfScience || that_present_fieldOfScience) {
if (!(this_present_fieldOfScience && that_present_fieldOfScience))
return false;
if (!this.fieldOfScience.equals(that.fieldOfScience))
return false;
}
boolean this_present_keywords = true && this.isSetKeywords();
boolean that_present_keywords = true && that.isSetKeywords();
if (this_present_keywords || that_present_keywords) {
if (!(this_present_keywords && that_present_keywords))
return false;
if (!this.keywords.equals(that.keywords))
return false;
}
boolean this_present_maxMemoryPerCpu = true && this.isSetMaxMemoryPerCpu();
boolean that_present_maxMemoryPerCpu = true && that.isSetMaxMemoryPerCpu();
if (this_present_maxMemoryPerCpu || that_present_maxMemoryPerCpu) {
if (!(this_present_maxMemoryPerCpu && that_present_maxMemoryPerCpu))
return false;
if (this.maxMemoryPerCpu != that.maxMemoryPerCpu)
return false;
}
boolean this_present_numberOfCpuPerJob = true && this.isSetNumberOfCpuPerJob();
boolean that_present_numberOfCpuPerJob = true && that.isSetNumberOfCpuPerJob();
if (this_present_numberOfCpuPerJob || that_present_numberOfCpuPerJob) {
if (!(this_present_numberOfCpuPerJob && that_present_numberOfCpuPerJob))
return false;
if (this.numberOfCpuPerJob != that.numberOfCpuPerJob)
return false;
}
boolean this_present_projectDescription = true && this.isSetProjectDescription();
boolean that_present_projectDescription = true && that.isSetProjectDescription();
if (this_present_projectDescription || that_present_projectDescription) {
if (!(this_present_projectDescription && that_present_projectDescription))
return false;
if (!this.projectDescription.equals(that.projectDescription))
return false;
}
boolean this_present_projectReviewedAndFundedBy = true && this.isSetProjectReviewedAndFundedBy();
boolean that_present_projectReviewedAndFundedBy = true && that.isSetProjectReviewedAndFundedBy();
if (this_present_projectReviewedAndFundedBy || that_present_projectReviewedAndFundedBy) {
if (!(this_present_projectReviewedAndFundedBy && that_present_projectReviewedAndFundedBy))
return false;
if (!this.projectReviewedAndFundedBy.equals(that.projectReviewedAndFundedBy))
return false;
}
boolean this_present_requestedDate = true && this.isSetRequestedDate();
boolean that_present_requestedDate = true && that.isSetRequestedDate();
if (this_present_requestedDate || that_present_requestedDate) {
if (!(this_present_requestedDate && that_present_requestedDate))
return false;
if (this.requestedDate != that.requestedDate)
return false;
}
boolean this_present_serviceUnits = true && this.isSetServiceUnits();
boolean that_present_serviceUnits = true && that.isSetServiceUnits();
if (this_present_serviceUnits || that_present_serviceUnits) {
if (!(this_present_serviceUnits && that_present_serviceUnits))
return false;
if (this.serviceUnits != that.serviceUnits)
return false;
}
boolean this_present_specificResourceSelection = true && this.isSetSpecificResourceSelection();
boolean that_present_specificResourceSelection = true && that.isSetSpecificResourceSelection();
if (this_present_specificResourceSelection || that_present_specificResourceSelection) {
if (!(this_present_specificResourceSelection && that_present_specificResourceSelection))
return false;
if (!this.specificResourceSelection.equals(that.specificResourceSelection))
return false;
}
boolean this_present_title = true && this.isSetTitle();
boolean that_present_title = true && that.isSetTitle();
if (this_present_title || that_present_title) {
if (!(this_present_title && that_present_title))
return false;
if (!this.title.equals(that.title))
return false;
}
boolean this_present_typeOfAllocation = true && this.isSetTypeOfAllocation();
boolean that_present_typeOfAllocation = true && that.isSetTypeOfAllocation();
if (this_present_typeOfAllocation || that_present_typeOfAllocation) {
if (!(this_present_typeOfAllocation && that_present_typeOfAllocation))
return false;
if (!this.typeOfAllocation.equals(that.typeOfAllocation))
return false;
}
boolean this_present_typicalSuPerJob = true && this.isSetTypicalSuPerJob();
boolean that_present_typicalSuPerJob = true && that.isSetTypicalSuPerJob();
if (this_present_typicalSuPerJob || that_present_typicalSuPerJob) {
if (!(this_present_typicalSuPerJob && that_present_typicalSuPerJob))
return false;
if (this.typicalSuPerJob != that.typicalSuPerJob)
return false;
}
boolean this_present_awardAllocation = true && this.isSetAwardAllocation();
boolean that_present_awardAllocation = true && that.isSetAwardAllocation();
if (this_present_awardAllocation || that_present_awardAllocation) {
if (!(this_present_awardAllocation && that_present_awardAllocation))
return false;
if (this.awardAllocation != that.awardAllocation)
return false;
}
boolean this_present_startDate = true && this.isSetStartDate();
boolean that_present_startDate = true && that.isSetStartDate();
if (this_present_startDate || that_present_startDate) {
if (!(this_present_startDate && that_present_startDate))
return false;
if (this.startDate != that.startDate)
return false;
}
boolean this_present_endDate = true && this.isSetEndDate();
boolean that_present_endDate = true && that.isSetEndDate();
if (this_present_endDate || that_present_endDate) {
if (!(this_present_endDate && that_present_endDate))
return false;
if (this.endDate != that.endDate)
return false;
}
boolean this_present_status = true && this.isSetStatus();
boolean that_present_status = true && that.isSetStatus();
if (this_present_status || that_present_status) {
if (!(this_present_status && that_present_status))
return false;
if (!this.status.equals(that.status))
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (this.id != that.id)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetApplicationsToBeUsed()) ? 131071 : 524287);
if (isSetApplicationsToBeUsed())
hashCode = hashCode * 8191 + applicationsToBeUsed.hashCode();
hashCode = hashCode * 8191 + ((isSetDiskUsageRangePerJob()) ? 131071 : 524287);
if (isSetDiskUsageRangePerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(diskUsageRangePerJob);
hashCode = hashCode * 8191 + ((isSetDocuments()) ? 131071 : 524287);
if (isSetDocuments())
hashCode = hashCode * 8191 + documents.hashCode();
hashCode = hashCode * 8191 + ((isSetFieldOfScience()) ? 131071 : 524287);
if (isSetFieldOfScience())
hashCode = hashCode * 8191 + fieldOfScience.hashCode();
hashCode = hashCode * 8191 + ((isSetKeywords()) ? 131071 : 524287);
if (isSetKeywords())
hashCode = hashCode * 8191 + keywords.hashCode();
hashCode = hashCode * 8191 + ((isSetMaxMemoryPerCpu()) ? 131071 : 524287);
if (isSetMaxMemoryPerCpu())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxMemoryPerCpu);
hashCode = hashCode * 8191 + ((isSetNumberOfCpuPerJob()) ? 131071 : 524287);
if (isSetNumberOfCpuPerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(numberOfCpuPerJob);
hashCode = hashCode * 8191 + ((isSetProjectDescription()) ? 131071 : 524287);
if (isSetProjectDescription())
hashCode = hashCode * 8191 + projectDescription.hashCode();
hashCode = hashCode * 8191 + ((isSetProjectReviewedAndFundedBy()) ? 131071 : 524287);
if (isSetProjectReviewedAndFundedBy())
hashCode = hashCode * 8191 + projectReviewedAndFundedBy.hashCode();
hashCode = hashCode * 8191 + ((isSetRequestedDate()) ? 131071 : 524287);
if (isSetRequestedDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(requestedDate);
hashCode = hashCode * 8191 + ((isSetServiceUnits()) ? 131071 : 524287);
if (isSetServiceUnits())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(serviceUnits);
hashCode = hashCode * 8191 + ((isSetSpecificResourceSelection()) ? 131071 : 524287);
if (isSetSpecificResourceSelection())
hashCode = hashCode * 8191 + specificResourceSelection.hashCode();
hashCode = hashCode * 8191 + ((isSetTitle()) ? 131071 : 524287);
if (isSetTitle())
hashCode = hashCode * 8191 + title.hashCode();
hashCode = hashCode * 8191 + ((isSetTypeOfAllocation()) ? 131071 : 524287);
if (isSetTypeOfAllocation())
hashCode = hashCode * 8191 + typeOfAllocation.hashCode();
hashCode = hashCode * 8191 + ((isSetTypicalSuPerJob()) ? 131071 : 524287);
if (isSetTypicalSuPerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(typicalSuPerJob);
hashCode = hashCode * 8191 + ((isSetAwardAllocation()) ? 131071 : 524287);
if (isSetAwardAllocation())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(awardAllocation);
hashCode = hashCode * 8191 + ((isSetStartDate()) ? 131071 : 524287);
if (isSetStartDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startDate);
hashCode = hashCode * 8191 + ((isSetEndDate()) ? 131071 : 524287);
if (isSetEndDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endDate);
hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
if (isSetStatus())
hashCode = hashCode * 8191 + status.hashCode();
hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
if (isSetUsername())
hashCode = hashCode * 8191 + username.hashCode();
hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
if (isSetId())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id);
return hashCode;
}
@Override
public int compareTo(ReviewerAllocationDetail other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetApplicationsToBeUsed()).compareTo(other.isSetApplicationsToBeUsed());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetApplicationsToBeUsed()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationsToBeUsed, other.applicationsToBeUsed);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetDiskUsageRangePerJob()).compareTo(other.isSetDiskUsageRangePerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDiskUsageRangePerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.diskUsageRangePerJob, other.diskUsageRangePerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetDocuments()).compareTo(other.isSetDocuments());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDocuments()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.documents, other.documents);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetFieldOfScience()).compareTo(other.isSetFieldOfScience());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFieldOfScience()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fieldOfScience, other.fieldOfScience);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetKeywords()).compareTo(other.isSetKeywords());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetKeywords()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keywords, other.keywords);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetMaxMemoryPerCpu()).compareTo(other.isSetMaxMemoryPerCpu());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMaxMemoryPerCpu()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxMemoryPerCpu, other.maxMemoryPerCpu);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetNumberOfCpuPerJob()).compareTo(other.isSetNumberOfCpuPerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNumberOfCpuPerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numberOfCpuPerJob, other.numberOfCpuPerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetProjectDescription()).compareTo(other.isSetProjectDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectDescription()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectDescription, other.projectDescription);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetProjectReviewedAndFundedBy()).compareTo(other.isSetProjectReviewedAndFundedBy());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectReviewedAndFundedBy()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectReviewedAndFundedBy, other.projectReviewedAndFundedBy);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetRequestedDate()).compareTo(other.isSetRequestedDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequestedDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestedDate, other.requestedDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetServiceUnits()).compareTo(other.isSetServiceUnits());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceUnits()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceUnits, other.serviceUnits);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetSpecificResourceSelection()).compareTo(other.isSetSpecificResourceSelection());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSpecificResourceSelection()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.specificResourceSelection, other.specificResourceSelection);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTitle()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTypeOfAllocation()).compareTo(other.isSetTypeOfAllocation());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTypeOfAllocation()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeOfAllocation, other.typeOfAllocation);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTypicalSuPerJob()).compareTo(other.isSetTypicalSuPerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTypicalSuPerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typicalSuPerJob, other.typicalSuPerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAwardAllocation()).compareTo(other.isSetAwardAllocation());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAwardAllocation()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.awardAllocation, other.awardAllocation);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStartDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEndDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStatus()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("ReviewerAllocationDetail(");
boolean first = true;
if (isSetProjectId()) {
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
}
if (isSetApplicationsToBeUsed()) {
if (!first) sb.append(", ");
sb.append("applicationsToBeUsed:");
if (this.applicationsToBeUsed == null) {
sb.append("null");
} else {
sb.append(this.applicationsToBeUsed);
}
first = false;
}
if (isSetDiskUsageRangePerJob()) {
if (!first) sb.append(", ");
sb.append("diskUsageRangePerJob:");
sb.append(this.diskUsageRangePerJob);
first = false;
}
if (isSetDocuments()) {
if (!first) sb.append(", ");
sb.append("documents:");
if (this.documents == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.documents, sb);
}
first = false;
}
if (isSetFieldOfScience()) {
if (!first) sb.append(", ");
sb.append("fieldOfScience:");
if (this.fieldOfScience == null) {
sb.append("null");
} else {
sb.append(this.fieldOfScience);
}
first = false;
}
if (isSetKeywords()) {
if (!first) sb.append(", ");
sb.append("keywords:");
if (this.keywords == null) {
sb.append("null");
} else {
sb.append(this.keywords);
}
first = false;
}
if (isSetMaxMemoryPerCpu()) {
if (!first) sb.append(", ");
sb.append("maxMemoryPerCpu:");
sb.append(this.maxMemoryPerCpu);
first = false;
}
if (isSetNumberOfCpuPerJob()) {
if (!first) sb.append(", ");
sb.append("numberOfCpuPerJob:");
sb.append(this.numberOfCpuPerJob);
first = false;
}
if (isSetProjectDescription()) {
if (!first) sb.append(", ");
sb.append("projectDescription:");
if (this.projectDescription == null) {
sb.append("null");
} else {
sb.append(this.projectDescription);
}
first = false;
}
if (isSetProjectReviewedAndFundedBy()) {
if (!first) sb.append(", ");
sb.append("projectReviewedAndFundedBy:");
if (this.projectReviewedAndFundedBy == null) {
sb.append("null");
} else {
sb.append(this.projectReviewedAndFundedBy);
}
first = false;
}
if (isSetRequestedDate()) {
if (!first) sb.append(", ");
sb.append("requestedDate:");
sb.append(this.requestedDate);
first = false;
}
if (isSetServiceUnits()) {
if (!first) sb.append(", ");
sb.append("serviceUnits:");
sb.append(this.serviceUnits);
first = false;
}
if (isSetSpecificResourceSelection()) {
if (!first) sb.append(", ");
sb.append("specificResourceSelection:");
if (this.specificResourceSelection == null) {
sb.append("null");
} else {
sb.append(this.specificResourceSelection);
}
first = false;
}
if (isSetTitle()) {
if (!first) sb.append(", ");
sb.append("title:");
if (this.title == null) {
sb.append("null");
} else {
sb.append(this.title);
}
first = false;
}
if (isSetTypeOfAllocation()) {
if (!first) sb.append(", ");
sb.append("typeOfAllocation:");
if (this.typeOfAllocation == null) {
sb.append("null");
} else {
sb.append(this.typeOfAllocation);
}
first = false;
}
if (isSetTypicalSuPerJob()) {
if (!first) sb.append(", ");
sb.append("typicalSuPerJob:");
sb.append(this.typicalSuPerJob);
first = false;
}
if (isSetAwardAllocation()) {
if (!first) sb.append(", ");
sb.append("awardAllocation:");
sb.append(this.awardAllocation);
first = false;
}
if (isSetStartDate()) {
if (!first) sb.append(", ");
sb.append("startDate:");
sb.append(this.startDate);
first = false;
}
if (isSetEndDate()) {
if (!first) sb.append(", ");
sb.append("endDate:");
sb.append(this.endDate);
first = false;
}
if (isSetStatus()) {
if (!first) sb.append(", ");
sb.append("status:");
if (this.status == null) {
sb.append("null");
} else {
sb.append(this.status);
}
first = false;
}
if (isSetUsername()) {
if (!first) sb.append(", ");
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
}
if (isSetId()) {
if (!first) sb.append(", ");
sb.append("id:");
sb.append(this.id);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ReviewerAllocationDetailStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ReviewerAllocationDetailStandardScheme getScheme() {
return new ReviewerAllocationDetailStandardScheme();
}
}
private static class ReviewerAllocationDetailStandardScheme extends org.apache.thrift.scheme.StandardScheme<ReviewerAllocationDetail> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ReviewerAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // APPLICATIONS_TO_BE_USED
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.applicationsToBeUsed = iprot.readString();
struct.setApplicationsToBeUsedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // DISK_USAGE_RANGE_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.diskUsageRangePerJob = iprot.readI64();
struct.setDiskUsageRangePerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // DOCUMENTS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.documents = iprot.readBinary();
struct.setDocumentsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // FIELD_OF_SCIENCE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.fieldOfScience = iprot.readString();
struct.setFieldOfScienceIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // KEYWORDS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.keywords = iprot.readString();
struct.setKeywordsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // MAX_MEMORY_PER_CPU
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.maxMemoryPerCpu = iprot.readI64();
struct.setMaxMemoryPerCpuIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // NUMBER_OF_CPU_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.numberOfCpuPerJob = iprot.readI64();
struct.setNumberOfCpuPerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // PROJECT_DESCRIPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectDescription = iprot.readString();
struct.setProjectDescriptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // PROJECT_REVIEWED_AND_FUNDED_BY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectReviewedAndFundedBy = iprot.readString();
struct.setProjectReviewedAndFundedByIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // REQUESTED_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.requestedDate = iprot.readI64();
struct.setRequestedDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // SERVICE_UNITS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.serviceUnits = iprot.readI64();
struct.setServiceUnitsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // SPECIFIC_RESOURCE_SELECTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.specificResourceSelection = iprot.readString();
struct.setSpecificResourceSelectionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 14: // TITLE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.title = iprot.readString();
struct.setTitleIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 15: // TYPE_OF_ALLOCATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.typeOfAllocation = iprot.readString();
struct.setTypeOfAllocationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 16: // TYPICAL_SU_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.typicalSuPerJob = iprot.readI64();
struct.setTypicalSuPerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 17: // AWARD_ALLOCATION
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 18: // START_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 19: // END_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 20: // STATUS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.status = iprot.readString();
struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 21: // USERNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 22: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ReviewerAllocationDetail struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
if (struct.isSetProjectId()) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
}
if (struct.applicationsToBeUsed != null) {
if (struct.isSetApplicationsToBeUsed()) {
oprot.writeFieldBegin(APPLICATIONS_TO_BE_USED_FIELD_DESC);
oprot.writeString(struct.applicationsToBeUsed);
oprot.writeFieldEnd();
}
}
if (struct.isSetDiskUsageRangePerJob()) {
oprot.writeFieldBegin(DISK_USAGE_RANGE_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.diskUsageRangePerJob);
oprot.writeFieldEnd();
}
if (struct.documents != null) {
if (struct.isSetDocuments()) {
oprot.writeFieldBegin(DOCUMENTS_FIELD_DESC);
oprot.writeBinary(struct.documents);
oprot.writeFieldEnd();
}
}
if (struct.fieldOfScience != null) {
if (struct.isSetFieldOfScience()) {
oprot.writeFieldBegin(FIELD_OF_SCIENCE_FIELD_DESC);
oprot.writeString(struct.fieldOfScience);
oprot.writeFieldEnd();
}
}
if (struct.keywords != null) {
if (struct.isSetKeywords()) {
oprot.writeFieldBegin(KEYWORDS_FIELD_DESC);
oprot.writeString(struct.keywords);
oprot.writeFieldEnd();
}
}
if (struct.isSetMaxMemoryPerCpu()) {
oprot.writeFieldBegin(MAX_MEMORY_PER_CPU_FIELD_DESC);
oprot.writeI64(struct.maxMemoryPerCpu);
oprot.writeFieldEnd();
}
if (struct.isSetNumberOfCpuPerJob()) {
oprot.writeFieldBegin(NUMBER_OF_CPU_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.numberOfCpuPerJob);
oprot.writeFieldEnd();
}
if (struct.projectDescription != null) {
if (struct.isSetProjectDescription()) {
oprot.writeFieldBegin(PROJECT_DESCRIPTION_FIELD_DESC);
oprot.writeString(struct.projectDescription);
oprot.writeFieldEnd();
}
}
if (struct.projectReviewedAndFundedBy != null) {
if (struct.isSetProjectReviewedAndFundedBy()) {
oprot.writeFieldBegin(PROJECT_REVIEWED_AND_FUNDED_BY_FIELD_DESC);
oprot.writeString(struct.projectReviewedAndFundedBy);
oprot.writeFieldEnd();
}
}
if (struct.isSetRequestedDate()) {
oprot.writeFieldBegin(REQUESTED_DATE_FIELD_DESC);
oprot.writeI64(struct.requestedDate);
oprot.writeFieldEnd();
}
if (struct.isSetServiceUnits()) {
oprot.writeFieldBegin(SERVICE_UNITS_FIELD_DESC);
oprot.writeI64(struct.serviceUnits);
oprot.writeFieldEnd();
}
if (struct.specificResourceSelection != null) {
if (struct.isSetSpecificResourceSelection()) {
oprot.writeFieldBegin(SPECIFIC_RESOURCE_SELECTION_FIELD_DESC);
oprot.writeString(struct.specificResourceSelection);
oprot.writeFieldEnd();
}
}
if (struct.title != null) {
if (struct.isSetTitle()) {
oprot.writeFieldBegin(TITLE_FIELD_DESC);
oprot.writeString(struct.title);
oprot.writeFieldEnd();
}
}
if (struct.typeOfAllocation != null) {
if (struct.isSetTypeOfAllocation()) {
oprot.writeFieldBegin(TYPE_OF_ALLOCATION_FIELD_DESC);
oprot.writeString(struct.typeOfAllocation);
oprot.writeFieldEnd();
}
}
if (struct.isSetTypicalSuPerJob()) {
oprot.writeFieldBegin(TYPICAL_SU_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.typicalSuPerJob);
oprot.writeFieldEnd();
}
if (struct.isSetAwardAllocation()) {
oprot.writeFieldBegin(AWARD_ALLOCATION_FIELD_DESC);
oprot.writeI64(struct.awardAllocation);
oprot.writeFieldEnd();
}
if (struct.isSetStartDate()) {
oprot.writeFieldBegin(START_DATE_FIELD_DESC);
oprot.writeI64(struct.startDate);
oprot.writeFieldEnd();
}
if (struct.isSetEndDate()) {
oprot.writeFieldBegin(END_DATE_FIELD_DESC);
oprot.writeI64(struct.endDate);
oprot.writeFieldEnd();
}
if (struct.status != null) {
if (struct.isSetStatus()) {
oprot.writeFieldBegin(STATUS_FIELD_DESC);
oprot.writeString(struct.status);
oprot.writeFieldEnd();
}
}
if (struct.username != null) {
if (struct.isSetUsername()) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(struct.username);
oprot.writeFieldEnd();
}
}
if (struct.isSetId()) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeI64(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ReviewerAllocationDetailTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ReviewerAllocationDetailTupleScheme getScheme() {
return new ReviewerAllocationDetailTupleScheme();
}
}
private static class ReviewerAllocationDetailTupleScheme extends org.apache.thrift.scheme.TupleScheme<ReviewerAllocationDetail> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ReviewerAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetProjectId()) {
optionals.set(0);
}
if (struct.isSetApplicationsToBeUsed()) {
optionals.set(1);
}
if (struct.isSetDiskUsageRangePerJob()) {
optionals.set(2);
}
if (struct.isSetDocuments()) {
optionals.set(3);
}
if (struct.isSetFieldOfScience()) {
optionals.set(4);
}
if (struct.isSetKeywords()) {
optionals.set(5);
}
if (struct.isSetMaxMemoryPerCpu()) {
optionals.set(6);
}
if (struct.isSetNumberOfCpuPerJob()) {
optionals.set(7);
}
if (struct.isSetProjectDescription()) {
optionals.set(8);
}
if (struct.isSetProjectReviewedAndFundedBy()) {
optionals.set(9);
}
if (struct.isSetRequestedDate()) {
optionals.set(10);
}
if (struct.isSetServiceUnits()) {
optionals.set(11);
}
if (struct.isSetSpecificResourceSelection()) {
optionals.set(12);
}
if (struct.isSetTitle()) {
optionals.set(13);
}
if (struct.isSetTypeOfAllocation()) {
optionals.set(14);
}
if (struct.isSetTypicalSuPerJob()) {
optionals.set(15);
}
if (struct.isSetAwardAllocation()) {
optionals.set(16);
}
if (struct.isSetStartDate()) {
optionals.set(17);
}
if (struct.isSetEndDate()) {
optionals.set(18);
}
if (struct.isSetStatus()) {
optionals.set(19);
}
if (struct.isSetUsername()) {
optionals.set(20);
}
if (struct.isSetId()) {
optionals.set(21);
}
oprot.writeBitSet(optionals, 22);
if (struct.isSetProjectId()) {
oprot.writeString(struct.projectId);
}
if (struct.isSetApplicationsToBeUsed()) {
oprot.writeString(struct.applicationsToBeUsed);
}
if (struct.isSetDiskUsageRangePerJob()) {
oprot.writeI64(struct.diskUsageRangePerJob);
}
if (struct.isSetDocuments()) {
oprot.writeBinary(struct.documents);
}
if (struct.isSetFieldOfScience()) {
oprot.writeString(struct.fieldOfScience);
}
if (struct.isSetKeywords()) {
oprot.writeString(struct.keywords);
}
if (struct.isSetMaxMemoryPerCpu()) {
oprot.writeI64(struct.maxMemoryPerCpu);
}
if (struct.isSetNumberOfCpuPerJob()) {
oprot.writeI64(struct.numberOfCpuPerJob);
}
if (struct.isSetProjectDescription()) {
oprot.writeString(struct.projectDescription);
}
if (struct.isSetProjectReviewedAndFundedBy()) {
oprot.writeString(struct.projectReviewedAndFundedBy);
}
if (struct.isSetRequestedDate()) {
oprot.writeI64(struct.requestedDate);
}
if (struct.isSetServiceUnits()) {
oprot.writeI64(struct.serviceUnits);
}
if (struct.isSetSpecificResourceSelection()) {
oprot.writeString(struct.specificResourceSelection);
}
if (struct.isSetTitle()) {
oprot.writeString(struct.title);
}
if (struct.isSetTypeOfAllocation()) {
oprot.writeString(struct.typeOfAllocation);
}
if (struct.isSetTypicalSuPerJob()) {
oprot.writeI64(struct.typicalSuPerJob);
}
if (struct.isSetAwardAllocation()) {
oprot.writeI64(struct.awardAllocation);
}
if (struct.isSetStartDate()) {
oprot.writeI64(struct.startDate);
}
if (struct.isSetEndDate()) {
oprot.writeI64(struct.endDate);
}
if (struct.isSetStatus()) {
oprot.writeString(struct.status);
}
if (struct.isSetUsername()) {
oprot.writeString(struct.username);
}
if (struct.isSetId()) {
oprot.writeI64(struct.id);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ReviewerAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(22);
if (incoming.get(0)) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
if (incoming.get(1)) {
struct.applicationsToBeUsed = iprot.readString();
struct.setApplicationsToBeUsedIsSet(true);
}
if (incoming.get(2)) {
struct.diskUsageRangePerJob = iprot.readI64();
struct.setDiskUsageRangePerJobIsSet(true);
}
if (incoming.get(3)) {
struct.documents = iprot.readBinary();
struct.setDocumentsIsSet(true);
}
if (incoming.get(4)) {
struct.fieldOfScience = iprot.readString();
struct.setFieldOfScienceIsSet(true);
}
if (incoming.get(5)) {
struct.keywords = iprot.readString();
struct.setKeywordsIsSet(true);
}
if (incoming.get(6)) {
struct.maxMemoryPerCpu = iprot.readI64();
struct.setMaxMemoryPerCpuIsSet(true);
}
if (incoming.get(7)) {
struct.numberOfCpuPerJob = iprot.readI64();
struct.setNumberOfCpuPerJobIsSet(true);
}
if (incoming.get(8)) {
struct.projectDescription = iprot.readString();
struct.setProjectDescriptionIsSet(true);
}
if (incoming.get(9)) {
struct.projectReviewedAndFundedBy = iprot.readString();
struct.setProjectReviewedAndFundedByIsSet(true);
}
if (incoming.get(10)) {
struct.requestedDate = iprot.readI64();
struct.setRequestedDateIsSet(true);
}
if (incoming.get(11)) {
struct.serviceUnits = iprot.readI64();
struct.setServiceUnitsIsSet(true);
}
if (incoming.get(12)) {
struct.specificResourceSelection = iprot.readString();
struct.setSpecificResourceSelectionIsSet(true);
}
if (incoming.get(13)) {
struct.title = iprot.readString();
struct.setTitleIsSet(true);
}
if (incoming.get(14)) {
struct.typeOfAllocation = iprot.readString();
struct.setTypeOfAllocationIsSet(true);
}
if (incoming.get(15)) {
struct.typicalSuPerJob = iprot.readI64();
struct.setTypicalSuPerJobIsSet(true);
}
if (incoming.get(16)) {
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
}
if (incoming.get(17)) {
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
}
if (incoming.get(18)) {
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
}
if (incoming.get(19)) {
struct.status = iprot.readString();
struct.setStatusIsSet(true);
}
if (incoming.get(20)) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
}
if (incoming.get(21)) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| 9,064 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/models/UserAllocationDetail.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.models;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
* <p>Required allocation request details</p>
* <li>id : (primary key) Ask the user to assign project ID, but this project should unique, we will need an API endpoint to check whether this ID is not used by other projects and the username</li>
* <li>applicationsToBeUsed : Select the application that the user intends to use, according to application chosen here, resources that can be allocable will be fetch from resource discovery module. User will not be restricted to these application upon allocation grant, provided the resources allocated support the application.</li>
* <li>diskUsageRangePerJob : An optional field to help reviewer and PI for allocation approval</li>
* <li>documents : Resume, CV, PI’s portfolio etc</li>
* <li>fieldOfScience :An optional field to help reviewer and PI for allocation approval</li>
* <li>keywords : Keyword will be helpful in search</li>
* <li>maxMemoryPerCpu :An optional field to help reviewer and PI for allocation approval</li>
* <li>numberOfCpuPerJob : An optional field to help reviewer and PI for allocation approval</li>
* <li>projectDescription :(Eg: Hypothesis, Model Systems, Methods, and Analysis)</li>
* <li>projectReviewedAndFundedBy : (Eg., NSF, NIH, DOD, DOE, None etc...). An optional field to help reviewer and PI for allocation approval</li>
* <li>requestedDate: The date the allocation was requested</li>
* <li>serviceUnits : 1 SU is approximately 1 workstation CPU hour, if the user fails to give a value, default value will be chosen.</li>
* <li>specificResourceSelection : This list will be fetched from resource discovery module, in case of community allocation, the request is subject to reviewers, PI discretion and availability</li>
* <li>title : Assign a title to allocation request</li>
* <li>typeOfAllocation : If the User has an exclusive allocation with third party organization and wants to use airavata middleware to manage jobs.</li>
* <li>typicalSuPerJob : An optional field to help reviewer and PI for allocation approval</li>
*
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class UserAllocationDetail implements org.apache.thrift.TBase<UserAllocationDetail, UserAllocationDetail._Fields>, java.io.Serializable, Cloneable, Comparable<UserAllocationDetail> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserAllocationDetail");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField APPLICATIONS_TO_BE_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationsToBeUsed", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField DISK_USAGE_RANGE_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("diskUsageRangePerJob", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField DOCUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("documents", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField FIELD_OF_SCIENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("fieldOfScience", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField KEYWORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("keywords", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField MAX_MEMORY_PER_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("maxMemoryPerCpu", org.apache.thrift.protocol.TType.I64, (short)7);
private static final org.apache.thrift.protocol.TField NUMBER_OF_CPU_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("numberOfCpuPerJob", org.apache.thrift.protocol.TType.I64, (short)8);
private static final org.apache.thrift.protocol.TField PROJECT_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projectDescription", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField PROJECT_REVIEWED_AND_FUNDED_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("projectReviewedAndFundedBy", org.apache.thrift.protocol.TType.STRING, (short)10);
private static final org.apache.thrift.protocol.TField REQUESTED_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestedDate", org.apache.thrift.protocol.TType.I64, (short)11);
private static final org.apache.thrift.protocol.TField SERVICE_UNITS_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceUnits", org.apache.thrift.protocol.TType.I64, (short)12);
private static final org.apache.thrift.protocol.TField SPECIFIC_RESOURCE_SELECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("specificResourceSelection", org.apache.thrift.protocol.TType.STRING, (short)13);
private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)14);
private static final org.apache.thrift.protocol.TField TYPE_OF_ALLOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("typeOfAllocation", org.apache.thrift.protocol.TType.STRING, (short)15);
private static final org.apache.thrift.protocol.TField TYPICAL_SU_PER_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("typicalSuPerJob", org.apache.thrift.protocol.TType.I64, (short)16);
private static final org.apache.thrift.protocol.TField AWARD_ALLOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("awardAllocation", org.apache.thrift.protocol.TType.I64, (short)17);
private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)18);
private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)19);
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)20);
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)21);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UserAllocationDetailStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UserAllocationDetailTupleSchemeFactory();
public java.lang.String projectId; // optional
public java.lang.String applicationsToBeUsed; // optional
public long diskUsageRangePerJob; // optional
public java.nio.ByteBuffer documents; // optional
public java.lang.String fieldOfScience; // optional
public java.lang.String keywords; // optional
public long maxMemoryPerCpu; // optional
public long numberOfCpuPerJob; // optional
public java.lang.String projectDescription; // optional
public java.lang.String projectReviewedAndFundedBy; // optional
public long requestedDate; // optional
public long serviceUnits; // optional
public java.lang.String specificResourceSelection; // optional
public java.lang.String title; // optional
public java.lang.String typeOfAllocation; // optional
public long typicalSuPerJob; // optional
public long awardAllocation; // optional
public long startDate; // optional
public long endDate; // optional
public java.lang.String status; // optional
public java.lang.String username; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
APPLICATIONS_TO_BE_USED((short)2, "applicationsToBeUsed"),
DISK_USAGE_RANGE_PER_JOB((short)3, "diskUsageRangePerJob"),
DOCUMENTS((short)4, "documents"),
FIELD_OF_SCIENCE((short)5, "fieldOfScience"),
KEYWORDS((short)6, "keywords"),
MAX_MEMORY_PER_CPU((short)7, "maxMemoryPerCpu"),
NUMBER_OF_CPU_PER_JOB((short)8, "numberOfCpuPerJob"),
PROJECT_DESCRIPTION((short)9, "projectDescription"),
PROJECT_REVIEWED_AND_FUNDED_BY((short)10, "projectReviewedAndFundedBy"),
REQUESTED_DATE((short)11, "requestedDate"),
SERVICE_UNITS((short)12, "serviceUnits"),
SPECIFIC_RESOURCE_SELECTION((short)13, "specificResourceSelection"),
TITLE((short)14, "title"),
TYPE_OF_ALLOCATION((short)15, "typeOfAllocation"),
TYPICAL_SU_PER_JOB((short)16, "typicalSuPerJob"),
AWARD_ALLOCATION((short)17, "awardAllocation"),
START_DATE((short)18, "startDate"),
END_DATE((short)19, "endDate"),
STATUS((short)20, "status"),
USERNAME((short)21, "username");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // APPLICATIONS_TO_BE_USED
return APPLICATIONS_TO_BE_USED;
case 3: // DISK_USAGE_RANGE_PER_JOB
return DISK_USAGE_RANGE_PER_JOB;
case 4: // DOCUMENTS
return DOCUMENTS;
case 5: // FIELD_OF_SCIENCE
return FIELD_OF_SCIENCE;
case 6: // KEYWORDS
return KEYWORDS;
case 7: // MAX_MEMORY_PER_CPU
return MAX_MEMORY_PER_CPU;
case 8: // NUMBER_OF_CPU_PER_JOB
return NUMBER_OF_CPU_PER_JOB;
case 9: // PROJECT_DESCRIPTION
return PROJECT_DESCRIPTION;
case 10: // PROJECT_REVIEWED_AND_FUNDED_BY
return PROJECT_REVIEWED_AND_FUNDED_BY;
case 11: // REQUESTED_DATE
return REQUESTED_DATE;
case 12: // SERVICE_UNITS
return SERVICE_UNITS;
case 13: // SPECIFIC_RESOURCE_SELECTION
return SPECIFIC_RESOURCE_SELECTION;
case 14: // TITLE
return TITLE;
case 15: // TYPE_OF_ALLOCATION
return TYPE_OF_ALLOCATION;
case 16: // TYPICAL_SU_PER_JOB
return TYPICAL_SU_PER_JOB;
case 17: // AWARD_ALLOCATION
return AWARD_ALLOCATION;
case 18: // START_DATE
return START_DATE;
case 19: // END_DATE
return END_DATE;
case 20: // STATUS
return STATUS;
case 21: // USERNAME
return USERNAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __DISKUSAGERANGEPERJOB_ISSET_ID = 0;
private static final int __MAXMEMORYPERCPU_ISSET_ID = 1;
private static final int __NUMBEROFCPUPERJOB_ISSET_ID = 2;
private static final int __REQUESTEDDATE_ISSET_ID = 3;
private static final int __SERVICEUNITS_ISSET_ID = 4;
private static final int __TYPICALSUPERJOB_ISSET_ID = 5;
private static final int __AWARDALLOCATION_ISSET_ID = 6;
private static final int __STARTDATE_ISSET_ID = 7;
private static final int __ENDDATE_ISSET_ID = 8;
private short __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PROJECT_ID,_Fields.APPLICATIONS_TO_BE_USED,_Fields.DISK_USAGE_RANGE_PER_JOB,_Fields.DOCUMENTS,_Fields.FIELD_OF_SCIENCE,_Fields.KEYWORDS,_Fields.MAX_MEMORY_PER_CPU,_Fields.NUMBER_OF_CPU_PER_JOB,_Fields.PROJECT_DESCRIPTION,_Fields.PROJECT_REVIEWED_AND_FUNDED_BY,_Fields.REQUESTED_DATE,_Fields.SERVICE_UNITS,_Fields.SPECIFIC_RESOURCE_SELECTION,_Fields.TITLE,_Fields.TYPE_OF_ALLOCATION,_Fields.TYPICAL_SU_PER_JOB,_Fields.AWARD_ALLOCATION,_Fields.START_DATE,_Fields.END_DATE,_Fields.STATUS,_Fields.USERNAME};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.APPLICATIONS_TO_BE_USED, new org.apache.thrift.meta_data.FieldMetaData("applicationsToBeUsed", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DISK_USAGE_RANGE_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("diskUsageRangePerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.DOCUMENTS, new org.apache.thrift.meta_data.FieldMetaData("documents", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.FIELD_OF_SCIENCE, new org.apache.thrift.meta_data.FieldMetaData("fieldOfScience", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.KEYWORDS, new org.apache.thrift.meta_data.FieldMetaData("keywords", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MAX_MEMORY_PER_CPU, new org.apache.thrift.meta_data.FieldMetaData("maxMemoryPerCpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.NUMBER_OF_CPU_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("numberOfCpuPerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.PROJECT_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("projectDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PROJECT_REVIEWED_AND_FUNDED_BY, new org.apache.thrift.meta_data.FieldMetaData("projectReviewedAndFundedBy", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.REQUESTED_DATE, new org.apache.thrift.meta_data.FieldMetaData("requestedDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SERVICE_UNITS, new org.apache.thrift.meta_data.FieldMetaData("serviceUnits", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.SPECIFIC_RESOURCE_SELECTION, new org.apache.thrift.meta_data.FieldMetaData("specificResourceSelection", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TYPE_OF_ALLOCATION, new org.apache.thrift.meta_data.FieldMetaData("typeOfAllocation", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TYPICAL_SU_PER_JOB, new org.apache.thrift.meta_data.FieldMetaData("typicalSuPerJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.AWARD_ALLOCATION, new org.apache.thrift.meta_data.FieldMetaData("awardAllocation", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserAllocationDetail.class, metaDataMap);
}
public UserAllocationDetail() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public UserAllocationDetail(UserAllocationDetail other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetApplicationsToBeUsed()) {
this.applicationsToBeUsed = other.applicationsToBeUsed;
}
this.diskUsageRangePerJob = other.diskUsageRangePerJob;
if (other.isSetDocuments()) {
this.documents = org.apache.thrift.TBaseHelper.copyBinary(other.documents);
}
if (other.isSetFieldOfScience()) {
this.fieldOfScience = other.fieldOfScience;
}
if (other.isSetKeywords()) {
this.keywords = other.keywords;
}
this.maxMemoryPerCpu = other.maxMemoryPerCpu;
this.numberOfCpuPerJob = other.numberOfCpuPerJob;
if (other.isSetProjectDescription()) {
this.projectDescription = other.projectDescription;
}
if (other.isSetProjectReviewedAndFundedBy()) {
this.projectReviewedAndFundedBy = other.projectReviewedAndFundedBy;
}
this.requestedDate = other.requestedDate;
this.serviceUnits = other.serviceUnits;
if (other.isSetSpecificResourceSelection()) {
this.specificResourceSelection = other.specificResourceSelection;
}
if (other.isSetTitle()) {
this.title = other.title;
}
if (other.isSetTypeOfAllocation()) {
this.typeOfAllocation = other.typeOfAllocation;
}
this.typicalSuPerJob = other.typicalSuPerJob;
this.awardAllocation = other.awardAllocation;
this.startDate = other.startDate;
this.endDate = other.endDate;
if (other.isSetStatus()) {
this.status = other.status;
}
if (other.isSetUsername()) {
this.username = other.username;
}
}
public UserAllocationDetail deepCopy() {
return new UserAllocationDetail(this);
}
@Override
public void clear() {
this.projectId = null;
this.applicationsToBeUsed = null;
setDiskUsageRangePerJobIsSet(false);
this.diskUsageRangePerJob = 0;
this.documents = null;
this.fieldOfScience = null;
this.keywords = null;
setMaxMemoryPerCpuIsSet(false);
this.maxMemoryPerCpu = 0;
setNumberOfCpuPerJobIsSet(false);
this.numberOfCpuPerJob = 0;
this.projectDescription = null;
this.projectReviewedAndFundedBy = null;
setRequestedDateIsSet(false);
this.requestedDate = 0;
setServiceUnitsIsSet(false);
this.serviceUnits = 0;
this.specificResourceSelection = null;
this.title = null;
this.typeOfAllocation = null;
setTypicalSuPerJobIsSet(false);
this.typicalSuPerJob = 0;
setAwardAllocationIsSet(false);
this.awardAllocation = 0;
setStartDateIsSet(false);
this.startDate = 0;
setEndDateIsSet(false);
this.endDate = 0;
this.status = null;
this.username = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public UserAllocationDetail setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getApplicationsToBeUsed() {
return this.applicationsToBeUsed;
}
public UserAllocationDetail setApplicationsToBeUsed(java.lang.String applicationsToBeUsed) {
this.applicationsToBeUsed = applicationsToBeUsed;
return this;
}
public void unsetApplicationsToBeUsed() {
this.applicationsToBeUsed = null;
}
/** Returns true if field applicationsToBeUsed is set (has been assigned a value) and false otherwise */
public boolean isSetApplicationsToBeUsed() {
return this.applicationsToBeUsed != null;
}
public void setApplicationsToBeUsedIsSet(boolean value) {
if (!value) {
this.applicationsToBeUsed = null;
}
}
public long getDiskUsageRangePerJob() {
return this.diskUsageRangePerJob;
}
public UserAllocationDetail setDiskUsageRangePerJob(long diskUsageRangePerJob) {
this.diskUsageRangePerJob = diskUsageRangePerJob;
setDiskUsageRangePerJobIsSet(true);
return this;
}
public void unsetDiskUsageRangePerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID);
}
/** Returns true if field diskUsageRangePerJob is set (has been assigned a value) and false otherwise */
public boolean isSetDiskUsageRangePerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID);
}
public void setDiskUsageRangePerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DISKUSAGERANGEPERJOB_ISSET_ID, value);
}
public byte[] getDocuments() {
setDocuments(org.apache.thrift.TBaseHelper.rightSize(documents));
return documents == null ? null : documents.array();
}
public java.nio.ByteBuffer bufferForDocuments() {
return org.apache.thrift.TBaseHelper.copyBinary(documents);
}
public UserAllocationDetail setDocuments(byte[] documents) {
this.documents = documents == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(documents.clone());
return this;
}
public UserAllocationDetail setDocuments(java.nio.ByteBuffer documents) {
this.documents = org.apache.thrift.TBaseHelper.copyBinary(documents);
return this;
}
public void unsetDocuments() {
this.documents = null;
}
/** Returns true if field documents is set (has been assigned a value) and false otherwise */
public boolean isSetDocuments() {
return this.documents != null;
}
public void setDocumentsIsSet(boolean value) {
if (!value) {
this.documents = null;
}
}
public java.lang.String getFieldOfScience() {
return this.fieldOfScience;
}
public UserAllocationDetail setFieldOfScience(java.lang.String fieldOfScience) {
this.fieldOfScience = fieldOfScience;
return this;
}
public void unsetFieldOfScience() {
this.fieldOfScience = null;
}
/** Returns true if field fieldOfScience is set (has been assigned a value) and false otherwise */
public boolean isSetFieldOfScience() {
return this.fieldOfScience != null;
}
public void setFieldOfScienceIsSet(boolean value) {
if (!value) {
this.fieldOfScience = null;
}
}
public java.lang.String getKeywords() {
return this.keywords;
}
public UserAllocationDetail setKeywords(java.lang.String keywords) {
this.keywords = keywords;
return this;
}
public void unsetKeywords() {
this.keywords = null;
}
/** Returns true if field keywords is set (has been assigned a value) and false otherwise */
public boolean isSetKeywords() {
return this.keywords != null;
}
public void setKeywordsIsSet(boolean value) {
if (!value) {
this.keywords = null;
}
}
public long getMaxMemoryPerCpu() {
return this.maxMemoryPerCpu;
}
public UserAllocationDetail setMaxMemoryPerCpu(long maxMemoryPerCpu) {
this.maxMemoryPerCpu = maxMemoryPerCpu;
setMaxMemoryPerCpuIsSet(true);
return this;
}
public void unsetMaxMemoryPerCpu() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID);
}
/** Returns true if field maxMemoryPerCpu is set (has been assigned a value) and false otherwise */
public boolean isSetMaxMemoryPerCpu() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID);
}
public void setMaxMemoryPerCpuIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXMEMORYPERCPU_ISSET_ID, value);
}
public long getNumberOfCpuPerJob() {
return this.numberOfCpuPerJob;
}
public UserAllocationDetail setNumberOfCpuPerJob(long numberOfCpuPerJob) {
this.numberOfCpuPerJob = numberOfCpuPerJob;
setNumberOfCpuPerJobIsSet(true);
return this;
}
public void unsetNumberOfCpuPerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID);
}
/** Returns true if field numberOfCpuPerJob is set (has been assigned a value) and false otherwise */
public boolean isSetNumberOfCpuPerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID);
}
public void setNumberOfCpuPerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUMBEROFCPUPERJOB_ISSET_ID, value);
}
public java.lang.String getProjectDescription() {
return this.projectDescription;
}
public UserAllocationDetail setProjectDescription(java.lang.String projectDescription) {
this.projectDescription = projectDescription;
return this;
}
public void unsetProjectDescription() {
this.projectDescription = null;
}
/** Returns true if field projectDescription is set (has been assigned a value) and false otherwise */
public boolean isSetProjectDescription() {
return this.projectDescription != null;
}
public void setProjectDescriptionIsSet(boolean value) {
if (!value) {
this.projectDescription = null;
}
}
public java.lang.String getProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy;
}
public UserAllocationDetail setProjectReviewedAndFundedBy(java.lang.String projectReviewedAndFundedBy) {
this.projectReviewedAndFundedBy = projectReviewedAndFundedBy;
return this;
}
public void unsetProjectReviewedAndFundedBy() {
this.projectReviewedAndFundedBy = null;
}
/** Returns true if field projectReviewedAndFundedBy is set (has been assigned a value) and false otherwise */
public boolean isSetProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy != null;
}
public void setProjectReviewedAndFundedByIsSet(boolean value) {
if (!value) {
this.projectReviewedAndFundedBy = null;
}
}
public long getRequestedDate() {
return this.requestedDate;
}
public UserAllocationDetail setRequestedDate(long requestedDate) {
this.requestedDate = requestedDate;
setRequestedDateIsSet(true);
return this;
}
public void unsetRequestedDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID);
}
/** Returns true if field requestedDate is set (has been assigned a value) and false otherwise */
public boolean isSetRequestedDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID);
}
public void setRequestedDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REQUESTEDDATE_ISSET_ID, value);
}
public long getServiceUnits() {
return this.serviceUnits;
}
public UserAllocationDetail setServiceUnits(long serviceUnits) {
this.serviceUnits = serviceUnits;
setServiceUnitsIsSet(true);
return this;
}
public void unsetServiceUnits() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID);
}
/** Returns true if field serviceUnits is set (has been assigned a value) and false otherwise */
public boolean isSetServiceUnits() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID);
}
public void setServiceUnitsIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SERVICEUNITS_ISSET_ID, value);
}
public java.lang.String getSpecificResourceSelection() {
return this.specificResourceSelection;
}
public UserAllocationDetail setSpecificResourceSelection(java.lang.String specificResourceSelection) {
this.specificResourceSelection = specificResourceSelection;
return this;
}
public void unsetSpecificResourceSelection() {
this.specificResourceSelection = null;
}
/** Returns true if field specificResourceSelection is set (has been assigned a value) and false otherwise */
public boolean isSetSpecificResourceSelection() {
return this.specificResourceSelection != null;
}
public void setSpecificResourceSelectionIsSet(boolean value) {
if (!value) {
this.specificResourceSelection = null;
}
}
public java.lang.String getTitle() {
return this.title;
}
public UserAllocationDetail setTitle(java.lang.String title) {
this.title = title;
return this;
}
public void unsetTitle() {
this.title = null;
}
/** Returns true if field title is set (has been assigned a value) and false otherwise */
public boolean isSetTitle() {
return this.title != null;
}
public void setTitleIsSet(boolean value) {
if (!value) {
this.title = null;
}
}
public java.lang.String getTypeOfAllocation() {
return this.typeOfAllocation;
}
public UserAllocationDetail setTypeOfAllocation(java.lang.String typeOfAllocation) {
this.typeOfAllocation = typeOfAllocation;
return this;
}
public void unsetTypeOfAllocation() {
this.typeOfAllocation = null;
}
/** Returns true if field typeOfAllocation is set (has been assigned a value) and false otherwise */
public boolean isSetTypeOfAllocation() {
return this.typeOfAllocation != null;
}
public void setTypeOfAllocationIsSet(boolean value) {
if (!value) {
this.typeOfAllocation = null;
}
}
public long getTypicalSuPerJob() {
return this.typicalSuPerJob;
}
public UserAllocationDetail setTypicalSuPerJob(long typicalSuPerJob) {
this.typicalSuPerJob = typicalSuPerJob;
setTypicalSuPerJobIsSet(true);
return this;
}
public void unsetTypicalSuPerJob() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID);
}
/** Returns true if field typicalSuPerJob is set (has been assigned a value) and false otherwise */
public boolean isSetTypicalSuPerJob() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID);
}
public void setTypicalSuPerJobIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TYPICALSUPERJOB_ISSET_ID, value);
}
public long getAwardAllocation() {
return this.awardAllocation;
}
public UserAllocationDetail setAwardAllocation(long awardAllocation) {
this.awardAllocation = awardAllocation;
setAwardAllocationIsSet(true);
return this;
}
public void unsetAwardAllocation() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
/** Returns true if field awardAllocation is set (has been assigned a value) and false otherwise */
public boolean isSetAwardAllocation() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
public void setAwardAllocationIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID, value);
}
public long getStartDate() {
return this.startDate;
}
public UserAllocationDetail setStartDate(long startDate) {
this.startDate = startDate;
setStartDateIsSet(true);
return this;
}
public void unsetStartDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
/** Returns true if field startDate is set (has been assigned a value) and false otherwise */
public boolean isSetStartDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
public void setStartDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTDATE_ISSET_ID, value);
}
public long getEndDate() {
return this.endDate;
}
public UserAllocationDetail setEndDate(long endDate) {
this.endDate = endDate;
setEndDateIsSet(true);
return this;
}
public void unsetEndDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
/** Returns true if field endDate is set (has been assigned a value) and false otherwise */
public boolean isSetEndDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
public void setEndDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDDATE_ISSET_ID, value);
}
public java.lang.String getStatus() {
return this.status;
}
public UserAllocationDetail setStatus(java.lang.String status) {
this.status = status;
return this;
}
public void unsetStatus() {
this.status = null;
}
/** Returns true if field status is set (has been assigned a value) and false otherwise */
public boolean isSetStatus() {
return this.status != null;
}
public void setStatusIsSet(boolean value) {
if (!value) {
this.status = null;
}
}
public java.lang.String getUsername() {
return this.username;
}
public UserAllocationDetail setUsername(java.lang.String username) {
this.username = username;
return this;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case APPLICATIONS_TO_BE_USED:
if (value == null) {
unsetApplicationsToBeUsed();
} else {
setApplicationsToBeUsed((java.lang.String)value);
}
break;
case DISK_USAGE_RANGE_PER_JOB:
if (value == null) {
unsetDiskUsageRangePerJob();
} else {
setDiskUsageRangePerJob((java.lang.Long)value);
}
break;
case DOCUMENTS:
if (value == null) {
unsetDocuments();
} else {
if (value instanceof byte[]) {
setDocuments((byte[])value);
} else {
setDocuments((java.nio.ByteBuffer)value);
}
}
break;
case FIELD_OF_SCIENCE:
if (value == null) {
unsetFieldOfScience();
} else {
setFieldOfScience((java.lang.String)value);
}
break;
case KEYWORDS:
if (value == null) {
unsetKeywords();
} else {
setKeywords((java.lang.String)value);
}
break;
case MAX_MEMORY_PER_CPU:
if (value == null) {
unsetMaxMemoryPerCpu();
} else {
setMaxMemoryPerCpu((java.lang.Long)value);
}
break;
case NUMBER_OF_CPU_PER_JOB:
if (value == null) {
unsetNumberOfCpuPerJob();
} else {
setNumberOfCpuPerJob((java.lang.Long)value);
}
break;
case PROJECT_DESCRIPTION:
if (value == null) {
unsetProjectDescription();
} else {
setProjectDescription((java.lang.String)value);
}
break;
case PROJECT_REVIEWED_AND_FUNDED_BY:
if (value == null) {
unsetProjectReviewedAndFundedBy();
} else {
setProjectReviewedAndFundedBy((java.lang.String)value);
}
break;
case REQUESTED_DATE:
if (value == null) {
unsetRequestedDate();
} else {
setRequestedDate((java.lang.Long)value);
}
break;
case SERVICE_UNITS:
if (value == null) {
unsetServiceUnits();
} else {
setServiceUnits((java.lang.Long)value);
}
break;
case SPECIFIC_RESOURCE_SELECTION:
if (value == null) {
unsetSpecificResourceSelection();
} else {
setSpecificResourceSelection((java.lang.String)value);
}
break;
case TITLE:
if (value == null) {
unsetTitle();
} else {
setTitle((java.lang.String)value);
}
break;
case TYPE_OF_ALLOCATION:
if (value == null) {
unsetTypeOfAllocation();
} else {
setTypeOfAllocation((java.lang.String)value);
}
break;
case TYPICAL_SU_PER_JOB:
if (value == null) {
unsetTypicalSuPerJob();
} else {
setTypicalSuPerJob((java.lang.Long)value);
}
break;
case AWARD_ALLOCATION:
if (value == null) {
unsetAwardAllocation();
} else {
setAwardAllocation((java.lang.Long)value);
}
break;
case START_DATE:
if (value == null) {
unsetStartDate();
} else {
setStartDate((java.lang.Long)value);
}
break;
case END_DATE:
if (value == null) {
unsetEndDate();
} else {
setEndDate((java.lang.Long)value);
}
break;
case STATUS:
if (value == null) {
unsetStatus();
} else {
setStatus((java.lang.String)value);
}
break;
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case APPLICATIONS_TO_BE_USED:
return getApplicationsToBeUsed();
case DISK_USAGE_RANGE_PER_JOB:
return getDiskUsageRangePerJob();
case DOCUMENTS:
return getDocuments();
case FIELD_OF_SCIENCE:
return getFieldOfScience();
case KEYWORDS:
return getKeywords();
case MAX_MEMORY_PER_CPU:
return getMaxMemoryPerCpu();
case NUMBER_OF_CPU_PER_JOB:
return getNumberOfCpuPerJob();
case PROJECT_DESCRIPTION:
return getProjectDescription();
case PROJECT_REVIEWED_AND_FUNDED_BY:
return getProjectReviewedAndFundedBy();
case REQUESTED_DATE:
return getRequestedDate();
case SERVICE_UNITS:
return getServiceUnits();
case SPECIFIC_RESOURCE_SELECTION:
return getSpecificResourceSelection();
case TITLE:
return getTitle();
case TYPE_OF_ALLOCATION:
return getTypeOfAllocation();
case TYPICAL_SU_PER_JOB:
return getTypicalSuPerJob();
case AWARD_ALLOCATION:
return getAwardAllocation();
case START_DATE:
return getStartDate();
case END_DATE:
return getEndDate();
case STATUS:
return getStatus();
case USERNAME:
return getUsername();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case APPLICATIONS_TO_BE_USED:
return isSetApplicationsToBeUsed();
case DISK_USAGE_RANGE_PER_JOB:
return isSetDiskUsageRangePerJob();
case DOCUMENTS:
return isSetDocuments();
case FIELD_OF_SCIENCE:
return isSetFieldOfScience();
case KEYWORDS:
return isSetKeywords();
case MAX_MEMORY_PER_CPU:
return isSetMaxMemoryPerCpu();
case NUMBER_OF_CPU_PER_JOB:
return isSetNumberOfCpuPerJob();
case PROJECT_DESCRIPTION:
return isSetProjectDescription();
case PROJECT_REVIEWED_AND_FUNDED_BY:
return isSetProjectReviewedAndFundedBy();
case REQUESTED_DATE:
return isSetRequestedDate();
case SERVICE_UNITS:
return isSetServiceUnits();
case SPECIFIC_RESOURCE_SELECTION:
return isSetSpecificResourceSelection();
case TITLE:
return isSetTitle();
case TYPE_OF_ALLOCATION:
return isSetTypeOfAllocation();
case TYPICAL_SU_PER_JOB:
return isSetTypicalSuPerJob();
case AWARD_ALLOCATION:
return isSetAwardAllocation();
case START_DATE:
return isSetStartDate();
case END_DATE:
return isSetEndDate();
case STATUS:
return isSetStatus();
case USERNAME:
return isSetUsername();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof UserAllocationDetail)
return this.equals((UserAllocationDetail)that);
return false;
}
public boolean equals(UserAllocationDetail that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_applicationsToBeUsed = true && this.isSetApplicationsToBeUsed();
boolean that_present_applicationsToBeUsed = true && that.isSetApplicationsToBeUsed();
if (this_present_applicationsToBeUsed || that_present_applicationsToBeUsed) {
if (!(this_present_applicationsToBeUsed && that_present_applicationsToBeUsed))
return false;
if (!this.applicationsToBeUsed.equals(that.applicationsToBeUsed))
return false;
}
boolean this_present_diskUsageRangePerJob = true && this.isSetDiskUsageRangePerJob();
boolean that_present_diskUsageRangePerJob = true && that.isSetDiskUsageRangePerJob();
if (this_present_diskUsageRangePerJob || that_present_diskUsageRangePerJob) {
if (!(this_present_diskUsageRangePerJob && that_present_diskUsageRangePerJob))
return false;
if (this.diskUsageRangePerJob != that.diskUsageRangePerJob)
return false;
}
boolean this_present_documents = true && this.isSetDocuments();
boolean that_present_documents = true && that.isSetDocuments();
if (this_present_documents || that_present_documents) {
if (!(this_present_documents && that_present_documents))
return false;
if (!this.documents.equals(that.documents))
return false;
}
boolean this_present_fieldOfScience = true && this.isSetFieldOfScience();
boolean that_present_fieldOfScience = true && that.isSetFieldOfScience();
if (this_present_fieldOfScience || that_present_fieldOfScience) {
if (!(this_present_fieldOfScience && that_present_fieldOfScience))
return false;
if (!this.fieldOfScience.equals(that.fieldOfScience))
return false;
}
boolean this_present_keywords = true && this.isSetKeywords();
boolean that_present_keywords = true && that.isSetKeywords();
if (this_present_keywords || that_present_keywords) {
if (!(this_present_keywords && that_present_keywords))
return false;
if (!this.keywords.equals(that.keywords))
return false;
}
boolean this_present_maxMemoryPerCpu = true && this.isSetMaxMemoryPerCpu();
boolean that_present_maxMemoryPerCpu = true && that.isSetMaxMemoryPerCpu();
if (this_present_maxMemoryPerCpu || that_present_maxMemoryPerCpu) {
if (!(this_present_maxMemoryPerCpu && that_present_maxMemoryPerCpu))
return false;
if (this.maxMemoryPerCpu != that.maxMemoryPerCpu)
return false;
}
boolean this_present_numberOfCpuPerJob = true && this.isSetNumberOfCpuPerJob();
boolean that_present_numberOfCpuPerJob = true && that.isSetNumberOfCpuPerJob();
if (this_present_numberOfCpuPerJob || that_present_numberOfCpuPerJob) {
if (!(this_present_numberOfCpuPerJob && that_present_numberOfCpuPerJob))
return false;
if (this.numberOfCpuPerJob != that.numberOfCpuPerJob)
return false;
}
boolean this_present_projectDescription = true && this.isSetProjectDescription();
boolean that_present_projectDescription = true && that.isSetProjectDescription();
if (this_present_projectDescription || that_present_projectDescription) {
if (!(this_present_projectDescription && that_present_projectDescription))
return false;
if (!this.projectDescription.equals(that.projectDescription))
return false;
}
boolean this_present_projectReviewedAndFundedBy = true && this.isSetProjectReviewedAndFundedBy();
boolean that_present_projectReviewedAndFundedBy = true && that.isSetProjectReviewedAndFundedBy();
if (this_present_projectReviewedAndFundedBy || that_present_projectReviewedAndFundedBy) {
if (!(this_present_projectReviewedAndFundedBy && that_present_projectReviewedAndFundedBy))
return false;
if (!this.projectReviewedAndFundedBy.equals(that.projectReviewedAndFundedBy))
return false;
}
boolean this_present_requestedDate = true && this.isSetRequestedDate();
boolean that_present_requestedDate = true && that.isSetRequestedDate();
if (this_present_requestedDate || that_present_requestedDate) {
if (!(this_present_requestedDate && that_present_requestedDate))
return false;
if (this.requestedDate != that.requestedDate)
return false;
}
boolean this_present_serviceUnits = true && this.isSetServiceUnits();
boolean that_present_serviceUnits = true && that.isSetServiceUnits();
if (this_present_serviceUnits || that_present_serviceUnits) {
if (!(this_present_serviceUnits && that_present_serviceUnits))
return false;
if (this.serviceUnits != that.serviceUnits)
return false;
}
boolean this_present_specificResourceSelection = true && this.isSetSpecificResourceSelection();
boolean that_present_specificResourceSelection = true && that.isSetSpecificResourceSelection();
if (this_present_specificResourceSelection || that_present_specificResourceSelection) {
if (!(this_present_specificResourceSelection && that_present_specificResourceSelection))
return false;
if (!this.specificResourceSelection.equals(that.specificResourceSelection))
return false;
}
boolean this_present_title = true && this.isSetTitle();
boolean that_present_title = true && that.isSetTitle();
if (this_present_title || that_present_title) {
if (!(this_present_title && that_present_title))
return false;
if (!this.title.equals(that.title))
return false;
}
boolean this_present_typeOfAllocation = true && this.isSetTypeOfAllocation();
boolean that_present_typeOfAllocation = true && that.isSetTypeOfAllocation();
if (this_present_typeOfAllocation || that_present_typeOfAllocation) {
if (!(this_present_typeOfAllocation && that_present_typeOfAllocation))
return false;
if (!this.typeOfAllocation.equals(that.typeOfAllocation))
return false;
}
boolean this_present_typicalSuPerJob = true && this.isSetTypicalSuPerJob();
boolean that_present_typicalSuPerJob = true && that.isSetTypicalSuPerJob();
if (this_present_typicalSuPerJob || that_present_typicalSuPerJob) {
if (!(this_present_typicalSuPerJob && that_present_typicalSuPerJob))
return false;
if (this.typicalSuPerJob != that.typicalSuPerJob)
return false;
}
boolean this_present_awardAllocation = true && this.isSetAwardAllocation();
boolean that_present_awardAllocation = true && that.isSetAwardAllocation();
if (this_present_awardAllocation || that_present_awardAllocation) {
if (!(this_present_awardAllocation && that_present_awardAllocation))
return false;
if (this.awardAllocation != that.awardAllocation)
return false;
}
boolean this_present_startDate = true && this.isSetStartDate();
boolean that_present_startDate = true && that.isSetStartDate();
if (this_present_startDate || that_present_startDate) {
if (!(this_present_startDate && that_present_startDate))
return false;
if (this.startDate != that.startDate)
return false;
}
boolean this_present_endDate = true && this.isSetEndDate();
boolean that_present_endDate = true && that.isSetEndDate();
if (this_present_endDate || that_present_endDate) {
if (!(this_present_endDate && that_present_endDate))
return false;
if (this.endDate != that.endDate)
return false;
}
boolean this_present_status = true && this.isSetStatus();
boolean that_present_status = true && that.isSetStatus();
if (this_present_status || that_present_status) {
if (!(this_present_status && that_present_status))
return false;
if (!this.status.equals(that.status))
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetApplicationsToBeUsed()) ? 131071 : 524287);
if (isSetApplicationsToBeUsed())
hashCode = hashCode * 8191 + applicationsToBeUsed.hashCode();
hashCode = hashCode * 8191 + ((isSetDiskUsageRangePerJob()) ? 131071 : 524287);
if (isSetDiskUsageRangePerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(diskUsageRangePerJob);
hashCode = hashCode * 8191 + ((isSetDocuments()) ? 131071 : 524287);
if (isSetDocuments())
hashCode = hashCode * 8191 + documents.hashCode();
hashCode = hashCode * 8191 + ((isSetFieldOfScience()) ? 131071 : 524287);
if (isSetFieldOfScience())
hashCode = hashCode * 8191 + fieldOfScience.hashCode();
hashCode = hashCode * 8191 + ((isSetKeywords()) ? 131071 : 524287);
if (isSetKeywords())
hashCode = hashCode * 8191 + keywords.hashCode();
hashCode = hashCode * 8191 + ((isSetMaxMemoryPerCpu()) ? 131071 : 524287);
if (isSetMaxMemoryPerCpu())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxMemoryPerCpu);
hashCode = hashCode * 8191 + ((isSetNumberOfCpuPerJob()) ? 131071 : 524287);
if (isSetNumberOfCpuPerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(numberOfCpuPerJob);
hashCode = hashCode * 8191 + ((isSetProjectDescription()) ? 131071 : 524287);
if (isSetProjectDescription())
hashCode = hashCode * 8191 + projectDescription.hashCode();
hashCode = hashCode * 8191 + ((isSetProjectReviewedAndFundedBy()) ? 131071 : 524287);
if (isSetProjectReviewedAndFundedBy())
hashCode = hashCode * 8191 + projectReviewedAndFundedBy.hashCode();
hashCode = hashCode * 8191 + ((isSetRequestedDate()) ? 131071 : 524287);
if (isSetRequestedDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(requestedDate);
hashCode = hashCode * 8191 + ((isSetServiceUnits()) ? 131071 : 524287);
if (isSetServiceUnits())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(serviceUnits);
hashCode = hashCode * 8191 + ((isSetSpecificResourceSelection()) ? 131071 : 524287);
if (isSetSpecificResourceSelection())
hashCode = hashCode * 8191 + specificResourceSelection.hashCode();
hashCode = hashCode * 8191 + ((isSetTitle()) ? 131071 : 524287);
if (isSetTitle())
hashCode = hashCode * 8191 + title.hashCode();
hashCode = hashCode * 8191 + ((isSetTypeOfAllocation()) ? 131071 : 524287);
if (isSetTypeOfAllocation())
hashCode = hashCode * 8191 + typeOfAllocation.hashCode();
hashCode = hashCode * 8191 + ((isSetTypicalSuPerJob()) ? 131071 : 524287);
if (isSetTypicalSuPerJob())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(typicalSuPerJob);
hashCode = hashCode * 8191 + ((isSetAwardAllocation()) ? 131071 : 524287);
if (isSetAwardAllocation())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(awardAllocation);
hashCode = hashCode * 8191 + ((isSetStartDate()) ? 131071 : 524287);
if (isSetStartDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startDate);
hashCode = hashCode * 8191 + ((isSetEndDate()) ? 131071 : 524287);
if (isSetEndDate())
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endDate);
hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
if (isSetStatus())
hashCode = hashCode * 8191 + status.hashCode();
hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
if (isSetUsername())
hashCode = hashCode * 8191 + username.hashCode();
return hashCode;
}
@Override
public int compareTo(UserAllocationDetail other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetApplicationsToBeUsed()).compareTo(other.isSetApplicationsToBeUsed());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetApplicationsToBeUsed()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationsToBeUsed, other.applicationsToBeUsed);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetDiskUsageRangePerJob()).compareTo(other.isSetDiskUsageRangePerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDiskUsageRangePerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.diskUsageRangePerJob, other.diskUsageRangePerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetDocuments()).compareTo(other.isSetDocuments());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDocuments()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.documents, other.documents);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetFieldOfScience()).compareTo(other.isSetFieldOfScience());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFieldOfScience()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fieldOfScience, other.fieldOfScience);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetKeywords()).compareTo(other.isSetKeywords());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetKeywords()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keywords, other.keywords);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetMaxMemoryPerCpu()).compareTo(other.isSetMaxMemoryPerCpu());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMaxMemoryPerCpu()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxMemoryPerCpu, other.maxMemoryPerCpu);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetNumberOfCpuPerJob()).compareTo(other.isSetNumberOfCpuPerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNumberOfCpuPerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numberOfCpuPerJob, other.numberOfCpuPerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetProjectDescription()).compareTo(other.isSetProjectDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectDescription()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectDescription, other.projectDescription);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetProjectReviewedAndFundedBy()).compareTo(other.isSetProjectReviewedAndFundedBy());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectReviewedAndFundedBy()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectReviewedAndFundedBy, other.projectReviewedAndFundedBy);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetRequestedDate()).compareTo(other.isSetRequestedDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequestedDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestedDate, other.requestedDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetServiceUnits()).compareTo(other.isSetServiceUnits());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceUnits()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceUnits, other.serviceUnits);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetSpecificResourceSelection()).compareTo(other.isSetSpecificResourceSelection());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSpecificResourceSelection()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.specificResourceSelection, other.specificResourceSelection);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTitle()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTypeOfAllocation()).compareTo(other.isSetTypeOfAllocation());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTypeOfAllocation()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeOfAllocation, other.typeOfAllocation);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTypicalSuPerJob()).compareTo(other.isSetTypicalSuPerJob());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTypicalSuPerJob()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typicalSuPerJob, other.typicalSuPerJob);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAwardAllocation()).compareTo(other.isSetAwardAllocation());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAwardAllocation()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.awardAllocation, other.awardAllocation);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStartDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEndDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStatus()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("UserAllocationDetail(");
boolean first = true;
if (isSetProjectId()) {
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
}
if (isSetApplicationsToBeUsed()) {
if (!first) sb.append(", ");
sb.append("applicationsToBeUsed:");
if (this.applicationsToBeUsed == null) {
sb.append("null");
} else {
sb.append(this.applicationsToBeUsed);
}
first = false;
}
if (isSetDiskUsageRangePerJob()) {
if (!first) sb.append(", ");
sb.append("diskUsageRangePerJob:");
sb.append(this.diskUsageRangePerJob);
first = false;
}
if (isSetDocuments()) {
if (!first) sb.append(", ");
sb.append("documents:");
if (this.documents == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.documents, sb);
}
first = false;
}
if (isSetFieldOfScience()) {
if (!first) sb.append(", ");
sb.append("fieldOfScience:");
if (this.fieldOfScience == null) {
sb.append("null");
} else {
sb.append(this.fieldOfScience);
}
first = false;
}
if (isSetKeywords()) {
if (!first) sb.append(", ");
sb.append("keywords:");
if (this.keywords == null) {
sb.append("null");
} else {
sb.append(this.keywords);
}
first = false;
}
if (isSetMaxMemoryPerCpu()) {
if (!first) sb.append(", ");
sb.append("maxMemoryPerCpu:");
sb.append(this.maxMemoryPerCpu);
first = false;
}
if (isSetNumberOfCpuPerJob()) {
if (!first) sb.append(", ");
sb.append("numberOfCpuPerJob:");
sb.append(this.numberOfCpuPerJob);
first = false;
}
if (isSetProjectDescription()) {
if (!first) sb.append(", ");
sb.append("projectDescription:");
if (this.projectDescription == null) {
sb.append("null");
} else {
sb.append(this.projectDescription);
}
first = false;
}
if (isSetProjectReviewedAndFundedBy()) {
if (!first) sb.append(", ");
sb.append("projectReviewedAndFundedBy:");
if (this.projectReviewedAndFundedBy == null) {
sb.append("null");
} else {
sb.append(this.projectReviewedAndFundedBy);
}
first = false;
}
if (isSetRequestedDate()) {
if (!first) sb.append(", ");
sb.append("requestedDate:");
sb.append(this.requestedDate);
first = false;
}
if (isSetServiceUnits()) {
if (!first) sb.append(", ");
sb.append("serviceUnits:");
sb.append(this.serviceUnits);
first = false;
}
if (isSetSpecificResourceSelection()) {
if (!first) sb.append(", ");
sb.append("specificResourceSelection:");
if (this.specificResourceSelection == null) {
sb.append("null");
} else {
sb.append(this.specificResourceSelection);
}
first = false;
}
if (isSetTitle()) {
if (!first) sb.append(", ");
sb.append("title:");
if (this.title == null) {
sb.append("null");
} else {
sb.append(this.title);
}
first = false;
}
if (isSetTypeOfAllocation()) {
if (!first) sb.append(", ");
sb.append("typeOfAllocation:");
if (this.typeOfAllocation == null) {
sb.append("null");
} else {
sb.append(this.typeOfAllocation);
}
first = false;
}
if (isSetTypicalSuPerJob()) {
if (!first) sb.append(", ");
sb.append("typicalSuPerJob:");
sb.append(this.typicalSuPerJob);
first = false;
}
if (isSetAwardAllocation()) {
if (!first) sb.append(", ");
sb.append("awardAllocation:");
sb.append(this.awardAllocation);
first = false;
}
if (isSetStartDate()) {
if (!first) sb.append(", ");
sb.append("startDate:");
sb.append(this.startDate);
first = false;
}
if (isSetEndDate()) {
if (!first) sb.append(", ");
sb.append("endDate:");
sb.append(this.endDate);
first = false;
}
if (isSetStatus()) {
if (!first) sb.append(", ");
sb.append("status:");
if (this.status == null) {
sb.append("null");
} else {
sb.append(this.status);
}
first = false;
}
if (isSetUsername()) {
if (!first) sb.append(", ");
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class UserAllocationDetailStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UserAllocationDetailStandardScheme getScheme() {
return new UserAllocationDetailStandardScheme();
}
}
private static class UserAllocationDetailStandardScheme extends org.apache.thrift.scheme.StandardScheme<UserAllocationDetail> {
public void read(org.apache.thrift.protocol.TProtocol iprot, UserAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // APPLICATIONS_TO_BE_USED
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.applicationsToBeUsed = iprot.readString();
struct.setApplicationsToBeUsedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // DISK_USAGE_RANGE_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.diskUsageRangePerJob = iprot.readI64();
struct.setDiskUsageRangePerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // DOCUMENTS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.documents = iprot.readBinary();
struct.setDocumentsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // FIELD_OF_SCIENCE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.fieldOfScience = iprot.readString();
struct.setFieldOfScienceIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // KEYWORDS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.keywords = iprot.readString();
struct.setKeywordsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // MAX_MEMORY_PER_CPU
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.maxMemoryPerCpu = iprot.readI64();
struct.setMaxMemoryPerCpuIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // NUMBER_OF_CPU_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.numberOfCpuPerJob = iprot.readI64();
struct.setNumberOfCpuPerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // PROJECT_DESCRIPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectDescription = iprot.readString();
struct.setProjectDescriptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // PROJECT_REVIEWED_AND_FUNDED_BY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectReviewedAndFundedBy = iprot.readString();
struct.setProjectReviewedAndFundedByIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // REQUESTED_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.requestedDate = iprot.readI64();
struct.setRequestedDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // SERVICE_UNITS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.serviceUnits = iprot.readI64();
struct.setServiceUnitsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // SPECIFIC_RESOURCE_SELECTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.specificResourceSelection = iprot.readString();
struct.setSpecificResourceSelectionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 14: // TITLE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.title = iprot.readString();
struct.setTitleIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 15: // TYPE_OF_ALLOCATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.typeOfAllocation = iprot.readString();
struct.setTypeOfAllocationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 16: // TYPICAL_SU_PER_JOB
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.typicalSuPerJob = iprot.readI64();
struct.setTypicalSuPerJobIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 17: // AWARD_ALLOCATION
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 18: // START_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 19: // END_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 20: // STATUS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.status = iprot.readString();
struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 21: // USERNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, UserAllocationDetail struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
if (struct.isSetProjectId()) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
}
if (struct.applicationsToBeUsed != null) {
if (struct.isSetApplicationsToBeUsed()) {
oprot.writeFieldBegin(APPLICATIONS_TO_BE_USED_FIELD_DESC);
oprot.writeString(struct.applicationsToBeUsed);
oprot.writeFieldEnd();
}
}
if (struct.isSetDiskUsageRangePerJob()) {
oprot.writeFieldBegin(DISK_USAGE_RANGE_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.diskUsageRangePerJob);
oprot.writeFieldEnd();
}
if (struct.documents != null) {
if (struct.isSetDocuments()) {
oprot.writeFieldBegin(DOCUMENTS_FIELD_DESC);
oprot.writeBinary(struct.documents);
oprot.writeFieldEnd();
}
}
if (struct.fieldOfScience != null) {
if (struct.isSetFieldOfScience()) {
oprot.writeFieldBegin(FIELD_OF_SCIENCE_FIELD_DESC);
oprot.writeString(struct.fieldOfScience);
oprot.writeFieldEnd();
}
}
if (struct.keywords != null) {
if (struct.isSetKeywords()) {
oprot.writeFieldBegin(KEYWORDS_FIELD_DESC);
oprot.writeString(struct.keywords);
oprot.writeFieldEnd();
}
}
if (struct.isSetMaxMemoryPerCpu()) {
oprot.writeFieldBegin(MAX_MEMORY_PER_CPU_FIELD_DESC);
oprot.writeI64(struct.maxMemoryPerCpu);
oprot.writeFieldEnd();
}
if (struct.isSetNumberOfCpuPerJob()) {
oprot.writeFieldBegin(NUMBER_OF_CPU_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.numberOfCpuPerJob);
oprot.writeFieldEnd();
}
if (struct.projectDescription != null) {
if (struct.isSetProjectDescription()) {
oprot.writeFieldBegin(PROJECT_DESCRIPTION_FIELD_DESC);
oprot.writeString(struct.projectDescription);
oprot.writeFieldEnd();
}
}
if (struct.projectReviewedAndFundedBy != null) {
if (struct.isSetProjectReviewedAndFundedBy()) {
oprot.writeFieldBegin(PROJECT_REVIEWED_AND_FUNDED_BY_FIELD_DESC);
oprot.writeString(struct.projectReviewedAndFundedBy);
oprot.writeFieldEnd();
}
}
if (struct.isSetRequestedDate()) {
oprot.writeFieldBegin(REQUESTED_DATE_FIELD_DESC);
oprot.writeI64(struct.requestedDate);
oprot.writeFieldEnd();
}
if (struct.isSetServiceUnits()) {
oprot.writeFieldBegin(SERVICE_UNITS_FIELD_DESC);
oprot.writeI64(struct.serviceUnits);
oprot.writeFieldEnd();
}
if (struct.specificResourceSelection != null) {
if (struct.isSetSpecificResourceSelection()) {
oprot.writeFieldBegin(SPECIFIC_RESOURCE_SELECTION_FIELD_DESC);
oprot.writeString(struct.specificResourceSelection);
oprot.writeFieldEnd();
}
}
if (struct.title != null) {
if (struct.isSetTitle()) {
oprot.writeFieldBegin(TITLE_FIELD_DESC);
oprot.writeString(struct.title);
oprot.writeFieldEnd();
}
}
if (struct.typeOfAllocation != null) {
if (struct.isSetTypeOfAllocation()) {
oprot.writeFieldBegin(TYPE_OF_ALLOCATION_FIELD_DESC);
oprot.writeString(struct.typeOfAllocation);
oprot.writeFieldEnd();
}
}
if (struct.isSetTypicalSuPerJob()) {
oprot.writeFieldBegin(TYPICAL_SU_PER_JOB_FIELD_DESC);
oprot.writeI64(struct.typicalSuPerJob);
oprot.writeFieldEnd();
}
if (struct.isSetAwardAllocation()) {
oprot.writeFieldBegin(AWARD_ALLOCATION_FIELD_DESC);
oprot.writeI64(struct.awardAllocation);
oprot.writeFieldEnd();
}
if (struct.isSetStartDate()) {
oprot.writeFieldBegin(START_DATE_FIELD_DESC);
oprot.writeI64(struct.startDate);
oprot.writeFieldEnd();
}
if (struct.isSetEndDate()) {
oprot.writeFieldBegin(END_DATE_FIELD_DESC);
oprot.writeI64(struct.endDate);
oprot.writeFieldEnd();
}
if (struct.status != null) {
if (struct.isSetStatus()) {
oprot.writeFieldBegin(STATUS_FIELD_DESC);
oprot.writeString(struct.status);
oprot.writeFieldEnd();
}
}
if (struct.username != null) {
if (struct.isSetUsername()) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(struct.username);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class UserAllocationDetailTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UserAllocationDetailTupleScheme getScheme() {
return new UserAllocationDetailTupleScheme();
}
}
private static class UserAllocationDetailTupleScheme extends org.apache.thrift.scheme.TupleScheme<UserAllocationDetail> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UserAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetProjectId()) {
optionals.set(0);
}
if (struct.isSetApplicationsToBeUsed()) {
optionals.set(1);
}
if (struct.isSetDiskUsageRangePerJob()) {
optionals.set(2);
}
if (struct.isSetDocuments()) {
optionals.set(3);
}
if (struct.isSetFieldOfScience()) {
optionals.set(4);
}
if (struct.isSetKeywords()) {
optionals.set(5);
}
if (struct.isSetMaxMemoryPerCpu()) {
optionals.set(6);
}
if (struct.isSetNumberOfCpuPerJob()) {
optionals.set(7);
}
if (struct.isSetProjectDescription()) {
optionals.set(8);
}
if (struct.isSetProjectReviewedAndFundedBy()) {
optionals.set(9);
}
if (struct.isSetRequestedDate()) {
optionals.set(10);
}
if (struct.isSetServiceUnits()) {
optionals.set(11);
}
if (struct.isSetSpecificResourceSelection()) {
optionals.set(12);
}
if (struct.isSetTitle()) {
optionals.set(13);
}
if (struct.isSetTypeOfAllocation()) {
optionals.set(14);
}
if (struct.isSetTypicalSuPerJob()) {
optionals.set(15);
}
if (struct.isSetAwardAllocation()) {
optionals.set(16);
}
if (struct.isSetStartDate()) {
optionals.set(17);
}
if (struct.isSetEndDate()) {
optionals.set(18);
}
if (struct.isSetStatus()) {
optionals.set(19);
}
if (struct.isSetUsername()) {
optionals.set(20);
}
oprot.writeBitSet(optionals, 21);
if (struct.isSetProjectId()) {
oprot.writeString(struct.projectId);
}
if (struct.isSetApplicationsToBeUsed()) {
oprot.writeString(struct.applicationsToBeUsed);
}
if (struct.isSetDiskUsageRangePerJob()) {
oprot.writeI64(struct.diskUsageRangePerJob);
}
if (struct.isSetDocuments()) {
oprot.writeBinary(struct.documents);
}
if (struct.isSetFieldOfScience()) {
oprot.writeString(struct.fieldOfScience);
}
if (struct.isSetKeywords()) {
oprot.writeString(struct.keywords);
}
if (struct.isSetMaxMemoryPerCpu()) {
oprot.writeI64(struct.maxMemoryPerCpu);
}
if (struct.isSetNumberOfCpuPerJob()) {
oprot.writeI64(struct.numberOfCpuPerJob);
}
if (struct.isSetProjectDescription()) {
oprot.writeString(struct.projectDescription);
}
if (struct.isSetProjectReviewedAndFundedBy()) {
oprot.writeString(struct.projectReviewedAndFundedBy);
}
if (struct.isSetRequestedDate()) {
oprot.writeI64(struct.requestedDate);
}
if (struct.isSetServiceUnits()) {
oprot.writeI64(struct.serviceUnits);
}
if (struct.isSetSpecificResourceSelection()) {
oprot.writeString(struct.specificResourceSelection);
}
if (struct.isSetTitle()) {
oprot.writeString(struct.title);
}
if (struct.isSetTypeOfAllocation()) {
oprot.writeString(struct.typeOfAllocation);
}
if (struct.isSetTypicalSuPerJob()) {
oprot.writeI64(struct.typicalSuPerJob);
}
if (struct.isSetAwardAllocation()) {
oprot.writeI64(struct.awardAllocation);
}
if (struct.isSetStartDate()) {
oprot.writeI64(struct.startDate);
}
if (struct.isSetEndDate()) {
oprot.writeI64(struct.endDate);
}
if (struct.isSetStatus()) {
oprot.writeString(struct.status);
}
if (struct.isSetUsername()) {
oprot.writeString(struct.username);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UserAllocationDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(21);
if (incoming.get(0)) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
if (incoming.get(1)) {
struct.applicationsToBeUsed = iprot.readString();
struct.setApplicationsToBeUsedIsSet(true);
}
if (incoming.get(2)) {
struct.diskUsageRangePerJob = iprot.readI64();
struct.setDiskUsageRangePerJobIsSet(true);
}
if (incoming.get(3)) {
struct.documents = iprot.readBinary();
struct.setDocumentsIsSet(true);
}
if (incoming.get(4)) {
struct.fieldOfScience = iprot.readString();
struct.setFieldOfScienceIsSet(true);
}
if (incoming.get(5)) {
struct.keywords = iprot.readString();
struct.setKeywordsIsSet(true);
}
if (incoming.get(6)) {
struct.maxMemoryPerCpu = iprot.readI64();
struct.setMaxMemoryPerCpuIsSet(true);
}
if (incoming.get(7)) {
struct.numberOfCpuPerJob = iprot.readI64();
struct.setNumberOfCpuPerJobIsSet(true);
}
if (incoming.get(8)) {
struct.projectDescription = iprot.readString();
struct.setProjectDescriptionIsSet(true);
}
if (incoming.get(9)) {
struct.projectReviewedAndFundedBy = iprot.readString();
struct.setProjectReviewedAndFundedByIsSet(true);
}
if (incoming.get(10)) {
struct.requestedDate = iprot.readI64();
struct.setRequestedDateIsSet(true);
}
if (incoming.get(11)) {
struct.serviceUnits = iprot.readI64();
struct.setServiceUnitsIsSet(true);
}
if (incoming.get(12)) {
struct.specificResourceSelection = iprot.readString();
struct.setSpecificResourceSelectionIsSet(true);
}
if (incoming.get(13)) {
struct.title = iprot.readString();
struct.setTitleIsSet(true);
}
if (incoming.get(14)) {
struct.typeOfAllocation = iprot.readString();
struct.setTypeOfAllocationIsSet(true);
}
if (incoming.get(15)) {
struct.typicalSuPerJob = iprot.readI64();
struct.setTypicalSuPerJobIsSet(true);
}
if (incoming.get(16)) {
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
}
if (incoming.get(17)) {
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
}
if (incoming.get(18)) {
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
}
if (incoming.get(19)) {
struct.status = iprot.readString();
struct.setStatusIsSet(true);
}
if (incoming.get(20)) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| 9,065 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/models/AllocationManagerException.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.models;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
* <p>Exception model used in the allocation manager service</p>
*
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class AllocationManagerException extends org.apache.thrift.TException implements org.apache.thrift.TBase<AllocationManagerException, AllocationManagerException._Fields>, java.io.Serializable, Cloneable, Comparable<AllocationManagerException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AllocationManagerException");
private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AllocationManagerExceptionStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AllocationManagerExceptionTupleSchemeFactory();
public java.lang.String message; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
MESSAGE((short)1, "message");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // MESSAGE
return MESSAGE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AllocationManagerException.class, metaDataMap);
}
public AllocationManagerException() {
}
public AllocationManagerException(
java.lang.String message)
{
this();
this.message = message;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AllocationManagerException(AllocationManagerException other) {
if (other.isSetMessage()) {
this.message = other.message;
}
}
public AllocationManagerException deepCopy() {
return new AllocationManagerException(this);
}
@Override
public void clear() {
this.message = null;
}
public java.lang.String getMessage() {
return this.message;
}
public AllocationManagerException setMessage(java.lang.String message) {
this.message = message;
return this;
}
public void unsetMessage() {
this.message = null;
}
/** Returns true if field message is set (has been assigned a value) and false otherwise */
public boolean isSetMessage() {
return this.message != null;
}
public void setMessageIsSet(boolean value) {
if (!value) {
this.message = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case MESSAGE:
if (value == null) {
unsetMessage();
} else {
setMessage((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MESSAGE:
return getMessage();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case MESSAGE:
return isSetMessage();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof AllocationManagerException)
return this.equals((AllocationManagerException)that);
return false;
}
public boolean equals(AllocationManagerException that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_message = true && this.isSetMessage();
boolean that_present_message = true && that.isSetMessage();
if (this_present_message || that_present_message) {
if (!(this_present_message && that_present_message))
return false;
if (!this.message.equals(that.message))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287);
if (isSetMessage())
hashCode = hashCode * 8191 + message.hashCode();
return hashCode;
}
@Override
public int compareTo(AllocationManagerException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMessage()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("AllocationManagerException(");
boolean first = true;
sb.append("message:");
if (this.message == null) {
sb.append("null");
} else {
sb.append(this.message);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (message == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class AllocationManagerExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public AllocationManagerExceptionStandardScheme getScheme() {
return new AllocationManagerExceptionStandardScheme();
}
}
private static class AllocationManagerExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<AllocationManagerException> {
public void read(org.apache.thrift.protocol.TProtocol iprot, AllocationManagerException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // MESSAGE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.message = iprot.readString();
struct.setMessageIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, AllocationManagerException struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.message != null) {
oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
oprot.writeString(struct.message);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class AllocationManagerExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public AllocationManagerExceptionTupleScheme getScheme() {
return new AllocationManagerExceptionTupleScheme();
}
}
private static class AllocationManagerExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<AllocationManagerException> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, AllocationManagerException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.message);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, AllocationManagerException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.message = iprot.readString();
struct.setMessageIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| 9,066 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/models/UserDetail.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.models;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
* <p>A user should have an account with airavata to request an allocation</p>
* <li>username : Login Username</li>
* <li>email :Login email</li>
* <li>fullName: Full name of the user</li>
* <li>Password: Password of the user</li>
* <li>userType: Type of the user</li>
*
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class UserDetail implements org.apache.thrift.TBase<UserDetail, UserDetail._Fields>, java.io.Serializable, Cloneable, Comparable<UserDetail> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserDetail");
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField FULL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("fullName", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField USER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("userType", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UserDetailStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UserDetailTupleSchemeFactory();
public java.lang.String username; // optional
public java.lang.String email; // optional
public java.lang.String fullName; // optional
public java.lang.String password; // optional
public java.lang.String userType; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USERNAME((short)1, "username"),
EMAIL((short)2, "email"),
FULL_NAME((short)3, "fullName"),
PASSWORD((short)4, "password"),
USER_TYPE((short)5, "userType");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USERNAME
return USERNAME;
case 2: // EMAIL
return EMAIL;
case 3: // FULL_NAME
return FULL_NAME;
case 4: // PASSWORD
return PASSWORD;
case 5: // USER_TYPE
return USER_TYPE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.EMAIL,_Fields.FULL_NAME,_Fields.PASSWORD,_Fields.USER_TYPE};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FULL_NAME, new org.apache.thrift.meta_data.FieldMetaData("fullName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("userType", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserDetail.class, metaDataMap);
}
public UserDetail() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public UserDetail(UserDetail other) {
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetEmail()) {
this.email = other.email;
}
if (other.isSetFullName()) {
this.fullName = other.fullName;
}
if (other.isSetPassword()) {
this.password = other.password;
}
if (other.isSetUserType()) {
this.userType = other.userType;
}
}
public UserDetail deepCopy() {
return new UserDetail(this);
}
@Override
public void clear() {
this.username = null;
this.email = null;
this.fullName = null;
this.password = null;
this.userType = null;
}
public java.lang.String getUsername() {
return this.username;
}
public UserDetail setUsername(java.lang.String username) {
this.username = username;
return this;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public java.lang.String getEmail() {
return this.email;
}
public UserDetail setEmail(java.lang.String email) {
this.email = email;
return this;
}
public void unsetEmail() {
this.email = null;
}
/** Returns true if field email is set (has been assigned a value) and false otherwise */
public boolean isSetEmail() {
return this.email != null;
}
public void setEmailIsSet(boolean value) {
if (!value) {
this.email = null;
}
}
public java.lang.String getFullName() {
return this.fullName;
}
public UserDetail setFullName(java.lang.String fullName) {
this.fullName = fullName;
return this;
}
public void unsetFullName() {
this.fullName = null;
}
/** Returns true if field fullName is set (has been assigned a value) and false otherwise */
public boolean isSetFullName() {
return this.fullName != null;
}
public void setFullNameIsSet(boolean value) {
if (!value) {
this.fullName = null;
}
}
public java.lang.String getPassword() {
return this.password;
}
public UserDetail setPassword(java.lang.String password) {
this.password = password;
return this;
}
public void unsetPassword() {
this.password = null;
}
/** Returns true if field password is set (has been assigned a value) and false otherwise */
public boolean isSetPassword() {
return this.password != null;
}
public void setPasswordIsSet(boolean value) {
if (!value) {
this.password = null;
}
}
public java.lang.String getUserType() {
return this.userType;
}
public UserDetail setUserType(java.lang.String userType) {
this.userType = userType;
return this;
}
public void unsetUserType() {
this.userType = null;
}
/** Returns true if field userType is set (has been assigned a value) and false otherwise */
public boolean isSetUserType() {
return this.userType != null;
}
public void setUserTypeIsSet(boolean value) {
if (!value) {
this.userType = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((java.lang.String)value);
}
break;
case EMAIL:
if (value == null) {
unsetEmail();
} else {
setEmail((java.lang.String)value);
}
break;
case FULL_NAME:
if (value == null) {
unsetFullName();
} else {
setFullName((java.lang.String)value);
}
break;
case PASSWORD:
if (value == null) {
unsetPassword();
} else {
setPassword((java.lang.String)value);
}
break;
case USER_TYPE:
if (value == null) {
unsetUserType();
} else {
setUserType((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USERNAME:
return getUsername();
case EMAIL:
return getEmail();
case FULL_NAME:
return getFullName();
case PASSWORD:
return getPassword();
case USER_TYPE:
return getUserType();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USERNAME:
return isSetUsername();
case EMAIL:
return isSetEmail();
case FULL_NAME:
return isSetFullName();
case PASSWORD:
return isSetPassword();
case USER_TYPE:
return isSetUserType();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof UserDetail)
return this.equals((UserDetail)that);
return false;
}
public boolean equals(UserDetail that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_email = true && this.isSetEmail();
boolean that_present_email = true && that.isSetEmail();
if (this_present_email || that_present_email) {
if (!(this_present_email && that_present_email))
return false;
if (!this.email.equals(that.email))
return false;
}
boolean this_present_fullName = true && this.isSetFullName();
boolean that_present_fullName = true && that.isSetFullName();
if (this_present_fullName || that_present_fullName) {
if (!(this_present_fullName && that_present_fullName))
return false;
if (!this.fullName.equals(that.fullName))
return false;
}
boolean this_present_password = true && this.isSetPassword();
boolean that_present_password = true && that.isSetPassword();
if (this_present_password || that_present_password) {
if (!(this_present_password && that_present_password))
return false;
if (!this.password.equals(that.password))
return false;
}
boolean this_present_userType = true && this.isSetUserType();
boolean that_present_userType = true && that.isSetUserType();
if (this_present_userType || that_present_userType) {
if (!(this_present_userType && that_present_userType))
return false;
if (!this.userType.equals(that.userType))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
if (isSetUsername())
hashCode = hashCode * 8191 + username.hashCode();
hashCode = hashCode * 8191 + ((isSetEmail()) ? 131071 : 524287);
if (isSetEmail())
hashCode = hashCode * 8191 + email.hashCode();
hashCode = hashCode * 8191 + ((isSetFullName()) ? 131071 : 524287);
if (isSetFullName())
hashCode = hashCode * 8191 + fullName.hashCode();
hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287);
if (isSetPassword())
hashCode = hashCode * 8191 + password.hashCode();
hashCode = hashCode * 8191 + ((isSetUserType()) ? 131071 : 524287);
if (isSetUserType())
hashCode = hashCode * 8191 + userType.hashCode();
return hashCode;
}
@Override
public int compareTo(UserDetail other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetEmail()).compareTo(other.isSetEmail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEmail()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, other.email);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetFullName()).compareTo(other.isSetFullName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFullName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fullName, other.fullName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPassword()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetUserType()).compareTo(other.isSetUserType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userType, other.userType);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("UserDetail(");
boolean first = true;
if (isSetUsername()) {
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
}
if (isSetEmail()) {
if (!first) sb.append(", ");
sb.append("email:");
if (this.email == null) {
sb.append("null");
} else {
sb.append(this.email);
}
first = false;
}
if (isSetFullName()) {
if (!first) sb.append(", ");
sb.append("fullName:");
if (this.fullName == null) {
sb.append("null");
} else {
sb.append(this.fullName);
}
first = false;
}
if (isSetPassword()) {
if (!first) sb.append(", ");
sb.append("password:");
if (this.password == null) {
sb.append("null");
} else {
sb.append(this.password);
}
first = false;
}
if (isSetUserType()) {
if (!first) sb.append(", ");
sb.append("userType:");
if (this.userType == null) {
sb.append("null");
} else {
sb.append(this.userType);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class UserDetailStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UserDetailStandardScheme getScheme() {
return new UserDetailStandardScheme();
}
}
private static class UserDetailStandardScheme extends org.apache.thrift.scheme.StandardScheme<UserDetail> {
public void read(org.apache.thrift.protocol.TProtocol iprot, UserDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USERNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // EMAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.email = iprot.readString();
struct.setEmailIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // FULL_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.fullName = iprot.readString();
struct.setFullNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // PASSWORD
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.password = iprot.readString();
struct.setPasswordIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // USER_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userType = iprot.readString();
struct.setUserTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, UserDetail struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.username != null) {
if (struct.isSetUsername()) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(struct.username);
oprot.writeFieldEnd();
}
}
if (struct.email != null) {
if (struct.isSetEmail()) {
oprot.writeFieldBegin(EMAIL_FIELD_DESC);
oprot.writeString(struct.email);
oprot.writeFieldEnd();
}
}
if (struct.fullName != null) {
if (struct.isSetFullName()) {
oprot.writeFieldBegin(FULL_NAME_FIELD_DESC);
oprot.writeString(struct.fullName);
oprot.writeFieldEnd();
}
}
if (struct.password != null) {
if (struct.isSetPassword()) {
oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
oprot.writeString(struct.password);
oprot.writeFieldEnd();
}
}
if (struct.userType != null) {
if (struct.isSetUserType()) {
oprot.writeFieldBegin(USER_TYPE_FIELD_DESC);
oprot.writeString(struct.userType);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class UserDetailTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UserDetailTupleScheme getScheme() {
return new UserDetailTupleScheme();
}
}
private static class UserDetailTupleScheme extends org.apache.thrift.scheme.TupleScheme<UserDetail> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UserDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetUsername()) {
optionals.set(0);
}
if (struct.isSetEmail()) {
optionals.set(1);
}
if (struct.isSetFullName()) {
optionals.set(2);
}
if (struct.isSetPassword()) {
optionals.set(3);
}
if (struct.isSetUserType()) {
optionals.set(4);
}
oprot.writeBitSet(optionals, 5);
if (struct.isSetUsername()) {
oprot.writeString(struct.username);
}
if (struct.isSetEmail()) {
oprot.writeString(struct.email);
}
if (struct.isSetFullName()) {
oprot.writeString(struct.fullName);
}
if (struct.isSetPassword()) {
oprot.writeString(struct.password);
}
if (struct.isSetUserType()) {
oprot.writeString(struct.userType);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UserDetail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
}
if (incoming.get(1)) {
struct.email = iprot.readString();
struct.setEmailIsSet(true);
}
if (incoming.get(2)) {
struct.fullName = iprot.readString();
struct.setFullNameIsSet(true);
}
if (incoming.get(3)) {
struct.password = iprot.readString();
struct.setPasswordIsSet(true);
}
if (incoming.get(4)) {
struct.userType = iprot.readString();
struct.setUserTypeIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| 9,067 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/service | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/service/cpi/AllocationRegistryService.java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.airavata.allocation.manager.service.cpi;
import org.apache.airavata.allocation.manager.client.NotificationManager;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class AllocationRegistryService {
public interface Iface {
/**
* <p>API method to create new allocation requests</p>
*
* @param allocDetail
*/
public java.lang.String createAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException;
/**
* <p>API method to delete allocation request</p>
*
* @param projectId
*/
public boolean deleteAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to get an allocation Request</p>
*
* @param projectId
*/
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to update an allocation Request</p>
*
* @param allocDetail
*/
public boolean updateAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException;
/**
* <p>API method to get an allocation Request status</p>
*
* @param projectId
*/
public java.lang.String getAllocationRequestStatus(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to get an allocation Request PI email</p>
*
* @param userName
*/
public java.lang.String getAllocationRequestUserEmail(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to get an allocation Request Admin email</p>
*
* @param userType
*/
public java.lang.String getAllocationManagerAdminEmail(java.lang.String userType) throws org.apache.thrift.TException;
/**
* <p>API method to get an allocation Request PI</p>
*
* @param projectId
*/
public java.lang.String getAllocationRequestUserName(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to get all requests for admin</p>
*
* @param userName
*/
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getAllRequestsForAdmin(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to assign reviewers</p>
*
* @param projectId
* @param reviewerId
* @param adminId
*/
public boolean assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId) throws org.apache.thrift.TException;
/**
* <p>API method to update request submitted by reviewer</p>
*
* @param reviewerAllocationDetail
*/
public boolean updateRequestByReviewer(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail) throws org.apache.thrift.TException;
/**
* <p>API method to check if the logged in user is an Admin</p>
*
* @param userName
*/
public boolean isAdmin(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to check if the logged in user is a Reviewer</p>
*
* @param userName
*/
public boolean isReviewer(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to get all requests assigned to the reviewers</p>
*
* @param userName
*/
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getAllRequestsForReviewers(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to get a user details</p>
*
* @param userName
*/
public org.apache.airavata.allocation.manager.models.UserDetail getUserDetails(java.lang.String userName) throws org.apache.thrift.TException;
/**
* <p>API method to get all the reviews for a request</p>
*
* @param projectId
*/
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> getAllReviewsForARequest(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to get all reviewers</p>
*/
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getAllReviewers() throws org.apache.thrift.TException;
/**
* <p>API method to get all unassigned reviewers for a request</p>
*
* @param projectId
*/
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getAllUnassignedReviewersForRequest(java.lang.String projectId) throws org.apache.thrift.TException;
/**
* <p>API method to approve a request</p>
*
* @param projectId
* @param adminId
* @param startDate
* @param endDate
* @param awardAllocation
*/
public boolean approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation) throws org.apache.thrift.TException;
/**
* <p>API method to reject a request</p>
*
* @param projectId
* @param adminId
*/
public boolean rejectRequest(java.lang.String projectId, java.lang.String adminId) throws org.apache.thrift.TException;
/**
* <p>API method to create a new user</p>
*
* @param userDetail
*/
public boolean createUser(org.apache.airavata.allocation.manager.models.UserDetail userDetail) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void createAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
public void deleteAllocationRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void getAllocationRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail> resultHandler) throws org.apache.thrift.TException;
public void updateAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void getAllocationRequestStatus(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
public void getAllocationRequestUserEmail(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
public void getAllocationManagerAdminEmail(java.lang.String userType, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
public void getAllocationRequestUserName(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
public void getAllRequestsForAdmin(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException;
public void assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void updateRequestByReviewer(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void isAdmin(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void isReviewer(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void getAllRequestsForReviewers(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException;
public void getUserDetails(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail> resultHandler) throws org.apache.thrift.TException;
public void getAllReviewsForARequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> resultHandler) throws org.apache.thrift.TException;
public void getAllReviewers(org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException;
public void getAllUnassignedReviewersForRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException;
public void approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void rejectRequest(java.lang.String projectId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void createUser(org.apache.airavata.allocation.manager.models.UserDetail userDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public java.lang.String createAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException
{
send_createAllocationRequest(allocDetail);
return recv_createAllocationRequest();
}
public void send_createAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException
{
createAllocationRequest_args args = new createAllocationRequest_args();
args.setAllocDetail(allocDetail);
sendBase("createAllocationRequest", args);
}
public java.lang.String recv_createAllocationRequest() throws org.apache.thrift.TException
{
createAllocationRequest_result result = new createAllocationRequest_result();
receiveBase(result, "createAllocationRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createAllocationRequest failed: unknown result");
}
public boolean deleteAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
send_deleteAllocationRequest(projectId);
return recv_deleteAllocationRequest();
}
public void send_deleteAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
deleteAllocationRequest_args args = new deleteAllocationRequest_args();
args.setProjectId(projectId);
sendBase("deleteAllocationRequest", args);
}
public boolean recv_deleteAllocationRequest() throws org.apache.thrift.TException
{
deleteAllocationRequest_result result = new deleteAllocationRequest_result();
receiveBase(result, "deleteAllocationRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteAllocationRequest failed: unknown result");
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
send_getAllocationRequest(projectId);
return recv_getAllocationRequest();
}
public void send_getAllocationRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
getAllocationRequest_args args = new getAllocationRequest_args();
args.setProjectId(projectId);
sendBase("getAllocationRequest", args);
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail recv_getAllocationRequest() throws org.apache.thrift.TException
{
getAllocationRequest_result result = new getAllocationRequest_result();
receiveBase(result, "getAllocationRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllocationRequest failed: unknown result");
}
public boolean updateAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException
{
send_updateAllocationRequest(allocDetail);
return recv_updateAllocationRequest();
}
public void send_updateAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) throws org.apache.thrift.TException
{
updateAllocationRequest_args args = new updateAllocationRequest_args();
args.setAllocDetail(allocDetail);
sendBase("updateAllocationRequest", args);
}
public boolean recv_updateAllocationRequest() throws org.apache.thrift.TException
{
updateAllocationRequest_result result = new updateAllocationRequest_result();
receiveBase(result, "updateAllocationRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateAllocationRequest failed: unknown result");
}
public java.lang.String getAllocationRequestStatus(java.lang.String projectId) throws org.apache.thrift.TException
{
send_getAllocationRequestStatus(projectId);
return recv_getAllocationRequestStatus();
}
public void send_getAllocationRequestStatus(java.lang.String projectId) throws org.apache.thrift.TException
{
getAllocationRequestStatus_args args = new getAllocationRequestStatus_args();
args.setProjectId(projectId);
sendBase("getAllocationRequestStatus", args);
}
public java.lang.String recv_getAllocationRequestStatus() throws org.apache.thrift.TException
{
getAllocationRequestStatus_result result = new getAllocationRequestStatus_result();
receiveBase(result, "getAllocationRequestStatus");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllocationRequestStatus failed: unknown result");
}
public java.lang.String getAllocationRequestUserEmail(java.lang.String userName) throws org.apache.thrift.TException
{
send_getAllocationRequestUserEmail(userName);
return recv_getAllocationRequestUserEmail();
}
public void send_getAllocationRequestUserEmail(java.lang.String userName) throws org.apache.thrift.TException
{
getAllocationRequestUserEmail_args args = new getAllocationRequestUserEmail_args();
args.setUserName(userName);
sendBase("getAllocationRequestUserEmail", args);
}
public java.lang.String recv_getAllocationRequestUserEmail() throws org.apache.thrift.TException
{
getAllocationRequestUserEmail_result result = new getAllocationRequestUserEmail_result();
receiveBase(result, "getAllocationRequestUserEmail");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllocationRequestUserEmail failed: unknown result");
}
public java.lang.String getAllocationManagerAdminEmail(java.lang.String userType) throws org.apache.thrift.TException
{
send_getAllocationManagerAdminEmail(userType);
return recv_getAllocationManagerAdminEmail();
}
public void send_getAllocationManagerAdminEmail(java.lang.String userType) throws org.apache.thrift.TException
{
getAllocationManagerAdminEmail_args args = new getAllocationManagerAdminEmail_args();
args.setUserType(userType);
sendBase("getAllocationManagerAdminEmail", args);
}
public java.lang.String recv_getAllocationManagerAdminEmail() throws org.apache.thrift.TException
{
getAllocationManagerAdminEmail_result result = new getAllocationManagerAdminEmail_result();
receiveBase(result, "getAllocationManagerAdminEmail");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllocationManagerAdminEmail failed: unknown result");
}
public java.lang.String getAllocationRequestUserName(java.lang.String projectId) throws org.apache.thrift.TException
{
send_getAllocationRequestUserName(projectId);
return recv_getAllocationRequestUserName();
}
public void send_getAllocationRequestUserName(java.lang.String projectId) throws org.apache.thrift.TException
{
getAllocationRequestUserName_args args = new getAllocationRequestUserName_args();
args.setProjectId(projectId);
sendBase("getAllocationRequestUserName", args);
}
public java.lang.String recv_getAllocationRequestUserName() throws org.apache.thrift.TException
{
getAllocationRequestUserName_result result = new getAllocationRequestUserName_result();
receiveBase(result, "getAllocationRequestUserName");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllocationRequestUserName failed: unknown result");
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getAllRequestsForAdmin(java.lang.String userName) throws org.apache.thrift.TException
{
send_getAllRequestsForAdmin(userName);
return recv_getAllRequestsForAdmin();
}
public void send_getAllRequestsForAdmin(java.lang.String userName) throws org.apache.thrift.TException
{
getAllRequestsForAdmin_args args = new getAllRequestsForAdmin_args();
args.setUserName(userName);
sendBase("getAllRequestsForAdmin", args);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> recv_getAllRequestsForAdmin() throws org.apache.thrift.TException
{
getAllRequestsForAdmin_result result = new getAllRequestsForAdmin_result();
receiveBase(result, "getAllRequestsForAdmin");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllRequestsForAdmin failed: unknown result");
}
public boolean assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId) throws org.apache.thrift.TException
{
send_assignReviewers(projectId, reviewerId, adminId);
(new NotificationManager()).notificationSender(projectId, "ASSIGN_REQUEST");
return recv_assignReviewers();
}
public void send_assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId) throws org.apache.thrift.TException
{
assignReviewers_args args = new assignReviewers_args();
args.setProjectId(projectId);
args.setReviewerId(reviewerId);
args.setAdminId(adminId);
sendBase("assignReviewers", args);
}
public boolean recv_assignReviewers() throws org.apache.thrift.TException
{
assignReviewers_result result = new assignReviewers_result();
receiveBase(result, "assignReviewers");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignReviewers failed: unknown result");
}
public boolean updateRequestByReviewer(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail) throws org.apache.thrift.TException
{
send_updateRequestByReviewer(reviewerAllocationDetail);
return recv_updateRequestByReviewer();
}
public void send_updateRequestByReviewer(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail) throws org.apache.thrift.TException
{
updateRequestByReviewer_args args = new updateRequestByReviewer_args();
args.setReviewerAllocationDetail(reviewerAllocationDetail);
sendBase("updateRequestByReviewer", args);
}
public boolean recv_updateRequestByReviewer() throws org.apache.thrift.TException
{
updateRequestByReviewer_result result = new updateRequestByReviewer_result();
receiveBase(result, "updateRequestByReviewer");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateRequestByReviewer failed: unknown result");
}
public boolean isAdmin(java.lang.String userName) throws org.apache.thrift.TException
{
send_isAdmin(userName);
return recv_isAdmin();
}
public void send_isAdmin(java.lang.String userName) throws org.apache.thrift.TException
{
isAdmin_args args = new isAdmin_args();
args.setUserName(userName);
sendBase("isAdmin", args);
}
public boolean recv_isAdmin() throws org.apache.thrift.TException
{
isAdmin_result result = new isAdmin_result();
receiveBase(result, "isAdmin");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isAdmin failed: unknown result");
}
public boolean isReviewer(java.lang.String userName) throws org.apache.thrift.TException
{
send_isReviewer(userName);
return recv_isReviewer();
}
public void send_isReviewer(java.lang.String userName) throws org.apache.thrift.TException
{
isReviewer_args args = new isReviewer_args();
args.setUserName(userName);
sendBase("isReviewer", args);
}
public boolean recv_isReviewer() throws org.apache.thrift.TException
{
isReviewer_result result = new isReviewer_result();
receiveBase(result, "isReviewer");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isReviewer failed: unknown result");
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getAllRequestsForReviewers(java.lang.String userName) throws org.apache.thrift.TException
{
send_getAllRequestsForReviewers(userName);
return recv_getAllRequestsForReviewers();
}
public void send_getAllRequestsForReviewers(java.lang.String userName) throws org.apache.thrift.TException
{
getAllRequestsForReviewers_args args = new getAllRequestsForReviewers_args();
args.setUserName(userName);
sendBase("getAllRequestsForReviewers", args);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> recv_getAllRequestsForReviewers() throws org.apache.thrift.TException
{
getAllRequestsForReviewers_result result = new getAllRequestsForReviewers_result();
receiveBase(result, "getAllRequestsForReviewers");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllRequestsForReviewers failed: unknown result");
}
public org.apache.airavata.allocation.manager.models.UserDetail getUserDetails(java.lang.String userName) throws org.apache.thrift.TException
{
send_getUserDetails(userName);
return recv_getUserDetails();
}
public void send_getUserDetails(java.lang.String userName) throws org.apache.thrift.TException
{
getUserDetails_args args = new getUserDetails_args();
args.setUserName(userName);
sendBase("getUserDetails", args);
}
public org.apache.airavata.allocation.manager.models.UserDetail recv_getUserDetails() throws org.apache.thrift.TException
{
getUserDetails_result result = new getUserDetails_result();
receiveBase(result, "getUserDetails");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserDetails failed: unknown result");
}
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> getAllReviewsForARequest(java.lang.String projectId) throws org.apache.thrift.TException
{
send_getAllReviewsForARequest(projectId);
return recv_getAllReviewsForARequest();
}
public void send_getAllReviewsForARequest(java.lang.String projectId) throws org.apache.thrift.TException
{
getAllReviewsForARequest_args args = new getAllReviewsForARequest_args();
args.setProjectId(projectId);
sendBase("getAllReviewsForARequest", args);
}
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> recv_getAllReviewsForARequest() throws org.apache.thrift.TException
{
getAllReviewsForARequest_result result = new getAllReviewsForARequest_result();
receiveBase(result, "getAllReviewsForARequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllReviewsForARequest failed: unknown result");
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getAllReviewers() throws org.apache.thrift.TException
{
send_getAllReviewers();
return recv_getAllReviewers();
}
public void send_getAllReviewers() throws org.apache.thrift.TException
{
getAllReviewers_args args = new getAllReviewers_args();
sendBase("getAllReviewers", args);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> recv_getAllReviewers() throws org.apache.thrift.TException
{
getAllReviewers_result result = new getAllReviewers_result();
receiveBase(result, "getAllReviewers");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllReviewers failed: unknown result");
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getAllUnassignedReviewersForRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
send_getAllUnassignedReviewersForRequest(projectId);
return recv_getAllUnassignedReviewersForRequest();
}
public void send_getAllUnassignedReviewersForRequest(java.lang.String projectId) throws org.apache.thrift.TException
{
getAllUnassignedReviewersForRequest_args args = new getAllUnassignedReviewersForRequest_args();
args.setProjectId(projectId);
sendBase("getAllUnassignedReviewersForRequest", args);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> recv_getAllUnassignedReviewersForRequest() throws org.apache.thrift.TException
{
getAllUnassignedReviewersForRequest_result result = new getAllUnassignedReviewersForRequest_result();
receiveBase(result, "getAllUnassignedReviewersForRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUnassignedReviewersForRequest failed: unknown result");
}
public boolean approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation) throws org.apache.thrift.TException
{
send_approveRequest(projectId, adminId, startDate, endDate, awardAllocation);
(new NotificationManager()).notificationSender(projectId, "APPROVE_REQUEST");
return recv_approveRequest();
}
public void send_approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation) throws org.apache.thrift.TException
{
approveRequest_args args = new approveRequest_args();
args.setProjectId(projectId);
args.setAdminId(adminId);
args.setStartDate(startDate);
args.setEndDate(endDate);
args.setAwardAllocation(awardAllocation);
sendBase("approveRequest", args);
}
public boolean recv_approveRequest() throws org.apache.thrift.TException
{
approveRequest_result result = new approveRequest_result();
receiveBase(result, "approveRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "approveRequest failed: unknown result");
}
public boolean rejectRequest(java.lang.String projectId, java.lang.String adminId) throws org.apache.thrift.TException
{
send_rejectRequest(projectId, adminId);
(new NotificationManager()).notificationSender(projectId, "DENY_REQUEST");
return recv_rejectRequest();
}
public void send_rejectRequest(java.lang.String projectId, java.lang.String adminId) throws org.apache.thrift.TException
{
rejectRequest_args args = new rejectRequest_args();
args.setProjectId(projectId);
args.setAdminId(adminId);
sendBase("rejectRequest", args);
}
public boolean recv_rejectRequest() throws org.apache.thrift.TException
{
rejectRequest_result result = new rejectRequest_result();
receiveBase(result, "rejectRequest");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "rejectRequest failed: unknown result");
}
public boolean createUser(org.apache.airavata.allocation.manager.models.UserDetail userDetail) throws org.apache.thrift.TException
{
send_createUser(userDetail);
return recv_createUser();
}
public void send_createUser(org.apache.airavata.allocation.manager.models.UserDetail userDetail) throws org.apache.thrift.TException
{
createUser_args args = new createUser_args();
args.setUserDetail(userDetail);
sendBase("createUser", args);
}
public boolean recv_createUser() throws org.apache.thrift.TException
{
createUser_result result = new createUser_result();
receiveBase(result, "createUser");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createUser failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void createAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
createAllocationRequest_call method_call = new createAllocationRequest_call(allocDetail, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class createAllocationRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail;
public createAllocationRequest_call(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.allocDetail = allocDetail;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createAllocationRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
createAllocationRequest_args args = new createAllocationRequest_args();
args.setAllocDetail(allocDetail);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_createAllocationRequest();
}
}
public void deleteAllocationRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
deleteAllocationRequest_call method_call = new deleteAllocationRequest_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class deleteAllocationRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String projectId;
public deleteAllocationRequest_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteAllocationRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
deleteAllocationRequest_args args = new deleteAllocationRequest_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_deleteAllocationRequest();
}
}
public void getAllocationRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllocationRequest_call method_call = new getAllocationRequest_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllocationRequest_call extends org.apache.thrift.async.TAsyncMethodCall<org.apache.airavata.allocation.manager.models.UserAllocationDetail> {
private java.lang.String projectId;
public getAllocationRequest_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllocationRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllocationRequest_args args = new getAllocationRequest_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllocationRequest();
}
}
public void updateAllocationRequest(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
updateAllocationRequest_call method_call = new updateAllocationRequest_call(allocDetail, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class updateAllocationRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail;
public updateAllocationRequest_call(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.allocDetail = allocDetail;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateAllocationRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
updateAllocationRequest_args args = new updateAllocationRequest_args();
args.setAllocDetail(allocDetail);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_updateAllocationRequest();
}
}
public void getAllocationRequestStatus(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllocationRequestStatus_call method_call = new getAllocationRequestStatus_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllocationRequestStatus_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private java.lang.String projectId;
public getAllocationRequestStatus_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllocationRequestStatus", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllocationRequestStatus_args args = new getAllocationRequestStatus_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllocationRequestStatus();
}
}
public void getAllocationRequestUserEmail(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllocationRequestUserEmail_call method_call = new getAllocationRequestUserEmail_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllocationRequestUserEmail_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private java.lang.String userName;
public getAllocationRequestUserEmail_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllocationRequestUserEmail", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllocationRequestUserEmail_args args = new getAllocationRequestUserEmail_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllocationRequestUserEmail();
}
}
public void getAllocationManagerAdminEmail(java.lang.String userType, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllocationManagerAdminEmail_call method_call = new getAllocationManagerAdminEmail_call(userType, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllocationManagerAdminEmail_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private java.lang.String userType;
public getAllocationManagerAdminEmail_call(java.lang.String userType, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userType = userType;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllocationManagerAdminEmail", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllocationManagerAdminEmail_args args = new getAllocationManagerAdminEmail_args();
args.setUserType(userType);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllocationManagerAdminEmail();
}
}
public void getAllocationRequestUserName(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllocationRequestUserName_call method_call = new getAllocationRequestUserName_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllocationRequestUserName_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private java.lang.String projectId;
public getAllocationRequestUserName_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllocationRequestUserName", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllocationRequestUserName_args args = new getAllocationRequestUserName_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllocationRequestUserName();
}
}
public void getAllRequestsForAdmin(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllRequestsForAdmin_call method_call = new getAllRequestsForAdmin_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllRequestsForAdmin_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> {
private java.lang.String userName;
public getAllRequestsForAdmin_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllRequestsForAdmin", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllRequestsForAdmin_args args = new getAllRequestsForAdmin_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllRequestsForAdmin();
}
}
public void assignReviewers(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
assignReviewers_call method_call = new assignReviewers_call(projectId, reviewerId, adminId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class assignReviewers_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String projectId;
private java.lang.String reviewerId;
private java.lang.String adminId;
public assignReviewers_call(java.lang.String projectId, java.lang.String reviewerId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
this.reviewerId = reviewerId;
this.adminId = adminId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignReviewers", org.apache.thrift.protocol.TMessageType.CALL, 0));
assignReviewers_args args = new assignReviewers_args();
args.setProjectId(projectId);
args.setReviewerId(reviewerId);
args.setAdminId(adminId);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_assignReviewers();
}
}
public void updateRequestByReviewer(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
updateRequestByReviewer_call method_call = new updateRequestByReviewer_call(reviewerAllocationDetail, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class updateRequestByReviewer_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail;
public updateRequestByReviewer_call(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.reviewerAllocationDetail = reviewerAllocationDetail;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateRequestByReviewer", org.apache.thrift.protocol.TMessageType.CALL, 0));
updateRequestByReviewer_args args = new updateRequestByReviewer_args();
args.setReviewerAllocationDetail(reviewerAllocationDetail);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_updateRequestByReviewer();
}
}
public void isAdmin(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
isAdmin_call method_call = new isAdmin_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class isAdmin_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String userName;
public isAdmin_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isAdmin", org.apache.thrift.protocol.TMessageType.CALL, 0));
isAdmin_args args = new isAdmin_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_isAdmin();
}
}
public void isReviewer(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
isReviewer_call method_call = new isReviewer_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class isReviewer_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String userName;
public isReviewer_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isReviewer", org.apache.thrift.protocol.TMessageType.CALL, 0));
isReviewer_args args = new isReviewer_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_isReviewer();
}
}
public void getAllRequestsForReviewers(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllRequestsForReviewers_call method_call = new getAllRequestsForReviewers_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllRequestsForReviewers_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> {
private java.lang.String userName;
public getAllRequestsForReviewers_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllRequestsForReviewers", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllRequestsForReviewers_args args = new getAllRequestsForReviewers_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllRequestsForReviewers();
}
}
public void getUserDetails(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail> resultHandler) throws org.apache.thrift.TException {
checkReady();
getUserDetails_call method_call = new getUserDetails_call(userName, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getUserDetails_call extends org.apache.thrift.async.TAsyncMethodCall<org.apache.airavata.allocation.manager.models.UserDetail> {
private java.lang.String userName;
public getUserDetails_call(java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userName = userName;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserDetails", org.apache.thrift.protocol.TMessageType.CALL, 0));
getUserDetails_args args = new getUserDetails_args();
args.setUserName(userName);
args.write(prot);
prot.writeMessageEnd();
}
public org.apache.airavata.allocation.manager.models.UserDetail getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getUserDetails();
}
}
public void getAllReviewsForARequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllReviewsForARequest_call method_call = new getAllReviewsForARequest_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllReviewsForARequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> {
private java.lang.String projectId;
public getAllReviewsForARequest_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllReviewsForARequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllReviewsForARequest_args args = new getAllReviewsForARequest_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllReviewsForARequest();
}
}
public void getAllReviewers(org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllReviewers_call method_call = new getAllReviewers_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllReviewers_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> {
public getAllReviewers_call(org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllReviewers", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllReviewers_args args = new getAllReviewers_args();
args.write(prot);
prot.writeMessageEnd();
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllReviewers();
}
}
public void getAllUnassignedReviewersForRequest(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllUnassignedReviewersForRequest_call method_call = new getAllUnassignedReviewersForRequest_call(projectId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getAllUnassignedReviewersForRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> {
private java.lang.String projectId;
public getAllUnassignedReviewersForRequest_call(java.lang.String projectId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUnassignedReviewersForRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
getAllUnassignedReviewersForRequest_args args = new getAllUnassignedReviewersForRequest_args();
args.setProjectId(projectId);
args.write(prot);
prot.writeMessageEnd();
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getAllUnassignedReviewersForRequest();
}
}
public void approveRequest(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
approveRequest_call method_call = new approveRequest_call(projectId, adminId, startDate, endDate, awardAllocation, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class approveRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String projectId;
private java.lang.String adminId;
private long startDate;
private long endDate;
private long awardAllocation;
public approveRequest_call(java.lang.String projectId, java.lang.String adminId, long startDate, long endDate, long awardAllocation, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
this.adminId = adminId;
this.startDate = startDate;
this.endDate = endDate;
this.awardAllocation = awardAllocation;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("approveRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
approveRequest_args args = new approveRequest_args();
args.setProjectId(projectId);
args.setAdminId(adminId);
args.setStartDate(startDate);
args.setEndDate(endDate);
args.setAwardAllocation(awardAllocation);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_approveRequest();
}
}
public void rejectRequest(java.lang.String projectId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
rejectRequest_call method_call = new rejectRequest_call(projectId, adminId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class rejectRequest_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private java.lang.String projectId;
private java.lang.String adminId;
public rejectRequest_call(java.lang.String projectId, java.lang.String adminId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.projectId = projectId;
this.adminId = adminId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rejectRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
rejectRequest_args args = new rejectRequest_args();
args.setProjectId(projectId);
args.setAdminId(adminId);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_rejectRequest();
}
}
public void createUser(org.apache.airavata.allocation.manager.models.UserDetail userDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
createUser_call method_call = new createUser_call(userDetail, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class createUser_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private org.apache.airavata.allocation.manager.models.UserDetail userDetail;
public createUser_call(org.apache.airavata.allocation.manager.models.UserDetail userDetail, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.userDetail = userDetail;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
createUser_args args = new createUser_args();
args.setUserDetail(userDetail);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_createUser();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new java.util.HashMap<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("createAllocationRequest", new createAllocationRequest());
processMap.put("deleteAllocationRequest", new deleteAllocationRequest());
processMap.put("getAllocationRequest", new getAllocationRequest());
processMap.put("updateAllocationRequest", new updateAllocationRequest());
processMap.put("getAllocationRequestStatus", new getAllocationRequestStatus());
processMap.put("getAllocationRequestUserEmail", new getAllocationRequestUserEmail());
processMap.put("getAllocationManagerAdminEmail", new getAllocationManagerAdminEmail());
processMap.put("getAllocationRequestUserName", new getAllocationRequestUserName());
processMap.put("getAllRequestsForAdmin", new getAllRequestsForAdmin());
processMap.put("assignReviewers", new assignReviewers());
processMap.put("updateRequestByReviewer", new updateRequestByReviewer());
processMap.put("isAdmin", new isAdmin());
processMap.put("isReviewer", new isReviewer());
processMap.put("getAllRequestsForReviewers", new getAllRequestsForReviewers());
processMap.put("getUserDetails", new getUserDetails());
processMap.put("getAllReviewsForARequest", new getAllReviewsForARequest());
processMap.put("getAllReviewers", new getAllReviewers());
processMap.put("getAllUnassignedReviewersForRequest", new getAllUnassignedReviewersForRequest());
processMap.put("approveRequest", new approveRequest());
processMap.put("rejectRequest", new rejectRequest());
processMap.put("createUser", new createUser());
return processMap;
}
public static class createAllocationRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createAllocationRequest_args> {
public createAllocationRequest() {
super("createAllocationRequest");
}
public createAllocationRequest_args getEmptyArgsInstance() {
return new createAllocationRequest_args();
}
protected boolean isOneway() {
return false;
}
public createAllocationRequest_result getResult(I iface, createAllocationRequest_args args) throws org.apache.thrift.TException {
createAllocationRequest_result result = new createAllocationRequest_result();
result.success = iface.createAllocationRequest(args.allocDetail);
return result;
}
}
public static class deleteAllocationRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteAllocationRequest_args> {
public deleteAllocationRequest() {
super("deleteAllocationRequest");
}
public deleteAllocationRequest_args getEmptyArgsInstance() {
return new deleteAllocationRequest_args();
}
protected boolean isOneway() {
return false;
}
public deleteAllocationRequest_result getResult(I iface, deleteAllocationRequest_args args) throws org.apache.thrift.TException {
deleteAllocationRequest_result result = new deleteAllocationRequest_result();
result.success = iface.deleteAllocationRequest(args.projectId);
result.setSuccessIsSet(true);
return result;
}
}
public static class getAllocationRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllocationRequest_args> {
public getAllocationRequest() {
super("getAllocationRequest");
}
public getAllocationRequest_args getEmptyArgsInstance() {
return new getAllocationRequest_args();
}
protected boolean isOneway() {
return false;
}
public getAllocationRequest_result getResult(I iface, getAllocationRequest_args args) throws org.apache.thrift.TException {
getAllocationRequest_result result = new getAllocationRequest_result();
result.success = iface.getAllocationRequest(args.projectId);
return result;
}
}
public static class updateAllocationRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateAllocationRequest_args> {
public updateAllocationRequest() {
super("updateAllocationRequest");
}
public updateAllocationRequest_args getEmptyArgsInstance() {
return new updateAllocationRequest_args();
}
protected boolean isOneway() {
return false;
}
public updateAllocationRequest_result getResult(I iface, updateAllocationRequest_args args) throws org.apache.thrift.TException {
updateAllocationRequest_result result = new updateAllocationRequest_result();
result.success = iface.updateAllocationRequest(args.allocDetail);
result.setSuccessIsSet(true);
return result;
}
}
public static class getAllocationRequestStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllocationRequestStatus_args> {
public getAllocationRequestStatus() {
super("getAllocationRequestStatus");
}
public getAllocationRequestStatus_args getEmptyArgsInstance() {
return new getAllocationRequestStatus_args();
}
protected boolean isOneway() {
return false;
}
public getAllocationRequestStatus_result getResult(I iface, getAllocationRequestStatus_args args) throws org.apache.thrift.TException {
getAllocationRequestStatus_result result = new getAllocationRequestStatus_result();
result.success = iface.getAllocationRequestStatus(args.projectId);
return result;
}
}
public static class getAllocationRequestUserEmail<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllocationRequestUserEmail_args> {
public getAllocationRequestUserEmail() {
super("getAllocationRequestUserEmail");
}
public getAllocationRequestUserEmail_args getEmptyArgsInstance() {
return new getAllocationRequestUserEmail_args();
}
protected boolean isOneway() {
return false;
}
public getAllocationRequestUserEmail_result getResult(I iface, getAllocationRequestUserEmail_args args) throws org.apache.thrift.TException {
getAllocationRequestUserEmail_result result = new getAllocationRequestUserEmail_result();
result.success = iface.getAllocationRequestUserEmail(args.userName);
return result;
}
}
public static class getAllocationManagerAdminEmail<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllocationManagerAdminEmail_args> {
public getAllocationManagerAdminEmail() {
super("getAllocationManagerAdminEmail");
}
public getAllocationManagerAdminEmail_args getEmptyArgsInstance() {
return new getAllocationManagerAdminEmail_args();
}
protected boolean isOneway() {
return false;
}
public getAllocationManagerAdminEmail_result getResult(I iface, getAllocationManagerAdminEmail_args args) throws org.apache.thrift.TException {
getAllocationManagerAdminEmail_result result = new getAllocationManagerAdminEmail_result();
result.success = iface.getAllocationManagerAdminEmail(args.userType);
return result;
}
}
public static class getAllocationRequestUserName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllocationRequestUserName_args> {
public getAllocationRequestUserName() {
super("getAllocationRequestUserName");
}
public getAllocationRequestUserName_args getEmptyArgsInstance() {
return new getAllocationRequestUserName_args();
}
protected boolean isOneway() {
return false;
}
public getAllocationRequestUserName_result getResult(I iface, getAllocationRequestUserName_args args) throws org.apache.thrift.TException {
getAllocationRequestUserName_result result = new getAllocationRequestUserName_result();
result.success = iface.getAllocationRequestUserName(args.projectId);
return result;
}
}
public static class getAllRequestsForAdmin<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllRequestsForAdmin_args> {
public getAllRequestsForAdmin() {
super("getAllRequestsForAdmin");
}
public getAllRequestsForAdmin_args getEmptyArgsInstance() {
return new getAllRequestsForAdmin_args();
}
protected boolean isOneway() {
return false;
}
public getAllRequestsForAdmin_result getResult(I iface, getAllRequestsForAdmin_args args) throws org.apache.thrift.TException {
getAllRequestsForAdmin_result result = new getAllRequestsForAdmin_result();
result.success = iface.getAllRequestsForAdmin(args.userName);
return result;
}
}
public static class assignReviewers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignReviewers_args> {
public assignReviewers() {
super("assignReviewers");
}
public assignReviewers_args getEmptyArgsInstance() {
return new assignReviewers_args();
}
protected boolean isOneway() {
return false;
}
public assignReviewers_result getResult(I iface, assignReviewers_args args) throws org.apache.thrift.TException {
assignReviewers_result result = new assignReviewers_result();
result.success = iface.assignReviewers(args.projectId, args.reviewerId, args.adminId);
result.setSuccessIsSet(true);
return result;
}
}
public static class updateRequestByReviewer<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateRequestByReviewer_args> {
public updateRequestByReviewer() {
super("updateRequestByReviewer");
}
public updateRequestByReviewer_args getEmptyArgsInstance() {
return new updateRequestByReviewer_args();
}
protected boolean isOneway() {
return false;
}
public updateRequestByReviewer_result getResult(I iface, updateRequestByReviewer_args args) throws org.apache.thrift.TException {
updateRequestByReviewer_result result = new updateRequestByReviewer_result();
result.success = iface.updateRequestByReviewer(args.reviewerAllocationDetail);
result.setSuccessIsSet(true);
return result;
}
}
public static class isAdmin<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isAdmin_args> {
public isAdmin() {
super("isAdmin");
}
public isAdmin_args getEmptyArgsInstance() {
return new isAdmin_args();
}
protected boolean isOneway() {
return false;
}
public isAdmin_result getResult(I iface, isAdmin_args args) throws org.apache.thrift.TException {
isAdmin_result result = new isAdmin_result();
result.success = iface.isAdmin(args.userName);
result.setSuccessIsSet(true);
return result;
}
}
public static class isReviewer<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isReviewer_args> {
public isReviewer() {
super("isReviewer");
}
public isReviewer_args getEmptyArgsInstance() {
return new isReviewer_args();
}
protected boolean isOneway() {
return false;
}
public isReviewer_result getResult(I iface, isReviewer_args args) throws org.apache.thrift.TException {
isReviewer_result result = new isReviewer_result();
result.success = iface.isReviewer(args.userName);
result.setSuccessIsSet(true);
return result;
}
}
public static class getAllRequestsForReviewers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllRequestsForReviewers_args> {
public getAllRequestsForReviewers() {
super("getAllRequestsForReviewers");
}
public getAllRequestsForReviewers_args getEmptyArgsInstance() {
return new getAllRequestsForReviewers_args();
}
protected boolean isOneway() {
return false;
}
public getAllRequestsForReviewers_result getResult(I iface, getAllRequestsForReviewers_args args) throws org.apache.thrift.TException {
getAllRequestsForReviewers_result result = new getAllRequestsForReviewers_result();
result.success = iface.getAllRequestsForReviewers(args.userName);
return result;
}
}
public static class getUserDetails<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserDetails_args> {
public getUserDetails() {
super("getUserDetails");
}
public getUserDetails_args getEmptyArgsInstance() {
return new getUserDetails_args();
}
protected boolean isOneway() {
return false;
}
public getUserDetails_result getResult(I iface, getUserDetails_args args) throws org.apache.thrift.TException {
getUserDetails_result result = new getUserDetails_result();
result.success = iface.getUserDetails(args.userName);
return result;
}
}
public static class getAllReviewsForARequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllReviewsForARequest_args> {
public getAllReviewsForARequest() {
super("getAllReviewsForARequest");
}
public getAllReviewsForARequest_args getEmptyArgsInstance() {
return new getAllReviewsForARequest_args();
}
protected boolean isOneway() {
return false;
}
public getAllReviewsForARequest_result getResult(I iface, getAllReviewsForARequest_args args) throws org.apache.thrift.TException {
getAllReviewsForARequest_result result = new getAllReviewsForARequest_result();
result.success = iface.getAllReviewsForARequest(args.projectId);
return result;
}
}
public static class getAllReviewers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllReviewers_args> {
public getAllReviewers() {
super("getAllReviewers");
}
public getAllReviewers_args getEmptyArgsInstance() {
return new getAllReviewers_args();
}
protected boolean isOneway() {
return false;
}
public getAllReviewers_result getResult(I iface, getAllReviewers_args args) throws org.apache.thrift.TException {
getAllReviewers_result result = new getAllReviewers_result();
result.success = iface.getAllReviewers();
return result;
}
}
public static class getAllUnassignedReviewersForRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllUnassignedReviewersForRequest_args> {
public getAllUnassignedReviewersForRequest() {
super("getAllUnassignedReviewersForRequest");
}
public getAllUnassignedReviewersForRequest_args getEmptyArgsInstance() {
return new getAllUnassignedReviewersForRequest_args();
}
protected boolean isOneway() {
return false;
}
public getAllUnassignedReviewersForRequest_result getResult(I iface, getAllUnassignedReviewersForRequest_args args) throws org.apache.thrift.TException {
getAllUnassignedReviewersForRequest_result result = new getAllUnassignedReviewersForRequest_result();
result.success = iface.getAllUnassignedReviewersForRequest(args.projectId);
return result;
}
}
public static class approveRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, approveRequest_args> {
public approveRequest() {
super("approveRequest");
}
public approveRequest_args getEmptyArgsInstance() {
return new approveRequest_args();
}
protected boolean isOneway() {
return false;
}
public approveRequest_result getResult(I iface, approveRequest_args args) throws org.apache.thrift.TException {
approveRequest_result result = new approveRequest_result();
result.success = iface.approveRequest(args.projectId, args.adminId, args.startDate, args.endDate, args.awardAllocation);
result.setSuccessIsSet(true);
return result;
}
}
public static class rejectRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, rejectRequest_args> {
public rejectRequest() {
super("rejectRequest");
}
public rejectRequest_args getEmptyArgsInstance() {
return new rejectRequest_args();
}
protected boolean isOneway() {
return false;
}
public rejectRequest_result getResult(I iface, rejectRequest_args args) throws org.apache.thrift.TException {
rejectRequest_result result = new rejectRequest_result();
result.success = iface.rejectRequest(args.projectId, args.adminId);
result.setSuccessIsSet(true);
return result;
}
}
public static class createUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createUser_args> {
public createUser() {
super("createUser");
}
public createUser_args getEmptyArgsInstance() {
return new createUser_args();
}
protected boolean isOneway() {
return false;
}
public createUser_result getResult(I iface, createUser_args args) throws org.apache.thrift.TException {
createUser_result result = new createUser_result();
result.success = iface.createUser(args.userDetail);
result.setSuccessIsSet(true);
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new java.util.HashMap<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("createAllocationRequest", new createAllocationRequest());
processMap.put("deleteAllocationRequest", new deleteAllocationRequest());
processMap.put("getAllocationRequest", new getAllocationRequest());
processMap.put("updateAllocationRequest", new updateAllocationRequest());
processMap.put("getAllocationRequestStatus", new getAllocationRequestStatus());
processMap.put("getAllocationRequestUserEmail", new getAllocationRequestUserEmail());
processMap.put("getAllocationManagerAdminEmail", new getAllocationManagerAdminEmail());
processMap.put("getAllocationRequestUserName", new getAllocationRequestUserName());
processMap.put("getAllRequestsForAdmin", new getAllRequestsForAdmin());
processMap.put("assignReviewers", new assignReviewers());
processMap.put("updateRequestByReviewer", new updateRequestByReviewer());
processMap.put("isAdmin", new isAdmin());
processMap.put("isReviewer", new isReviewer());
processMap.put("getAllRequestsForReviewers", new getAllRequestsForReviewers());
processMap.put("getUserDetails", new getUserDetails());
processMap.put("getAllReviewsForARequest", new getAllReviewsForARequest());
processMap.put("getAllReviewers", new getAllReviewers());
processMap.put("getAllUnassignedReviewersForRequest", new getAllUnassignedReviewersForRequest());
processMap.put("approveRequest", new approveRequest());
processMap.put("rejectRequest", new rejectRequest());
processMap.put("createUser", new createUser());
return processMap;
}
public static class createAllocationRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createAllocationRequest_args, java.lang.String> {
public createAllocationRequest() {
super("createAllocationRequest");
}
public createAllocationRequest_args getEmptyArgsInstance() {
return new createAllocationRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
createAllocationRequest_result result = new createAllocationRequest_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
createAllocationRequest_result result = new createAllocationRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, createAllocationRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.createAllocationRequest(args.allocDetail,resultHandler);
}
}
public static class deleteAllocationRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteAllocationRequest_args, java.lang.Boolean> {
public deleteAllocationRequest() {
super("deleteAllocationRequest");
}
public deleteAllocationRequest_args getEmptyArgsInstance() {
return new deleteAllocationRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
deleteAllocationRequest_result result = new deleteAllocationRequest_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
deleteAllocationRequest_result result = new deleteAllocationRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, deleteAllocationRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.deleteAllocationRequest(args.projectId,resultHandler);
}
}
public static class getAllocationRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllocationRequest_args, org.apache.airavata.allocation.manager.models.UserAllocationDetail> {
public getAllocationRequest() {
super("getAllocationRequest");
}
public getAllocationRequest_args getEmptyArgsInstance() {
return new getAllocationRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail>() {
public void onComplete(org.apache.airavata.allocation.manager.models.UserAllocationDetail o) {
getAllocationRequest_result result = new getAllocationRequest_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllocationRequest_result result = new getAllocationRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllocationRequest_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserAllocationDetail> resultHandler) throws org.apache.thrift.TException {
iface.getAllocationRequest(args.projectId,resultHandler);
}
}
public static class updateAllocationRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateAllocationRequest_args, java.lang.Boolean> {
public updateAllocationRequest() {
super("updateAllocationRequest");
}
public updateAllocationRequest_args getEmptyArgsInstance() {
return new updateAllocationRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
updateAllocationRequest_result result = new updateAllocationRequest_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
updateAllocationRequest_result result = new updateAllocationRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, updateAllocationRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.updateAllocationRequest(args.allocDetail,resultHandler);
}
}
public static class getAllocationRequestStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllocationRequestStatus_args, java.lang.String> {
public getAllocationRequestStatus() {
super("getAllocationRequestStatus");
}
public getAllocationRequestStatus_args getEmptyArgsInstance() {
return new getAllocationRequestStatus_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
getAllocationRequestStatus_result result = new getAllocationRequestStatus_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllocationRequestStatus_result result = new getAllocationRequestStatus_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllocationRequestStatus_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.getAllocationRequestStatus(args.projectId,resultHandler);
}
}
public static class getAllocationRequestUserEmail<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllocationRequestUserEmail_args, java.lang.String> {
public getAllocationRequestUserEmail() {
super("getAllocationRequestUserEmail");
}
public getAllocationRequestUserEmail_args getEmptyArgsInstance() {
return new getAllocationRequestUserEmail_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
getAllocationRequestUserEmail_result result = new getAllocationRequestUserEmail_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllocationRequestUserEmail_result result = new getAllocationRequestUserEmail_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllocationRequestUserEmail_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.getAllocationRequestUserEmail(args.userName,resultHandler);
}
}
public static class getAllocationManagerAdminEmail<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllocationManagerAdminEmail_args, java.lang.String> {
public getAllocationManagerAdminEmail() {
super("getAllocationManagerAdminEmail");
}
public getAllocationManagerAdminEmail_args getEmptyArgsInstance() {
return new getAllocationManagerAdminEmail_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
getAllocationManagerAdminEmail_result result = new getAllocationManagerAdminEmail_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllocationManagerAdminEmail_result result = new getAllocationManagerAdminEmail_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllocationManagerAdminEmail_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.getAllocationManagerAdminEmail(args.userType,resultHandler);
}
}
public static class getAllocationRequestUserName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllocationRequestUserName_args, java.lang.String> {
public getAllocationRequestUserName() {
super("getAllocationRequestUserName");
}
public getAllocationRequestUserName_args getEmptyArgsInstance() {
return new getAllocationRequestUserName_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
getAllocationRequestUserName_result result = new getAllocationRequestUserName_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllocationRequestUserName_result result = new getAllocationRequestUserName_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllocationRequestUserName_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.getAllocationRequestUserName(args.projectId,resultHandler);
}
}
public static class getAllRequestsForAdmin<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllRequestsForAdmin_args, java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> {
public getAllRequestsForAdmin() {
super("getAllRequestsForAdmin");
}
public getAllRequestsForAdmin_args getEmptyArgsInstance() {
return new getAllRequestsForAdmin_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>>() {
public void onComplete(java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> o) {
getAllRequestsForAdmin_result result = new getAllRequestsForAdmin_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllRequestsForAdmin_result result = new getAllRequestsForAdmin_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllRequestsForAdmin_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
iface.getAllRequestsForAdmin(args.userName,resultHandler);
}
}
public static class assignReviewers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, assignReviewers_args, java.lang.Boolean> {
public assignReviewers() {
super("assignReviewers");
}
public assignReviewers_args getEmptyArgsInstance() {
return new assignReviewers_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
assignReviewers_result result = new assignReviewers_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
assignReviewers_result result = new assignReviewers_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, assignReviewers_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.assignReviewers(args.projectId, args.reviewerId, args.adminId,resultHandler);
}
}
public static class updateRequestByReviewer<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateRequestByReviewer_args, java.lang.Boolean> {
public updateRequestByReviewer() {
super("updateRequestByReviewer");
}
public updateRequestByReviewer_args getEmptyArgsInstance() {
return new updateRequestByReviewer_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
updateRequestByReviewer_result result = new updateRequestByReviewer_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
updateRequestByReviewer_result result = new updateRequestByReviewer_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, updateRequestByReviewer_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.updateRequestByReviewer(args.reviewerAllocationDetail,resultHandler);
}
}
public static class isAdmin<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isAdmin_args, java.lang.Boolean> {
public isAdmin() {
super("isAdmin");
}
public isAdmin_args getEmptyArgsInstance() {
return new isAdmin_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
isAdmin_result result = new isAdmin_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
isAdmin_result result = new isAdmin_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, isAdmin_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.isAdmin(args.userName,resultHandler);
}
}
public static class isReviewer<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isReviewer_args, java.lang.Boolean> {
public isReviewer() {
super("isReviewer");
}
public isReviewer_args getEmptyArgsInstance() {
return new isReviewer_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
isReviewer_result result = new isReviewer_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
isReviewer_result result = new isReviewer_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, isReviewer_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.isReviewer(args.userName,resultHandler);
}
}
public static class getAllRequestsForReviewers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllRequestsForReviewers_args, java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> {
public getAllRequestsForReviewers() {
super("getAllRequestsForReviewers");
}
public getAllRequestsForReviewers_args getEmptyArgsInstance() {
return new getAllRequestsForReviewers_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>>() {
public void onComplete(java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> o) {
getAllRequestsForReviewers_result result = new getAllRequestsForReviewers_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllRequestsForReviewers_result result = new getAllRequestsForReviewers_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllRequestsForReviewers_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
iface.getAllRequestsForReviewers(args.userName,resultHandler);
}
}
public static class getUserDetails<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserDetails_args, org.apache.airavata.allocation.manager.models.UserDetail> {
public getUserDetails() {
super("getUserDetails");
}
public getUserDetails_args getEmptyArgsInstance() {
return new getUserDetails_args();
}
public org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail>() {
public void onComplete(org.apache.airavata.allocation.manager.models.UserDetail o) {
getUserDetails_result result = new getUserDetails_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getUserDetails_result result = new getUserDetails_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getUserDetails_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.allocation.manager.models.UserDetail> resultHandler) throws org.apache.thrift.TException {
iface.getUserDetails(args.userName,resultHandler);
}
}
public static class getAllReviewsForARequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllReviewsForARequest_args, java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> {
public getAllReviewsForARequest() {
super("getAllReviewsForARequest");
}
public getAllReviewsForARequest_args getEmptyArgsInstance() {
return new getAllReviewsForARequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>>() {
public void onComplete(java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> o) {
getAllReviewsForARequest_result result = new getAllReviewsForARequest_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllReviewsForARequest_result result = new getAllReviewsForARequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllReviewsForARequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>> resultHandler) throws org.apache.thrift.TException {
iface.getAllReviewsForARequest(args.projectId,resultHandler);
}
}
public static class getAllReviewers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllReviewers_args, java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> {
public getAllReviewers() {
super("getAllReviewers");
}
public getAllReviewers_args getEmptyArgsInstance() {
return new getAllReviewers_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>>() {
public void onComplete(java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> o) {
getAllReviewers_result result = new getAllReviewers_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllReviewers_result result = new getAllReviewers_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllReviewers_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException {
iface.getAllReviewers(resultHandler);
}
}
public static class getAllUnassignedReviewersForRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllUnassignedReviewersForRequest_args, java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> {
public getAllUnassignedReviewersForRequest() {
super("getAllUnassignedReviewersForRequest");
}
public getAllUnassignedReviewersForRequest_args getEmptyArgsInstance() {
return new getAllUnassignedReviewersForRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>>() {
public void onComplete(java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> o) {
getAllUnassignedReviewersForRequest_result result = new getAllUnassignedReviewersForRequest_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getAllUnassignedReviewersForRequest_result result = new getAllUnassignedReviewersForRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getAllUnassignedReviewersForRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>> resultHandler) throws org.apache.thrift.TException {
iface.getAllUnassignedReviewersForRequest(args.projectId,resultHandler);
}
}
public static class approveRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, approveRequest_args, java.lang.Boolean> {
public approveRequest() {
super("approveRequest");
}
public approveRequest_args getEmptyArgsInstance() {
return new approveRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
approveRequest_result result = new approveRequest_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
approveRequest_result result = new approveRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, approveRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.approveRequest(args.projectId, args.adminId, args.startDate, args.endDate, args.awardAllocation,resultHandler);
}
}
public static class rejectRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, rejectRequest_args, java.lang.Boolean> {
public rejectRequest() {
super("rejectRequest");
}
public rejectRequest_args getEmptyArgsInstance() {
return new rejectRequest_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
rejectRequest_result result = new rejectRequest_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
rejectRequest_result result = new rejectRequest_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, rejectRequest_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.rejectRequest(args.projectId, args.adminId,resultHandler);
}
}
public static class createUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createUser_args, java.lang.Boolean> {
public createUser() {
super("createUser");
}
public createUser_args getEmptyArgsInstance() {
return new createUser_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
createUser_result result = new createUser_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
createUser_result result = new createUser_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, createUser_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.createUser(args.userDetail,resultHandler);
}
}
}
public static class createAllocationRequest_args implements org.apache.thrift.TBase<createAllocationRequest_args, createAllocationRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<createAllocationRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createAllocationRequest_args");
private static final org.apache.thrift.protocol.TField ALLOC_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("allocDetail", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createAllocationRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createAllocationRequest_argsTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ALLOC_DETAIL((short)1, "allocDetail");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ALLOC_DETAIL
return ALLOC_DETAIL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ALLOC_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("allocDetail", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserAllocationDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createAllocationRequest_args.class, metaDataMap);
}
public createAllocationRequest_args() {
}
public createAllocationRequest_args(
org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail)
{
this();
this.allocDetail = allocDetail;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createAllocationRequest_args(createAllocationRequest_args other) {
if (other.isSetAllocDetail()) {
this.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail(other.allocDetail);
}
}
public createAllocationRequest_args deepCopy() {
return new createAllocationRequest_args(this);
}
@Override
public void clear() {
this.allocDetail = null;
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getAllocDetail() {
return this.allocDetail;
}
public createAllocationRequest_args setAllocDetail(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) {
this.allocDetail = allocDetail;
return this;
}
public void unsetAllocDetail() {
this.allocDetail = null;
}
/** Returns true if field allocDetail is set (has been assigned a value) and false otherwise */
public boolean isSetAllocDetail() {
return this.allocDetail != null;
}
public void setAllocDetailIsSet(boolean value) {
if (!value) {
this.allocDetail = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case ALLOC_DETAIL:
if (value == null) {
unsetAllocDetail();
} else {
setAllocDetail((org.apache.airavata.allocation.manager.models.UserAllocationDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ALLOC_DETAIL:
return getAllocDetail();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ALLOC_DETAIL:
return isSetAllocDetail();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof createAllocationRequest_args)
return this.equals((createAllocationRequest_args)that);
return false;
}
public boolean equals(createAllocationRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_allocDetail = true && this.isSetAllocDetail();
boolean that_present_allocDetail = true && that.isSetAllocDetail();
if (this_present_allocDetail || that_present_allocDetail) {
if (!(this_present_allocDetail && that_present_allocDetail))
return false;
if (!this.allocDetail.equals(that.allocDetail))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetAllocDetail()) ? 131071 : 524287);
if (isSetAllocDetail())
hashCode = hashCode * 8191 + allocDetail.hashCode();
return hashCode;
}
@Override
public int compareTo(createAllocationRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetAllocDetail()).compareTo(other.isSetAllocDetail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAllocDetail()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allocDetail, other.allocDetail);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("createAllocationRequest_args(");
boolean first = true;
sb.append("allocDetail:");
if (this.allocDetail == null) {
sb.append("null");
} else {
sb.append(this.allocDetail);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (allocDetail == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'allocDetail' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (allocDetail != null) {
allocDetail.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class createAllocationRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createAllocationRequest_argsStandardScheme getScheme() {
return new createAllocationRequest_argsStandardScheme();
}
}
private static class createAllocationRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<createAllocationRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ALLOC_DETAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.allocDetail.read(iprot);
struct.setAllocDetailIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, createAllocationRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.allocDetail != null) {
oprot.writeFieldBegin(ALLOC_DETAIL_FIELD_DESC);
struct.allocDetail.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class createAllocationRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createAllocationRequest_argsTupleScheme getScheme() {
return new createAllocationRequest_argsTupleScheme();
}
}
private static class createAllocationRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<createAllocationRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.allocDetail.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.allocDetail.read(iprot);
struct.setAllocDetailIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class createAllocationRequest_result implements org.apache.thrift.TBase<createAllocationRequest_result, createAllocationRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<createAllocationRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createAllocationRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createAllocationRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createAllocationRequest_resultTupleSchemeFactory();
public java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createAllocationRequest_result.class, metaDataMap);
}
public createAllocationRequest_result() {
}
public createAllocationRequest_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createAllocationRequest_result(createAllocationRequest_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public createAllocationRequest_result deepCopy() {
return new createAllocationRequest_result(this);
}
@Override
public void clear() {
this.success = null;
}
public java.lang.String getSuccess() {
return this.success;
}
public createAllocationRequest_result setSuccess(java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof createAllocationRequest_result)
return this.equals((createAllocationRequest_result)that);
return false;
}
public boolean equals(createAllocationRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(createAllocationRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("createAllocationRequest_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class createAllocationRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createAllocationRequest_resultStandardScheme getScheme() {
return new createAllocationRequest_resultStandardScheme();
}
}
private static class createAllocationRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<createAllocationRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, createAllocationRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class createAllocationRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createAllocationRequest_resultTupleScheme getScheme() {
return new createAllocationRequest_resultTupleScheme();
}
}
private static class createAllocationRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<createAllocationRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class deleteAllocationRequest_args implements org.apache.thrift.TBase<deleteAllocationRequest_args, deleteAllocationRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteAllocationRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllocationRequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new deleteAllocationRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new deleteAllocationRequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllocationRequest_args.class, metaDataMap);
}
public deleteAllocationRequest_args() {
}
public deleteAllocationRequest_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deleteAllocationRequest_args(deleteAllocationRequest_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public deleteAllocationRequest_args deepCopy() {
return new deleteAllocationRequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public deleteAllocationRequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof deleteAllocationRequest_args)
return this.equals((deleteAllocationRequest_args)that);
return false;
}
public boolean equals(deleteAllocationRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(deleteAllocationRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("deleteAllocationRequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class deleteAllocationRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public deleteAllocationRequest_argsStandardScheme getScheme() {
return new deleteAllocationRequest_argsStandardScheme();
}
}
private static class deleteAllocationRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteAllocationRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, deleteAllocationRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deleteAllocationRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public deleteAllocationRequest_argsTupleScheme getScheme() {
return new deleteAllocationRequest_argsTupleScheme();
}
}
private static class deleteAllocationRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteAllocationRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class deleteAllocationRequest_result implements org.apache.thrift.TBase<deleteAllocationRequest_result, deleteAllocationRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteAllocationRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteAllocationRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new deleteAllocationRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new deleteAllocationRequest_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteAllocationRequest_result.class, metaDataMap);
}
public deleteAllocationRequest_result() {
}
public deleteAllocationRequest_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deleteAllocationRequest_result(deleteAllocationRequest_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public deleteAllocationRequest_result deepCopy() {
return new deleteAllocationRequest_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public deleteAllocationRequest_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof deleteAllocationRequest_result)
return this.equals((deleteAllocationRequest_result)that);
return false;
}
public boolean equals(deleteAllocationRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(deleteAllocationRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("deleteAllocationRequest_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class deleteAllocationRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public deleteAllocationRequest_resultStandardScheme getScheme() {
return new deleteAllocationRequest_resultStandardScheme();
}
}
private static class deleteAllocationRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteAllocationRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, deleteAllocationRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deleteAllocationRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public deleteAllocationRequest_resultTupleScheme getScheme() {
return new deleteAllocationRequest_resultTupleScheme();
}
}
private static class deleteAllocationRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteAllocationRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deleteAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deleteAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequest_args implements org.apache.thrift.TBase<getAllocationRequest_args, getAllocationRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequest_args.class, metaDataMap);
}
public getAllocationRequest_args() {
}
public getAllocationRequest_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequest_args(getAllocationRequest_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public getAllocationRequest_args deepCopy() {
return new getAllocationRequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public getAllocationRequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequest_args)
return this.equals((getAllocationRequest_args)that);
return false;
}
public boolean equals(getAllocationRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequest_argsStandardScheme getScheme() {
return new getAllocationRequest_argsStandardScheme();
}
}
private static class getAllocationRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequest_argsTupleScheme getScheme() {
return new getAllocationRequest_argsTupleScheme();
}
}
private static class getAllocationRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequest_result implements org.apache.thrift.TBase<getAllocationRequest_result, getAllocationRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequest_resultTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.UserAllocationDetail success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserAllocationDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequest_result.class, metaDataMap);
}
public getAllocationRequest_result() {
}
public getAllocationRequest_result(
org.apache.airavata.allocation.manager.models.UserAllocationDetail success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequest_result(getAllocationRequest_result other) {
if (other.isSetSuccess()) {
this.success = new org.apache.airavata.allocation.manager.models.UserAllocationDetail(other.success);
}
}
public getAllocationRequest_result deepCopy() {
return new getAllocationRequest_result(this);
}
@Override
public void clear() {
this.success = null;
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getSuccess() {
return this.success;
}
public getAllocationRequest_result setSuccess(org.apache.airavata.allocation.manager.models.UserAllocationDetail success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((org.apache.airavata.allocation.manager.models.UserAllocationDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequest_result)
return this.equals((getAllocationRequest_result)that);
return false;
}
public boolean equals(getAllocationRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequest_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequest_resultStandardScheme getScheme() {
return new getAllocationRequest_resultStandardScheme();
}
}
private static class getAllocationRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequest_resultTupleScheme getScheme() {
return new getAllocationRequest_resultTupleScheme();
}
}
private static class getAllocationRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class updateAllocationRequest_args implements org.apache.thrift.TBase<updateAllocationRequest_args, updateAllocationRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateAllocationRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateAllocationRequest_args");
private static final org.apache.thrift.protocol.TField ALLOC_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("allocDetail", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new updateAllocationRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateAllocationRequest_argsTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ALLOC_DETAIL((short)1, "allocDetail");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ALLOC_DETAIL
return ALLOC_DETAIL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ALLOC_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("allocDetail", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserAllocationDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateAllocationRequest_args.class, metaDataMap);
}
public updateAllocationRequest_args() {
}
public updateAllocationRequest_args(
org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail)
{
this();
this.allocDetail = allocDetail;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateAllocationRequest_args(updateAllocationRequest_args other) {
if (other.isSetAllocDetail()) {
this.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail(other.allocDetail);
}
}
public updateAllocationRequest_args deepCopy() {
return new updateAllocationRequest_args(this);
}
@Override
public void clear() {
this.allocDetail = null;
}
public org.apache.airavata.allocation.manager.models.UserAllocationDetail getAllocDetail() {
return this.allocDetail;
}
public updateAllocationRequest_args setAllocDetail(org.apache.airavata.allocation.manager.models.UserAllocationDetail allocDetail) {
this.allocDetail = allocDetail;
return this;
}
public void unsetAllocDetail() {
this.allocDetail = null;
}
/** Returns true if field allocDetail is set (has been assigned a value) and false otherwise */
public boolean isSetAllocDetail() {
return this.allocDetail != null;
}
public void setAllocDetailIsSet(boolean value) {
if (!value) {
this.allocDetail = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case ALLOC_DETAIL:
if (value == null) {
unsetAllocDetail();
} else {
setAllocDetail((org.apache.airavata.allocation.manager.models.UserAllocationDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ALLOC_DETAIL:
return getAllocDetail();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ALLOC_DETAIL:
return isSetAllocDetail();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof updateAllocationRequest_args)
return this.equals((updateAllocationRequest_args)that);
return false;
}
public boolean equals(updateAllocationRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_allocDetail = true && this.isSetAllocDetail();
boolean that_present_allocDetail = true && that.isSetAllocDetail();
if (this_present_allocDetail || that_present_allocDetail) {
if (!(this_present_allocDetail && that_present_allocDetail))
return false;
if (!this.allocDetail.equals(that.allocDetail))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetAllocDetail()) ? 131071 : 524287);
if (isSetAllocDetail())
hashCode = hashCode * 8191 + allocDetail.hashCode();
return hashCode;
}
@Override
public int compareTo(updateAllocationRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetAllocDetail()).compareTo(other.isSetAllocDetail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAllocDetail()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allocDetail, other.allocDetail);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("updateAllocationRequest_args(");
boolean first = true;
sb.append("allocDetail:");
if (this.allocDetail == null) {
sb.append("null");
} else {
sb.append(this.allocDetail);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (allocDetail == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'allocDetail' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (allocDetail != null) {
allocDetail.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class updateAllocationRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateAllocationRequest_argsStandardScheme getScheme() {
return new updateAllocationRequest_argsStandardScheme();
}
}
private static class updateAllocationRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<updateAllocationRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ALLOC_DETAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.allocDetail.read(iprot);
struct.setAllocDetailIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, updateAllocationRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.allocDetail != null) {
oprot.writeFieldBegin(ALLOC_DETAIL_FIELD_DESC);
struct.allocDetail.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateAllocationRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateAllocationRequest_argsTupleScheme getScheme() {
return new updateAllocationRequest_argsTupleScheme();
}
}
private static class updateAllocationRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<updateAllocationRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.allocDetail.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateAllocationRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.allocDetail = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
struct.allocDetail.read(iprot);
struct.setAllocDetailIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class updateAllocationRequest_result implements org.apache.thrift.TBase<updateAllocationRequest_result, updateAllocationRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateAllocationRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateAllocationRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new updateAllocationRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateAllocationRequest_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateAllocationRequest_result.class, metaDataMap);
}
public updateAllocationRequest_result() {
}
public updateAllocationRequest_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateAllocationRequest_result(updateAllocationRequest_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public updateAllocationRequest_result deepCopy() {
return new updateAllocationRequest_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public updateAllocationRequest_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof updateAllocationRequest_result)
return this.equals((updateAllocationRequest_result)that);
return false;
}
public boolean equals(updateAllocationRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(updateAllocationRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("updateAllocationRequest_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class updateAllocationRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateAllocationRequest_resultStandardScheme getScheme() {
return new updateAllocationRequest_resultStandardScheme();
}
}
private static class updateAllocationRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<updateAllocationRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, updateAllocationRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateAllocationRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateAllocationRequest_resultTupleScheme getScheme() {
return new updateAllocationRequest_resultTupleScheme();
}
}
private static class updateAllocationRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<updateAllocationRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateAllocationRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestStatus_args implements org.apache.thrift.TBase<getAllocationRequestStatus_args, getAllocationRequestStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestStatus_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestStatus_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestStatus_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestStatus_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestStatus_args.class, metaDataMap);
}
public getAllocationRequestStatus_args() {
}
public getAllocationRequestStatus_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestStatus_args(getAllocationRequestStatus_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public getAllocationRequestStatus_args deepCopy() {
return new getAllocationRequestStatus_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public getAllocationRequestStatus_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestStatus_args)
return this.equals((getAllocationRequestStatus_args)that);
return false;
}
public boolean equals(getAllocationRequestStatus_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestStatus_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestStatus_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestStatus_argsStandardScheme getScheme() {
return new getAllocationRequestStatus_argsStandardScheme();
}
}
private static class getAllocationRequestStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestStatus_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestStatus_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestStatus_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestStatus_argsTupleScheme getScheme() {
return new getAllocationRequestStatus_argsTupleScheme();
}
}
private static class getAllocationRequestStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestStatus_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestStatus_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestStatus_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestStatus_result implements org.apache.thrift.TBase<getAllocationRequestStatus_result, getAllocationRequestStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestStatus_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestStatus_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestStatus_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestStatus_resultTupleSchemeFactory();
public java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestStatus_result.class, metaDataMap);
}
public getAllocationRequestStatus_result() {
}
public getAllocationRequestStatus_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestStatus_result(getAllocationRequestStatus_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getAllocationRequestStatus_result deepCopy() {
return new getAllocationRequestStatus_result(this);
}
@Override
public void clear() {
this.success = null;
}
public java.lang.String getSuccess() {
return this.success;
}
public getAllocationRequestStatus_result setSuccess(java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestStatus_result)
return this.equals((getAllocationRequestStatus_result)that);
return false;
}
public boolean equals(getAllocationRequestStatus_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestStatus_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestStatus_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestStatus_resultStandardScheme getScheme() {
return new getAllocationRequestStatus_resultStandardScheme();
}
}
private static class getAllocationRequestStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestStatus_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestStatus_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestStatus_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestStatus_resultTupleScheme getScheme() {
return new getAllocationRequestStatus_resultTupleScheme();
}
}
private static class getAllocationRequestStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestStatus_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestStatus_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestStatus_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestUserEmail_args implements org.apache.thrift.TBase<getAllocationRequestUserEmail_args, getAllocationRequestUserEmail_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestUserEmail_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestUserEmail_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestUserEmail_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestUserEmail_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestUserEmail_args.class, metaDataMap);
}
public getAllocationRequestUserEmail_args() {
}
public getAllocationRequestUserEmail_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestUserEmail_args(getAllocationRequestUserEmail_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public getAllocationRequestUserEmail_args deepCopy() {
return new getAllocationRequestUserEmail_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public getAllocationRequestUserEmail_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestUserEmail_args)
return this.equals((getAllocationRequestUserEmail_args)that);
return false;
}
public boolean equals(getAllocationRequestUserEmail_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestUserEmail_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestUserEmail_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestUserEmail_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserEmail_argsStandardScheme getScheme() {
return new getAllocationRequestUserEmail_argsStandardScheme();
}
}
private static class getAllocationRequestUserEmail_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestUserEmail_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestUserEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestUserEmail_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestUserEmail_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserEmail_argsTupleScheme getScheme() {
return new getAllocationRequestUserEmail_argsTupleScheme();
}
}
private static class getAllocationRequestUserEmail_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestUserEmail_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestUserEmail_result implements org.apache.thrift.TBase<getAllocationRequestUserEmail_result, getAllocationRequestUserEmail_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestUserEmail_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestUserEmail_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestUserEmail_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestUserEmail_resultTupleSchemeFactory();
public java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestUserEmail_result.class, metaDataMap);
}
public getAllocationRequestUserEmail_result() {
}
public getAllocationRequestUserEmail_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestUserEmail_result(getAllocationRequestUserEmail_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getAllocationRequestUserEmail_result deepCopy() {
return new getAllocationRequestUserEmail_result(this);
}
@Override
public void clear() {
this.success = null;
}
public java.lang.String getSuccess() {
return this.success;
}
public getAllocationRequestUserEmail_result setSuccess(java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestUserEmail_result)
return this.equals((getAllocationRequestUserEmail_result)that);
return false;
}
public boolean equals(getAllocationRequestUserEmail_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestUserEmail_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestUserEmail_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestUserEmail_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserEmail_resultStandardScheme getScheme() {
return new getAllocationRequestUserEmail_resultStandardScheme();
}
}
private static class getAllocationRequestUserEmail_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestUserEmail_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestUserEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestUserEmail_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestUserEmail_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserEmail_resultTupleScheme getScheme() {
return new getAllocationRequestUserEmail_resultTupleScheme();
}
}
private static class getAllocationRequestUserEmail_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestUserEmail_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationManagerAdminEmail_args implements org.apache.thrift.TBase<getAllocationManagerAdminEmail_args, getAllocationManagerAdminEmail_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationManagerAdminEmail_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationManagerAdminEmail_args");
private static final org.apache.thrift.protocol.TField USER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("userType", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationManagerAdminEmail_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationManagerAdminEmail_argsTupleSchemeFactory();
public java.lang.String userType; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_TYPE((short)1, "userType");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_TYPE
return USER_TYPE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("userType", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationManagerAdminEmail_args.class, metaDataMap);
}
public getAllocationManagerAdminEmail_args() {
}
public getAllocationManagerAdminEmail_args(
java.lang.String userType)
{
this();
this.userType = userType;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationManagerAdminEmail_args(getAllocationManagerAdminEmail_args other) {
if (other.isSetUserType()) {
this.userType = other.userType;
}
}
public getAllocationManagerAdminEmail_args deepCopy() {
return new getAllocationManagerAdminEmail_args(this);
}
@Override
public void clear() {
this.userType = null;
}
public java.lang.String getUserType() {
return this.userType;
}
public getAllocationManagerAdminEmail_args setUserType(java.lang.String userType) {
this.userType = userType;
return this;
}
public void unsetUserType() {
this.userType = null;
}
/** Returns true if field userType is set (has been assigned a value) and false otherwise */
public boolean isSetUserType() {
return this.userType != null;
}
public void setUserTypeIsSet(boolean value) {
if (!value) {
this.userType = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_TYPE:
if (value == null) {
unsetUserType();
} else {
setUserType((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_TYPE:
return getUserType();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_TYPE:
return isSetUserType();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationManagerAdminEmail_args)
return this.equals((getAllocationManagerAdminEmail_args)that);
return false;
}
public boolean equals(getAllocationManagerAdminEmail_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userType = true && this.isSetUserType();
boolean that_present_userType = true && that.isSetUserType();
if (this_present_userType || that_present_userType) {
if (!(this_present_userType && that_present_userType))
return false;
if (!this.userType.equals(that.userType))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserType()) ? 131071 : 524287);
if (isSetUserType())
hashCode = hashCode * 8191 + userType.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationManagerAdminEmail_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserType()).compareTo(other.isSetUserType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userType, other.userType);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationManagerAdminEmail_args(");
boolean first = true;
sb.append("userType:");
if (this.userType == null) {
sb.append("null");
} else {
sb.append(this.userType);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userType == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userType' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationManagerAdminEmail_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationManagerAdminEmail_argsStandardScheme getScheme() {
return new getAllocationManagerAdminEmail_argsStandardScheme();
}
}
private static class getAllocationManagerAdminEmail_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationManagerAdminEmail_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationManagerAdminEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userType = iprot.readString();
struct.setUserTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationManagerAdminEmail_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userType != null) {
oprot.writeFieldBegin(USER_TYPE_FIELD_DESC);
oprot.writeString(struct.userType);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationManagerAdminEmail_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationManagerAdminEmail_argsTupleScheme getScheme() {
return new getAllocationManagerAdminEmail_argsTupleScheme();
}
}
private static class getAllocationManagerAdminEmail_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationManagerAdminEmail_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationManagerAdminEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userType);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationManagerAdminEmail_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userType = iprot.readString();
struct.setUserTypeIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationManagerAdminEmail_result implements org.apache.thrift.TBase<getAllocationManagerAdminEmail_result, getAllocationManagerAdminEmail_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationManagerAdminEmail_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationManagerAdminEmail_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationManagerAdminEmail_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationManagerAdminEmail_resultTupleSchemeFactory();
public java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationManagerAdminEmail_result.class, metaDataMap);
}
public getAllocationManagerAdminEmail_result() {
}
public getAllocationManagerAdminEmail_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationManagerAdminEmail_result(getAllocationManagerAdminEmail_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getAllocationManagerAdminEmail_result deepCopy() {
return new getAllocationManagerAdminEmail_result(this);
}
@Override
public void clear() {
this.success = null;
}
public java.lang.String getSuccess() {
return this.success;
}
public getAllocationManagerAdminEmail_result setSuccess(java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationManagerAdminEmail_result)
return this.equals((getAllocationManagerAdminEmail_result)that);
return false;
}
public boolean equals(getAllocationManagerAdminEmail_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationManagerAdminEmail_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationManagerAdminEmail_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationManagerAdminEmail_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationManagerAdminEmail_resultStandardScheme getScheme() {
return new getAllocationManagerAdminEmail_resultStandardScheme();
}
}
private static class getAllocationManagerAdminEmail_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationManagerAdminEmail_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationManagerAdminEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationManagerAdminEmail_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationManagerAdminEmail_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationManagerAdminEmail_resultTupleScheme getScheme() {
return new getAllocationManagerAdminEmail_resultTupleScheme();
}
}
private static class getAllocationManagerAdminEmail_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationManagerAdminEmail_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationManagerAdminEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationManagerAdminEmail_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestUserName_args implements org.apache.thrift.TBase<getAllocationRequestUserName_args, getAllocationRequestUserName_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestUserName_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestUserName_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestUserName_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestUserName_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestUserName_args.class, metaDataMap);
}
public getAllocationRequestUserName_args() {
}
public getAllocationRequestUserName_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestUserName_args(getAllocationRequestUserName_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public getAllocationRequestUserName_args deepCopy() {
return new getAllocationRequestUserName_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public getAllocationRequestUserName_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestUserName_args)
return this.equals((getAllocationRequestUserName_args)that);
return false;
}
public boolean equals(getAllocationRequestUserName_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestUserName_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestUserName_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestUserName_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserName_argsStandardScheme getScheme() {
return new getAllocationRequestUserName_argsStandardScheme();
}
}
private static class getAllocationRequestUserName_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestUserName_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestUserName_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestUserName_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestUserName_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserName_argsTupleScheme getScheme() {
return new getAllocationRequestUserName_argsTupleScheme();
}
}
private static class getAllocationRequestUserName_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestUserName_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserName_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserName_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllocationRequestUserName_result implements org.apache.thrift.TBase<getAllocationRequestUserName_result, getAllocationRequestUserName_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllocationRequestUserName_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllocationRequestUserName_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllocationRequestUserName_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllocationRequestUserName_resultTupleSchemeFactory();
public java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllocationRequestUserName_result.class, metaDataMap);
}
public getAllocationRequestUserName_result() {
}
public getAllocationRequestUserName_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllocationRequestUserName_result(getAllocationRequestUserName_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getAllocationRequestUserName_result deepCopy() {
return new getAllocationRequestUserName_result(this);
}
@Override
public void clear() {
this.success = null;
}
public java.lang.String getSuccess() {
return this.success;
}
public getAllocationRequestUserName_result setSuccess(java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllocationRequestUserName_result)
return this.equals((getAllocationRequestUserName_result)that);
return false;
}
public boolean equals(getAllocationRequestUserName_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllocationRequestUserName_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllocationRequestUserName_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllocationRequestUserName_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserName_resultStandardScheme getScheme() {
return new getAllocationRequestUserName_resultStandardScheme();
}
}
private static class getAllocationRequestUserName_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllocationRequestUserName_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllocationRequestUserName_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllocationRequestUserName_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllocationRequestUserName_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllocationRequestUserName_resultTupleScheme getScheme() {
return new getAllocationRequestUserName_resultTupleScheme();
}
}
private static class getAllocationRequestUserName_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllocationRequestUserName_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserName_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllocationRequestUserName_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllRequestsForAdmin_args implements org.apache.thrift.TBase<getAllRequestsForAdmin_args, getAllRequestsForAdmin_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllRequestsForAdmin_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRequestsForAdmin_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllRequestsForAdmin_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllRequestsForAdmin_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllRequestsForAdmin_args.class, metaDataMap);
}
public getAllRequestsForAdmin_args() {
}
public getAllRequestsForAdmin_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllRequestsForAdmin_args(getAllRequestsForAdmin_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public getAllRequestsForAdmin_args deepCopy() {
return new getAllRequestsForAdmin_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public getAllRequestsForAdmin_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllRequestsForAdmin_args)
return this.equals((getAllRequestsForAdmin_args)that);
return false;
}
public boolean equals(getAllRequestsForAdmin_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllRequestsForAdmin_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllRequestsForAdmin_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllRequestsForAdmin_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForAdmin_argsStandardScheme getScheme() {
return new getAllRequestsForAdmin_argsStandardScheme();
}
}
private static class getAllRequestsForAdmin_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllRequestsForAdmin_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRequestsForAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllRequestsForAdmin_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllRequestsForAdmin_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForAdmin_argsTupleScheme getScheme() {
return new getAllRequestsForAdmin_argsTupleScheme();
}
}
private static class getAllRequestsForAdmin_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllRequestsForAdmin_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllRequestsForAdmin_result implements org.apache.thrift.TBase<getAllRequestsForAdmin_result, getAllRequestsForAdmin_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllRequestsForAdmin_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRequestsForAdmin_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllRequestsForAdmin_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllRequestsForAdmin_resultTupleSchemeFactory();
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserAllocationDetail.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllRequestsForAdmin_result.class, metaDataMap);
}
public getAllRequestsForAdmin_result() {
}
public getAllRequestsForAdmin_result(
java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllRequestsForAdmin_result(getAllRequestsForAdmin_result other) {
if (other.isSetSuccess()) {
java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> __this__success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(other.success.size());
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail other_element : other.success) {
__this__success.add(new org.apache.airavata.allocation.manager.models.UserAllocationDetail(other_element));
}
this.success = __this__success;
}
}
public getAllRequestsForAdmin_result deepCopy() {
return new getAllRequestsForAdmin_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(org.apache.airavata.allocation.manager.models.UserAllocationDetail elem) {
if (this.success == null) {
this.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>();
}
this.success.add(elem);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getSuccess() {
return this.success;
}
public getAllRequestsForAdmin_result setSuccess(java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllRequestsForAdmin_result)
return this.equals((getAllRequestsForAdmin_result)that);
return false;
}
public boolean equals(getAllRequestsForAdmin_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllRequestsForAdmin_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllRequestsForAdmin_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllRequestsForAdmin_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForAdmin_resultStandardScheme getScheme() {
return new getAllRequestsForAdmin_resultStandardScheme();
}
}
private static class getAllRequestsForAdmin_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllRequestsForAdmin_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRequestsForAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(_list0.size);
org.apache.airavata.allocation.manager.models.UserAllocationDetail _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
_elem1.read(iprot);
struct.success.add(_elem1);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllRequestsForAdmin_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail _iter3 : struct.success)
{
_iter3.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllRequestsForAdmin_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForAdmin_resultTupleScheme getScheme() {
return new getAllRequestsForAdmin_resultTupleScheme();
}
}
private static class getAllRequestsForAdmin_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllRequestsForAdmin_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail _iter4 : struct.success)
{
_iter4.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(_list5.size);
org.apache.airavata.allocation.manager.models.UserAllocationDetail _elem6;
for (int _i7 = 0; _i7 < _list5.size; ++_i7)
{
_elem6 = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
_elem6.read(iprot);
struct.success.add(_elem6);
}
}
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class assignReviewers_args implements org.apache.thrift.TBase<assignReviewers_args, assignReviewers_args._Fields>, java.io.Serializable, Cloneable, Comparable<assignReviewers_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignReviewers_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField REVIEWER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("reviewerId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField ADMIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("adminId", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new assignReviewers_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new assignReviewers_argsTupleSchemeFactory();
public java.lang.String projectId; // required
public java.lang.String reviewerId; // required
public java.lang.String adminId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
REVIEWER_ID((short)2, "reviewerId"),
ADMIN_ID((short)3, "adminId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // REVIEWER_ID
return REVIEWER_ID;
case 3: // ADMIN_ID
return ADMIN_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.REVIEWER_ID, new org.apache.thrift.meta_data.FieldMetaData("reviewerId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ADMIN_ID, new org.apache.thrift.meta_data.FieldMetaData("adminId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignReviewers_args.class, metaDataMap);
}
public assignReviewers_args() {
}
public assignReviewers_args(
java.lang.String projectId,
java.lang.String reviewerId,
java.lang.String adminId)
{
this();
this.projectId = projectId;
this.reviewerId = reviewerId;
this.adminId = adminId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public assignReviewers_args(assignReviewers_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetReviewerId()) {
this.reviewerId = other.reviewerId;
}
if (other.isSetAdminId()) {
this.adminId = other.adminId;
}
}
public assignReviewers_args deepCopy() {
return new assignReviewers_args(this);
}
@Override
public void clear() {
this.projectId = null;
this.reviewerId = null;
this.adminId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public assignReviewers_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getReviewerId() {
return this.reviewerId;
}
public assignReviewers_args setReviewerId(java.lang.String reviewerId) {
this.reviewerId = reviewerId;
return this;
}
public void unsetReviewerId() {
this.reviewerId = null;
}
/** Returns true if field reviewerId is set (has been assigned a value) and false otherwise */
public boolean isSetReviewerId() {
return this.reviewerId != null;
}
public void setReviewerIdIsSet(boolean value) {
if (!value) {
this.reviewerId = null;
}
}
public java.lang.String getAdminId() {
return this.adminId;
}
public assignReviewers_args setAdminId(java.lang.String adminId) {
this.adminId = adminId;
return this;
}
public void unsetAdminId() {
this.adminId = null;
}
/** Returns true if field adminId is set (has been assigned a value) and false otherwise */
public boolean isSetAdminId() {
return this.adminId != null;
}
public void setAdminIdIsSet(boolean value) {
if (!value) {
this.adminId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case REVIEWER_ID:
if (value == null) {
unsetReviewerId();
} else {
setReviewerId((java.lang.String)value);
}
break;
case ADMIN_ID:
if (value == null) {
unsetAdminId();
} else {
setAdminId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case REVIEWER_ID:
return getReviewerId();
case ADMIN_ID:
return getAdminId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case REVIEWER_ID:
return isSetReviewerId();
case ADMIN_ID:
return isSetAdminId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof assignReviewers_args)
return this.equals((assignReviewers_args)that);
return false;
}
public boolean equals(assignReviewers_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_reviewerId = true && this.isSetReviewerId();
boolean that_present_reviewerId = true && that.isSetReviewerId();
if (this_present_reviewerId || that_present_reviewerId) {
if (!(this_present_reviewerId && that_present_reviewerId))
return false;
if (!this.reviewerId.equals(that.reviewerId))
return false;
}
boolean this_present_adminId = true && this.isSetAdminId();
boolean that_present_adminId = true && that.isSetAdminId();
if (this_present_adminId || that_present_adminId) {
if (!(this_present_adminId && that_present_adminId))
return false;
if (!this.adminId.equals(that.adminId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetReviewerId()) ? 131071 : 524287);
if (isSetReviewerId())
hashCode = hashCode * 8191 + reviewerId.hashCode();
hashCode = hashCode * 8191 + ((isSetAdminId()) ? 131071 : 524287);
if (isSetAdminId())
hashCode = hashCode * 8191 + adminId.hashCode();
return hashCode;
}
@Override
public int compareTo(assignReviewers_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetReviewerId()).compareTo(other.isSetReviewerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReviewerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reviewerId, other.reviewerId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAdminId()).compareTo(other.isSetAdminId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAdminId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adminId, other.adminId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("assignReviewers_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
if (!first) sb.append(", ");
sb.append("reviewerId:");
if (this.reviewerId == null) {
sb.append("null");
} else {
sb.append(this.reviewerId);
}
first = false;
if (!first) sb.append(", ");
sb.append("adminId:");
if (this.adminId == null) {
sb.append("null");
} else {
sb.append(this.adminId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
if (reviewerId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'reviewerId' was not present! Struct: " + toString());
}
if (adminId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'adminId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class assignReviewers_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public assignReviewers_argsStandardScheme getScheme() {
return new assignReviewers_argsStandardScheme();
}
}
private static class assignReviewers_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<assignReviewers_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, assignReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // REVIEWER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.reviewerId = iprot.readString();
struct.setReviewerIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // ADMIN_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, assignReviewers_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
if (struct.reviewerId != null) {
oprot.writeFieldBegin(REVIEWER_ID_FIELD_DESC);
oprot.writeString(struct.reviewerId);
oprot.writeFieldEnd();
}
if (struct.adminId != null) {
oprot.writeFieldBegin(ADMIN_ID_FIELD_DESC);
oprot.writeString(struct.adminId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class assignReviewers_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public assignReviewers_argsTupleScheme getScheme() {
return new assignReviewers_argsTupleScheme();
}
}
private static class assignReviewers_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<assignReviewers_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, assignReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
oprot.writeString(struct.reviewerId);
oprot.writeString(struct.adminId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, assignReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
struct.reviewerId = iprot.readString();
struct.setReviewerIdIsSet(true);
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class assignReviewers_result implements org.apache.thrift.TBase<assignReviewers_result, assignReviewers_result._Fields>, java.io.Serializable, Cloneable, Comparable<assignReviewers_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignReviewers_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new assignReviewers_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new assignReviewers_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignReviewers_result.class, metaDataMap);
}
public assignReviewers_result() {
}
public assignReviewers_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public assignReviewers_result(assignReviewers_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public assignReviewers_result deepCopy() {
return new assignReviewers_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public assignReviewers_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof assignReviewers_result)
return this.equals((assignReviewers_result)that);
return false;
}
public boolean equals(assignReviewers_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(assignReviewers_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("assignReviewers_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class assignReviewers_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public assignReviewers_resultStandardScheme getScheme() {
return new assignReviewers_resultStandardScheme();
}
}
private static class assignReviewers_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<assignReviewers_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, assignReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, assignReviewers_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class assignReviewers_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public assignReviewers_resultTupleScheme getScheme() {
return new assignReviewers_resultTupleScheme();
}
}
private static class assignReviewers_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<assignReviewers_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, assignReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, assignReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class updateRequestByReviewer_args implements org.apache.thrift.TBase<updateRequestByReviewer_args, updateRequestByReviewer_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateRequestByReviewer_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateRequestByReviewer_args");
private static final org.apache.thrift.protocol.TField REVIEWER_ALLOCATION_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("reviewerAllocationDetail", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new updateRequestByReviewer_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateRequestByReviewer_argsTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
REVIEWER_ALLOCATION_DETAIL((short)1, "reviewerAllocationDetail");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // REVIEWER_ALLOCATION_DETAIL
return REVIEWER_ALLOCATION_DETAIL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.REVIEWER_ALLOCATION_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("reviewerAllocationDetail", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateRequestByReviewer_args.class, metaDataMap);
}
public updateRequestByReviewer_args() {
}
public updateRequestByReviewer_args(
org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail)
{
this();
this.reviewerAllocationDetail = reviewerAllocationDetail;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateRequestByReviewer_args(updateRequestByReviewer_args other) {
if (other.isSetReviewerAllocationDetail()) {
this.reviewerAllocationDetail = new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail(other.reviewerAllocationDetail);
}
}
public updateRequestByReviewer_args deepCopy() {
return new updateRequestByReviewer_args(this);
}
@Override
public void clear() {
this.reviewerAllocationDetail = null;
}
public org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail getReviewerAllocationDetail() {
return this.reviewerAllocationDetail;
}
public updateRequestByReviewer_args setReviewerAllocationDetail(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail reviewerAllocationDetail) {
this.reviewerAllocationDetail = reviewerAllocationDetail;
return this;
}
public void unsetReviewerAllocationDetail() {
this.reviewerAllocationDetail = null;
}
/** Returns true if field reviewerAllocationDetail is set (has been assigned a value) and false otherwise */
public boolean isSetReviewerAllocationDetail() {
return this.reviewerAllocationDetail != null;
}
public void setReviewerAllocationDetailIsSet(boolean value) {
if (!value) {
this.reviewerAllocationDetail = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case REVIEWER_ALLOCATION_DETAIL:
if (value == null) {
unsetReviewerAllocationDetail();
} else {
setReviewerAllocationDetail((org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case REVIEWER_ALLOCATION_DETAIL:
return getReviewerAllocationDetail();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case REVIEWER_ALLOCATION_DETAIL:
return isSetReviewerAllocationDetail();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof updateRequestByReviewer_args)
return this.equals((updateRequestByReviewer_args)that);
return false;
}
public boolean equals(updateRequestByReviewer_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_reviewerAllocationDetail = true && this.isSetReviewerAllocationDetail();
boolean that_present_reviewerAllocationDetail = true && that.isSetReviewerAllocationDetail();
if (this_present_reviewerAllocationDetail || that_present_reviewerAllocationDetail) {
if (!(this_present_reviewerAllocationDetail && that_present_reviewerAllocationDetail))
return false;
if (!this.reviewerAllocationDetail.equals(that.reviewerAllocationDetail))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetReviewerAllocationDetail()) ? 131071 : 524287);
if (isSetReviewerAllocationDetail())
hashCode = hashCode * 8191 + reviewerAllocationDetail.hashCode();
return hashCode;
}
@Override
public int compareTo(updateRequestByReviewer_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetReviewerAllocationDetail()).compareTo(other.isSetReviewerAllocationDetail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReviewerAllocationDetail()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reviewerAllocationDetail, other.reviewerAllocationDetail);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("updateRequestByReviewer_args(");
boolean first = true;
sb.append("reviewerAllocationDetail:");
if (this.reviewerAllocationDetail == null) {
sb.append("null");
} else {
sb.append(this.reviewerAllocationDetail);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (reviewerAllocationDetail == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'reviewerAllocationDetail' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (reviewerAllocationDetail != null) {
reviewerAllocationDetail.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class updateRequestByReviewer_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateRequestByReviewer_argsStandardScheme getScheme() {
return new updateRequestByReviewer_argsStandardScheme();
}
}
private static class updateRequestByReviewer_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<updateRequestByReviewer_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateRequestByReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // REVIEWER_ALLOCATION_DETAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.reviewerAllocationDetail = new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail();
struct.reviewerAllocationDetail.read(iprot);
struct.setReviewerAllocationDetailIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, updateRequestByReviewer_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.reviewerAllocationDetail != null) {
oprot.writeFieldBegin(REVIEWER_ALLOCATION_DETAIL_FIELD_DESC);
struct.reviewerAllocationDetail.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateRequestByReviewer_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateRequestByReviewer_argsTupleScheme getScheme() {
return new updateRequestByReviewer_argsTupleScheme();
}
}
private static class updateRequestByReviewer_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<updateRequestByReviewer_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateRequestByReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.reviewerAllocationDetail.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateRequestByReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.reviewerAllocationDetail = new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail();
struct.reviewerAllocationDetail.read(iprot);
struct.setReviewerAllocationDetailIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class updateRequestByReviewer_result implements org.apache.thrift.TBase<updateRequestByReviewer_result, updateRequestByReviewer_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateRequestByReviewer_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateRequestByReviewer_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new updateRequestByReviewer_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateRequestByReviewer_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateRequestByReviewer_result.class, metaDataMap);
}
public updateRequestByReviewer_result() {
}
public updateRequestByReviewer_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateRequestByReviewer_result(updateRequestByReviewer_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public updateRequestByReviewer_result deepCopy() {
return new updateRequestByReviewer_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public updateRequestByReviewer_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof updateRequestByReviewer_result)
return this.equals((updateRequestByReviewer_result)that);
return false;
}
public boolean equals(updateRequestByReviewer_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(updateRequestByReviewer_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("updateRequestByReviewer_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class updateRequestByReviewer_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateRequestByReviewer_resultStandardScheme getScheme() {
return new updateRequestByReviewer_resultStandardScheme();
}
}
private static class updateRequestByReviewer_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<updateRequestByReviewer_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateRequestByReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, updateRequestByReviewer_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateRequestByReviewer_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public updateRequestByReviewer_resultTupleScheme getScheme() {
return new updateRequestByReviewer_resultTupleScheme();
}
}
private static class updateRequestByReviewer_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<updateRequestByReviewer_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateRequestByReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateRequestByReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class isAdmin_args implements org.apache.thrift.TBase<isAdmin_args, isAdmin_args._Fields>, java.io.Serializable, Cloneable, Comparable<isAdmin_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isAdmin_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isAdmin_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isAdmin_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isAdmin_args.class, metaDataMap);
}
public isAdmin_args() {
}
public isAdmin_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public isAdmin_args(isAdmin_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public isAdmin_args deepCopy() {
return new isAdmin_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public isAdmin_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof isAdmin_args)
return this.equals((isAdmin_args)that);
return false;
}
public boolean equals(isAdmin_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(isAdmin_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("isAdmin_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class isAdmin_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isAdmin_argsStandardScheme getScheme() {
return new isAdmin_argsStandardScheme();
}
}
private static class isAdmin_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<isAdmin_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, isAdmin_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class isAdmin_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isAdmin_argsTupleScheme getScheme() {
return new isAdmin_argsTupleScheme();
}
}
private static class isAdmin_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<isAdmin_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isAdmin_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class isAdmin_result implements org.apache.thrift.TBase<isAdmin_result, isAdmin_result._Fields>, java.io.Serializable, Cloneable, Comparable<isAdmin_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isAdmin_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isAdmin_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isAdmin_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isAdmin_result.class, metaDataMap);
}
public isAdmin_result() {
}
public isAdmin_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public isAdmin_result(isAdmin_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public isAdmin_result deepCopy() {
return new isAdmin_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public isAdmin_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof isAdmin_result)
return this.equals((isAdmin_result)that);
return false;
}
public boolean equals(isAdmin_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(isAdmin_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("isAdmin_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class isAdmin_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isAdmin_resultStandardScheme getScheme() {
return new isAdmin_resultStandardScheme();
}
}
private static class isAdmin_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<isAdmin_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, isAdmin_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class isAdmin_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isAdmin_resultTupleScheme getScheme() {
return new isAdmin_resultTupleScheme();
}
}
private static class isAdmin_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<isAdmin_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isAdmin_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class isReviewer_args implements org.apache.thrift.TBase<isReviewer_args, isReviewer_args._Fields>, java.io.Serializable, Cloneable, Comparable<isReviewer_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isReviewer_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isReviewer_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isReviewer_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isReviewer_args.class, metaDataMap);
}
public isReviewer_args() {
}
public isReviewer_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public isReviewer_args(isReviewer_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public isReviewer_args deepCopy() {
return new isReviewer_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public isReviewer_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof isReviewer_args)
return this.equals((isReviewer_args)that);
return false;
}
public boolean equals(isReviewer_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(isReviewer_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("isReviewer_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class isReviewer_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isReviewer_argsStandardScheme getScheme() {
return new isReviewer_argsStandardScheme();
}
}
private static class isReviewer_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<isReviewer_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, isReviewer_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class isReviewer_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isReviewer_argsTupleScheme getScheme() {
return new isReviewer_argsTupleScheme();
}
}
private static class isReviewer_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<isReviewer_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isReviewer_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class isReviewer_result implements org.apache.thrift.TBase<isReviewer_result, isReviewer_result._Fields>, java.io.Serializable, Cloneable, Comparable<isReviewer_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isReviewer_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isReviewer_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isReviewer_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isReviewer_result.class, metaDataMap);
}
public isReviewer_result() {
}
public isReviewer_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public isReviewer_result(isReviewer_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public isReviewer_result deepCopy() {
return new isReviewer_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public isReviewer_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof isReviewer_result)
return this.equals((isReviewer_result)that);
return false;
}
public boolean equals(isReviewer_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(isReviewer_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("isReviewer_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class isReviewer_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isReviewer_resultStandardScheme getScheme() {
return new isReviewer_resultStandardScheme();
}
}
private static class isReviewer_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<isReviewer_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, isReviewer_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class isReviewer_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public isReviewer_resultTupleScheme getScheme() {
return new isReviewer_resultTupleScheme();
}
}
private static class isReviewer_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<isReviewer_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isReviewer_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllRequestsForReviewers_args implements org.apache.thrift.TBase<getAllRequestsForReviewers_args, getAllRequestsForReviewers_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllRequestsForReviewers_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRequestsForReviewers_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllRequestsForReviewers_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllRequestsForReviewers_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllRequestsForReviewers_args.class, metaDataMap);
}
public getAllRequestsForReviewers_args() {
}
public getAllRequestsForReviewers_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllRequestsForReviewers_args(getAllRequestsForReviewers_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public getAllRequestsForReviewers_args deepCopy() {
return new getAllRequestsForReviewers_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public getAllRequestsForReviewers_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllRequestsForReviewers_args)
return this.equals((getAllRequestsForReviewers_args)that);
return false;
}
public boolean equals(getAllRequestsForReviewers_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllRequestsForReviewers_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllRequestsForReviewers_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllRequestsForReviewers_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForReviewers_argsStandardScheme getScheme() {
return new getAllRequestsForReviewers_argsStandardScheme();
}
}
private static class getAllRequestsForReviewers_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllRequestsForReviewers_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRequestsForReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllRequestsForReviewers_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllRequestsForReviewers_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForReviewers_argsTupleScheme getScheme() {
return new getAllRequestsForReviewers_argsTupleScheme();
}
}
private static class getAllRequestsForReviewers_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllRequestsForReviewers_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllRequestsForReviewers_result implements org.apache.thrift.TBase<getAllRequestsForReviewers_result, getAllRequestsForReviewers_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllRequestsForReviewers_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllRequestsForReviewers_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllRequestsForReviewers_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllRequestsForReviewers_resultTupleSchemeFactory();
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserAllocationDetail.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllRequestsForReviewers_result.class, metaDataMap);
}
public getAllRequestsForReviewers_result() {
}
public getAllRequestsForReviewers_result(
java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllRequestsForReviewers_result(getAllRequestsForReviewers_result other) {
if (other.isSetSuccess()) {
java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> __this__success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(other.success.size());
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail other_element : other.success) {
__this__success.add(new org.apache.airavata.allocation.manager.models.UserAllocationDetail(other_element));
}
this.success = __this__success;
}
}
public getAllRequestsForReviewers_result deepCopy() {
return new getAllRequestsForReviewers_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(org.apache.airavata.allocation.manager.models.UserAllocationDetail elem) {
if (this.success == null) {
this.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>();
}
this.success.add(elem);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> getSuccess() {
return this.success;
}
public getAllRequestsForReviewers_result setSuccess(java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail> success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.util.List<org.apache.airavata.allocation.manager.models.UserAllocationDetail>)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllRequestsForReviewers_result)
return this.equals((getAllRequestsForReviewers_result)that);
return false;
}
public boolean equals(getAllRequestsForReviewers_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllRequestsForReviewers_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllRequestsForReviewers_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllRequestsForReviewers_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForReviewers_resultStandardScheme getScheme() {
return new getAllRequestsForReviewers_resultStandardScheme();
}
}
private static class getAllRequestsForReviewers_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllRequestsForReviewers_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllRequestsForReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(_list8.size);
org.apache.airavata.allocation.manager.models.UserAllocationDetail _elem9;
for (int _i10 = 0; _i10 < _list8.size; ++_i10)
{
_elem9 = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
_elem9.read(iprot);
struct.success.add(_elem9);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllRequestsForReviewers_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail _iter11 : struct.success)
{
_iter11.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllRequestsForReviewers_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllRequestsForReviewers_resultTupleScheme getScheme() {
return new getAllRequestsForReviewers_resultTupleScheme();
}
}
private static class getAllRequestsForReviewers_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllRequestsForReviewers_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (org.apache.airavata.allocation.manager.models.UserAllocationDetail _iter12 : struct.success)
{
_iter12.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllRequestsForReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserAllocationDetail>(_list13.size);
org.apache.airavata.allocation.manager.models.UserAllocationDetail _elem14;
for (int _i15 = 0; _i15 < _list13.size; ++_i15)
{
_elem14 = new org.apache.airavata.allocation.manager.models.UserAllocationDetail();
_elem14.read(iprot);
struct.success.add(_elem14);
}
}
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getUserDetails_args implements org.apache.thrift.TBase<getUserDetails_args, getUserDetails_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserDetails_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserDetails_args");
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getUserDetails_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getUserDetails_argsTupleSchemeFactory();
public java.lang.String userName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_NAME((short)1, "userName");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_NAME
return USER_NAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserDetails_args.class, metaDataMap);
}
public getUserDetails_args() {
}
public getUserDetails_args(
java.lang.String userName)
{
this();
this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getUserDetails_args(getUserDetails_args other) {
if (other.isSetUserName()) {
this.userName = other.userName;
}
}
public getUserDetails_args deepCopy() {
return new getUserDetails_args(this);
}
@Override
public void clear() {
this.userName = null;
}
public java.lang.String getUserName() {
return this.userName;
}
public getUserDetails_args setUserName(java.lang.String userName) {
this.userName = userName;
return this;
}
public void unsetUserName() {
this.userName = null;
}
/** Returns true if field userName is set (has been assigned a value) and false otherwise */
public boolean isSetUserName() {
return this.userName != null;
}
public void setUserNameIsSet(boolean value) {
if (!value) {
this.userName = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_NAME:
if (value == null) {
unsetUserName();
} else {
setUserName((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_NAME:
return getUserName();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_NAME:
return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getUserDetails_args)
return this.equals((getUserDetails_args)that);
return false;
}
public boolean equals(getUserDetails_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userName = true && this.isSetUserName();
boolean that_present_userName = true && that.isSetUserName();
if (this_present_userName || that_present_userName) {
if (!(this_present_userName && that_present_userName))
return false;
if (!this.userName.equals(that.userName))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
if (isSetUserName())
hashCode = hashCode * 8191 + userName.hashCode();
return hashCode;
}
@Override
public int compareTo(getUserDetails_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getUserDetails_args(");
boolean first = true;
sb.append("userName:");
if (this.userName == null) {
sb.append("null");
} else {
sb.append(this.userName);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getUserDetails_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getUserDetails_argsStandardScheme getScheme() {
return new getUserDetails_argsStandardScheme();
}
}
private static class getUserDetails_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getUserDetails_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getUserDetails_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getUserDetails_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userName != null) {
oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
oprot.writeString(struct.userName);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getUserDetails_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getUserDetails_argsTupleScheme getScheme() {
return new getUserDetails_argsTupleScheme();
}
}
private static class getUserDetails_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getUserDetails_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getUserDetails_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.userName);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getUserDetails_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userName = iprot.readString();
struct.setUserNameIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getUserDetails_result implements org.apache.thrift.TBase<getUserDetails_result, getUserDetails_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserDetails_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserDetails_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getUserDetails_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getUserDetails_resultTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.UserDetail success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserDetails_result.class, metaDataMap);
}
public getUserDetails_result() {
}
public getUserDetails_result(
org.apache.airavata.allocation.manager.models.UserDetail success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getUserDetails_result(getUserDetails_result other) {
if (other.isSetSuccess()) {
this.success = new org.apache.airavata.allocation.manager.models.UserDetail(other.success);
}
}
public getUserDetails_result deepCopy() {
return new getUserDetails_result(this);
}
@Override
public void clear() {
this.success = null;
}
public org.apache.airavata.allocation.manager.models.UserDetail getSuccess() {
return this.success;
}
public getUserDetails_result setSuccess(org.apache.airavata.allocation.manager.models.UserDetail success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((org.apache.airavata.allocation.manager.models.UserDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getUserDetails_result)
return this.equals((getUserDetails_result)that);
return false;
}
public boolean equals(getUserDetails_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getUserDetails_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getUserDetails_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getUserDetails_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getUserDetails_resultStandardScheme getScheme() {
return new getUserDetails_resultStandardScheme();
}
}
private static class getUserDetails_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getUserDetails_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getUserDetails_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new org.apache.airavata.allocation.manager.models.UserDetail();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getUserDetails_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getUserDetails_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getUserDetails_resultTupleScheme getScheme() {
return new getUserDetails_resultTupleScheme();
}
}
private static class getUserDetails_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getUserDetails_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getUserDetails_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getUserDetails_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new org.apache.airavata.allocation.manager.models.UserDetail();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllReviewsForARequest_args implements org.apache.thrift.TBase<getAllReviewsForARequest_args, getAllReviewsForARequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllReviewsForARequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllReviewsForARequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllReviewsForARequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllReviewsForARequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllReviewsForARequest_args.class, metaDataMap);
}
public getAllReviewsForARequest_args() {
}
public getAllReviewsForARequest_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllReviewsForARequest_args(getAllReviewsForARequest_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public getAllReviewsForARequest_args deepCopy() {
return new getAllReviewsForARequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public getAllReviewsForARequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllReviewsForARequest_args)
return this.equals((getAllReviewsForARequest_args)that);
return false;
}
public boolean equals(getAllReviewsForARequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllReviewsForARequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllReviewsForARequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllReviewsForARequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewsForARequest_argsStandardScheme getScheme() {
return new getAllReviewsForARequest_argsStandardScheme();
}
}
private static class getAllReviewsForARequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllReviewsForARequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllReviewsForARequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllReviewsForARequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllReviewsForARequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewsForARequest_argsTupleScheme getScheme() {
return new getAllReviewsForARequest_argsTupleScheme();
}
}
private static class getAllReviewsForARequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllReviewsForARequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllReviewsForARequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllReviewsForARequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllReviewsForARequest_result implements org.apache.thrift.TBase<getAllReviewsForARequest_result, getAllReviewsForARequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllReviewsForARequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllReviewsForARequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllReviewsForARequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllReviewsForARequest_resultTupleSchemeFactory();
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllReviewsForARequest_result.class, metaDataMap);
}
public getAllReviewsForARequest_result() {
}
public getAllReviewsForARequest_result(
java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllReviewsForARequest_result(getAllReviewsForARequest_result other) {
if (other.isSetSuccess()) {
java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> __this__success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>(other.success.size());
for (org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail other_element : other.success) {
__this__success.add(new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail(other_element));
}
this.success = __this__success;
}
}
public getAllReviewsForARequest_result deepCopy() {
return new getAllReviewsForARequest_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail elem) {
if (this.success == null) {
this.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>();
}
this.success.add(elem);
}
public java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> getSuccess() {
return this.success;
}
public getAllReviewsForARequest_result setSuccess(java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail> success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.util.List<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllReviewsForARequest_result)
return this.equals((getAllReviewsForARequest_result)that);
return false;
}
public boolean equals(getAllReviewsForARequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllReviewsForARequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllReviewsForARequest_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllReviewsForARequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewsForARequest_resultStandardScheme getScheme() {
return new getAllReviewsForARequest_resultStandardScheme();
}
}
private static class getAllReviewsForARequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllReviewsForARequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllReviewsForARequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>(_list16.size);
org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail _elem17;
for (int _i18 = 0; _i18 < _list16.size; ++_i18)
{
_elem17 = new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail();
_elem17.read(iprot);
struct.success.add(_elem17);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllReviewsForARequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail _iter19 : struct.success)
{
_iter19.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllReviewsForARequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewsForARequest_resultTupleScheme getScheme() {
return new getAllReviewsForARequest_resultTupleScheme();
}
}
private static class getAllReviewsForARequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllReviewsForARequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllReviewsForARequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail _iter20 : struct.success)
{
_iter20.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllReviewsForARequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail>(_list21.size);
org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail _elem22;
for (int _i23 = 0; _i23 < _list21.size; ++_i23)
{
_elem22 = new org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail();
_elem22.read(iprot);
struct.success.add(_elem22);
}
}
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllReviewers_args implements org.apache.thrift.TBase<getAllReviewers_args, getAllReviewers_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllReviewers_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllReviewers_args");
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllReviewers_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllReviewers_argsTupleSchemeFactory();
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllReviewers_args.class, metaDataMap);
}
public getAllReviewers_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllReviewers_args(getAllReviewers_args other) {
}
public getAllReviewers_args deepCopy() {
return new getAllReviewers_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllReviewers_args)
return this.equals((getAllReviewers_args)that);
return false;
}
public boolean equals(getAllReviewers_args that) {
if (that == null)
return false;
if (this == that)
return true;
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public int compareTo(getAllReviewers_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllReviewers_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllReviewers_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewers_argsStandardScheme getScheme() {
return new getAllReviewers_argsStandardScheme();
}
}
private static class getAllReviewers_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllReviewers_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllReviewers_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllReviewers_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewers_argsTupleScheme getScheme() {
return new getAllReviewers_argsTupleScheme();
}
}
private static class getAllReviewers_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllReviewers_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllReviewers_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllReviewers_result implements org.apache.thrift.TBase<getAllReviewers_result, getAllReviewers_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllReviewers_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllReviewers_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllReviewers_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllReviewers_resultTupleSchemeFactory();
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserDetail.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllReviewers_result.class, metaDataMap);
}
public getAllReviewers_result() {
}
public getAllReviewers_result(
java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllReviewers_result(getAllReviewers_result other) {
if (other.isSetSuccess()) {
java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> __this__success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(other.success.size());
for (org.apache.airavata.allocation.manager.models.UserDetail other_element : other.success) {
__this__success.add(new org.apache.airavata.allocation.manager.models.UserDetail(other_element));
}
this.success = __this__success;
}
}
public getAllReviewers_result deepCopy() {
return new getAllReviewers_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<org.apache.airavata.allocation.manager.models.UserDetail> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(org.apache.airavata.allocation.manager.models.UserDetail elem) {
if (this.success == null) {
this.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>();
}
this.success.add(elem);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getSuccess() {
return this.success;
}
public getAllReviewers_result setSuccess(java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllReviewers_result)
return this.equals((getAllReviewers_result)that);
return false;
}
public boolean equals(getAllReviewers_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllReviewers_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllReviewers_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllReviewers_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewers_resultStandardScheme getScheme() {
return new getAllReviewers_resultStandardScheme();
}
}
private static class getAllReviewers_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllReviewers_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(_list24.size);
org.apache.airavata.allocation.manager.models.UserDetail _elem25;
for (int _i26 = 0; _i26 < _list24.size; ++_i26)
{
_elem25 = new org.apache.airavata.allocation.manager.models.UserDetail();
_elem25.read(iprot);
struct.success.add(_elem25);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllReviewers_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (org.apache.airavata.allocation.manager.models.UserDetail _iter27 : struct.success)
{
_iter27.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllReviewers_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllReviewers_resultTupleScheme getScheme() {
return new getAllReviewers_resultTupleScheme();
}
}
private static class getAllReviewers_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllReviewers_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (org.apache.airavata.allocation.manager.models.UserDetail _iter28 : struct.success)
{
_iter28.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllReviewers_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(_list29.size);
org.apache.airavata.allocation.manager.models.UserDetail _elem30;
for (int _i31 = 0; _i31 < _list29.size; ++_i31)
{
_elem30 = new org.apache.airavata.allocation.manager.models.UserDetail();
_elem30.read(iprot);
struct.success.add(_elem30);
}
}
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllUnassignedReviewersForRequest_args implements org.apache.thrift.TBase<getAllUnassignedReviewersForRequest_args, getAllUnassignedReviewersForRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllUnassignedReviewersForRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUnassignedReviewersForRequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllUnassignedReviewersForRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllUnassignedReviewersForRequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUnassignedReviewersForRequest_args.class, metaDataMap);
}
public getAllUnassignedReviewersForRequest_args() {
}
public getAllUnassignedReviewersForRequest_args(
java.lang.String projectId)
{
this();
this.projectId = projectId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllUnassignedReviewersForRequest_args(getAllUnassignedReviewersForRequest_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
}
public getAllUnassignedReviewersForRequest_args deepCopy() {
return new getAllUnassignedReviewersForRequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public getAllUnassignedReviewersForRequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllUnassignedReviewersForRequest_args)
return this.equals((getAllUnassignedReviewersForRequest_args)that);
return false;
}
public boolean equals(getAllUnassignedReviewersForRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllUnassignedReviewersForRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllUnassignedReviewersForRequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllUnassignedReviewersForRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllUnassignedReviewersForRequest_argsStandardScheme getScheme() {
return new getAllUnassignedReviewersForRequest_argsStandardScheme();
}
}
private static class getAllUnassignedReviewersForRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllUnassignedReviewersForRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUnassignedReviewersForRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUnassignedReviewersForRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllUnassignedReviewersForRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllUnassignedReviewersForRequest_argsTupleScheme getScheme() {
return new getAllUnassignedReviewersForRequest_argsTupleScheme();
}
}
private static class getAllUnassignedReviewersForRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllUnassignedReviewersForRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllUnassignedReviewersForRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllUnassignedReviewersForRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getAllUnassignedReviewersForRequest_result implements org.apache.thrift.TBase<getAllUnassignedReviewersForRequest_result, getAllUnassignedReviewersForRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllUnassignedReviewersForRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUnassignedReviewersForRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllUnassignedReviewersForRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllUnassignedReviewersForRequest_resultTupleSchemeFactory();
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserDetail.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllUnassignedReviewersForRequest_result.class, metaDataMap);
}
public getAllUnassignedReviewersForRequest_result() {
}
public getAllUnassignedReviewersForRequest_result(
java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getAllUnassignedReviewersForRequest_result(getAllUnassignedReviewersForRequest_result other) {
if (other.isSetSuccess()) {
java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> __this__success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(other.success.size());
for (org.apache.airavata.allocation.manager.models.UserDetail other_element : other.success) {
__this__success.add(new org.apache.airavata.allocation.manager.models.UserDetail(other_element));
}
this.success = __this__success;
}
}
public getAllUnassignedReviewersForRequest_result deepCopy() {
return new getAllUnassignedReviewersForRequest_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<org.apache.airavata.allocation.manager.models.UserDetail> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(org.apache.airavata.allocation.manager.models.UserDetail elem) {
if (this.success == null) {
this.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>();
}
this.success.add(elem);
}
public java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> getSuccess() {
return this.success;
}
public getAllUnassignedReviewersForRequest_result setSuccess(java.util.List<org.apache.airavata.allocation.manager.models.UserDetail> success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.util.List<org.apache.airavata.allocation.manager.models.UserDetail>)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getAllUnassignedReviewersForRequest_result)
return this.equals((getAllUnassignedReviewersForRequest_result)that);
return false;
}
public boolean equals(getAllUnassignedReviewersForRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(getAllUnassignedReviewersForRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllUnassignedReviewersForRequest_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getAllUnassignedReviewersForRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllUnassignedReviewersForRequest_resultStandardScheme getScheme() {
return new getAllUnassignedReviewersForRequest_resultStandardScheme();
}
}
private static class getAllUnassignedReviewersForRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllUnassignedReviewersForRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUnassignedReviewersForRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(_list32.size);
org.apache.airavata.allocation.manager.models.UserDetail _elem33;
for (int _i34 = 0; _i34 < _list32.size; ++_i34)
{
_elem33 = new org.apache.airavata.allocation.manager.models.UserDetail();
_elem33.read(iprot);
struct.success.add(_elem33);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getAllUnassignedReviewersForRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (org.apache.airavata.allocation.manager.models.UserDetail _iter35 : struct.success)
{
_iter35.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getAllUnassignedReviewersForRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getAllUnassignedReviewersForRequest_resultTupleScheme getScheme() {
return new getAllUnassignedReviewersForRequest_resultTupleScheme();
}
}
private static class getAllUnassignedReviewersForRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllUnassignedReviewersForRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getAllUnassignedReviewersForRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (org.apache.airavata.allocation.manager.models.UserDetail _iter36 : struct.success)
{
_iter36.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllUnassignedReviewersForRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new java.util.ArrayList<org.apache.airavata.allocation.manager.models.UserDetail>(_list37.size);
org.apache.airavata.allocation.manager.models.UserDetail _elem38;
for (int _i39 = 0; _i39 < _list37.size; ++_i39)
{
_elem38 = new org.apache.airavata.allocation.manager.models.UserDetail();
_elem38.read(iprot);
struct.success.add(_elem38);
}
}
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class approveRequest_args implements org.apache.thrift.TBase<approveRequest_args, approveRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<approveRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("approveRequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField ADMIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("adminId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField AWARD_ALLOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("awardAllocation", org.apache.thrift.protocol.TType.I64, (short)5);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new approveRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new approveRequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
public java.lang.String adminId; // required
public long startDate; // required
public long endDate; // required
public long awardAllocation; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
ADMIN_ID((short)2, "adminId"),
START_DATE((short)3, "startDate"),
END_DATE((short)4, "endDate"),
AWARD_ALLOCATION((short)5, "awardAllocation");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // ADMIN_ID
return ADMIN_ID;
case 3: // START_DATE
return START_DATE;
case 4: // END_DATE
return END_DATE;
case 5: // AWARD_ALLOCATION
return AWARD_ALLOCATION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __STARTDATE_ISSET_ID = 0;
private static final int __ENDDATE_ISSET_ID = 1;
private static final int __AWARDALLOCATION_ISSET_ID = 2;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ADMIN_ID, new org.apache.thrift.meta_data.FieldMetaData("adminId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.AWARD_ALLOCATION, new org.apache.thrift.meta_data.FieldMetaData("awardAllocation", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(approveRequest_args.class, metaDataMap);
}
public approveRequest_args() {
}
public approveRequest_args(
java.lang.String projectId,
java.lang.String adminId,
long startDate,
long endDate,
long awardAllocation)
{
this();
this.projectId = projectId;
this.adminId = adminId;
this.startDate = startDate;
setStartDateIsSet(true);
this.endDate = endDate;
setEndDateIsSet(true);
this.awardAllocation = awardAllocation;
setAwardAllocationIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public approveRequest_args(approveRequest_args other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetAdminId()) {
this.adminId = other.adminId;
}
this.startDate = other.startDate;
this.endDate = other.endDate;
this.awardAllocation = other.awardAllocation;
}
public approveRequest_args deepCopy() {
return new approveRequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
this.adminId = null;
setStartDateIsSet(false);
this.startDate = 0;
setEndDateIsSet(false);
this.endDate = 0;
setAwardAllocationIsSet(false);
this.awardAllocation = 0;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public approveRequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getAdminId() {
return this.adminId;
}
public approveRequest_args setAdminId(java.lang.String adminId) {
this.adminId = adminId;
return this;
}
public void unsetAdminId() {
this.adminId = null;
}
/** Returns true if field adminId is set (has been assigned a value) and false otherwise */
public boolean isSetAdminId() {
return this.adminId != null;
}
public void setAdminIdIsSet(boolean value) {
if (!value) {
this.adminId = null;
}
}
public long getStartDate() {
return this.startDate;
}
public approveRequest_args setStartDate(long startDate) {
this.startDate = startDate;
setStartDateIsSet(true);
return this;
}
public void unsetStartDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
/** Returns true if field startDate is set (has been assigned a value) and false otherwise */
public boolean isSetStartDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTDATE_ISSET_ID);
}
public void setStartDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTDATE_ISSET_ID, value);
}
public long getEndDate() {
return this.endDate;
}
public approveRequest_args setEndDate(long endDate) {
this.endDate = endDate;
setEndDateIsSet(true);
return this;
}
public void unsetEndDate() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
/** Returns true if field endDate is set (has been assigned a value) and false otherwise */
public boolean isSetEndDate() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDDATE_ISSET_ID);
}
public void setEndDateIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDDATE_ISSET_ID, value);
}
public long getAwardAllocation() {
return this.awardAllocation;
}
public approveRequest_args setAwardAllocation(long awardAllocation) {
this.awardAllocation = awardAllocation;
setAwardAllocationIsSet(true);
return this;
}
public void unsetAwardAllocation() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
/** Returns true if field awardAllocation is set (has been assigned a value) and false otherwise */
public boolean isSetAwardAllocation() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID);
}
public void setAwardAllocationIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AWARDALLOCATION_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case ADMIN_ID:
if (value == null) {
unsetAdminId();
} else {
setAdminId((java.lang.String)value);
}
break;
case START_DATE:
if (value == null) {
unsetStartDate();
} else {
setStartDate((java.lang.Long)value);
}
break;
case END_DATE:
if (value == null) {
unsetEndDate();
} else {
setEndDate((java.lang.Long)value);
}
break;
case AWARD_ALLOCATION:
if (value == null) {
unsetAwardAllocation();
} else {
setAwardAllocation((java.lang.Long)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case ADMIN_ID:
return getAdminId();
case START_DATE:
return getStartDate();
case END_DATE:
return getEndDate();
case AWARD_ALLOCATION:
return getAwardAllocation();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case ADMIN_ID:
return isSetAdminId();
case START_DATE:
return isSetStartDate();
case END_DATE:
return isSetEndDate();
case AWARD_ALLOCATION:
return isSetAwardAllocation();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof approveRequest_args)
return this.equals((approveRequest_args)that);
return false;
}
public boolean equals(approveRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_adminId = true && this.isSetAdminId();
boolean that_present_adminId = true && that.isSetAdminId();
if (this_present_adminId || that_present_adminId) {
if (!(this_present_adminId && that_present_adminId))
return false;
if (!this.adminId.equals(that.adminId))
return false;
}
boolean this_present_startDate = true;
boolean that_present_startDate = true;
if (this_present_startDate || that_present_startDate) {
if (!(this_present_startDate && that_present_startDate))
return false;
if (this.startDate != that.startDate)
return false;
}
boolean this_present_endDate = true;
boolean that_present_endDate = true;
if (this_present_endDate || that_present_endDate) {
if (!(this_present_endDate && that_present_endDate))
return false;
if (this.endDate != that.endDate)
return false;
}
boolean this_present_awardAllocation = true;
boolean that_present_awardAllocation = true;
if (this_present_awardAllocation || that_present_awardAllocation) {
if (!(this_present_awardAllocation && that_present_awardAllocation))
return false;
if (this.awardAllocation != that.awardAllocation)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetAdminId()) ? 131071 : 524287);
if (isSetAdminId())
hashCode = hashCode * 8191 + adminId.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startDate);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endDate);
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(awardAllocation);
return hashCode;
}
@Override
public int compareTo(approveRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAdminId()).compareTo(other.isSetAdminId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAdminId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adminId, other.adminId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStartDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEndDate()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAwardAllocation()).compareTo(other.isSetAwardAllocation());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAwardAllocation()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.awardAllocation, other.awardAllocation);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("approveRequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
if (!first) sb.append(", ");
sb.append("adminId:");
if (this.adminId == null) {
sb.append("null");
} else {
sb.append(this.adminId);
}
first = false;
if (!first) sb.append(", ");
sb.append("startDate:");
sb.append(this.startDate);
first = false;
if (!first) sb.append(", ");
sb.append("endDate:");
sb.append(this.endDate);
first = false;
if (!first) sb.append(", ");
sb.append("awardAllocation:");
sb.append(this.awardAllocation);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
if (adminId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'adminId' was not present! Struct: " + toString());
}
// alas, we cannot check 'startDate' because it's a primitive and you chose the non-beans generator.
// alas, we cannot check 'endDate' because it's a primitive and you chose the non-beans generator.
// alas, we cannot check 'awardAllocation' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class approveRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public approveRequest_argsStandardScheme getScheme() {
return new approveRequest_argsStandardScheme();
}
}
private static class approveRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<approveRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, approveRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // ADMIN_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // START_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // END_DATE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // AWARD_ALLOCATION
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetStartDate()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'startDate' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetEndDate()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'endDate' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAwardAllocation()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'awardAllocation' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, approveRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
if (struct.adminId != null) {
oprot.writeFieldBegin(ADMIN_ID_FIELD_DESC);
oprot.writeString(struct.adminId);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(START_DATE_FIELD_DESC);
oprot.writeI64(struct.startDate);
oprot.writeFieldEnd();
oprot.writeFieldBegin(END_DATE_FIELD_DESC);
oprot.writeI64(struct.endDate);
oprot.writeFieldEnd();
oprot.writeFieldBegin(AWARD_ALLOCATION_FIELD_DESC);
oprot.writeI64(struct.awardAllocation);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class approveRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public approveRequest_argsTupleScheme getScheme() {
return new approveRequest_argsTupleScheme();
}
}
private static class approveRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<approveRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, approveRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
oprot.writeString(struct.adminId);
oprot.writeI64(struct.startDate);
oprot.writeI64(struct.endDate);
oprot.writeI64(struct.awardAllocation);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, approveRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
struct.startDate = iprot.readI64();
struct.setStartDateIsSet(true);
struct.endDate = iprot.readI64();
struct.setEndDateIsSet(true);
struct.awardAllocation = iprot.readI64();
struct.setAwardAllocationIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class approveRequest_result implements org.apache.thrift.TBase<approveRequest_result, approveRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<approveRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("approveRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new approveRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new approveRequest_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(approveRequest_result.class, metaDataMap);
}
public approveRequest_result() {
}
public approveRequest_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public approveRequest_result(approveRequest_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public approveRequest_result deepCopy() {
return new approveRequest_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public approveRequest_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof approveRequest_result)
return this.equals((approveRequest_result)that);
return false;
}
public boolean equals(approveRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(approveRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("approveRequest_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class approveRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public approveRequest_resultStandardScheme getScheme() {
return new approveRequest_resultStandardScheme();
}
}
private static class approveRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<approveRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, approveRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, approveRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class approveRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public approveRequest_resultTupleScheme getScheme() {
return new approveRequest_resultTupleScheme();
}
}
private static class approveRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<approveRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, approveRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, approveRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class rejectRequest_args implements org.apache.thrift.TBase<rejectRequest_args, rejectRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<rejectRequest_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rejectRequest_args");
private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField ADMIN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("adminId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new rejectRequest_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new rejectRequest_argsTupleSchemeFactory();
public java.lang.String projectId; // required
public java.lang.String adminId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PROJECT_ID((short)1, "projectId"),
ADMIN_ID((short)2, "adminId");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PROJECT_ID
return PROJECT_ID;
case 2: // ADMIN_ID
return ADMIN_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ADMIN_ID, new org.apache.thrift.meta_data.FieldMetaData("adminId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rejectRequest_args.class, metaDataMap);
}
public rejectRequest_args() {
}
public rejectRequest_args(
java.lang.String projectId,
java.lang.String adminId)
{
this();
this.projectId = projectId;
this.adminId = adminId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public rejectRequest_args(rejectRequest_args other) {
if (other.isSetProjectId()) {
this.projectId = other.projectId;
}
if (other.isSetAdminId()) {
this.adminId = other.adminId;
}
}
public rejectRequest_args deepCopy() {
return new rejectRequest_args(this);
}
@Override
public void clear() {
this.projectId = null;
this.adminId = null;
}
public java.lang.String getProjectId() {
return this.projectId;
}
public rejectRequest_args setProjectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
public void unsetProjectId() {
this.projectId = null;
}
/** Returns true if field projectId is set (has been assigned a value) and false otherwise */
public boolean isSetProjectId() {
return this.projectId != null;
}
public void setProjectIdIsSet(boolean value) {
if (!value) {
this.projectId = null;
}
}
public java.lang.String getAdminId() {
return this.adminId;
}
public rejectRequest_args setAdminId(java.lang.String adminId) {
this.adminId = adminId;
return this;
}
public void unsetAdminId() {
this.adminId = null;
}
/** Returns true if field adminId is set (has been assigned a value) and false otherwise */
public boolean isSetAdminId() {
return this.adminId != null;
}
public void setAdminIdIsSet(boolean value) {
if (!value) {
this.adminId = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PROJECT_ID:
if (value == null) {
unsetProjectId();
} else {
setProjectId((java.lang.String)value);
}
break;
case ADMIN_ID:
if (value == null) {
unsetAdminId();
} else {
setAdminId((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PROJECT_ID:
return getProjectId();
case ADMIN_ID:
return getAdminId();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PROJECT_ID:
return isSetProjectId();
case ADMIN_ID:
return isSetAdminId();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof rejectRequest_args)
return this.equals((rejectRequest_args)that);
return false;
}
public boolean equals(rejectRequest_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_projectId = true && this.isSetProjectId();
boolean that_present_projectId = true && that.isSetProjectId();
if (this_present_projectId || that_present_projectId) {
if (!(this_present_projectId && that_present_projectId))
return false;
if (!this.projectId.equals(that.projectId))
return false;
}
boolean this_present_adminId = true && this.isSetAdminId();
boolean that_present_adminId = true && that.isSetAdminId();
if (this_present_adminId || that_present_adminId) {
if (!(this_present_adminId && that_present_adminId))
return false;
if (!this.adminId.equals(that.adminId))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetProjectId()) ? 131071 : 524287);
if (isSetProjectId())
hashCode = hashCode * 8191 + projectId.hashCode();
hashCode = hashCode * 8191 + ((isSetAdminId()) ? 131071 : 524287);
if (isSetAdminId())
hashCode = hashCode * 8191 + adminId.hashCode();
return hashCode;
}
@Override
public int compareTo(rejectRequest_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProjectId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetAdminId()).compareTo(other.isSetAdminId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAdminId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adminId, other.adminId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("rejectRequest_args(");
boolean first = true;
sb.append("projectId:");
if (this.projectId == null) {
sb.append("null");
} else {
sb.append(this.projectId);
}
first = false;
if (!first) sb.append(", ");
sb.append("adminId:");
if (this.adminId == null) {
sb.append("null");
} else {
sb.append(this.adminId);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (projectId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId' was not present! Struct: " + toString());
}
if (adminId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'adminId' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class rejectRequest_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public rejectRequest_argsStandardScheme getScheme() {
return new rejectRequest_argsStandardScheme();
}
}
private static class rejectRequest_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<rejectRequest_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, rejectRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PROJECT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // ADMIN_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, rejectRequest_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.projectId != null) {
oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
oprot.writeString(struct.projectId);
oprot.writeFieldEnd();
}
if (struct.adminId != null) {
oprot.writeFieldBegin(ADMIN_ID_FIELD_DESC);
oprot.writeString(struct.adminId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class rejectRequest_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public rejectRequest_argsTupleScheme getScheme() {
return new rejectRequest_argsTupleScheme();
}
}
private static class rejectRequest_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<rejectRequest_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, rejectRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.projectId);
oprot.writeString(struct.adminId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, rejectRequest_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.projectId = iprot.readString();
struct.setProjectIdIsSet(true);
struct.adminId = iprot.readString();
struct.setAdminIdIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class rejectRequest_result implements org.apache.thrift.TBase<rejectRequest_result, rejectRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<rejectRequest_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rejectRequest_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new rejectRequest_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new rejectRequest_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rejectRequest_result.class, metaDataMap);
}
public rejectRequest_result() {
}
public rejectRequest_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public rejectRequest_result(rejectRequest_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public rejectRequest_result deepCopy() {
return new rejectRequest_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public rejectRequest_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof rejectRequest_result)
return this.equals((rejectRequest_result)that);
return false;
}
public boolean equals(rejectRequest_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(rejectRequest_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("rejectRequest_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class rejectRequest_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public rejectRequest_resultStandardScheme getScheme() {
return new rejectRequest_resultStandardScheme();
}
}
private static class rejectRequest_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<rejectRequest_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, rejectRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, rejectRequest_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class rejectRequest_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public rejectRequest_resultTupleScheme getScheme() {
return new rejectRequest_resultTupleScheme();
}
}
private static class rejectRequest_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<rejectRequest_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, rejectRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, rejectRequest_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class createUser_args implements org.apache.thrift.TBase<createUser_args, createUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_args");
private static final org.apache.thrift.protocol.TField USER_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userDetail", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createUser_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createUser_argsTupleSchemeFactory();
public org.apache.airavata.allocation.manager.models.UserDetail userDetail; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USER_DETAIL((short)1, "userDetail");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // USER_DETAIL
return USER_DETAIL;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.USER_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("userDetail", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.allocation.manager.models.UserDetail.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_args.class, metaDataMap);
}
public createUser_args() {
}
public createUser_args(
org.apache.airavata.allocation.manager.models.UserDetail userDetail)
{
this();
this.userDetail = userDetail;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createUser_args(createUser_args other) {
if (other.isSetUserDetail()) {
this.userDetail = new org.apache.airavata.allocation.manager.models.UserDetail(other.userDetail);
}
}
public createUser_args deepCopy() {
return new createUser_args(this);
}
@Override
public void clear() {
this.userDetail = null;
}
public org.apache.airavata.allocation.manager.models.UserDetail getUserDetail() {
return this.userDetail;
}
public createUser_args setUserDetail(org.apache.airavata.allocation.manager.models.UserDetail userDetail) {
this.userDetail = userDetail;
return this;
}
public void unsetUserDetail() {
this.userDetail = null;
}
/** Returns true if field userDetail is set (has been assigned a value) and false otherwise */
public boolean isSetUserDetail() {
return this.userDetail != null;
}
public void setUserDetailIsSet(boolean value) {
if (!value) {
this.userDetail = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case USER_DETAIL:
if (value == null) {
unsetUserDetail();
} else {
setUserDetail((org.apache.airavata.allocation.manager.models.UserDetail)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case USER_DETAIL:
return getUserDetail();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case USER_DETAIL:
return isSetUserDetail();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof createUser_args)
return this.equals((createUser_args)that);
return false;
}
public boolean equals(createUser_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_userDetail = true && this.isSetUserDetail();
boolean that_present_userDetail = true && that.isSetUserDetail();
if (this_present_userDetail || that_present_userDetail) {
if (!(this_present_userDetail && that_present_userDetail))
return false;
if (!this.userDetail.equals(that.userDetail))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetUserDetail()) ? 131071 : 524287);
if (isSetUserDetail())
hashCode = hashCode * 8191 + userDetail.hashCode();
return hashCode;
}
@Override
public int compareTo(createUser_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetUserDetail()).compareTo(other.isSetUserDetail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserDetail()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userDetail, other.userDetail);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("createUser_args(");
boolean first = true;
sb.append("userDetail:");
if (this.userDetail == null) {
sb.append("null");
} else {
sb.append(this.userDetail);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (userDetail == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userDetail' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (userDetail != null) {
userDetail.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class createUser_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createUser_argsStandardScheme getScheme() {
return new createUser_argsStandardScheme();
}
}
private static class createUser_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<createUser_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // USER_DETAIL
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.userDetail = new org.apache.airavata.allocation.manager.models.UserDetail();
struct.userDetail.read(iprot);
struct.setUserDetailIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userDetail != null) {
oprot.writeFieldBegin(USER_DETAIL_FIELD_DESC);
struct.userDetail.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class createUser_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createUser_argsTupleScheme getScheme() {
return new createUser_argsTupleScheme();
}
}
private static class createUser_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<createUser_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userDetail.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createUser_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.userDetail = new org.apache.airavata.allocation.manager.models.UserDetail();
struct.userDetail.read(iprot);
struct.setUserDetailIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class createUser_result implements org.apache.thrift.TBase<createUser_result, createUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<createUser_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createUser_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new createUser_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new createUser_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createUser_result.class, metaDataMap);
}
public createUser_result() {
}
public createUser_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public createUser_result(createUser_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public createUser_result deepCopy() {
return new createUser_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public createUser_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof createUser_result)
return this.equals((createUser_result)that);
return false;
}
public boolean equals(createUser_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(createUser_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("createUser_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class createUser_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createUser_resultStandardScheme getScheme() {
return new createUser_resultStandardScheme();
}
}
private static class createUser_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<createUser_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, createUser_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, createUser_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class createUser_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public createUser_resultTupleScheme getScheme() {
return new createUser_resultTupleScheme();
}
}
private static class createUser_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<createUser_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, createUser_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}
| 9,068 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationManager.java | package org.apache.airavata.allocation.manager.client;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
public class NotificationManager {
private final static String QUEUE_NAME = "notify";
public void notificationSender(String projectID, String notificationType) {
try {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
// this is the project id and notification type that is sent
String project_ID = projectID+","+notificationType;
channel.basicPublish("", QUEUE_NAME, null, project_ID.getBytes());
System.out.println(" [x] Sent the request");
// Close the channel
channel.close();
// Close the connection
connection.close();
} catch (Exception e) {
// Dump any exception to the console
e.printStackTrace();
}
}
}
| 9,069 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/testClient.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.apache.airavata.allocation.manager.client;
import java.util.List;
import org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.airavata.allocation.manager.models.UserAllocationDetail;
import org.apache.airavata.allocation.manager.models.UserDetail;
import org.apache.airavata.allocation.manager.service.cpi.AllocationRegistryService;
public class testClient {
public static void main(String[] args) {
try {
TTransport transport;
transport = new TSocket("localhost", 9040);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
AllocationRegistryService.Client client = new AllocationRegistryService.Client(protocol);
System.out.println("Started client");
System.out.println("Testing createUser() ");
UserDetail reqDetails = new UserDetail();
reqDetails.setEmail("admin@gmail.com");
reqDetails.setFullName("admin");
reqDetails.setPassword("admin");
reqDetails.setUsername("admin");
reqDetails.setUserType("ADMIN");
System.out.println(client.createUser(reqDetails));
UserDetail reqDetails1 = new UserDetail();
reqDetails1.setEmail("reviewer1@gmail.com");
reqDetails1.setFullName("reviewer1");
reqDetails1.setPassword("reviewer1");
reqDetails1.setUsername("reviewer1");
reqDetails1.setUserType("REVIEWER");
System.out.println(client.createUser(reqDetails1));
UserDetail reqDetails2 = new UserDetail();
reqDetails2.setEmail("reviewer2@gmail.com");
reqDetails2.setFullName("reviewer2");
reqDetails2.setPassword("reviewer2");
reqDetails2.setUsername("reviewer2");
reqDetails2.setUserType("REVIEWER");
System.out.println(client.createUser(reqDetails2));
UserDetail reqDetails3 = new UserDetail();
reqDetails3.setEmail("reviewer3@gmail.com");
reqDetails3.setFullName("reviewer3");
reqDetails3.setPassword("reviewer3");
reqDetails3.setUsername("reviewer3");
reqDetails3.setUserType("REVIEWER");
System.out.println(client.createUser(reqDetails3));
UserDetail reqDetails4 = new UserDetail();
reqDetails4.setEmail("user@gmail.com");
reqDetails4.setFullName("user");
reqDetails4.setPassword("user");
reqDetails4.setUsername("user");
reqDetails4.setUserType("USER");
System.out.println(client.createUser(reqDetails4));
System.out.println("######################");
System.out.println("Testing createAllocationRequest() ");
UserAllocationDetail requestDetails = new UserAllocationDetail();
requestDetails.setProjectId("123456");
requestDetails.setUsername("harsha");
requestDetails.setRequestedDate(101L);
requestDetails.setTitle("Test");
requestDetails.setProjectDescription("Test");
requestDetails.setTypeOfAllocation("Comm");
requestDetails.setStatus("pending");
System.out.println(client.createAllocationRequest(requestDetails));
UserAllocationDetail rDetails1 = new UserAllocationDetail();
rDetails1.setProjectId("1234");
rDetails1.setUsername("madrina");
rDetails1.setRequestedDate(101L);
rDetails1.setTitle("Test");
rDetails1.setProjectDescription("Test");
rDetails1.setTypeOfAllocation("Comm");
rDetails1.setStatus("pending");
System.out.println(client.createAllocationRequest(rDetails1));
System.out.println("######################");
System.out.println("Testing deleteAllocationRequest() ");
System.out.println(client.deleteAllocationRequest("123456"));
System.out.println("######################");
System.out.println("Testing getAllocationRequest() ");
UserAllocationDetail userAllocationDetail = client.getAllocationRequest("123456");
System.out.println("Successful" + userAllocationDetail.getProjectDescription());
System.out.println("######################");
System.out.println("Testing updateAllocationRequest() ");
UserAllocationDetail reqDetailsObj = new UserAllocationDetail();
reqDetailsObj.setProjectId("123456");
reqDetailsObj.setTitle("Title Temp");
System.out.println(client.updateAllocationRequest(reqDetailsObj));
System.out.println("######################");
System.out.println("Testing isAdmin() ");
System.out.println("Successful: " + client.isAdmin("admin"));
System.out.println("Testing isReviewer() ");
System.out.println("Successful: " + client.isReviewer("reviewer1"));
System.out.println("######################");
System.out.println("Testing getAllRequestsForAdmin() ");
List<UserAllocationDetail> userAllocationDetailList = client.getAllRequestsForAdmin("admin");
for (UserAllocationDetail object : userAllocationDetailList) {
System.out.println(object.getProjectId());
}
System.out.println("######################");
System.out.println("Testing assignReviewers() ");
System.out.println(client.assignReviewers("123456", "reviewer1", "admin"));
System.out.println(client.assignReviewers("123456", "reviewer2", "admin"));
System.out.println(client.assignReviewers("1234", "reviewer2", "admin"));
System.out.println(client.assignReviewers("1234", "reviewer3", "admin"));
System.out.println("######################");
System.out.println("Testing getAllRequestsForReviewers() ");
List<UserAllocationDetail> userAllocationDetailList1 = client.getAllRequestsForReviewers("reviewer2");
for (UserAllocationDetail object : userAllocationDetailList1) {
System.out.println(object.getProjectId());
}
System.out.println("######################");
System.out.println("Testing getUserDetails() ");
UserDetail userDetail = client.getUserDetails("admin");
System.out.println(userDetail.getEmail());
System.out.println("######################");
System.out.println("Testing updateRequestByReviewer() ");
ReviewerAllocationDetail reviewerAllocationDetail = new ReviewerAllocationDetail();
reviewerAllocationDetail.setProjectId("123456");
reviewerAllocationDetail.setUsername("reviewer2");
reviewerAllocationDetail.setMaxMemoryPerCpu(15L);
System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail));
ReviewerAllocationDetail reviewerAllocationDetail1 = new ReviewerAllocationDetail();
reviewerAllocationDetail1.setProjectId("123456");
reviewerAllocationDetail1.setUsername("reviewer1");
reviewerAllocationDetail1.setMaxMemoryPerCpu(5L);
System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail1));
System.out.println("######################");
System.out.println("Testing getAllReviewsForARequest() ");
List<ReviewerAllocationDetail> reviewerAllocationDetailList = client.getAllReviewsForARequest("123456");
for (ReviewerAllocationDetail object : reviewerAllocationDetailList) {
System.out.println(object.getMaxMemoryPerCpu());
}
System.out.println("######################");
System.out.println("Testing getAllUnassignedReviewersForRequest() ");
List<UserDetail> userDetailList = client.getAllUnassignedReviewersForRequest("123456");
for (UserDetail object : userDetailList) {
System.out.println(object.getUsername());
}
System.out.println("######################");
System.out.println("Testing approveRequest() ");
System.out.println(client.approveRequest("123456", "admin", 1l, 2l, 50l));
System.out.println("######################");
System.out.println("Testing rejectRequest() ");
System.out.println(client.rejectRequest("1234", "admin"));
System.out.println("######################");
transport.close();
} catch (TTransportException e) {
e.printStackTrace();
} catch (TException x) {
x.printStackTrace();
} finally {
//transport.close();
}
}
}
| 9,070 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-stubs/src/main/java/org/apache/airavata/allocation/manager/client/NotificationTestClient.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.apache.airavata.allocation.manager.client;
import java.util.List;
import org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.airavata.allocation.manager.models.UserAllocationDetail;
import org.apache.airavata.allocation.manager.models.UserDetail;
import org.apache.airavata.allocation.manager.service.cpi.AllocationRegistryService;
public class NotificationTestClient {
public static void main(String[] args) {
try {
TTransport transport;
transport = new TSocket("localhost", 9040);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
AllocationRegistryService.Client client = new AllocationRegistryService.Client(protocol);
System.out.println("Started client");
// System.out.println("Testing createAllocationRequest() ");
//
// UserAllocationDetail requestDetails = new UserAllocationDetail();
// requestDetails.setProjectId("1115");
// requestDetails.setUsername("nikitha");
// requestDetails.setRequestedDate(101L);
// requestDetails.setTitle("Test");
// requestDetails.setProjectDescription("Test");
// requestDetails.setTypeOfAllocation("Comm");
// requestDetails.setStatus("pending");
//
// System.out.println(client.createAllocationRequest(requestDetails));
// UserAllocationDetail rDetails1 = new UserAllocationDetail();
// rDetails1.setProjectId("1234");
// rDetails1.setUsername("madrina");
// rDetails1.setRequestedDate(101L);
// rDetails1.setTitle("Test");
// rDetails1.setProjectDescription("Test");
// rDetails1.setTypeOfAllocation("Comm");
// rDetails1.setStatus("pending");
//
// System.out.println(client.createAllocationRequest(rDetails1));
//
// System.out.println("######################");
//
// System.out.println("Testing deleteAllocationRequest() ");
//
// System.out.println(client.deleteAllocationRequest("123456"));
//
// System.out.println("######################");
//
// System.out.println("Testing assignReviewers() ");
//
// System.out.println(client.assignReviewers("123456", "reviewer1", "admin"));
// System.out.println(client.assignReviewers("123456", "reviewer2", "admin"));
System.out.println(client.assignReviewers("1234", "reviewer2", "admin"));
System.out.println(client.assignReviewers("1234", "reviewer3", "admin"));
//
// System.out.println("######################");
//
//
//
// System.out.println("Testing updateRequestByReviewer() ");
// ReviewerAllocationDetail reviewerAllocationDetail = new ReviewerAllocationDetail();
// reviewerAllocationDetail.setProjectId("123456");
// reviewerAllocationDetail.setUsername("reviewer2");
// reviewerAllocationDetail.setMaxMemoryPerCpu(15L);
// System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail));
//
// ReviewerAllocationDetail reviewerAllocationDetail1 = new ReviewerAllocationDetail();
// reviewerAllocationDetail1.setProjectId("123456");
// reviewerAllocationDetail1.setUsername("reviewer1");
// reviewerAllocationDetail1.setMaxMemoryPerCpu(5L);
// System.out.println(client.updateRequestByReviewer(reviewerAllocationDetail1));
//
//
//
System.out.println("Testing approveRequest() ");
System.out.println(client.approveRequest("1234", "admin", 1l, 2l, 50l));
//
// System.out.println("######################");
//
System.out.println("Testing rejectRequest() ");
System.out.println(client.rejectRequest("1234", "admin"));
//
// System.out.println("######################");
transport.close();
} catch (TTransportException e) {
e.printStackTrace();
} catch (TException x) {
x.printStackTrace();
} finally {
//transport.close();
}
}
}
| 9,071 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/test/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/test/java/org/apache/airavata/allocation/manager/util/Initialize.java | /**
*
* 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.allocation.manager.util;
import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.allocation.manager.db.utils.JPAUtils;
import org.apache.derby.drda.NetworkServerControl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.URI;
import java.sql.*;
import java.util.StringTokenizer;
public class Initialize {
// private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
// public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
// public String scriptName ;
// private NetworkServerControl server;
// private static final String delimiter = ";";
// public static final String PERSISTANT_DATA = "Configuration";
//
// public Initialize(String scriptName) {
// this.scriptName = scriptName;
// }
//
// public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
// if (suffix.length() > buffer.length()) {
// return false;
// }
// // this loop is done on purpose to avoid memory allocation performance
// // problems on various JDKs
// // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
// // implementation is ok though does allocation/copying
// // StringBuffer.toString().endsWith() does massive memory
// // allocation/copying on JDK 1.5
// // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
// int endIndex = suffix.length() - 1;
// int bufferIndex = buffer.length() - 1;
// while (endIndex >= 0) {
// if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
// return false;
// }
// bufferIndex--;
// endIndex--;
// }
// return true;
// }
//
// private static boolean isServerStarted(NetworkServerControl server, int ntries)
// {
// for (int i = 1; i <= ntries; i ++)
// {
// try {
// Thread.sleep(500);
// server.ping();
// return true;
// }
// catch (Exception e) {
// if (i == ntries)
// return false;
// }
// }
// return false;
// }
//
// public void initializeDB() throws SQLException{
// String jdbcUrl = null;
// String jdbcUser = null;
// String jdbcPassword = null;
// try{
// jdbcUrl = ServerSettings.getSetting("sharingcatalog.jdbc.url");
// jdbcUser = ServerSettings.getSetting("sharingcatalog.jdbc.user");
// jdbcPassword = ServerSettings.getSetting("sharingcatalog.jdbc.password");
// jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
// } catch (ApplicationSettingsException e) {
// logger.error("Unable to read properties", e);
// }
// startDerbyInServerMode();
// if(!isServerStarted(server, 20)){
// throw new RuntimeException("Derby server cound not started within five seconds...");
// }
//
// Connection conn = null;
// try {
// Class.forName(JPAUtils.readServerProperties(JPAUtils.SHARING_REG_JDBC_DRIVER)).newInstance();
// conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
// if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
// executeSQLScript(conn);
// logger.info("New Database created for Registry");
// } else {
// logger.debug("Database already created for Registry!");
// }
// } catch (Exception e) {
// logger.error(e.getMessage(), e);
// throw new RuntimeException("Database failure", e);
// } finally {
// try {
// if (conn != null){
// if (!conn.getAutoCommit()) {
// conn.commit();
// }
// conn.close();
// }
// } catch (SQLException e) {
// logger.error(e.getMessage(), e);
// }
// }
// }
//
// public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
// try {
// System.out.println("Running a query to test the database tables existence.");
// // check whether the tables are already created with a query
// Statement statement = null;
// try {
// statement = conn.createStatement();
// ResultSet rs = statement.executeQuery("select * from " + tableName);
// if (rs != null) {
// rs.close();
// }
// } finally {
// try {
// if (statement != null) {
// statement.close();
// }
// } catch (SQLException e) {
// return false;
// }
// }
// } catch (SQLException e) {
// return false;
// }
//
// return true;
// }
//
// private void executeSQLScript(Connection conn) throws Exception {
// StringBuffer sql = new StringBuffer();
// BufferedReader reader = null;
// try{
//
// InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName);
// reader = new BufferedReader(new InputStreamReader(inputStream));
// String line;
// while ((line = reader.readLine()) != null) {
// line = line.trim();
// if (line.startsWith("//")) {
// continue;
// }
// if (line.startsWith("--")) {
// continue;
// }
// StringTokenizer st = new StringTokenizer(line);
// if (st.hasMoreTokens()) {
// String token = st.nextToken();
// if ("REM".equalsIgnoreCase(token)) {
// continue;
// }
// }
// sql.append(" ").append(line);
//
// // SQL defines "--" as a comment to EOL
// // and in Oracle it may contain a hint
// // so we cannot just remove it, instead we must end it
// if (line.indexOf("--") >= 0) {
// sql.append("\n");
// }
// if ((checkStringBufferEndsWith(sql, delimiter))) {
// executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
// sql.replace(0, sql.length(), "");
// }
// }
// // Catch any statements not followed by ;
// if (sql.length() > 0) {
// executeSQL(sql.toString(), conn);
// }
// }catch (IOException e){
// logger.error("Error occurred while executing SQL script for creating Airavata database", e);
// throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
// }finally {
// if (reader != null) {
// reader.close();
// }
//
// }
//
// }
//
// private static void executeSQL(String sql, Connection conn) throws Exception {
// // Check and ignore empty statements
// if ("".equals(sql.trim())) {
// return;
// }
//
// Statement statement = null;
// try {
// logger.debug("SQL : " + sql);
//
// boolean ret;
// int updateCount = 0, updateCountTotal = 0;
// statement = conn.createStatement();
// ret = statement.execute(sql);
// updateCount = statement.getUpdateCount();
// do {
// if (!ret) {
// if (updateCount != -1) {
// updateCountTotal += updateCount;
// }
// }
// ret = statement.getMoreResults();
// if (ret) {
// updateCount = statement.getUpdateCount();
// }
// } while (ret);
//
// logger.debug(sql + " : " + updateCountTotal + " rows affected");
//
// SQLWarning warning = conn.getWarnings();
// while (warning != null) {
// logger.warn(warning + " sql warning");
// warning = warning.getNextWarning();
// }
// conn.clearWarnings();
// } catch (SQLException e) {
// if (e.getSQLState().equals("X0Y32")) {
// // eliminating the table already exception for the derby
// // database
// logger.info("Table Already Exists", e);
// } else {
// throw new Exception("Error occurred while executing : " + sql, e);
// }
// } finally {
// if (statement != null) {
// try {
// statement.close();
// } catch (SQLException e) {
// logger.error("Error occurred while closing result set.", e);
// }
// }
// }
// }
//
// private void startDerbyInServerMode() {
// try {
// System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
// String jdbcURL = JPAUtils.readServerProperties(JPAUtils.SHARING_REG_JDBC_URL);
// String cleanURI = jdbcURL.substring(5);
// URI uri = URI.create(cleanURI);
// server = new NetworkServerControl(InetAddress.getByName(uri.getHost()),
// 20000,
// JPAUtils.readServerProperties(JPAUtils.SHARING_REG_JDBC_USER), JPAUtils.readServerProperties(JPAUtils.SHARING_REG_JDBC_USER));
// java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
// server.start(consoleWriter);
// } catch (IOException e) {
// logger.error("Unable to start Apache derby in the server mode! Check whether " +
// "specified port is available");
// } catch (Exception e) {
// logger.error("Unable to start Apache derby in the server mode! Check whether " +
// "specified port is available");
// }
//
// }
//
// public void stopDerbyServer() throws SQLException{
// try {
// server.shutdown();
// } catch (Exception e) {
// logger.error(e.getMessage(), e);
// throw new SQLException("Error while stopping derby server", e);
// }
// }
}
| 9,072 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/server/AllocationManagerServerHandler.java | /**
*
* 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.allocation.manager.server;
import static java.lang.System.in;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.allocation.manager.client.NotificationManager;
import org.apache.airavata.allocation.manager.db.repositories.*;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.db.utils.JPAUtils;
import org.apache.airavata.allocation.manager.models.*;
import org.apache.airavata.allocation.manager.service.cpi.AllocationRegistryService;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AllocationManagerServerHandler implements AllocationRegistryService.Iface {
private final static Logger logger = LoggerFactory.getLogger(AllocationManagerServerHandler.class);
public static String OWNER_PERMISSION_NAME = "OWNER";
public AllocationManagerServerHandler()
throws AllocationManagerException, ApplicationSettingsException, TException, Exception {
JPAUtils.initializeDB();
}
@Override
public boolean createUser(UserDetail userDetail) throws TException {
// TODO Auto-generated method stub
try {
UserDetail create = (new UserDetailRepository()).create(userDetail);
return true;
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
// Implementing createAllocationRequest method
@Override
public String createAllocationRequest(UserAllocationDetail reqDetails)
throws AllocationManagerException, TException {
try {
if ((new UserAllocationDetailRepository()).isExists(reqDetails.getProjectId())) {
throw new TException("There exist project with the id");
}
reqDetails.setStatus(DBConstants.RequestStatus.PENDING);
UserAllocationDetail create = (new UserAllocationDetailRepository()).create(reqDetails);
String projectId =reqDetails.getProjectId();
(new NotificationManager()).notificationSender(projectId, "NEW_REQUEST");
return projectId;
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public boolean deleteAllocationRequest(String projectId) throws TException {
try {
(new UserAllocationDetailRepository()).delete(projectId);
(new NotificationManager()).notificationSender(projectId, "NEW_REQUEST");
return true;
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public boolean updateAllocationRequest(UserAllocationDetail reqDetails) throws TException {
try {
if ((new UserAllocationDetailRepository()).update(reqDetails).getProjectId() != null) {
return true;
}
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
return false;
}
@Override
public UserAllocationDetail getAllocationRequest(String projectId) throws TException {
try {
return (new UserAllocationDetailRepository().get(projectId));
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public boolean isAdmin(String userName) throws AllocationManagerException, TException {
try {
UserDetail objUser = getUserDetails(userName);
if (objUser == null) {
throw new IllegalArgumentException();
}
return objUser.userType.equals(DBConstants.UserType.ADMIN);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public boolean isReviewer(String userName) throws AllocationManagerException, TException {
try {
UserDetail objUser = getUserDetails(userName);
if (objUser == null) {
throw new IllegalArgumentException();
}
return objUser.userType.equals(DBConstants.UserType.REVIEWER);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public List<UserAllocationDetail> getAllRequestsForReviewers(String userName)
throws AllocationManagerException, TException {
List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
try {
if (!isReviewer(userName)) {
throw new AllocationManagerException().setMessage("Invalid reviewer id!");
}
List<ProjectReviewer> projReviewerList = (new ProjectReviewerRepository()).getProjectForReviewer(userName);
List<String> projectIds = new ArrayList<String>();
for (ProjectReviewer objProj : projReviewerList) {
projectIds.add(objProj.getProjectId());
}
return new UserAllocationDetailRepository().get(projectIds);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public UserDetail getUserDetails(String userName) throws AllocationManagerException, TException {
try {
return (new UserDetailRepository()).get(userName);
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public List<UserAllocationDetail> getAllRequestsForAdmin(String userName) throws TException {
List<UserAllocationDetail> userAllocationDetailList = new ArrayList<UserAllocationDetail>();
try {
if (!isAdmin(userName)) {
throw new AllocationManagerException().setMessage("Invalid admin id!");
}
userAllocationDetailList = new UserAllocationDetailRepository().getAllUserRequests();
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
return userAllocationDetailList;
}
@Override
public boolean assignReviewers(String projectId, String reviewerId, String adminId) throws TException {
try {
if (!isAdmin(adminId)) {
throw new AllocationManagerException().setMessage("Invalid admin id!");
}
if (!isReviewer(reviewerId)) {
throw new AllocationManagerException().setMessage("Invalid reviewer id!");
}
ProjectReviewer projectReviewer = new ProjectReviewer();
projectReviewer.setProjectId(projectId);
projectReviewer.setReviewer(reviewerId);
ProjectReviewer projectReviewerObj = new ProjectReviewerRepository().create(projectReviewer);
if (projectReviewerObj.getProjectId() != null) {
// Update the status to under review.
// Construct the primary key
UserAllocationDetail userAllocationDetail = new UserAllocationDetailRepository().get(projectId)
.setStatus(DBConstants.RequestStatus.UNDER_REVIEW);
// Updates the request
new UserAllocationDetailRepository().update(userAllocationDetail);
}
(new NotificationManager()).notificationSender(projectId, "ASSIGN_REQUEST");
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
return true;
}
@Override
public List<ReviewerAllocationDetail> getAllReviewsForARequest(String projectId) throws TException {
List<ReviewerAllocationDetail> reviewerAllocationDetailList = new ArrayList<ReviewerAllocationDetail>();
try {
reviewerAllocationDetailList = new ReviewerAllocationDetailRepository().getAllReviewsForARequest(projectId);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
return reviewerAllocationDetailList;
}
@Override
public List<UserDetail> getAllReviewers() throws TException {
try {
return new UserDetailRepository().getAllReviewers();
} catch (Exception ex) {
java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE, null,
ex);
}
return null;
}
@Override
public boolean updateRequestByReviewer(ReviewerAllocationDetail reviewerAllocationDetail) throws TException {
try {
ReviewerAllocationDetail reviewerAllocationDetailObj = new ReviewerAllocationDetail();
reviewerAllocationDetailObj = new ReviewerAllocationDetailRepository()
.isProjectExists(reviewerAllocationDetail.getProjectId(), reviewerAllocationDetail.getUsername());
if (reviewerAllocationDetailObj != null) {
reviewerAllocationDetail.setId(reviewerAllocationDetailObj.getId());
reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository())
.update(reviewerAllocationDetail);
} else {
reviewerAllocationDetailObj = (new ReviewerAllocationDetailRepository())
.create(reviewerAllocationDetail);
}
if (reviewerAllocationDetailObj.getProjectId() != null) {
return true;
}
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
return false;
}
/* Method to get a list of all reviewers not yet assigned to a request */
@Override
public List<UserDetail> getAllUnassignedReviewersForRequest(String projectId) throws TException {
List<UserDetail> userDetailList = getAllReviewers();
// TO_DO part
List<UserDetail> reviewerList = new ArrayList<UserDetail>();
for (UserDetail userDetailObj : userDetailList) {
try {
if (!new ProjectReviewerRepository().isProjectExists(projectId, userDetailObj.getUsername())) {
reviewerList.add(userDetailObj);
}
} catch (Exception ex) {
java.util.logging.Logger.getLogger(AllocationManagerServerHandler.class.getName()).log(Level.SEVERE,
null, ex);
}
}
return reviewerList;
}
/*
* Method to update the request's start date, end date, status and award
* allocation on approval
*/
@Override
public boolean approveRequest(String projectId, String adminId, long startDate, long endDate, long awardAllocation)
throws TException {
try {
if (!isAdmin(adminId)) {
throw new AllocationManagerException().setMessage("Invalid admin id!");
}
// Create UserAllocationDetail object to call update method
UserAllocationDetail userAllocDetail = new UserAllocationDetail();
userAllocDetail = new UserAllocationDetailRepository().get(projectId);
userAllocDetail.setStatus(DBConstants.RequestStatus.APPROVED);
userAllocDetail.setStartDate(startDate);
userAllocDetail.setEndDate(endDate);
userAllocDetail.setAwardAllocation(awardAllocation);
(new NotificationManager()).notificationSender(projectId, "APPROVE_REQUEST");
// updates the request
return updateAllocationRequest(userAllocDetail);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
/* Method to update the request status to rejected on reject of a request */
@Override
public boolean rejectRequest(String projectId, String adminId) throws TException {
try {
if (!isAdmin(adminId)) {
throw new AllocationManagerException().setMessage("Invalid admin id!");
}
// Create UserAllocationDetail object to call update method
UserAllocationDetail userAllocDetail = new UserAllocationDetail();
userAllocDetail = new UserAllocationDetailRepository().get(projectId);
userAllocDetail.setStatus(DBConstants.RequestStatus.REJECTED);
// Updates the request
(new NotificationManager()).notificationSender(projectId, "DENY_REQUEST");
return updateAllocationRequest(userAllocDetail);
} catch (Exception ex) {
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public String getAllocationRequestStatus(String projectId) throws TException {
try {
return (new UserAllocationDetailRepository().get(projectId).getStatus());
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public String getAllocationRequestUserEmail(String projectId) throws TException {
try {
String username = getAllocationRequestUserName(projectId);
return ((new UserDetailRepository()).get(username)).getEmail();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public String getAllocationRequestUserName(String projectId) throws org.apache.thrift.TException {
try {
return ((new UserAllocationDetailRepository()).get(projectId)).getUsername();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
@Override
public String getAllocationManagerAdminEmail(String userType) throws TException {
try {
return (new UserDetailRepository()).getAdminDetails().getEmail();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
throw new AllocationManagerException()
.setMessage(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex));
}
}
public List<String> getEmailIdsOfReviewersForRequest(String projectId) {
List<String> reviewerEmailList = new ArrayList<>();
try {
for (ReviewerAllocationDetail s : getAllReviewsForARequest(projectId)) {
reviewerEmailList.add(getUserDetails(s.getUsername()).getEmail());
}
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return reviewerEmailList;
}
}
| 9,073 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/server/TestServer.java | package org.apache.airavata.allocation.manager.server;
import org.apache.airavata.allocation.manager.service.cpi.AllocationRegistryService;
import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.thrift.TException;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TServer.Args;
import org.apache.thrift.server.TSimpleServer;
public class TestServer {
public static void StartsimpleServer(AllocationRegistryService.Processor<AllocationManagerServerHandler> processor) {
try {
TServerTransport serverTransport = new TServerSocket(9040);
TServer server = new TSimpleServer(
new Args(serverTransport).processor(processor));
// Use this for a multithreaded server
// TServer server = new TThreadPoolServer(new
// TThreadPoolServer.Args(serverTransport).processor(processor));
System.out.println("Starting the Resource request server...");
server.serve();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws TException, ApplicationSettingsException {
try {
StartsimpleServer(new AllocationRegistryService.Processor<AllocationManagerServerHandler>(
new AllocationManagerServerHandler()));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | 9,074 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/utils/Constants.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.apache.airavata.allocation.manager.utils;
import org.apache.airavata.common.utils.DBEventService;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author madrinathapa
*/
public class Constants {
/**
* List of publishers in which allocation manager service is interested.
* Add publishers as required
*/
public static final List<String> PUBLISHERS = new ArrayList<String>(){{add(DBEventService.USER_PROFILE.toString());};};
}
| 9,075 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/JdbcStorage.java | /**
*
* 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.allocation.manager.db.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.*;
public class JdbcStorage {
private static Logger log = LoggerFactory.getLogger(JdbcStorage.class);
private ConnectionPool connectionPool;
public JdbcStorage(String jdbcUrl, String jdbcDriver) {
// default init connection and max connection
this(3, 50, jdbcUrl, jdbcDriver, true);
}
public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) {
try {
if (enableTransactions) {
connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false,
Connection.TRANSACTION_SERIALIZABLE);
} else {
connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true);
}
} catch (Exception e) {
throw new RuntimeException("Failed to create database connection pool.", e);
}
}
/**
* Check if this connection pool is auto commit or not
*
* @return
*/
public boolean isAutoCommit() {
return connectionPool.isAutoCommit();
}
public void commit(Connection conn) {
try {
if (conn != null && !conn.getAutoCommit()) {
conn.commit();
}
} catch (SQLException sqle) {
log.error("Cannot commit data", sqle);
}
}
public void commitAndFree(Connection conn) {
commit(conn);
closeConnection(conn);
}
public void rollback(Connection conn) {
try {
if (conn != null && !conn.getAutoCommit()) {
conn.rollback();
}
} catch (SQLException sqle) {
log.error("Cannot Rollback data", sqle);
}
}
public void rollbackAndFree(Connection conn) {
rollback(conn);
closeConnection(conn);
}
public Connection connect() {
Connection conn = null;
try {
conn = connectionPool.getConnection();
} catch (SQLException e) {
log.error(e.getMessage(), e);
}
return conn;
}
/**
* This method is provided so that you can have better control over the statement. For example: You can use
* stmt.setString to convert quotation mark automatically in an UPDATE statement
*
* NOTE: Statement is closed after execution
*/
public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException {
int rows = 0;
try {
rows = stmt.executeUpdate();
if (rows == 0) {
log.info("Problem: 0 rows affected by insert/update/delete statement.");
}
} finally {
stmt.close();
}
return rows;
}
public int countRow(String tableName, String columnName) throws SQLException {
String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName);
int count = -1;
Connection conn = null;
PreparedStatement stmt = null;
try {
conn = connectionPool.getConnection();
stmt = conn.prepareStatement(query);
ResultSet rs = stmt.executeQuery();
rs.next();
count = rs.getInt(1);
commit(conn);
} catch (SQLException sql) {
rollback(conn);
throw sql;
} finally {
try {
if (stmt != null && !stmt.isClosed()) {
stmt.close();
}
} finally {
closeConnection(conn);
}
}
return count;
}
public void quietlyClose(Connection conn, Statement... stmts) {
if (stmts != null) {
for (Statement stmt : stmts) {
try {
if (stmt != null && !stmt.isClosed()) {
stmt.close();
}
} catch (SQLException sql) {
log.error(sql.getMessage(), sql);
}
}
}
closeConnection(conn);
}
public void closeConnection(Connection conn) {
if (conn != null) {
connectionPool.free(conn);
}
}
public void closeAllConnections() {
if (connectionPool != null)
connectionPool.dispose();
}
public void shutdown() throws SQLException {
connectionPool.shutdown();
}
} | 9,076 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/ConnectionPool.java | /**
*
* 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.allocation.manager.db.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Stack;
import java.util.concurrent.Semaphore;
/**
* A class for preallocating, recycling, and managing JDBC connections.
*/
public class ConnectionPool {
private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class);
private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes
private String driver;
private String url;
private String username;
private String password;
private String jdbcUrl;
private int maxConnections;
private boolean autoCommit = true;
private boolean waitIfBusy;
private Semaphore needConnection = new Semaphore(0);
private boolean stop;
private Stack<Connection> availableConnections;
private Stack<Connection> busyConnections;
private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>();
private String urlType = "";
private DataSource datasource;
private int transactionIsolation = Connection.TRANSACTION_NONE;
private Thread clenupThread;
private Thread producerThread;
public ConnectionPool(String driver, String url, String username, String password, int initialConnections,
int maxConnections, boolean waitIfBusy) throws SQLException {
this.driver = driver;
this.url = url;
this.username = username;
this.password = password;
this.urlType = "speratedURL";
initialize(initialConnections, maxConnections, waitIfBusy);
}
public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections,
boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException {
this.driver = driver;
this.jdbcUrl = jdbcUrl;
this.urlType = "simpleURL";
this.autoCommit = autoCommit;
this.transactionIsolation = transactionIsolation;
initialize(initialConnections, maxConnections, waitIfBusy);
}
public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy)
throws SQLException {
this.driver = driver;
this.jdbcUrl = jdbcUrl;
this.urlType = "simpleURL";
initialize(initialConnections, maxConnections, waitIfBusy);
}
public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy)
throws SQLException {
this.urlType = "dataSource";
this.datasource = dataSource;
initialize(initialConnections, maxConnections, waitIfBusy);
}
/**
* Check if this connection pool is auto commit or not
*
* @return
*/
public boolean isAutoCommit() {
return this.autoCommit;
}
private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
this.maxConnections = maxConnections;
this.waitIfBusy = waitIfBusy;
int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections;
availableConnections = new Stack<Connection>();
busyConnections = new Stack<Connection>();
for (int i = 0; i < sizeOfConnections; i++) {
Connection con = makeNewConnection();
setTimeStamp(con);
availableConnections.push(con);
}
producerThread = new Thread(new FillUpThread());
producerThread.start();
clenupThread = new Thread(new CleanUpThread());
clenupThread.start();
}
public synchronized Connection getConnection() throws SQLException {
if (!availableConnections.isEmpty()) {
Connection existingConnection = availableConnections.pop();
// If connection on available list is closed (e.g.,
// it timed out), then remove it from available list
// and race for a connection again.
if (existingConnection.isClosed()) {
lastAccessTimeRecord.remove(existingConnection);
// notifyAll for fairness
notifyAll();
} else {
busyConnections.push(existingConnection);
setTimeStamp(existingConnection);
return existingConnection;
}
} else if (!waitIfBusy && busyConnections.size() >= maxConnections) {
// You reached maxConnections limit and waitIfBusy flag is false.
// Throw SQLException in such a case.
throw new SQLException("Connection limit reached");
} else {
if (busyConnections.size() < maxConnections) {
// available connection is empty, but total number of connection
// doesn't reach maxConnection. Request for more connection
needConnection.release();
}
try {
// wait for free connection
wait();
} catch (InterruptedException ie) {
}
}
// always race for connection forever
return getConnection();
}
// This explicitly makes a new connection. Called in
// the foreground when initializing the ConnectionPool,
// and called in the background when running.
private Connection makeNewConnection() throws SQLException {
try {
// Load database driver if not already loaded
Class.forName(driver);
Connection connection;
// Establish network connection to database
if (urlType.equals("speratedURL")) {
connection = DriverManager.getConnection(url, username, password);
} else if (urlType.equals("simpleURL")) {
connection = DriverManager.getConnection(jdbcUrl);
} else { // if(urlType.equals("dataSource")){
connection = datasource.getConnection();
}
connection.setTransactionIsolation(this.transactionIsolation);
connection.setAutoCommit(this.autoCommit);
return connection;
} catch (ClassNotFoundException cnfe) {
// Simplify try/catch blocks of people using this by
// throwing only one exception type.
throw new SQLException("Can't find class for driver: " + driver);
}
}
private synchronized void fillUpConnection(Connection conn) {
setTimeStamp(conn);
availableConnections.push(conn);
// notify all since new connection is created
notifyAll();
}
private void setTimeStamp(Connection connection) {
lastAccessTimeRecord.put(connection, System.currentTimeMillis());
}
// The database connection cannot be left idle for too long, otherwise TCP
// connection will be broken.
/**
* From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the
* server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on
* your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most
* folks I know that run MySQL with a connection pool in high-load production environments only let connections sit
* idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one
* sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted.
*
* @throws java.sql.SQLException
*/
private boolean isConnectionStale(Connection connection) {
long currentTime = System.currentTimeMillis();
long lastAccess = lastAccessTimeRecord.get(connection);
if (currentTime - lastAccess > MAX_IDLE_TIME) {
return true;
} else
return false;
}
private synchronized void closeStaleConnections() {
// close idle connections
Iterator<Connection> iter = availableConnections.iterator();
while (iter.hasNext()) {
Connection existingConnection = iter.next();
if (isConnectionStale(existingConnection)) {
try {
existingConnection.close();
iter.remove();
} catch (SQLException sql) {
logger.error(sql.getMessage(), sql);
}
}
}
// close busy connections that have been checked out for too long.
// This should not happen since this means program has bug for not
// releasing connections .
iter = busyConnections.iterator();
while (iter.hasNext()) {
Connection busyConnection = iter.next();
if (isConnectionStale(busyConnection)) {
try {
busyConnection.close();
iter.remove();
logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]");
} catch (SQLException sql) {
logger.error(sql.getMessage(), sql);
}
}
}
}
public synchronized void free(Connection connection) {
busyConnections.removeElement(connection);
availableConnections.addElement(connection);
// Wake up threads that are waiting for a connection
notifyAll();
}
/**
* Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are
* not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed
* when garbage collected. But this method gives more control regarding when the connections are closed.
*/
public synchronized void dispose() {
logger.info("Connection Pool Shutting down");
// stop clean up thread
this.stop = true;
this.clenupThread.interrupt();
// stop producer up thread
this.producerThread.interrupt();
// close all connection
closeConnections(availableConnections);
availableConnections = new Stack<Connection>();
closeConnections(busyConnections);
busyConnections = new Stack<Connection>();
lastAccessTimeRecord.clear();
logger.info("All connection is closed");
try {
this.clenupThread.join();
this.producerThread.join();
} catch (Exception e) {
logger.error("Cannot shutdown cleanup thread", e);
}
logger.info("Connection Pool Shutdown");
}
private void closeConnections(Stack<Connection> connections) {
while (!connections.isEmpty()) {
Connection connection = connections.pop();
try {
if (!connection.isClosed()) {
connection.close();
}
} catch (SQLException sqle) {
// Ignore errors; garbage collect anyhow
logger.warn(sqle.getMessage());
}
}
}
public synchronized String toString() {
String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size()
+ ", busy=" + busyConnections.size() + ", max=" + maxConnections;
return (info);
}
class CleanUpThread implements Runnable {
public void run() {
while (!stop) {
try {
Thread.sleep(MAX_IDLE_TIME);
closeStaleConnections();
} catch (InterruptedException e) {
logger.info("Clean up thread is interrupted to close");
}
}
}
}
class FillUpThread implements Runnable {
public void run() {
while (!stop) {
try {
// block until get
needConnection.acquire();
Connection conn = makeNewConnection();
fillUpConnection(conn);
} catch (SQLException e) {
// cannot create connection (increase semaphore value back)
needConnection.release();
logger.error(e.getMessage(), e);
} catch (InterruptedException e) {
logger.info("Fill up thread is interrupted to close");
break;
}
}
}
}
public void shutdown() throws SQLException{
for (Connection c : availableConnections) {
try {
c.close();
} catch (SQLException e) {
logger.error("Error while closing the connection", e);
throw new SQLException("Error while closing the connection", e);
}
}
for (Connection c : busyConnections) {
try {
c.close();
} catch (SQLException e) {
logger.error("Error while closing the connection", e);
throw new SQLException("Error while closing the connection", e);
}
}
}
} | 9,077 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/JPAUtils.java | /**
*
* 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.allocation.manager.db.utils;
import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.allocation.manager.models.AllocationManagerException;
import org.apache.derby.drda.NetworkServerControl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.*;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URI;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
public class JPAUtils {
private final static Logger logger = LoggerFactory.getLogger(JPAUtils.class);
public static final String PERSISTENCE_UNIT_NAME = "airavata-allocation-manager-server";
@PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME)
protected static EntityManagerFactory factory;
@PersistenceContext(unitName = PERSISTENCE_UNIT_NAME)
private static EntityManager entityManager;
public synchronized static EntityManager getEntityManager() throws Exception {
if(factory==null){
String connectionProperties = "DriverClassName = com.mysql.jdbc.Driver" + "," +
"Url=jdbc:mysql://localhost:3306/resource"+ "?autoReconnect=true," +
"Username=root" + "," + "Password=root";
Map<String, String> properties = new HashMap<String, String>();
properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
properties.put("openjpa.ConnectionProperties", connectionProperties);
properties.put("openjpa.DynamicEnhancementAgent", "true");
properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
// properties.put("openjpa.DataCache", "" + readServerProperties(JPA_CACHE_ENABLED)
// + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
// properties.put("openjpa.QueryCache", "" + readServerProperties(JPA_CACHE_ENABLED)
// + "(CacheSize=" + Integer.valueOf(readServerProperties(JPA_CACHE_SIZE)) + ", SoftReferenceSize=0)");
// properties.put("openjpa.RemoteCommitProvider", "sjvm");
properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
properties.put("openjpa.jdbc.QuerySQLCache", "false");
// properties.put("openjpa.Multithreaded", "true");
properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72," +
" PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000, autoReconnect=true");
properties.put("openjpa.RuntimeUnenhancedClasses", "warn");
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
}
entityManager = factory.createEntityManager();
return entityManager;
}
public static void initializeDB() throws Exception {
String jdbcDriver = "com.mysql.jdbc.Driver";
String jdbcURl = "jdbc:mysql://localhost:3306/resource";
String jdbcUser = "root";
String jdbcPassword = "root";
jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
JdbcStorage db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
Connection conn = null;
try {
conn = db.connect();
if (!DatabaseCreator.isDatabaseStructureCreated("USER_DETAILS", conn)) {
DatabaseCreator.createRegistryDatabase("database_scripts/sharing-registry", conn);
logger.info("New Database created for Sharing Catalog !!! ");
} else {
logger.info("Database already created for Sharing Catalog !!!");
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RuntimeException("Database failure", e);
} finally {
db.closeConnection(conn);
try {
if(conn != null){
if (!conn.getAutoCommit()) {
conn.commit();
}
conn.close();
}
} catch (SQLException e) {
logger.error("Error while closing database connection...", e.getMessage(), e);
}
}
}
}
| 9,078 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/Committer.java | /**
*
* 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.allocation.manager.db.utils;
@FunctionalInterface
public interface Committer<T, R> {
R commit(T t);
} | 9,079 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/DBConstants.java | /**
*
* 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.allocation.manager.db.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DBConstants {
private final static Logger logger = LoggerFactory.getLogger(DBConstants.class);
public static int SELECT_MAX_ROWS = 1000;
public static class DomainTable {
public static final String DOMAIN_ID = "domainId";
public static final String NAME = "name";
public static final String DESCRIPTION = "description";
public static final String CREATED_TIME = "createdTime";
public static final String UPDATED_TIME = "updatedTime";
}
// Added the ProjectReviewer table fields
public static class ProjectReviewerTable {
public static final String PROJECTID = "projectId";
public static final String REVIEWER = "reviewer";
}
public static class UserAllocationDetailTable {
public static final String PROJECTID = "projectId";
public static final String USERNAME = "username";
public static final String ISPRIMARYOWNER = "isPrimaryOwner";
}
public static class UserDetailTable {
public static final String USERTYPE = "userType";
}
public static class UserType {
public static final String REVIEWER = "REVIEWER";
public static final String ADMIN = "ADMIN";
public static final String USER = "USER";
}
public static class RequestStatus {
public static final String PENDING = "PENDING";
public static final String UNDER_REVIEW = "UNDER_REVIEW";
public static final String APPROVED = "APPROVED";
public static final String REJECTED = "REJECTED";
}
}
| 9,080 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/DatabaseCreator.java | /**
*
* 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.allocation.manager.db.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.sql.*;
import java.util.StringTokenizer;
/**
* This class creates the database tables required for airavata with default configuration this
* class creates derby database in server mode. User can specify required database in appropriate
* properties files.
*/
public class DatabaseCreator {
private final static Logger logger = LoggerFactory.getLogger(DatabaseCreator.class);
public enum DatabaseType {
derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other("");
private String pattern;
private DatabaseType(String matchingPattern) {
this.pattern = matchingPattern;
}
public String getMatchingPattern() {
return this.pattern;
}
}
private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
private static final String delimiter = ";";
/**
* Creates database
*
* @throws Exception
*/
public static void createRegistryDatabase(String prefix, Connection conn) throws Exception {
createDatabase(prefix, conn);
}
/**
* Checks whether database tables are created by using select * on given table name
*
* @param tableName
* Table which should be existed
* @return <code>true</core> if checkSQL is success, else <code>false</code> .
*/
public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
try {
log.debug("Running a query to test the database tables existence.");
// check whether the tables are already created with a query
Statement statement = null;
try {
statement = conn.createStatement();
ResultSet rs = statement.executeQuery("select * from " + tableName);
if (rs != null) {
rs.close();
}
} finally {
try {
if (statement != null) {
statement.close();
}
} catch (SQLException e) {
return false;
}
}
} catch (SQLException e) {
return false;
}
return true;
}
/**
* executes given sql
*
* @param sql
* @throws Exception
*/
private static void executeSQL(String sql, Connection conn) throws Exception {
// Check and ignore empty statements
if ("".equals(sql.trim())) {
return;
}
Statement statement = null;
try {
log.debug("SQL : " + sql);
boolean ret;
int updateCount = 0, updateCountTotal = 0;
statement = conn.createStatement();
ret = statement.execute(sql);
updateCount = statement.getUpdateCount();
do {
if (!ret) {
if (updateCount != -1) {
updateCountTotal += updateCount;
}
}
ret = statement.getMoreResults();
if (ret) {
updateCount = statement.getUpdateCount();
}
} while (ret);
log.debug(sql + " : " + updateCountTotal + " rows affected");
SQLWarning warning = conn.getWarnings();
while (warning != null) {
log.info(warning + " sql warning");
warning = warning.getNextWarning();
}
conn.clearWarnings();
} catch (SQLException e) {
if (e.getSQLState().equals("X0Y32")) {
// eliminating the table already exception for the derby
// database
log.info("Table Already Exists", e);
} else {
throw new Exception("Error occurred while executing : " + sql, e);
}
} finally {
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
log.error("Error occurred while closing result set.", e);
}
}
}
}
/**
* computes relatational database type using database name
*
* @return DatabaseType
* @throws Exception
*
*/
public static DatabaseType getDatabaseType(Connection conn) throws Exception {
try {
if (conn != null && (!conn.isClosed())) {
DatabaseMetaData metaData = conn.getMetaData();
String databaseProductName = metaData.getDatabaseProductName();
return checkType(databaseProductName);
}
} catch (SQLException e) {
String msg = "Failed to create Airavata database." + e.getMessage();
log.error(msg, e);
throw new Exception(msg, e);
}
return DatabaseType.other;
}
/**
* Overloaded method with String input
*
* @return DatabaseType
* @throws Exception
*
*/
public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
return checkType(dbUrl);
}
private static DatabaseType checkType(String text) throws Exception {
try {
if (text != null) {
for (DatabaseType type : supportedDatabase) {
if (text.matches(type.getMatchingPattern()))
return type;
}
}
String msg = "Unsupported database: " + text
+ ". Database will not be created automatically by the Airavata. "
+ "Please create the database using appropriate database scripts for " + "the database.";
throw new Exception(msg);
} catch (SQLException e) {
String msg = "Failed to create Airavatadatabase." + e.getMessage();
log.error(msg, e);
throw new Exception(msg, e);
}
}
/**
* Get scripts location which is prefix + "-" + databaseType + ".sql"
*
* @param prefix
* @param databaseType
* @return script location
*/
private static String getScriptLocation(String prefix, DatabaseType databaseType) {
String scriptName = prefix + "-" + databaseType + ".sql";
log.debug("Loading database script from :" + scriptName);
return scriptName;
}
private static void createDatabase(String prefix, Connection conn) throws Exception {
Statement statement = null;
try {
conn.setAutoCommit(false);
statement = conn.createStatement();
executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
conn.commit();
log.debug("Tables are created successfully.");
} catch (SQLException e) {
String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
log.error(msg, e);
conn.rollback();
throw new Exception(msg, e);
} finally {
conn.setAutoCommit(true);
try {
if (statement != null) {
statement.close();
}
} catch (SQLException e) {
log.error("Failed to close statement.", e);
}
}
}
private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
StringBuffer sql = new StringBuffer();
BufferedReader reader = null;
try {
InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
if(is == null) {
logger.info("Script file not found at " + dbscriptName + ". Uses default database script file");
DatabaseType databaseType = DatabaseCreator.getDatabaseType(conn);
if(databaseType.equals(DatabaseType.derby)){
is = DatabaseCreator.class.getClassLoader().getResourceAsStream("sharing-registry-derby.sql");
}else if(databaseType.equals(DatabaseType.mysql)){
is = DatabaseCreator.class.getClassLoader().getResourceAsStream("sharing-registry-mysql.sql");
}
}
reader = new BufferedReader(new InputStreamReader(is));
String line;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.startsWith("//")) {
continue;
}
if (line.startsWith("--")) {
continue;
}
StringTokenizer st = new StringTokenizer(line);
if (st.hasMoreTokens()) {
String token = st.nextToken();
if ("REM".equalsIgnoreCase(token)) {
continue;
}
}
sql.append(" ").append(line);
// SQL defines "--" as a comment to EOL
// and in Oracle it may contain a hint
// so we cannot just remove it, instead we must end it
if (line.indexOf("--") >= 0) {
sql.append("\n");
}
if ((checkStringBufferEndsWith(sql, delimiter))) {
executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
sql.replace(0, sql.length(), "");
}
}
// Catch any statements not followed by ;
if (sql.length() > 0) {
executeSQL(sql.toString(), conn);
}
} catch (IOException e) {
log.error("Error occurred while executing SQL script for creating Airavata database", e);
throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
} finally {
if (reader != null) {
reader.close();
}
}
}
/**
* Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
* various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
* massive memory allocation and copying. See
*
* @param buffer
* the buffer to perform the check on
* @param suffix
* the suffix
* @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
* sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
* be <code>true</code> if the argument is the empty string.
*/
public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
if (suffix.length() > buffer.length()) {
return false;
}
// this loop is done on purpose to avoid memory allocation performance
// problems on various JDKs
// StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
// implementation is ok though does allocation/copying
// StringBuffer.toString().endsWith() does massive memory
// allocation/copying on JDK 1.5
// See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
int endIndex = suffix.length() - 1;
int bufferIndex = buffer.length() - 1;
while (endIndex >= 0) {
if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
return false;
}
bufferIndex--;
endIndex--;
}
return true;
}
} | 9,081 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/utils/ObjectMapperSingleton.java | /**
*
* 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.allocation.manager.db.utils;
import org.dozer.DozerBeanMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ObjectMapperSingleton extends DozerBeanMapper{
private final static Logger logger = LoggerFactory.getLogger(ObjectMapperSingleton.class);
private static ObjectMapperSingleton instance;
private ObjectMapperSingleton(){}
public static ObjectMapperSingleton getInstance(){
if(instance == null)
instance = new ObjectMapperSingleton();
return instance;
}
} | 9,082 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/AbstractRepository.java | /**
*
* 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.allocation.manager.db.repositories;
import org.apache.airavata.allocation.manager.db.utils.Committer;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.db.utils.JPAUtils;
import org.apache.airavata.allocation.manager.db.utils.ObjectMapperSingleton;
import org.apache.airavata.allocation.manager.models.AllocationManagerException;
import org.dozer.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public abstract class AbstractRepository<T, E, Id> {
private final static Logger logger = LoggerFactory.getLogger(AbstractRepository.class);
private Class<T> thriftGenericClass;
private Class<E> dbEntityGenericClass;
public AbstractRepository(Class<T> thriftGenericClass, Class<E> dbEntityGenericClass){
this.thriftGenericClass = thriftGenericClass;
this.dbEntityGenericClass = dbEntityGenericClass;
}
public T create(T t) throws Exception {
return update(t);
}
//FIXME do a bulk insert
public List<T> create(List<T> tList) throws Exception {
return update(tList);
}
public T update(T t) throws Exception {
Mapper mapper = ObjectMapperSingleton.getInstance();
E entity = mapper.map(t, dbEntityGenericClass);
E persistedCopy = execute(entityManager -> entityManager.merge(entity));
return mapper.map(persistedCopy, thriftGenericClass);
}
//FIXME do a bulk update
public List<T> update(List<T> tList) throws Exception {
List<T> returnList = new ArrayList<T>();
for(T temp : tList)
returnList.add(update(temp));
return returnList;
}
public boolean delete(Id id) throws Exception {
execute(entityManager -> {
E entity = entityManager.find(dbEntityGenericClass, id);
entityManager.remove(entity);
return entity;
});
return true;
}
public boolean delete(List<Id> idList) throws Exception {
for(Id id : idList)
delete(id);
return true;
}
public T get(Id id) throws Exception {
E entity = execute(entityManager -> entityManager
.find(dbEntityGenericClass, id));
Mapper mapper = ObjectMapperSingleton.getInstance();
if(entity == null)
return null;
return mapper.map(entity, thriftGenericClass);
}
public boolean isExists(Id id) throws Exception {
return get(id) != null;
}
public List<T> get(List<Id> idList) throws Exception {
List<T> returnList = new ArrayList<>();
for(Id id : idList)
returnList.add(get(id));
return returnList;
}
public List<T> select(Map<String, String> filters, int offset, int limit) throws Exception {
String query = "SELECT DISTINCT p from " + dbEntityGenericClass.getSimpleName() + " as p";
ArrayList<String> parameters = new ArrayList<>();
int parameterCount = 1;
if (filters != null && filters.size() != 0) {
query += " WHERE ";
for (String k : filters.keySet()) {
query += "p." + k + " = ?" + parameterCount + " AND ";
parameters.add(filters.get(k));
parameterCount++;
}
query = query.substring(0, query.length() - 5);
}
query += " ORDER BY p.createdTime DESC";
String queryString = query;
int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
List resultSet = execute(entityManager -> {
javax.persistence.Query q = entityManager.createQuery(queryString);
for (int i = 0; i < parameters.size(); i++) {
q.setParameter(i + 1, parameters.get(i));
}
return q.setFirstResult(offset).setMaxResults(newLimit).getResultList();
});
Mapper mapper = ObjectMapperSingleton.getInstance();
List<T> gatewayList = new ArrayList<>();
resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
return gatewayList;
}
public List<T> select(String queryString, Map<String,Object> queryParameters, int offset, int limit) throws Exception {
int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
List resultSet = execute(entityManager -> {
Query q = entityManager.createQuery(queryString);
for(Map.Entry<String, Object> queryParam : queryParameters.entrySet()){
q.setParameter(queryParam.getKey(), queryParam.getValue());
}
return q.setFirstResult(offset).setMaxResults(newLimit).getResultList();
});
Mapper mapper = ObjectMapperSingleton.getInstance();
List<T> gatewayList = new ArrayList<>();
resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
return gatewayList;
}
public <R> R execute(Committer<EntityManager, R> committer) throws Exception {
EntityManager entityManager = JPAUtils.getEntityManager();
try {
entityManager.getTransaction().begin();
R r = committer.commit(entityManager);
entityManager.getTransaction().commit();
return r;
} finally {
entityManager.close();
}
}
} | 9,083 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/ProjectReviewerRepository.java | package org.apache.airavata.allocation.manager.db.repositories;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.airavata.allocation.manager.db.entities.ProjectReviewerEntity;
import org.apache.airavata.allocation.manager.db.entities.ReviewerAllocationDetailEntity;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.models.AllocationManagerException;
import org.apache.airavata.allocation.manager.models.ProjectReviewer;
import org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ProjectReviewerRepository
extends AbstractRepository<ProjectReviewer, ProjectReviewerEntity, String> {
// private final static Logger logger =
// LoggerFactory.getLogger(DomainRepository.class);
public ProjectReviewerRepository() {
super(ProjectReviewer.class, ProjectReviewerEntity.class);
}
/* Method for getting a list of project assigned to a reviewer */
public List<ProjectReviewer> getProjectForReviewer(String reviewerUserName) throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + ProjectReviewerEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.ProjectReviewerTable.REVIEWER + " = " + "'" + reviewerUserName + "'";
//queryParameters.put(DBConstants.ProjectReviewerTable.REVIEWER, reviewerUserName);
return select(query, queryParameters, 0, -1);
}
public boolean isProjectExists(String projectId,String reviewerId) throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + ProjectReviewerEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.UserAllocationDetailTable.PROJECTID + " = '" + projectId + "'" + "AND ";
query += "p." + DBConstants.ProjectReviewerTable.REVIEWER + " = '" + reviewerId + "'";
List<ProjectReviewer> projectReviewer = select(query, queryParameters, 0, -1);
if(projectReviewer.size()>=1)
return true;
else
return false;
}
} | 9,084 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/UserAllocationDetailRepository.java | package org.apache.airavata.allocation.manager.db.repositories;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import org.apache.airavata.allocation.manager.db.entities.UserAllocationDetailEntity;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.models.UserAllocationDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserAllocationDetailRepository extends AbstractRepository<UserAllocationDetail, UserAllocationDetailEntity, String> {
// private final static Logger logger = LoggerFactory.getLogger(DomainRepository.class);
public UserAllocationDetailRepository(){
super(UserAllocationDetail.class, UserAllocationDetailEntity.class);
}
// public String getPrimaryOwner(String projectId) throws Exception{
// Map<String,Object> queryParameters = new HashMap<>();
// String query = "SELECT DISTINCT p from " + UserAllocationDetailEntity.class.getSimpleName() + " as p";
// query += " WHERE ";
// query += "p." + DBConstants.UserAllocationDetailTable.PROJECTID + " = " + projectId + " AND ";
// query += "p." + DBConstants.UserAllocationDetailTable.ISPRIMARYOWNER + " = 1" ;
// queryParameters.put(DBConstants.UserAllocationDetailTable.PROJECTID, projectId);
// return select(query, queryParameters, 0, -1).get(0).getId().getUsername();
// }
//
public List<UserAllocationDetail> getAllUserRequests() throws Exception{
Map<String,Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + UserAllocationDetailEntity.class.getSimpleName() + " as p";
return select(query, queryParameters, 0, -1);
}
// public List<UserAllocationDetail> getAllReviewsForARequest(String projectId) throws Exception{
// Map<String,Object> queryParameters = new HashMap<>();
// String query = "SELECT * from " + UserAllocationDetailEntity.class.getSimpleName();
// query += " WHERE ";
// query += DBConstants.UserAllocationDetailTable.PROJECTID + " = " + projectId + " AND ";
// query += DBConstants.UserAllocationDetailTable.ISPRIMARYOWNER + " = FALSE" ;
// queryParameters.put(DBConstants.UserAllocationDetailTable.PROJECTID, projectId);
// return select(query, queryParameters, 0, -1);
// }
} | 9,085 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/ReviewerAllocationDetailRepository.java | package org.apache.airavata.allocation.manager.db.repositories;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import org.apache.airavata.allocation.manager.db.entities.ReviewerAllocationDetailEntity;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.models.ReviewerAllocationDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ReviewerAllocationDetailRepository extends
AbstractRepository<ReviewerAllocationDetail, ReviewerAllocationDetailEntity, String> {
// private final static Logger logger =
// LoggerFactory.getLogger(DomainRepository.class);
public ReviewerAllocationDetailRepository() {
super(ReviewerAllocationDetail.class, ReviewerAllocationDetailEntity.class);
}
public List<ReviewerAllocationDetail> getAllReviewsForARequest(String projectId) throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + ReviewerAllocationDetailEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.UserAllocationDetailTable.PROJECTID + " = '" + projectId + " ' ";
return select(query, queryParameters, 0, -1);
}
public ReviewerAllocationDetail isProjectExists(String projectId,String reviewerId) throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + ReviewerAllocationDetailEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.UserAllocationDetailTable.PROJECTID + " = '" + projectId + "'" + "AND ";
query += "p." + DBConstants.UserAllocationDetailTable.USERNAME + " = '" + reviewerId + "'";
List<ReviewerAllocationDetail> reviewerAllocationDetail = select(query, queryParameters, 0, -1);
if(reviewerAllocationDetail.size()>=1)
return reviewerAllocationDetail.get(0);
else
return null;
}
} | 9,086 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/repositories/UserDetailRepository.java | package org.apache.airavata.allocation.manager.db.repositories;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.airavata.allocation.manager.db.entities.UserDetailEntity;
import org.apache.airavata.allocation.manager.db.utils.DBConstants;
import org.apache.airavata.allocation.manager.models.UserDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserDetailRepository extends AbstractRepository<UserDetail, UserDetailEntity, String> {
// private final static Logger logger =
// LoggerFactory.getLogger(DomainRepository.class);
public UserDetailRepository() {
super(UserDetail.class, UserDetailEntity.class);
}
public UserDetail getAdminDetails() throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + UserDetailEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.UserDetailTable.USERTYPE + " ='" + DBConstants.UserType.ADMIN + "'";
return select(query, queryParameters, 0, -1).get(0);
}
public List<UserDetail> getAllReviewers() throws Exception {
Map<String, Object> queryParameters = new HashMap<>();
String query = "SELECT DISTINCT p from " + UserDetailEntity.class.getSimpleName() + " as p";
query += " WHERE ";
query += "p." + DBConstants.UserDetailTable.USERTYPE + " ='" + DBConstants.UserType.REVIEWER + "'";
return select(query, queryParameters, 0, -1);
}
} | 9,087 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/entities/UserDetailEntity.java | package org.apache.airavata.allocation.manager.db.entities;
import java.io.Serializable;
import javax.persistence.*;
/**
* The persistent class for the USER_DETAILS database table.
*
*/
@Entity
@Table(name="USER_DETAILS")
@NamedQuery(name="UserDetailEntity.findAll", query="SELECT u FROM UserDetailEntity u")
public class UserDetailEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="USERNAME")
private String username;
@Lob
@Column(name="EMAIL")
private String email;
@Lob
@Column(name="FULL_NAME")
private String fullName;
@Column(name="PASSWORD")
private String password;
@Column(name="USER_TYPE")
private String userType;
public UserDetailEntity() {
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFullName() {
return this.fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUserType() {
return this.userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
} | 9,088 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/entities/ReviewerAllocationDetailEntity.java | package org.apache.airavata.allocation.manager.db.entities;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigInteger;
/**
* The persistent class for the REVIEWER_ALLOCATION_DETAILS database table.
*
*/
@Entity
@Table(name="REVIEWER_ALLOCATION_DETAILS")
@NamedQuery(name="ReviewerAllocationDetailEntity.findAll", query="SELECT r FROM ReviewerAllocationDetailEntity r")
public class ReviewerAllocationDetailEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="ID")
private int id;
@Column(name="APPLICATIONS_TO_BE_USED")
private Object applicationsToBeUsed;
@Column(name="AWARD_ALLOCATION")
private BigInteger awardAllocation;
@Column(name="DISK_USAGE_RANGE_PER_JOB")
private BigInteger diskUsageRangePerJob;
@Column(name="DOCUMENTS")
private Object documents;
@Column(name="END_DATE")
private BigInteger endDate;
@Column(name="FIELD_OF_SCIENCE")
private Object fieldOfScience;
@Column(name="KEYWORDS")
private Object keywords;
@Column(name="MAX_MEMORY_PER_CPU")
private BigInteger maxMemoryPerCpu;
@Column(name="NUMBER_OF_CPU_PER_JOB")
private BigInteger numberOfCpuPerJob;
@Column(name="PROJECT_DESCRIPTION")
private Object projectDescription;
@Column(name="PROJECT_ID")
private String projectId;
@Column(name="PROJECT_REVIEWED_AND_FUNDED_BY")
private Object projectReviewedAndFundedBy;
@Column(name="REQUESTED_DATE")
private BigInteger requestedDate;
@Column(name="SERVICE_UNITS")
private BigInteger serviceUnits;
@Column(name="SPECIFIC_RESOURCE_SELECTION")
private Object specificResourceSelection;
@Column(name="START_DATE")
private BigInteger startDate;
@Column(name="STATUS")
private String status;
@Column(name="TITLE")
private Object title;
@Column(name="TYPE_OF_ALLOCATION")
private String typeOfAllocation;
@Column(name="TYPICAL_SU_PER_JOB")
private BigInteger typicalSuPerJob;
@Column(name="USERNAME")
private String username;
public ReviewerAllocationDetailEntity() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public Object getApplicationsToBeUsed() {
return this.applicationsToBeUsed;
}
public void setApplicationsToBeUsed(Object applicationsToBeUsed) {
this.applicationsToBeUsed = applicationsToBeUsed;
}
public BigInteger getAwardAllocation() {
return this.awardAllocation;
}
public void setAwardAllocation(BigInteger awardAllocation) {
this.awardAllocation = awardAllocation;
}
public BigInteger getDiskUsageRangePerJob() {
return this.diskUsageRangePerJob;
}
public void setDiskUsageRangePerJob(BigInteger diskUsageRangePerJob) {
this.diskUsageRangePerJob = diskUsageRangePerJob;
}
public Object getDocuments() {
return this.documents;
}
public void setDocuments(Object documents) {
this.documents = documents;
}
public BigInteger getEndDate() {
return this.endDate;
}
public void setEndDate(BigInteger endDate) {
this.endDate = endDate;
}
public Object getFieldOfScience() {
return this.fieldOfScience;
}
public void setFieldOfScience(Object fieldOfScience) {
this.fieldOfScience = fieldOfScience;
}
public Object getKeywords() {
return this.keywords;
}
public void setKeywords(Object keywords) {
this.keywords = keywords;
}
public BigInteger getMaxMemoryPerCpu() {
return this.maxMemoryPerCpu;
}
public void setMaxMemoryPerCpu(BigInteger maxMemoryPerCpu) {
this.maxMemoryPerCpu = maxMemoryPerCpu;
}
public BigInteger getNumberOfCpuPerJob() {
return this.numberOfCpuPerJob;
}
public void setNumberOfCpuPerJob(BigInteger numberOfCpuPerJob) {
this.numberOfCpuPerJob = numberOfCpuPerJob;
}
public Object getProjectDescription() {
return this.projectDescription;
}
public void setProjectDescription(Object projectDescription) {
this.projectDescription = projectDescription;
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public Object getProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy;
}
public void setProjectReviewedAndFundedBy(Object projectReviewedAndFundedBy) {
this.projectReviewedAndFundedBy = projectReviewedAndFundedBy;
}
public BigInteger getRequestedDate() {
return this.requestedDate;
}
public void setRequestedDate(BigInteger requestedDate) {
this.requestedDate = requestedDate;
}
public BigInteger getServiceUnits() {
return this.serviceUnits;
}
public void setServiceUnits(BigInteger serviceUnits) {
this.serviceUnits = serviceUnits;
}
public Object getSpecificResourceSelection() {
return this.specificResourceSelection;
}
public void setSpecificResourceSelection(Object specificResourceSelection) {
this.specificResourceSelection = specificResourceSelection;
}
public BigInteger getStartDate() {
return this.startDate;
}
public void setStartDate(BigInteger startDate) {
this.startDate = startDate;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public Object getTitle() {
return this.title;
}
public void setTitle(Object title) {
this.title = title;
}
public String getTypeOfAllocation() {
return this.typeOfAllocation;
}
public void setTypeOfAllocation(String typeOfAllocation) {
this.typeOfAllocation = typeOfAllocation;
}
public BigInteger getTypicalSuPerJob() {
return this.typicalSuPerJob;
}
public void setTypicalSuPerJob(BigInteger typicalSuPerJob) {
this.typicalSuPerJob = typicalSuPerJob;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
} | 9,089 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/entities/ProjectReviewerEntity.java | package org.apache.airavata.allocation.manager.db.entities;
import java.io.Serializable;
import javax.persistence.*;
/**
* The persistent class for the PROJECT_REVIEWER database table.
*
*/
@Entity
@Table(name="PROJECT_REVIEWER")
@NamedQuery(name="ProjectReviewerEntity.findAll", query="SELECT p FROM ProjectReviewerEntity p")
public class ProjectReviewerEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="ID")
private int id;
@Column(name="PROJECT_ID")
private String projectId;
@Column(name="REVIEWER")
private String reviewer;
public ProjectReviewerEntity() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getReviewer() {
return this.reviewer;
}
public void setReviewer(String reviewer) {
this.reviewer = reviewer;
}
} | 9,090 |
0 | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db | Create_ds/airavata-sandbox/allocation-manager/airavata-allocation-manager/airavata-allocation-manager-server/src/main/java/org/apache/airavata/allocation/manager/db/entities/UserAllocationDetailEntity.java | package org.apache.airavata.allocation.manager.db.entities;
import java.io.Serializable;
import javax.persistence.*;
import java.math.BigInteger;
/**
* The persistent class for the USER_ALLOCATION_DETAILS database table.
*
*/
@Entity
@Table(name="USER_ALLOCATION_DETAILS")
@NamedQuery(name="UserAllocationDetailEntity.findAll", query="SELECT u FROM UserAllocationDetailEntity u")
public class UserAllocationDetailEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="PROJECT_ID")
private String projectId;
@Lob
@Column(name="APPLICATIONS_TO_BE_USED")
private String applicationsToBeUsed;
@Column(name="AWARD_ALLOCATION")
private BigInteger awardAllocation;
@Column(name="DISK_USAGE_RANGE_PER_JOB")
private BigInteger diskUsageRangePerJob;
@Lob
@Column(name="DOCUMENTS")
private byte[] documents;
@Column(name="END_DATE")
private BigInteger endDate;
@Lob
@Column(name="FIELD_OF_SCIENCE")
private String fieldOfScience;
@Lob
@Column(name="KEYWORDS")
private String keywords;
@Column(name="MAX_MEMORY_PER_CPU")
private BigInteger maxMemoryPerCpu;
@Column(name="NUMBER_OF_CPU_PER_JOB")
private BigInteger numberOfCpuPerJob;
@Lob
@Column(name="PROJECT_DESCRIPTION")
private String projectDescription;
@Lob
@Column(name="PROJECT_REVIEWED_AND_FUNDED_BY")
private String projectReviewedAndFundedBy;
@Column(name="REQUESTED_DATE")
private BigInteger requestedDate;
@Column(name="SERVICE_UNITS")
private BigInteger serviceUnits;
@Lob
@Column(name="SPECIFIC_RESOURCE_SELECTION")
private String specificResourceSelection;
@Column(name="START_DATE")
private BigInteger startDate;
@Column(name="STATUS")
private String status;
@Lob
@Column(name="TITLE")
private String title;
@Column(name="TYPE_OF_ALLOCATION")
private String typeOfAllocation;
@Column(name="TYPICAL_SU_PER_JOB")
private BigInteger typicalSuPerJob;
@Column(name="USERNAME")
private String username;
public UserAllocationDetailEntity() {
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getApplicationsToBeUsed() {
return this.applicationsToBeUsed;
}
public void setApplicationsToBeUsed(String applicationsToBeUsed) {
this.applicationsToBeUsed = applicationsToBeUsed;
}
public BigInteger getAwardAllocation() {
return this.awardAllocation;
}
public void setAwardAllocation(BigInteger awardAllocation) {
this.awardAllocation = awardAllocation;
}
public BigInteger getDiskUsageRangePerJob() {
return this.diskUsageRangePerJob;
}
public void setDiskUsageRangePerJob(BigInteger diskUsageRangePerJob) {
this.diskUsageRangePerJob = diskUsageRangePerJob;
}
public byte[] getDocuments() {
return this.documents;
}
public void setDocuments(byte[] documents) {
this.documents = documents;
}
public BigInteger getEndDate() {
return this.endDate;
}
public void setEndDate(BigInteger endDate) {
this.endDate = endDate;
}
public String getFieldOfScience() {
return this.fieldOfScience;
}
public void setFieldOfScience(String fieldOfScience) {
this.fieldOfScience = fieldOfScience;
}
public String getKeywords() {
return this.keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
public BigInteger getMaxMemoryPerCpu() {
return this.maxMemoryPerCpu;
}
public void setMaxMemoryPerCpu(BigInteger maxMemoryPerCpu) {
this.maxMemoryPerCpu = maxMemoryPerCpu;
}
public BigInteger getNumberOfCpuPerJob() {
return this.numberOfCpuPerJob;
}
public void setNumberOfCpuPerJob(BigInteger numberOfCpuPerJob) {
this.numberOfCpuPerJob = numberOfCpuPerJob;
}
public String getProjectDescription() {
return this.projectDescription;
}
public void setProjectDescription(String projectDescription) {
this.projectDescription = projectDescription;
}
public String getProjectReviewedAndFundedBy() {
return this.projectReviewedAndFundedBy;
}
public void setProjectReviewedAndFundedBy(String projectReviewedAndFundedBy) {
this.projectReviewedAndFundedBy = projectReviewedAndFundedBy;
}
public BigInteger getRequestedDate() {
return this.requestedDate;
}
public void setRequestedDate(BigInteger requestedDate) {
this.requestedDate = requestedDate;
}
public BigInteger getServiceUnits() {
return this.serviceUnits;
}
public void setServiceUnits(BigInteger serviceUnits) {
this.serviceUnits = serviceUnits;
}
public String getSpecificResourceSelection() {
return this.specificResourceSelection;
}
public void setSpecificResourceSelection(String specificResourceSelection) {
this.specificResourceSelection = specificResourceSelection;
}
public BigInteger getStartDate() {
return this.startDate;
}
public void setStartDate(BigInteger startDate) {
this.startDate = startDate;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getTypeOfAllocation() {
return this.typeOfAllocation;
}
public void setTypeOfAllocation(String typeOfAllocation) {
this.typeOfAllocation = typeOfAllocation;
}
public BigInteger getTypicalSuPerJob() {
return this.typicalSuPerJob;
}
public void setTypicalSuPerJob(BigInteger typicalSuPerJob) {
this.typicalSuPerJob = typicalSuPerJob;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
} | 9,091 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Authenticator/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Authenticator/src/main/java/org/apache/airavata/allocation/manager/notification/models/NotificationInformation.java | package org.apache.airavata.allocation.manager.notification.models;
import java.util.ArrayList;
import java.util.List;
public class NotificationInformation {
private String status;
List<String> SenderList = new ArrayList<String>();
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<String> getSenderList() {
return SenderList;
}
public void setSenderList(List<String> senderList) {
SenderList = senderList;
}
}
| 9,092 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Authenticator/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Authenticator/src/main/java/org/apache/airavata/allocation/manager/notification/authenticator/NotificationDetails.java | package org.apache.airavata.allocation.manager.notification.authenticator;
import java.util.ArrayList;
import java.util.List;
import org.apache.airavata.allocation.manager.notification.models.NotificationInformation;
import org.apache.airavata.allocation.manager.server.AllocationManagerServerHandler;
import org.apache.thrift.TException;
public class NotificationDetails {
public NotificationInformation getRequestDetails(String projectID, String notificationType) {
NotificationInformation result = new NotificationInformation();
try {
AllocationManagerServerHandler obj = new AllocationManagerServerHandler();
List<String> senderList = new ArrayList<String>();
if (notificationType.equals("NEW_REQUEST") || notificationType.equals("DELETE_REQUEST")) {
senderList.add(obj.getAllocationRequestUserEmail(projectID));
senderList.add(obj.getAllocationManagerAdminEmail("ADMIN"));
} else if (notificationType.equals("ASSIGN_REQUEST")) {
senderList = obj.getEmailIdsOfReviewersForRequest(projectID);
} else if (notificationType.equals("APPROVE_REQUEST")) {
senderList.add(obj.getAllocationRequestUserEmail(projectID));
} else if (notificationType.equals("DENY_REQUEST")) {
senderList.add(obj.getAllocationRequestUserEmail(projectID));
}
result.setSenderList(senderList);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
}
| 9,093 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification/receiver/NotificationReceiver.java | package org.apache.airavata.allocation.manager.notification.receiver;
import org.apache.airavata.allocation.manager.notification.authenticator.NotificationDetails;
import org.apache.airavata.allocation.manager.notification.models.NotificationInformation;
import org.apache.airavata.allocation.manager.notification.sender.MailNotification;
import org.apache.thrift.transport.TServerSocket;
import com.rabbitmq.client.*;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class NotificationReceiver {
public static void StartsimpleServer() {
try {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localHost");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare("notify", false, false, false, null);
// Comfort logging
System.out.println("Waiting for notification");
Consumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties,
byte[] body) throws IOException {
String request = new String(body, "UTF-8");
String notificationDetails[] = request.split(",");
String projectId = notificationDetails[0];
String notificationType = notificationDetails[1];
NotificationInformation information = (new NotificationDetails()).getRequestDetails(projectId,
notificationType);
(new MailNotification()).sendMail(projectId, notificationType, information.getSenderList(),projectId);
}
};
channel.basicConsume("notify", true, consumer);
} catch (Exception e) {
// Dump any error to the console
e.printStackTrace();
}
}
public static void main(String[] args) {
StartsimpleServer();
}
}
| 9,094 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Receiver/src/main/java/org/apache/airavata/allocation/manager/notification/receiver/NotificationSender.java | package org.apache.airavata.allocation.manager.notification.receiver;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
public class NotificationSender {
private final static String QUEUE_NAME = "notify";
public static void main(String[] args) {
try {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
// this is the project id and notification type that is sent
String project_ID = "1234,DENY_REQUEST";
channel.basicPublish("", QUEUE_NAME, null, project_ID.getBytes());
System.out.println(" [x] Sent the request");
// Close the channel
channel.close();
// Close the connection
connection.close();
} catch (Exception e) {
// Dump any exception to the console
e.printStackTrace();
}
}
}
| 9,095 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/sender/EmailNotificationMessage.java | package org.apache.airavata.allocation.manager.notification.sender;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import org.apache.airavata.allocation.manager.notification.models.NotificationMessage;
public class EmailNotificationMessage {
public NotificationMessage getEmailMessage(String status, String projectID) {
NotificationMessage result = new NotificationMessage();
Properties prop = new Properties();
InputStream input = null;
try {
InputStream input2 = new FileInputStream("./src/main/resources/messages.properties");
prop.load(input2);
switch (status) {
case "APPROVE_REQUEST":
result.setMessage(prop.getProperty("SUBJECT_APPROVED")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_APPROVED")+" "+projectID);
break;
case "DENY_REQUEST":
result.setMessage(prop.getProperty("SUBJECT_REJECTED")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_REJECTED")+" "+projectID);
break;
case "IN_PROGRESS":
result.setMessage(prop.getProperty("SUBJECT_IN_PROCESS")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_IN_PROCESS")+" "+projectID);
break;
case "NEW_REQUEST":
result.setMessage(prop.getProperty("SUBJECT_NEW_REQUEST")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_NEW_REQUEST")+" "+projectID);
break;
case "ASSIGN_REQUEST":
result.setMessage(prop.getProperty("SUBJECT_ASSIGN_REQUEST")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_ASSIGN_REQUEST")+" "+projectID);
break;
case "DELETE_REQUEST":
result.setMessage(prop.getProperty("SUBJECT_DELETE_REQUEST")+" "+projectID);
result.setSubject(prop.getProperty("MESSAGE_DELETE_REQUEST")+" "+projectID);
break;
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return result;
}
}
| 9,096 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/sender/MailNotification.java | package org.apache.airavata.allocation.manager.notification.sender;
import java.util.List;
import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
public class MailNotification {
public void sendMail(String requestId, String status, List<String> senderList, String projectId) {
EmailNotificationMessage message = new EmailNotificationMessage();
EmailNotificationConfiguration emailConfiguration = new EmailNotificationConfiguration();
String username = emailConfiguration.getCredentials().getUserName();
String password = emailConfiguration.getCredentials().getPassword();
String subject = message.getEmailMessage(status ,projectId).getSubject();
String body = message.getEmailMessage(status, projectId).getMessage();
mail( username, password, subject, body, senderList);
}
public void mail(String username, String password, String subject, String body, List<String> senderList) {
Email email = new SimpleEmail();
email.setHostName("smtp.googlemail.com");
email.setSmtpPort(465);
email.setAuthenticator(new DefaultAuthenticator(username, password));
email.setSSLOnConnect(true);
try {
email.setFrom(username);
email.setSubject(subject);
email.setMsg(body);
for(String s : senderList) {
email.addTo(s);
}
email.send();
} catch (EmailException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Mail sent");
}
}
| 9,097 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/sender/EmailNotificationConfiguration.java | package org.apache.airavata.allocation.manager.notification.sender;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.airavata.allocation.manager.notification.models.EmailCredentials;
public class EmailNotificationConfiguration {
public static void main(String args[]) {
EmailNotificationConfiguration obj = new EmailNotificationConfiguration();
}
public EmailCredentials getCredentials()
{
EmailCredentials result = new EmailCredentials();
Properties prop = new Properties();
InputStream input = null;
try {
InputStream input2 = new FileInputStream("./config.properties");
prop.load(input2);
result.setUserName(prop.getProperty("username"));
result.setPassword(prop.getProperty("password"));
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return result;
}
}
| 9,098 |
0 | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification | Create_ds/airavata-sandbox/allocation-manager/Notification-Manager/Notification-Sender/src/main/java/org/apache/airavata/allocation/manager/notification/models/NotificationMessage.java | /*The program in this file works to fetch a notification message for the given status from a resource file*/
package org.apache.airavata.allocation.manager.notification.models ;
public class NotificationMessage {
private String subject;
private String message;
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| 9,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.