Loading usage reporting information from the database
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayUsageReportingCommand.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayUsageReportingCommand.java
new file mode 100644
index 0000000..1b8196d
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayUsageReportingCommand.java
@@ -0,0 +1,480 @@
+/**
+ * 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.
+ */
+
+/**
+ * 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.model.workspace;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
+public class GatewayUsageReportingCommand implements org.apache.thrift.TBase<GatewayUsageReportingCommand, GatewayUsageReportingCommand._Fields>, java.io.Serializable, Cloneable, Comparable<GatewayUsageReportingCommand> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GatewayUsageReportingCommand");
+
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("command", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GatewayUsageReportingCommandStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GatewayUsageReportingCommandTupleSchemeFactory();
+
+ private java.lang.String gatewayId; // required
+ private java.lang.String command; // 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 {
+ GATEWAY_ID((short)1, "gatewayId"),
+ COMMAND((short)2, "command");
+
+ 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: // GATEWAY_ID
+ return GATEWAY_ID;
+ case 2: // COMMAND
+ return COMMAND;
+ 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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.COMMAND, new org.apache.thrift.meta_data.FieldMetaData("command", 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(GatewayUsageReportingCommand.class, metaDataMap);
+ }
+
+ public GatewayUsageReportingCommand() {
+ }
+
+ public GatewayUsageReportingCommand(
+ java.lang.String gatewayId,
+ java.lang.String command)
+ {
+ this();
+ this.gatewayId = gatewayId;
+ this.command = command;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public GatewayUsageReportingCommand(GatewayUsageReportingCommand other) {
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ if (other.isSetCommand()) {
+ this.command = other.command;
+ }
+ }
+
+ public GatewayUsageReportingCommand deepCopy() {
+ return new GatewayUsageReportingCommand(this);
+ }
+
+ @Override
+ public void clear() {
+ this.gatewayId = null;
+ this.command = null;
+ }
+
+ public java.lang.String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public void setGatewayId(java.lang.String gatewayId) {
+ this.gatewayId = gatewayId;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public java.lang.String getCommand() {
+ return this.command;
+ }
+
+ public void setCommand(java.lang.String command) {
+ this.command = command;
+ }
+
+ public void unsetCommand() {
+ this.command = null;
+ }
+
+ /** Returns true if field command is set (has been assigned a value) and false otherwise */
+ public boolean isSetCommand() {
+ return this.command != null;
+ }
+
+ public void setCommandIsSet(boolean value) {
+ if (!value) {
+ this.command = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((java.lang.String)value);
+ }
+ break;
+
+ case COMMAND:
+ if (value == null) {
+ unsetCommand();
+ } else {
+ setCommand((java.lang.String)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ case COMMAND:
+ return getCommand();
+
+ }
+ 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 GATEWAY_ID:
+ return isSetGatewayId();
+ case COMMAND:
+ return isSetCommand();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof GatewayUsageReportingCommand)
+ return this.equals((GatewayUsageReportingCommand)that);
+ return false;
+ }
+
+ public boolean equals(GatewayUsageReportingCommand that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ boolean this_present_command = true && this.isSetCommand();
+ boolean that_present_command = true && that.isSetCommand();
+ if (this_present_command || that_present_command) {
+ if (!(this_present_command && that_present_command))
+ return false;
+ if (!this.command.equals(that.command))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetGatewayId()) ? 131071 : 524287);
+ if (isSetGatewayId())
+ hashCode = hashCode * 8191 + gatewayId.hashCode();
+
+ hashCode = hashCode * 8191 + ((isSetCommand()) ? 131071 : 524287);
+ if (isSetCommand())
+ hashCode = hashCode * 8191 + command.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(GatewayUsageReportingCommand other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = java.lang.Boolean.valueOf(isSetCommand()).compareTo(other.isSetCommand());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCommand()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.command, other.command);
+ 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("GatewayUsageReportingCommand(");
+ boolean first = true;
+
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("command:");
+ if (this.command == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.command);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetGatewayId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetCommand()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'command' is unset! 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 GatewayUsageReportingCommandStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public GatewayUsageReportingCommandStandardScheme getScheme() {
+ return new GatewayUsageReportingCommandStandardScheme();
+ }
+ }
+
+ private static class GatewayUsageReportingCommandStandardScheme extends org.apache.thrift.scheme.StandardScheme<GatewayUsageReportingCommand> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, GatewayUsageReportingCommand 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: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // COMMAND
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.command = iprot.readString();
+ struct.setCommandIsSet(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();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, GatewayUsageReportingCommand struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.command != null) {
+ oprot.writeFieldBegin(COMMAND_FIELD_DESC);
+ oprot.writeString(struct.command);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class GatewayUsageReportingCommandTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public GatewayUsageReportingCommandTupleScheme getScheme() {
+ return new GatewayUsageReportingCommandTupleScheme();
+ }
+ }
+
+ private static class GatewayUsageReportingCommandTupleScheme extends org.apache.thrift.scheme.TupleScheme<GatewayUsageReportingCommand> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, GatewayUsageReportingCommand struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ oprot.writeString(struct.gatewayId);
+ oprot.writeString(struct.command);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, GatewayUsageReportingCommand struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ struct.command = iprot.readString();
+ struct.setCommandIsSet(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();
+ }
+}
+
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
index f1f877f..66eb333 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
@@ -29,9 +29,9 @@
import org.apache.airavata.helix.task.api.TaskHelper;
import org.apache.airavata.helix.task.api.annotation.TaskDef;
import org.apache.airavata.model.commons.ErrorModel;
-import org.apache.airavata.model.experiment.ExperimentModel;
-import org.apache.airavata.model.job.JobModel;
+ import org.apache.airavata.model.job.JobModel;
import org.apache.airavata.model.status.*;
+import org.apache.airavata.model.workspace.GatewayUsageReportingCommand;
import org.apache.helix.task.TaskResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -187,47 +187,19 @@
return onFail("Couldn't find job id in both submitted and verified steps. " + msg, false, null);
} else {
-
// usage reporting as the last step of job submission task
- if (getComputeResourceDescription().isGatewayUsageReporting()){
+ try {
+ mapData.setJobId(jobId);
+ boolean reportingAvailable = getRegistryServiceClient().isReportingAvailable(getGatewayId());
- try {
- ExperimentModel experiment = getRegistryServiceClient().getExperiment(getExperimentId());
- String usageReportingKey = ServerSettings.getSetting("usage.reporting.key");
- String username = URLEncoder.encode(
- experiment.getUserName(),
- StandardCharsets.UTF_8.toString()) + ":" +
- URLEncoder.encode(
- getTaskContext().getGroupComputeResourcePreference().getUsageReportingGatewayId(),
- StandardCharsets.UTF_8.toString());
+ if (reportingAvailable) {
+ GatewayUsageReportingCommand reportingCommand = getRegistryServiceClient().getGatewayReportingCommand(getGatewayId());
+ String parsedCommand = mapData.loadFromString(reportingCommand.getCommand());
+ logger.debug("Parsed usage reporting command {}", parsedCommand);
- SimpleDateFormat gmtDateFormat = new SimpleDateFormat("yyyy-MM-dd+HH:mmZ");
- gmtDateFormat.setTimeZone(TimeZone.getTimeZone("EST"));
+ Process commandSubmit = Runtime.getRuntime().exec(parsedCommand);
- String hostName = getComputeResourceDescription().getHostName();
- List<String> hostAliases = getComputeResourceDescription().getHostAliases();
- if (hostAliases != null && hostAliases.size() > 0) {
- // TODO this is a temporary fix. Properly add entries to API to fetch host specific xsederesourcename.
- hostName = hostAliases.get(0);
- }
-
- String command = String.format("curl -XPOST --data-urlencode apikey=%s " +
- "--data-urlencode gatewayuser=%s " +
- "--data-urlencode xsederesourcename=%s " +
- "--data-urlencode jobid=%s " +
- "--data-urlencode submittime='%s' " +
- "%s",
- usageReportingKey,
- username,
- hostName,
- jobId,
- gmtDateFormat.format(new Date()),
- ServerSettings.getSetting("usage.reporting.endpoint"));
-
- logger.info("Usage reporting CURL command " + command);
- Process curlSubmit = Runtime.getRuntime().exec(command);
-
- BufferedReader reader = new BufferedReader(new InputStreamReader(curlSubmit.getInputStream()));
+ BufferedReader reader = new BufferedReader(new InputStreamReader(commandSubmit.getInputStream()));
StringBuffer output = new StringBuffer();
String line;
@@ -237,14 +209,15 @@
}
logger.info("Usage reporting output " + output.toString());
- curlSubmit.waitFor();
+ commandSubmit.waitFor();
logger.info("Usage reporting completed");
- } catch (Exception e) {
- logger.error("Usage reporting failed but continuing. ", e);
+ } else {
+ logger.info("No usage reporting found");
}
+ } catch (Exception e) {
+ logger.error("Usage reporting failed but continuing. ", e);
}
-
return onSuccess("Submitted job to compute resource");
}
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/JobSubmissionTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/JobSubmissionTask.java
index 93df582..77f4d72 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/JobSubmissionTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/JobSubmissionTask.java
@@ -61,7 +61,7 @@
addMonitoringCommands(groovyMapData);
- String scriptAsString = groovyMapData.getAsString(jobManagerConfiguration.getJobDescriptionTemplateName());
+ String scriptAsString = groovyMapData.loadFromFile(jobManagerConfiguration.getJobDescriptionTemplateName());
logger.info("Generated job submission script : " + scriptAsString);
int number = new SecureRandom().nextInt();
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapBuilder.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapBuilder.java
index e76c6db..937c0e6 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapBuilder.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapBuilder.java
@@ -42,6 +42,7 @@
import java.io.File;
import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -80,6 +81,10 @@
mapData.setTaskId(taskContext.getTaskId());
mapData.setExperimentDataDir(taskContext.getProcessModel().getExperimentDataDir());
+ SimpleDateFormat gmtDateFormat = new SimpleDateFormat("yyyy-MM-dd+HH:mmZ");
+ gmtDateFormat.setTimeZone(TimeZone.getTimeZone("EST"));
+ mapData.setCurrentTime(gmtDateFormat.format(new Date()));
+
//List<String> emails = taskContext.getUserProfile().getEmails();
//if (emails != null && emails.size() > 0) {
// mapData.setGatewayUserEmail(emails.get(0));
@@ -96,6 +101,13 @@
mapData.setUserName(taskContext.getComputeResourceLoginUserName());
mapData.setShellName("/bin/bash");
+ String hostName = taskContext.getComputeResourceDescription().getHostName();
+ List<String> hostAliases = taskContext.getComputeResourceDescription().getHostAliases();
+ if (hostAliases != null && hostAliases.size() > 0) {
+ hostName = hostAliases.get(0);
+ }
+ mapData.setComputeHostName(hostName);
+
if (taskContext != null) {
try {
JobSubmissionTaskModel jobSubmissionTaskModel = ((JobSubmissionTaskModel) taskContext.getSubTaskModel());
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
index 663687d..316a34f 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
@@ -78,6 +78,9 @@
@ScriptTag(name = "jobName")
private String jobName;
+ @ScriptTag(name = "jobId")
+ private String jobId;
+
@ScriptTag(name = "workingDirectory")
private String workingDirectory;
@@ -87,9 +90,13 @@
@ScriptTag(name = "inputsAll")
private List<String> inputsAll;
+ // This is username of the airavata tries to talk to compute resources
@ScriptTag(name = "userName")
private String userName;
+ @ScriptTag(name = "currentTime")
+ private String currentTime;
+
@ScriptTag(name = "shellName")
private String shellName;
@@ -141,6 +148,10 @@
@ScriptTag(name = "experimentDataDir")
private String experimentDataDir;
+ @ScriptTag(name = "computeHostName")
+ private String computeHostName;
+
+
public Map<String, Object> getMap() {
Map<String, Object> map = new HashMap<>();
@@ -473,6 +484,30 @@
this.experimentDataDir = experimentDataDir;
}
+ public String getCurrentTime() {
+ return currentTime;
+ }
+
+ public void setCurrentTime(String currentTime) {
+ this.currentTime = currentTime;
+ }
+
+ public String getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+
+ public String getComputeHostName() {
+ return computeHostName;
+ }
+
+ public void setComputeHostName(String computeHostName) {
+ this.computeHostName = computeHostName;
+ }
+
public Map toImmutableMap() {
Map<String, Object> dataMap = new HashMap<>();
@@ -491,7 +526,23 @@
return dataMap;
}
- public String getAsString(String templateName) throws Exception {
+ public String loadFromString(String templateStr) throws Exception {
+ TemplateEngine engine = new GStringTemplateEngine();
+ Writable make;
+ try {
+ make = engine.createTemplate(templateStr).make(toImmutableMap());
+ } catch (Exception e) {
+ throw new Exception("Error while generating script using groovy map for string " + templateStr, e);
+ }
+
+ if (logger.isTraceEnabled()) {
+ logger.trace("Groovy map as string for template string " + templateStr);
+ logger.trace(make.toString());
+ }
+ return make.toString();
+ }
+
+ public String loadFromFile(String templateName) throws Exception {
URL templateUrl = ApplicationSettings.loadFile(templateName);
if (templateUrl == null) {
String error = "Template file '" + templateName + "' not found";
diff --git a/modules/ide-integration/src/main/resources/database_scripts/init/04-expcatalog-migrations.sql b/modules/ide-integration/src/main/resources/database_scripts/init/04-expcatalog-migrations.sql
index 38ba76d..1e561e6 100644
--- a/modules/ide-integration/src/main/resources/database_scripts/init/04-expcatalog-migrations.sql
+++ b/modules/ide-integration/src/main/resources/database_scripts/init/04-expcatalog-migrations.sql
@@ -2,3 +2,9 @@
ALTER TABLE EXPERIMENT_INPUT ADD COLUMN IF NOT EXISTS OVERRIDE_FILENAME VARCHAR(255);
ALTER TABLE PROCESS_INPUT ADD COLUMN IF NOT EXISTS OVERRIDE_FILENAME VARCHAR(255);
+
+CREATE TABLE IF NOT EXISTS GATEWAY_USAGE_REPORTING_COMMAND (
+ GATEWAY_ID VARCHAR(255) NOT NULL,
+ COMMAND LONGTEXT NOT NULL,
+ PRIMARY KEY (GATEWAY_ID)
+)ENGINE=InnoDB DEFAULT CHARSET=latin1;
\ No newline at end of file
diff --git a/modules/ide-integration/src/main/resources/logback.xml b/modules/ide-integration/src/main/resources/logback.xml
index 0ee0b72..98a8ca9 100644
--- a/modules/ide-integration/src/main/resources/logback.xml
+++ b/modules/ide-integration/src/main/resources/logback.xml
@@ -41,8 +41,8 @@
</rollingPolicy>
</appender>
- <logger name="ch.qos.logback" level="WARN"/>
- <logger name="org.apache.helix" level="WARN"/>
+ <logger name="ch.qos.logback" level="ERROR"/>
+ <logger name="org.apache.helix" level="ERROR"/>
<logger name="org.apache.zookeeper" level="ERROR"/>
<logger name="org.apache.airavata" level="INFO"/>
<logger name="org.hibernate" level="ERROR"/>
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/GatewayUsageReportingCommandEntity.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/GatewayUsageReportingCommandEntity.java
new file mode 100644
index 0000000..1aec78a
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/GatewayUsageReportingCommandEntity.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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.registry.core.entities.expcatalog;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+@Entity
+@Table(name = "GATEWAY_USAGE_REPORTING_COMMAND")
+public class GatewayUsageReportingCommandEntity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "GATEWAY_ID")
+ private String gatewayId;
+
+ @Lob
+ @Column(name = "COMMAND")
+ private String command;
+
+ public String getGatewayId() {
+ return gatewayId;
+ }
+
+ public void setGatewayId(String gatewayId) {
+ this.gatewayId = gatewayId;
+ }
+
+ public String getCommand() {
+ return command;
+ }
+
+ public void setCommand(String command) {
+ this.command = command;
+ }
+}
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/GatewayUsageReportingCommandRepository.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/GatewayUsageReportingCommandRepository.java
new file mode 100644
index 0000000..5c0ba5f
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/GatewayUsageReportingCommandRepository.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ package org.apache.airavata.registry.core.repositories.expcatalog;
+
+import org.apache.airavata.model.workspace.GatewayUsageReportingCommand;
+import org.apache.airavata.registry.core.entities.expcatalog.GatewayUsageReportingCommandEntity;
+import org.apache.airavata.registry.core.utils.ObjectMapperSingleton;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.dozer.Mapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class GatewayUsageReportingCommandRepository extends
+ ExpCatAbstractRepository<GatewayUsageReportingCommand, GatewayUsageReportingCommandEntity, String> {
+
+ private final static Logger logger = LoggerFactory.getLogger(GatewayRepository.class);
+
+ public GatewayUsageReportingCommandRepository() { super(GatewayUsageReportingCommand.class, GatewayUsageReportingCommandEntity.class); }
+
+ public void addGatewayUsageReportingCommand(GatewayUsageReportingCommand command) throws RegistryException {
+ String gatewayId = command.getGatewayId();
+ Mapper mapper = ObjectMapperSingleton.getInstance();
+ GatewayUsageReportingCommandEntity reportingEntity = mapper.map(command, GatewayUsageReportingCommandEntity.class);
+ execute(entityManager -> entityManager.merge(reportingEntity));
+ logger.info("Added gateway usage reporting command for gateway {} to the database", command.getGatewayId());
+ }
+
+ public GatewayUsageReportingCommand getGatewayUsageReportingCommand(String gatewayId) {
+ return get(gatewayId);
+ }
+
+ public boolean isGatewayUsageReportingCommandExists(String gatewayId) throws RegistryException {
+ return isExists(gatewayId);
+ }
+
+ public void removeGatewayUsageReportingCommand(String gatewayId) throws RegistryException {
+ if (isExists(gatewayId)) {
+ delete(gatewayId);
+ logger.info("Deleted gateway usage reporting command for gateway {}", gatewayId);
+ }
+ }
+}
diff --git a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
index 9f6fe1e..fa06080 100644
--- a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
+++ b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
@@ -115,6 +115,7 @@
<class>org.apache.airavata.registry.core.entities.expcatalog.ExperimentSummaryEntity</class>
<class>org.apache.airavata.registry.core.entities.expcatalog.GatewayEntity</class>
<class>org.apache.airavata.registry.core.entities.expcatalog.GatewayWorkerEntity</class>
+ <class>org.apache.airavata.registry.core.entities.expcatalog.GatewayUsageReportingCommandEntity</class>
<class>org.apache.airavata.registry.core.entities.expcatalog.JobEntity</class>
<class>org.apache.airavata.registry.core.entities.expcatalog.JobStatusEntity</class>
<class>org.apache.airavata.registry.core.entities.expcatalog.NotificationEntity</class>
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
index 9ee940b..d910f14 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
@@ -727,6 +727,12 @@
PRIMARY KEY (JOB_SUBMISSION_INTERFACE_ID)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE TABLE GATEWAY_USAGE_REPORTING_COMMAND (
+ GATEWAY_ID VARCHAR(255) NOT NULL,
+ COMMAND LONGTEXT NOT NULL,
+ PRIMARY KEY (GATEWAY_ID)
+)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
CREATE TABLE CONFIGURATION
(
CONFIG_KEY VARCHAR(255),
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index e54167b..222054f 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -82,6 +82,7 @@
import org.apache.airavata.model.task.TaskModel;
import org.apache.airavata.model.user.UserProfile;
import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.GatewayUsageReportingCommand;
import org.apache.airavata.model.workspace.Notification;
import org.apache.airavata.model.workspace.Project;
import org.apache.airavata.registry.api.RegistryService;
@@ -148,6 +149,7 @@
private ParsingTemplateRepository parsingTemplateRepository = new ParsingTemplateRepository();
private UserRepository userRepository = new UserRepository();
private ComputeResourceRepository computeResourceRepository = new ComputeResourceRepository();
+ private GatewayUsageReportingCommandRepository usageReportingCommandRepository = new GatewayUsageReportingCommandRepository();
/**
* Fetch Apache Registry API version
@@ -5059,4 +5061,64 @@
throw rse;
}
}
+
+ @Override
+ public boolean isReportingAvailable(String gatewayId) throws RegistryServiceException, TException {
+ try {
+ return usageReportingCommandRepository.isGatewayUsageReportingCommandExists(gatewayId);
+ } catch (Exception e) {
+ String message = "Failed to check the availability to find the reporting information for the gateway " + gatewayId;
+ logger.error(message, e);
+ RegistryServiceException rse = new RegistryServiceException();
+ rse.setMessage(message + ". More info " + e.getMessage());
+ throw rse;
+ }
+ }
+
+ @Override
+ public GatewayUsageReportingCommand getGatewayReportingCommand(String gatewayId) throws RegistryServiceException, TException {
+ try {
+ if (usageReportingCommandRepository.isGatewayUsageReportingCommandExists(gatewayId)) {
+ return usageReportingCommandRepository.getGatewayUsageReportingCommand(gatewayId);
+ } else {
+ String message = "No usage reporting information for the gateway " + gatewayId;
+ logger.error(message);
+ throw new RegistryServiceException(message);
+ }
+ } catch (RegistryServiceException e) {
+ throw e; // re-throw
+
+ } catch (Exception e) {
+ String message = "Failed to check the availability to find the reporting information for the gateway " + gatewayId;
+ logger.error(message, e);
+ RegistryServiceException rse = new RegistryServiceException();
+ rse.setMessage(message + ". More info " + e.getMessage());
+ throw rse;
+ } }
+
+ @Override
+ public void addGatewayUsageReportingCommand(GatewayUsageReportingCommand command) throws RegistryServiceException, TException {
+ try {
+ usageReportingCommandRepository.addGatewayUsageReportingCommand(command);
+ } catch (Exception e) {
+ String message = "Failed to add the reporting information for the gateway " + command.getGatewayId();
+ logger.error(message, e);
+ RegistryServiceException rse = new RegistryServiceException();
+ rse.setMessage(message + ". More info " + e.getMessage());
+ throw rse;
+ }
+ }
+
+ @Override
+ public void removeGatewayUsageReportingCommand(GatewayUsageReportingCommand command) throws RegistryServiceException, TException {
+ try {
+ usageReportingCommandRepository.removeGatewayUsageReportingCommand(command.getGatewayId());
+ } catch (Exception e) {
+ String message = "Failed to add the reporting information for the gateway " + command.getGatewayId();
+ logger.error(message, e);
+ RegistryServiceException rse = new RegistryServiceException();
+ rse.setMessage(message + ". More info " + e.getMessage());
+ throw rse;
+ }
+ }
}
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
index 79486cc..5542dea 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
@@ -2610,6 +2610,14 @@
public void removeParsingTemplate(java.lang.String templateId, java.lang.String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public boolean isReportingAvailable(java.lang.String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getGatewayReportingCommand(java.lang.String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+ public void addGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+ public void removeGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
}
public interface AsyncIface extends org.apache.airavata.base.api.BaseAPI .AsyncIface {
@@ -3006,6 +3014,14 @@
public void removeParsingTemplate(java.lang.String templateId, java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;
+ public void isReportingAvailable(java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
+
+ public void getGatewayReportingCommand(java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> resultHandler) throws org.apache.thrift.TException;
+
+ public void addGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;
+
+ public void removeGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.airavata.base.api.BaseAPI.Client implements Iface {
@@ -8261,6 +8277,104 @@
return;
}
+ public boolean isReportingAvailable(java.lang.String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ send_isReportingAvailable(gatewayId);
+ return recv_isReportingAvailable();
+ }
+
+ public void send_isReportingAvailable(java.lang.String gatewayId) throws org.apache.thrift.TException
+ {
+ isReportingAvailable_args args = new isReportingAvailable_args();
+ args.setGatewayId(gatewayId);
+ sendBase("isReportingAvailable", args);
+ }
+
+ public boolean recv_isReportingAvailable() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ isReportingAvailable_result result = new isReportingAvailable_result();
+ receiveBase(result, "isReportingAvailable");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.rse != null) {
+ throw result.rse;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isReportingAvailable failed: unknown result");
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getGatewayReportingCommand(java.lang.String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ send_getGatewayReportingCommand(gatewayId);
+ return recv_getGatewayReportingCommand();
+ }
+
+ public void send_getGatewayReportingCommand(java.lang.String gatewayId) throws org.apache.thrift.TException
+ {
+ getGatewayReportingCommand_args args = new getGatewayReportingCommand_args();
+ args.setGatewayId(gatewayId);
+ sendBase("getGatewayReportingCommand", args);
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand recv_getGatewayReportingCommand() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ getGatewayReportingCommand_result result = new getGatewayReportingCommand_result();
+ receiveBase(result, "getGatewayReportingCommand");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.rse != null) {
+ throw result.rse;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGatewayReportingCommand failed: unknown result");
+ }
+
+ public void addGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ send_addGatewayUsageReportingCommand(command);
+ recv_addGatewayUsageReportingCommand();
+ }
+
+ public void send_addGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.thrift.TException
+ {
+ addGatewayUsageReportingCommand_args args = new addGatewayUsageReportingCommand_args();
+ args.setCommand(command);
+ sendBase("addGatewayUsageReportingCommand", args);
+ }
+
+ public void recv_addGatewayUsageReportingCommand() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ addGatewayUsageReportingCommand_result result = new addGatewayUsageReportingCommand_result();
+ receiveBase(result, "addGatewayUsageReportingCommand");
+ if (result.rse != null) {
+ throw result.rse;
+ }
+ return;
+ }
+
+ public void removeGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ send_removeGatewayUsageReportingCommand(command);
+ recv_removeGatewayUsageReportingCommand();
+ }
+
+ public void send_removeGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) throws org.apache.thrift.TException
+ {
+ removeGatewayUsageReportingCommand_args args = new removeGatewayUsageReportingCommand_args();
+ args.setCommand(command);
+ sendBase("removeGatewayUsageReportingCommand", args);
+ }
+
+ public void recv_removeGatewayUsageReportingCommand() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ {
+ removeGatewayUsageReportingCommand_result result = new removeGatewayUsageReportingCommand_result();
+ receiveBase(result, "removeGatewayUsageReportingCommand");
+ if (result.rse != null) {
+ throw result.rse;
+ }
+ return;
+ }
+
}
public static class AsyncClient extends org.apache.airavata.base.api.BaseAPI.AsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -15007,6 +15121,134 @@
}
}
+ public void isReportingAvailable(java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ isReportingAvailable_call method_call = new isReportingAvailable_call(gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class isReportingAvailable_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
+ private java.lang.String gatewayId;
+ public isReportingAvailable_call(java.lang.String gatewayId, 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.gatewayId = gatewayId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isReportingAvailable", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ isReportingAvailable_args args = new isReportingAvailable_args();
+ args.setGatewayId(gatewayId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public java.lang.Boolean getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, 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_isReportingAvailable();
+ }
+ }
+
+ public void getGatewayReportingCommand(java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getGatewayReportingCommand_call method_call = new getGatewayReportingCommand_call(gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getGatewayReportingCommand_call extends org.apache.thrift.async.TAsyncMethodCall<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> {
+ private java.lang.String gatewayId;
+ public getGatewayReportingCommand_call(java.lang.String gatewayId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> 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.gatewayId = gatewayId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGatewayReportingCommand", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getGatewayReportingCommand_args args = new getGatewayReportingCommand_args();
+ args.setGatewayId(gatewayId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, 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_getGatewayReportingCommand();
+ }
+ }
+
+ public void addGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ addGatewayUsageReportingCommand_call method_call = new addGatewayUsageReportingCommand_call(command, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class addGatewayUsageReportingCommand_call extends org.apache.thrift.async.TAsyncMethodCall<Void> {
+ private org.apache.airavata.model.workspace.GatewayUsageReportingCommand command;
+ public addGatewayUsageReportingCommand_call(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> 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.command = command;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addGatewayUsageReportingCommand", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ addGatewayUsageReportingCommand_args args = new addGatewayUsageReportingCommand_args();
+ args.setCommand(command);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public Void getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, 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 null;
+ }
+ }
+
+ public void removeGatewayUsageReportingCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ removeGatewayUsageReportingCommand_call method_call = new removeGatewayUsageReportingCommand_call(command, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class removeGatewayUsageReportingCommand_call extends org.apache.thrift.async.TAsyncMethodCall<Void> {
+ private org.apache.airavata.model.workspace.GatewayUsageReportingCommand command;
+ public removeGatewayUsageReportingCommand_call(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command, org.apache.thrift.async.AsyncMethodCallback<Void> 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.command = command;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeGatewayUsageReportingCommand", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ removeGatewayUsageReportingCommand_args args = new removeGatewayUsageReportingCommand_args();
+ args.setCommand(command);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public Void getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, 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 null;
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.airavata.base.api.BaseAPI.Processor<I> implements org.apache.thrift.TProcessor {
@@ -15216,6 +15458,10 @@
processMap.put("saveParsingTemplate", new saveParsingTemplate());
processMap.put("listAllParsingTemplates", new listAllParsingTemplates());
processMap.put("removeParsingTemplate", new removeParsingTemplate());
+ processMap.put("isReportingAvailable", new isReportingAvailable());
+ processMap.put("getGatewayReportingCommand", new getGatewayReportingCommand());
+ processMap.put("addGatewayUsageReportingCommand", new addGatewayUsageReportingCommand());
+ processMap.put("removeGatewayUsageReportingCommand", new removeGatewayUsageReportingCommand());
return processMap;
}
@@ -20011,6 +20257,103 @@
}
}
+ public static class isReportingAvailable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isReportingAvailable_args> {
+ public isReportingAvailable() {
+ super("isReportingAvailable");
+ }
+
+ public isReportingAvailable_args getEmptyArgsInstance() {
+ return new isReportingAvailable_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public isReportingAvailable_result getResult(I iface, isReportingAvailable_args args) throws org.apache.thrift.TException {
+ isReportingAvailable_result result = new isReportingAvailable_result();
+ try {
+ result.success = iface.isReportingAvailable(args.gatewayId);
+ result.setSuccessIsSet(true);
+ } catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ result.rse = rse;
+ }
+ return result;
+ }
+ }
+
+ public static class getGatewayReportingCommand<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getGatewayReportingCommand_args> {
+ public getGatewayReportingCommand() {
+ super("getGatewayReportingCommand");
+ }
+
+ public getGatewayReportingCommand_args getEmptyArgsInstance() {
+ return new getGatewayReportingCommand_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getGatewayReportingCommand_result getResult(I iface, getGatewayReportingCommand_args args) throws org.apache.thrift.TException {
+ getGatewayReportingCommand_result result = new getGatewayReportingCommand_result();
+ try {
+ result.success = iface.getGatewayReportingCommand(args.gatewayId);
+ } catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ result.rse = rse;
+ }
+ return result;
+ }
+ }
+
+ public static class addGatewayUsageReportingCommand<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addGatewayUsageReportingCommand_args> {
+ public addGatewayUsageReportingCommand() {
+ super("addGatewayUsageReportingCommand");
+ }
+
+ public addGatewayUsageReportingCommand_args getEmptyArgsInstance() {
+ return new addGatewayUsageReportingCommand_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public addGatewayUsageReportingCommand_result getResult(I iface, addGatewayUsageReportingCommand_args args) throws org.apache.thrift.TException {
+ addGatewayUsageReportingCommand_result result = new addGatewayUsageReportingCommand_result();
+ try {
+ iface.addGatewayUsageReportingCommand(args.command);
+ } catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ result.rse = rse;
+ }
+ return result;
+ }
+ }
+
+ public static class removeGatewayUsageReportingCommand<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeGatewayUsageReportingCommand_args> {
+ public removeGatewayUsageReportingCommand() {
+ super("removeGatewayUsageReportingCommand");
+ }
+
+ public removeGatewayUsageReportingCommand_args getEmptyArgsInstance() {
+ return new removeGatewayUsageReportingCommand_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public removeGatewayUsageReportingCommand_result getResult(I iface, removeGatewayUsageReportingCommand_args args) throws org.apache.thrift.TException {
+ removeGatewayUsageReportingCommand_result result = new removeGatewayUsageReportingCommand_result();
+ try {
+ iface.removeGatewayUsageReportingCommand(args.command);
+ } catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ result.rse = rse;
+ }
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.airavata.base.api.BaseAPI.AsyncProcessor<I> {
@@ -20220,6 +20563,10 @@
processMap.put("saveParsingTemplate", new saveParsingTemplate());
processMap.put("listAllParsingTemplates", new listAllParsingTemplates());
processMap.put("removeParsingTemplate", new removeParsingTemplate());
+ processMap.put("isReportingAvailable", new isReportingAvailable());
+ processMap.put("getGatewayReportingCommand", new getGatewayReportingCommand());
+ processMap.put("addGatewayUsageReportingCommand", new addGatewayUsageReportingCommand());
+ processMap.put("removeGatewayUsageReportingCommand", new removeGatewayUsageReportingCommand());
return processMap;
}
@@ -33061,6 +33408,265 @@
}
}
+ public static class isReportingAvailable<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isReportingAvailable_args, java.lang.Boolean> {
+ public isReportingAvailable() {
+ super("isReportingAvailable");
+ }
+
+ public isReportingAvailable_args getEmptyArgsInstance() {
+ return new isReportingAvailable_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) {
+ isReportingAvailable_result result = new isReportingAvailable_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;
+ isReportingAvailable_result result = new isReportingAvailable_result();
+ if (e instanceof org.apache.airavata.registry.api.exception.RegistryServiceException) {
+ result.rse = (org.apache.airavata.registry.api.exception.RegistryServiceException) e;
+ result.setRseIsSet(true);
+ msg = result;
+ } else 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, isReportingAvailable_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
+ iface.isReportingAvailable(args.gatewayId,resultHandler);
+ }
+ }
+
+ public static class getGatewayReportingCommand<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getGatewayReportingCommand_args, org.apache.airavata.model.workspace.GatewayUsageReportingCommand> {
+ public getGatewayReportingCommand() {
+ super("getGatewayReportingCommand");
+ }
+
+ public getGatewayReportingCommand_args getEmptyArgsInstance() {
+ return new getGatewayReportingCommand_args();
+ }
+
+ public org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> 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.model.workspace.GatewayUsageReportingCommand>() {
+ public void onComplete(org.apache.airavata.model.workspace.GatewayUsageReportingCommand o) {
+ getGatewayReportingCommand_result result = new getGatewayReportingCommand_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;
+ getGatewayReportingCommand_result result = new getGatewayReportingCommand_result();
+ if (e instanceof org.apache.airavata.registry.api.exception.RegistryServiceException) {
+ result.rse = (org.apache.airavata.registry.api.exception.RegistryServiceException) e;
+ result.setRseIsSet(true);
+ msg = result;
+ } else 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, getGatewayReportingCommand_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.workspace.GatewayUsageReportingCommand> resultHandler) throws org.apache.thrift.TException {
+ iface.getGatewayReportingCommand(args.gatewayId,resultHandler);
+ }
+ }
+
+ public static class addGatewayUsageReportingCommand<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addGatewayUsageReportingCommand_args, Void> {
+ public addGatewayUsageReportingCommand() {
+ super("addGatewayUsageReportingCommand");
+ }
+
+ public addGatewayUsageReportingCommand_args getEmptyArgsInstance() {
+ return new addGatewayUsageReportingCommand_args();
+ }
+
+ public org.apache.thrift.async.AsyncMethodCallback<Void> 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<Void>() {
+ public void onComplete(Void o) {
+ addGatewayUsageReportingCommand_result result = new addGatewayUsageReportingCommand_result();
+ 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;
+ addGatewayUsageReportingCommand_result result = new addGatewayUsageReportingCommand_result();
+ if (e instanceof org.apache.airavata.registry.api.exception.RegistryServiceException) {
+ result.rse = (org.apache.airavata.registry.api.exception.RegistryServiceException) e;
+ result.setRseIsSet(true);
+ msg = result;
+ } else 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, addGatewayUsageReportingCommand_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+ iface.addGatewayUsageReportingCommand(args.command,resultHandler);
+ }
+ }
+
+ public static class removeGatewayUsageReportingCommand<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, removeGatewayUsageReportingCommand_args, Void> {
+ public removeGatewayUsageReportingCommand() {
+ super("removeGatewayUsageReportingCommand");
+ }
+
+ public removeGatewayUsageReportingCommand_args getEmptyArgsInstance() {
+ return new removeGatewayUsageReportingCommand_args();
+ }
+
+ public org.apache.thrift.async.AsyncMethodCallback<Void> 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<Void>() {
+ public void onComplete(Void o) {
+ removeGatewayUsageReportingCommand_result result = new removeGatewayUsageReportingCommand_result();
+ 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;
+ removeGatewayUsageReportingCommand_result result = new removeGatewayUsageReportingCommand_result();
+ if (e instanceof org.apache.airavata.registry.api.exception.RegistryServiceException) {
+ result.rse = (org.apache.airavata.registry.api.exception.RegistryServiceException) e;
+ result.setRseIsSet(true);
+ msg = result;
+ } else 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, removeGatewayUsageReportingCommand_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+ iface.removeGatewayUsageReportingCommand(args.command,resultHandler);
+ }
+ }
+
}
public static class isUserExists_args implements org.apache.thrift.TBase<isUserExists_args, isUserExists_args._Fields>, java.io.Serializable, Cloneable, Comparable<isUserExists_args> {
@@ -212871,4 +213477,3115 @@
}
}
+ public static class isReportingAvailable_args implements org.apache.thrift.TBase<isReportingAvailable_args, isReportingAvailable_args._Fields>, java.io.Serializable, Cloneable, Comparable<isReportingAvailable_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isReportingAvailable_args");
+
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isReportingAvailable_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isReportingAvailable_argsTupleSchemeFactory();
+
+ public java.lang.String gatewayId; // 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 {
+ GATEWAY_ID((short)1, "gatewayId");
+
+ 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: // GATEWAY_ID
+ return GATEWAY_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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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(isReportingAvailable_args.class, metaDataMap);
+ }
+
+ public isReportingAvailable_args() {
+ }
+
+ public isReportingAvailable_args(
+ java.lang.String gatewayId)
+ {
+ this();
+ this.gatewayId = gatewayId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public isReportingAvailable_args(isReportingAvailable_args other) {
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ }
+
+ public isReportingAvailable_args deepCopy() {
+ return new isReportingAvailable_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.gatewayId = null;
+ }
+
+ public java.lang.String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public isReportingAvailable_args setGatewayId(java.lang.String gatewayId) {
+ this.gatewayId = gatewayId;
+ return this;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((java.lang.String)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ }
+ 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 GATEWAY_ID:
+ return isSetGatewayId();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof isReportingAvailable_args)
+ return this.equals((isReportingAvailable_args)that);
+ return false;
+ }
+
+ public boolean equals(isReportingAvailable_args that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetGatewayId()) ? 131071 : 524287);
+ if (isSetGatewayId())
+ hashCode = hashCode * 8191 + gatewayId.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(isReportingAvailable_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ 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("isReportingAvailable_args(");
+ boolean first = true;
+
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (gatewayId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' 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 isReportingAvailable_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public isReportingAvailable_argsStandardScheme getScheme() {
+ return new isReportingAvailable_argsStandardScheme();
+ }
+ }
+
+ private static class isReportingAvailable_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<isReportingAvailable_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, isReportingAvailable_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: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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, isReportingAvailable_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class isReportingAvailable_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public isReportingAvailable_argsTupleScheme getScheme() {
+ return new isReportingAvailable_argsTupleScheme();
+ }
+ }
+
+ private static class isReportingAvailable_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<isReportingAvailable_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, isReportingAvailable_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ oprot.writeString(struct.gatewayId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, isReportingAvailable_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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 isReportingAvailable_result implements org.apache.thrift.TBase<isReportingAvailable_result, isReportingAvailable_result._Fields>, java.io.Serializable, Cloneable, Comparable<isReportingAvailable_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isReportingAvailable_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.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isReportingAvailable_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isReportingAvailable_resultTupleSchemeFactory();
+
+ public boolean success; // required
+ public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // 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"),
+ RSE((short)1, "rse");
+
+ 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;
+ case 1: // RSE
+ return RSE;
+ 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)));
+ tmpMap.put(_Fields.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.registry.api.exception.RegistryServiceException.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isReportingAvailable_result.class, metaDataMap);
+ }
+
+ public isReportingAvailable_result() {
+ }
+
+ public isReportingAvailable_result(
+ boolean success,
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ this.rse = rse;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public isReportingAvailable_result(isReportingAvailable_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ if (other.isSetRse()) {
+ this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
+ }
+ }
+
+ public isReportingAvailable_result deepCopy() {
+ return new isReportingAvailable_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ this.rse = null;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public isReportingAvailable_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 org.apache.airavata.registry.api.exception.RegistryServiceException getRse() {
+ return this.rse;
+ }
+
+ public isReportingAvailable_result setRse(org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ this.rse = rse;
+ return this;
+ }
+
+ public void unsetRse() {
+ this.rse = null;
+ }
+
+ /** Returns true if field rse is set (has been assigned a value) and false otherwise */
+ public boolean isSetRse() {
+ return this.rse != null;
+ }
+
+ public void setRseIsSet(boolean value) {
+ if (!value) {
+ this.rse = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((java.lang.Boolean)value);
+ }
+ break;
+
+ case RSE:
+ if (value == null) {
+ unsetRse();
+ } else {
+ setRse((org.apache.airavata.registry.api.exception.RegistryServiceException)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return isSuccess();
+
+ case RSE:
+ return getRse();
+
+ }
+ 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();
+ case RSE:
+ return isSetRse();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof isReportingAvailable_result)
+ return this.equals((isReportingAvailable_result)that);
+ return false;
+ }
+
+ public boolean equals(isReportingAvailable_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;
+ }
+
+ boolean this_present_rse = true && this.isSetRse();
+ boolean that_present_rse = true && that.isSetRse();
+ if (this_present_rse || that_present_rse) {
+ if (!(this_present_rse && that_present_rse))
+ return false;
+ if (!this.rse.equals(that.rse))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
+
+ hashCode = hashCode * 8191 + ((isSetRse()) ? 131071 : 524287);
+ if (isSetRse())
+ hashCode = hashCode * 8191 + rse.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(isReportingAvailable_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;
+ }
+ }
+ lastComparison = java.lang.Boolean.valueOf(isSetRse()).compareTo(other.isSetRse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rse, other.rse);
+ 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("isReportingAvailable_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("rse:");
+ if (this.rse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rse);
+ }
+ 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 isReportingAvailable_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public isReportingAvailable_resultStandardScheme getScheme() {
+ return new isReportingAvailable_resultStandardScheme();
+ }
+ }
+
+ private static class isReportingAvailable_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<isReportingAvailable_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, isReportingAvailable_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;
+ case 1: // RSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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, isReportingAvailable_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();
+ }
+ if (struct.rse != null) {
+ oprot.writeFieldBegin(RSE_FIELD_DESC);
+ struct.rse.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class isReportingAvailable_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public isReportingAvailable_resultTupleScheme getScheme() {
+ return new isReportingAvailable_resultTupleScheme();
+ }
+ }
+
+ private static class isReportingAvailable_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<isReportingAvailable_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, isReportingAvailable_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);
+ }
+ if (struct.isSetRse()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ if (struct.isSetRse()) {
+ struct.rse.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, isReportingAvailable_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(2);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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 getGatewayReportingCommand_args implements org.apache.thrift.TBase<getGatewayReportingCommand_args, getGatewayReportingCommand_args._Fields>, java.io.Serializable, Cloneable, Comparable<getGatewayReportingCommand_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGatewayReportingCommand_args");
+
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGatewayReportingCommand_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGatewayReportingCommand_argsTupleSchemeFactory();
+
+ public java.lang.String gatewayId; // 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 {
+ GATEWAY_ID((short)1, "gatewayId");
+
+ 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: // GATEWAY_ID
+ return GATEWAY_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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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(getGatewayReportingCommand_args.class, metaDataMap);
+ }
+
+ public getGatewayReportingCommand_args() {
+ }
+
+ public getGatewayReportingCommand_args(
+ java.lang.String gatewayId)
+ {
+ this();
+ this.gatewayId = gatewayId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getGatewayReportingCommand_args(getGatewayReportingCommand_args other) {
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ }
+
+ public getGatewayReportingCommand_args deepCopy() {
+ return new getGatewayReportingCommand_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.gatewayId = null;
+ }
+
+ public java.lang.String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public getGatewayReportingCommand_args setGatewayId(java.lang.String gatewayId) {
+ this.gatewayId = gatewayId;
+ return this;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((java.lang.String)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ }
+ 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 GATEWAY_ID:
+ return isSetGatewayId();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getGatewayReportingCommand_args)
+ return this.equals((getGatewayReportingCommand_args)that);
+ return false;
+ }
+
+ public boolean equals(getGatewayReportingCommand_args that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetGatewayId()) ? 131071 : 524287);
+ if (isSetGatewayId())
+ hashCode = hashCode * 8191 + gatewayId.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(getGatewayReportingCommand_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ 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("getGatewayReportingCommand_args(");
+ boolean first = true;
+
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (gatewayId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' 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 getGatewayReportingCommand_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGatewayReportingCommand_argsStandardScheme getScheme() {
+ return new getGatewayReportingCommand_argsStandardScheme();
+ }
+ }
+
+ private static class getGatewayReportingCommand_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getGatewayReportingCommand_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getGatewayReportingCommand_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: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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, getGatewayReportingCommand_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getGatewayReportingCommand_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGatewayReportingCommand_argsTupleScheme getScheme() {
+ return new getGatewayReportingCommand_argsTupleScheme();
+ }
+ }
+
+ private static class getGatewayReportingCommand_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getGatewayReportingCommand_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getGatewayReportingCommand_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ oprot.writeString(struct.gatewayId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getGatewayReportingCommand_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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 getGatewayReportingCommand_result implements org.apache.thrift.TBase<getGatewayReportingCommand_result, getGatewayReportingCommand_result._Fields>, java.io.Serializable, Cloneable, Comparable<getGatewayReportingCommand_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGatewayReportingCommand_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.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGatewayReportingCommand_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGatewayReportingCommand_resultTupleSchemeFactory();
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand success; // required
+ public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // 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"),
+ RSE((short)1, "rse");
+
+ 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;
+ case 1: // RSE
+ return RSE;
+ 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.model.workspace.GatewayUsageReportingCommand.class)));
+ tmpMap.put(_Fields.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.registry.api.exception.RegistryServiceException.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGatewayReportingCommand_result.class, metaDataMap);
+ }
+
+ public getGatewayReportingCommand_result() {
+ }
+
+ public getGatewayReportingCommand_result(
+ org.apache.airavata.model.workspace.GatewayUsageReportingCommand success,
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ {
+ this();
+ this.success = success;
+ this.rse = rse;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getGatewayReportingCommand_result(getGatewayReportingCommand_result other) {
+ if (other.isSetSuccess()) {
+ this.success = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand(other.success);
+ }
+ if (other.isSetRse()) {
+ this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
+ }
+ }
+
+ public getGatewayReportingCommand_result deepCopy() {
+ return new getGatewayReportingCommand_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ this.rse = null;
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getSuccess() {
+ return this.success;
+ }
+
+ public getGatewayReportingCommand_result setSuccess(org.apache.airavata.model.workspace.GatewayUsageReportingCommand 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 org.apache.airavata.registry.api.exception.RegistryServiceException getRse() {
+ return this.rse;
+ }
+
+ public getGatewayReportingCommand_result setRse(org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ this.rse = rse;
+ return this;
+ }
+
+ public void unsetRse() {
+ this.rse = null;
+ }
+
+ /** Returns true if field rse is set (has been assigned a value) and false otherwise */
+ public boolean isSetRse() {
+ return this.rse != null;
+ }
+
+ public void setRseIsSet(boolean value) {
+ if (!value) {
+ this.rse = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((org.apache.airavata.model.workspace.GatewayUsageReportingCommand)value);
+ }
+ break;
+
+ case RSE:
+ if (value == null) {
+ unsetRse();
+ } else {
+ setRse((org.apache.airavata.registry.api.exception.RegistryServiceException)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ case RSE:
+ return getRse();
+
+ }
+ 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();
+ case RSE:
+ return isSetRse();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getGatewayReportingCommand_result)
+ return this.equals((getGatewayReportingCommand_result)that);
+ return false;
+ }
+
+ public boolean equals(getGatewayReportingCommand_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;
+ }
+
+ boolean this_present_rse = true && this.isSetRse();
+ boolean that_present_rse = true && that.isSetRse();
+ if (this_present_rse || that_present_rse) {
+ if (!(this_present_rse && that_present_rse))
+ return false;
+ if (!this.rse.equals(that.rse))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
+ if (isSetSuccess())
+ hashCode = hashCode * 8191 + success.hashCode();
+
+ hashCode = hashCode * 8191 + ((isSetRse()) ? 131071 : 524287);
+ if (isSetRse())
+ hashCode = hashCode * 8191 + rse.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(getGatewayReportingCommand_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;
+ }
+ }
+ lastComparison = java.lang.Boolean.valueOf(isSetRse()).compareTo(other.isSetRse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rse, other.rse);
+ 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("getGatewayReportingCommand_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("rse:");
+ if (this.rse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rse);
+ }
+ 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 getGatewayReportingCommand_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGatewayReportingCommand_resultStandardScheme getScheme() {
+ return new getGatewayReportingCommand_resultStandardScheme();
+ }
+ }
+
+ private static class getGatewayReportingCommand_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getGatewayReportingCommand_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getGatewayReportingCommand_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.model.workspace.GatewayUsageReportingCommand();
+ struct.success.read(iprot);
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // RSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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, getGatewayReportingCommand_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();
+ }
+ if (struct.rse != null) {
+ oprot.writeFieldBegin(RSE_FIELD_DESC);
+ struct.rse.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getGatewayReportingCommand_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGatewayReportingCommand_resultTupleScheme getScheme() {
+ return new getGatewayReportingCommand_resultTupleScheme();
+ }
+ }
+
+ private static class getGatewayReportingCommand_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getGatewayReportingCommand_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getGatewayReportingCommand_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);
+ }
+ if (struct.isSetRse()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSuccess()) {
+ struct.success.write(oprot);
+ }
+ if (struct.isSetRse()) {
+ struct.rse.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getGatewayReportingCommand_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(2);
+ if (incoming.get(0)) {
+ struct.success = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand();
+ struct.success.read(iprot);
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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 addGatewayUsageReportingCommand_args implements org.apache.thrift.TBase<addGatewayUsageReportingCommand_args, addGatewayUsageReportingCommand_args._Fields>, java.io.Serializable, Cloneable, Comparable<addGatewayUsageReportingCommand_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGatewayUsageReportingCommand_args");
+
+ private static final org.apache.thrift.protocol.TField COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("command", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new addGatewayUsageReportingCommand_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new addGatewayUsageReportingCommand_argsTupleSchemeFactory();
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand command; // 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 {
+ COMMAND((short)1, "command");
+
+ 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: // COMMAND
+ return COMMAND;
+ 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.COMMAND, new org.apache.thrift.meta_data.FieldMetaData("command", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.workspace.GatewayUsageReportingCommand.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGatewayUsageReportingCommand_args.class, metaDataMap);
+ }
+
+ public addGatewayUsageReportingCommand_args() {
+ }
+
+ public addGatewayUsageReportingCommand_args(
+ org.apache.airavata.model.workspace.GatewayUsageReportingCommand command)
+ {
+ this();
+ this.command = command;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public addGatewayUsageReportingCommand_args(addGatewayUsageReportingCommand_args other) {
+ if (other.isSetCommand()) {
+ this.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand(other.command);
+ }
+ }
+
+ public addGatewayUsageReportingCommand_args deepCopy() {
+ return new addGatewayUsageReportingCommand_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.command = null;
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getCommand() {
+ return this.command;
+ }
+
+ public addGatewayUsageReportingCommand_args setCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) {
+ this.command = command;
+ return this;
+ }
+
+ public void unsetCommand() {
+ this.command = null;
+ }
+
+ /** Returns true if field command is set (has been assigned a value) and false otherwise */
+ public boolean isSetCommand() {
+ return this.command != null;
+ }
+
+ public void setCommandIsSet(boolean value) {
+ if (!value) {
+ this.command = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case COMMAND:
+ if (value == null) {
+ unsetCommand();
+ } else {
+ setCommand((org.apache.airavata.model.workspace.GatewayUsageReportingCommand)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case COMMAND:
+ return getCommand();
+
+ }
+ 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 COMMAND:
+ return isSetCommand();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof addGatewayUsageReportingCommand_args)
+ return this.equals((addGatewayUsageReportingCommand_args)that);
+ return false;
+ }
+
+ public boolean equals(addGatewayUsageReportingCommand_args that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_command = true && this.isSetCommand();
+ boolean that_present_command = true && that.isSetCommand();
+ if (this_present_command || that_present_command) {
+ if (!(this_present_command && that_present_command))
+ return false;
+ if (!this.command.equals(that.command))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetCommand()) ? 131071 : 524287);
+ if (isSetCommand())
+ hashCode = hashCode * 8191 + command.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(addGatewayUsageReportingCommand_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetCommand()).compareTo(other.isSetCommand());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCommand()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.command, other.command);
+ 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("addGatewayUsageReportingCommand_args(");
+ boolean first = true;
+
+ sb.append("command:");
+ if (this.command == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.command);
+ }
+ 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 (command != null) {
+ command.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 addGatewayUsageReportingCommand_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public addGatewayUsageReportingCommand_argsStandardScheme getScheme() {
+ return new addGatewayUsageReportingCommand_argsStandardScheme();
+ }
+ }
+
+ private static class addGatewayUsageReportingCommand_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<addGatewayUsageReportingCommand_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, addGatewayUsageReportingCommand_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: // COMMAND
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand();
+ struct.command.read(iprot);
+ struct.setCommandIsSet(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, addGatewayUsageReportingCommand_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.command != null) {
+ oprot.writeFieldBegin(COMMAND_FIELD_DESC);
+ struct.command.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class addGatewayUsageReportingCommand_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public addGatewayUsageReportingCommand_argsTupleScheme getScheme() {
+ return new addGatewayUsageReportingCommand_argsTupleScheme();
+ }
+ }
+
+ private static class addGatewayUsageReportingCommand_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<addGatewayUsageReportingCommand_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, addGatewayUsageReportingCommand_args 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.isSetCommand()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetCommand()) {
+ struct.command.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, addGatewayUsageReportingCommand_args 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.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand();
+ struct.command.read(iprot);
+ struct.setCommandIsSet(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 addGatewayUsageReportingCommand_result implements org.apache.thrift.TBase<addGatewayUsageReportingCommand_result, addGatewayUsageReportingCommand_result._Fields>, java.io.Serializable, Cloneable, Comparable<addGatewayUsageReportingCommand_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addGatewayUsageReportingCommand_result");
+
+ private static final org.apache.thrift.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new addGatewayUsageReportingCommand_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new addGatewayUsageReportingCommand_resultTupleSchemeFactory();
+
+ public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // 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 {
+ RSE((short)1, "rse");
+
+ 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: // RSE
+ return RSE;
+ 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.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.registry.api.exception.RegistryServiceException.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGatewayUsageReportingCommand_result.class, metaDataMap);
+ }
+
+ public addGatewayUsageReportingCommand_result() {
+ }
+
+ public addGatewayUsageReportingCommand_result(
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ {
+ this();
+ this.rse = rse;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public addGatewayUsageReportingCommand_result(addGatewayUsageReportingCommand_result other) {
+ if (other.isSetRse()) {
+ this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
+ }
+ }
+
+ public addGatewayUsageReportingCommand_result deepCopy() {
+ return new addGatewayUsageReportingCommand_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.rse = null;
+ }
+
+ public org.apache.airavata.registry.api.exception.RegistryServiceException getRse() {
+ return this.rse;
+ }
+
+ public addGatewayUsageReportingCommand_result setRse(org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ this.rse = rse;
+ return this;
+ }
+
+ public void unsetRse() {
+ this.rse = null;
+ }
+
+ /** Returns true if field rse is set (has been assigned a value) and false otherwise */
+ public boolean isSetRse() {
+ return this.rse != null;
+ }
+
+ public void setRseIsSet(boolean value) {
+ if (!value) {
+ this.rse = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case RSE:
+ if (value == null) {
+ unsetRse();
+ } else {
+ setRse((org.apache.airavata.registry.api.exception.RegistryServiceException)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case RSE:
+ return getRse();
+
+ }
+ 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 RSE:
+ return isSetRse();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof addGatewayUsageReportingCommand_result)
+ return this.equals((addGatewayUsageReportingCommand_result)that);
+ return false;
+ }
+
+ public boolean equals(addGatewayUsageReportingCommand_result that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_rse = true && this.isSetRse();
+ boolean that_present_rse = true && that.isSetRse();
+ if (this_present_rse || that_present_rse) {
+ if (!(this_present_rse && that_present_rse))
+ return false;
+ if (!this.rse.equals(that.rse))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetRse()) ? 131071 : 524287);
+ if (isSetRse())
+ hashCode = hashCode * 8191 + rse.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(addGatewayUsageReportingCommand_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetRse()).compareTo(other.isSetRse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rse, other.rse);
+ 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("addGatewayUsageReportingCommand_result(");
+ boolean first = true;
+
+ sb.append("rse:");
+ if (this.rse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rse);
+ }
+ 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 addGatewayUsageReportingCommand_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public addGatewayUsageReportingCommand_resultStandardScheme getScheme() {
+ return new addGatewayUsageReportingCommand_resultStandardScheme();
+ }
+ }
+
+ private static class addGatewayUsageReportingCommand_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<addGatewayUsageReportingCommand_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, addGatewayUsageReportingCommand_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 1: // RSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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, addGatewayUsageReportingCommand_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.rse != null) {
+ oprot.writeFieldBegin(RSE_FIELD_DESC);
+ struct.rse.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class addGatewayUsageReportingCommand_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public addGatewayUsageReportingCommand_resultTupleScheme getScheme() {
+ return new addGatewayUsageReportingCommand_resultTupleScheme();
+ }
+ }
+
+ private static class addGatewayUsageReportingCommand_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<addGatewayUsageReportingCommand_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, addGatewayUsageReportingCommand_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.isSetRse()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetRse()) {
+ struct.rse.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, addGatewayUsageReportingCommand_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.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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 removeGatewayUsageReportingCommand_args implements org.apache.thrift.TBase<removeGatewayUsageReportingCommand_args, removeGatewayUsageReportingCommand_args._Fields>, java.io.Serializable, Cloneable, Comparable<removeGatewayUsageReportingCommand_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeGatewayUsageReportingCommand_args");
+
+ private static final org.apache.thrift.protocol.TField COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("command", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new removeGatewayUsageReportingCommand_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new removeGatewayUsageReportingCommand_argsTupleSchemeFactory();
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand command; // 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 {
+ COMMAND((short)1, "command");
+
+ 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: // COMMAND
+ return COMMAND;
+ 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.COMMAND, new org.apache.thrift.meta_data.FieldMetaData("command", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.workspace.GatewayUsageReportingCommand.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeGatewayUsageReportingCommand_args.class, metaDataMap);
+ }
+
+ public removeGatewayUsageReportingCommand_args() {
+ }
+
+ public removeGatewayUsageReportingCommand_args(
+ org.apache.airavata.model.workspace.GatewayUsageReportingCommand command)
+ {
+ this();
+ this.command = command;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public removeGatewayUsageReportingCommand_args(removeGatewayUsageReportingCommand_args other) {
+ if (other.isSetCommand()) {
+ this.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand(other.command);
+ }
+ }
+
+ public removeGatewayUsageReportingCommand_args deepCopy() {
+ return new removeGatewayUsageReportingCommand_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.command = null;
+ }
+
+ public org.apache.airavata.model.workspace.GatewayUsageReportingCommand getCommand() {
+ return this.command;
+ }
+
+ public removeGatewayUsageReportingCommand_args setCommand(org.apache.airavata.model.workspace.GatewayUsageReportingCommand command) {
+ this.command = command;
+ return this;
+ }
+
+ public void unsetCommand() {
+ this.command = null;
+ }
+
+ /** Returns true if field command is set (has been assigned a value) and false otherwise */
+ public boolean isSetCommand() {
+ return this.command != null;
+ }
+
+ public void setCommandIsSet(boolean value) {
+ if (!value) {
+ this.command = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case COMMAND:
+ if (value == null) {
+ unsetCommand();
+ } else {
+ setCommand((org.apache.airavata.model.workspace.GatewayUsageReportingCommand)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case COMMAND:
+ return getCommand();
+
+ }
+ 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 COMMAND:
+ return isSetCommand();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof removeGatewayUsageReportingCommand_args)
+ return this.equals((removeGatewayUsageReportingCommand_args)that);
+ return false;
+ }
+
+ public boolean equals(removeGatewayUsageReportingCommand_args that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_command = true && this.isSetCommand();
+ boolean that_present_command = true && that.isSetCommand();
+ if (this_present_command || that_present_command) {
+ if (!(this_present_command && that_present_command))
+ return false;
+ if (!this.command.equals(that.command))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetCommand()) ? 131071 : 524287);
+ if (isSetCommand())
+ hashCode = hashCode * 8191 + command.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(removeGatewayUsageReportingCommand_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetCommand()).compareTo(other.isSetCommand());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCommand()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.command, other.command);
+ 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("removeGatewayUsageReportingCommand_args(");
+ boolean first = true;
+
+ sb.append("command:");
+ if (this.command == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.command);
+ }
+ 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 (command != null) {
+ command.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 removeGatewayUsageReportingCommand_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public removeGatewayUsageReportingCommand_argsStandardScheme getScheme() {
+ return new removeGatewayUsageReportingCommand_argsStandardScheme();
+ }
+ }
+
+ private static class removeGatewayUsageReportingCommand_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<removeGatewayUsageReportingCommand_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, removeGatewayUsageReportingCommand_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: // COMMAND
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand();
+ struct.command.read(iprot);
+ struct.setCommandIsSet(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, removeGatewayUsageReportingCommand_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.command != null) {
+ oprot.writeFieldBegin(COMMAND_FIELD_DESC);
+ struct.command.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class removeGatewayUsageReportingCommand_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public removeGatewayUsageReportingCommand_argsTupleScheme getScheme() {
+ return new removeGatewayUsageReportingCommand_argsTupleScheme();
+ }
+ }
+
+ private static class removeGatewayUsageReportingCommand_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<removeGatewayUsageReportingCommand_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, removeGatewayUsageReportingCommand_args 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.isSetCommand()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetCommand()) {
+ struct.command.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, removeGatewayUsageReportingCommand_args 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.command = new org.apache.airavata.model.workspace.GatewayUsageReportingCommand();
+ struct.command.read(iprot);
+ struct.setCommandIsSet(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 removeGatewayUsageReportingCommand_result implements org.apache.thrift.TBase<removeGatewayUsageReportingCommand_result, removeGatewayUsageReportingCommand_result._Fields>, java.io.Serializable, Cloneable, Comparable<removeGatewayUsageReportingCommand_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeGatewayUsageReportingCommand_result");
+
+ private static final org.apache.thrift.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new removeGatewayUsageReportingCommand_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new removeGatewayUsageReportingCommand_resultTupleSchemeFactory();
+
+ public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // 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 {
+ RSE((short)1, "rse");
+
+ 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: // RSE
+ return RSE;
+ 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.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.registry.api.exception.RegistryServiceException.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeGatewayUsageReportingCommand_result.class, metaDataMap);
+ }
+
+ public removeGatewayUsageReportingCommand_result() {
+ }
+
+ public removeGatewayUsageReportingCommand_result(
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ {
+ this();
+ this.rse = rse;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public removeGatewayUsageReportingCommand_result(removeGatewayUsageReportingCommand_result other) {
+ if (other.isSetRse()) {
+ this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
+ }
+ }
+
+ public removeGatewayUsageReportingCommand_result deepCopy() {
+ return new removeGatewayUsageReportingCommand_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.rse = null;
+ }
+
+ public org.apache.airavata.registry.api.exception.RegistryServiceException getRse() {
+ return this.rse;
+ }
+
+ public removeGatewayUsageReportingCommand_result setRse(org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
+ this.rse = rse;
+ return this;
+ }
+
+ public void unsetRse() {
+ this.rse = null;
+ }
+
+ /** Returns true if field rse is set (has been assigned a value) and false otherwise */
+ public boolean isSetRse() {
+ return this.rse != null;
+ }
+
+ public void setRseIsSet(boolean value) {
+ if (!value) {
+ this.rse = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, java.lang.Object value) {
+ switch (field) {
+ case RSE:
+ if (value == null) {
+ unsetRse();
+ } else {
+ setRse((org.apache.airavata.registry.api.exception.RegistryServiceException)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case RSE:
+ return getRse();
+
+ }
+ 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 RSE:
+ return isSetRse();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof removeGatewayUsageReportingCommand_result)
+ return this.equals((removeGatewayUsageReportingCommand_result)that);
+ return false;
+ }
+
+ public boolean equals(removeGatewayUsageReportingCommand_result that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ boolean this_present_rse = true && this.isSetRse();
+ boolean that_present_rse = true && that.isSetRse();
+ if (this_present_rse || that_present_rse) {
+ if (!(this_present_rse && that_present_rse))
+ return false;
+ if (!this.rse.equals(that.rse))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetRse()) ? 131071 : 524287);
+ if (isSetRse())
+ hashCode = hashCode * 8191 + rse.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(removeGatewayUsageReportingCommand_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.Boolean.valueOf(isSetRse()).compareTo(other.isSetRse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rse, other.rse);
+ 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("removeGatewayUsageReportingCommand_result(");
+ boolean first = true;
+
+ sb.append("rse:");
+ if (this.rse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rse);
+ }
+ 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 removeGatewayUsageReportingCommand_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public removeGatewayUsageReportingCommand_resultStandardScheme getScheme() {
+ return new removeGatewayUsageReportingCommand_resultStandardScheme();
+ }
+ }
+
+ private static class removeGatewayUsageReportingCommand_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<removeGatewayUsageReportingCommand_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, removeGatewayUsageReportingCommand_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 1: // RSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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, removeGatewayUsageReportingCommand_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.rse != null) {
+ oprot.writeFieldBegin(RSE_FIELD_DESC);
+ struct.rse.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class removeGatewayUsageReportingCommand_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public removeGatewayUsageReportingCommand_resultTupleScheme getScheme() {
+ return new removeGatewayUsageReportingCommand_resultTupleScheme();
+ }
+ }
+
+ private static class removeGatewayUsageReportingCommand_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<removeGatewayUsageReportingCommand_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, removeGatewayUsageReportingCommand_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.isSetRse()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetRse()) {
+ struct.rse.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, removeGatewayUsageReportingCommand_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.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException();
+ struct.rse.read(iprot);
+ struct.setRseIsSet(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();
+ }
+ }
+
}
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
index c6da494..dc4fac5 100644
--- a/thrift-interface-descriptions/component-cpis/registry-api.thrift
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -2677,4 +2677,12 @@
throws (1: registry_api_errors.RegistryServiceException rse);
void removeParsingTemplate(1: required string templateId, 2: required string gatewayId)
throws (1: registry_api_errors.RegistryServiceException rse);
+
+ bool isReportingAvailable(1: required string gatewayId) throws (1: registry_api_errors.RegistryServiceException rse);
+ workspace_model.GatewayUsageReportingCommand getGatewayReportingCommand(1: required string gatewayId)
+ throws (1: registry_api_errors.RegistryServiceException rse);
+ void addGatewayUsageReportingCommand(1: workspace_model.GatewayUsageReportingCommand command)
+ throws (1: registry_api_errors.RegistryServiceException rse);
+ void removeGatewayUsageReportingCommand(1: workspace_model.GatewayUsageReportingCommand command)
+ throws (1: registry_api_errors.RegistryServiceException rse);
}
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
index fc1cb88..1f202fd 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
@@ -94,6 +94,11 @@
20: optional string requesterUsername
}
+struct GatewayUsageReportingCommand {
+ 1: required string gatewayId,
+ 2: required string command
+}
+
enum NotificationPriority {
LOW,
NORMAL,