Beispiel #1
0
  /** Performs a deep copy on <i>other</i>. */
  public ResourceJobManager(ResourceJobManager other) {
    if (other.isSetResourceJobManagerId()) {
      this.resourceJobManagerId = other.resourceJobManagerId;
    }
    if (other.isSetResourceJobManagerType()) {
      this.resourceJobManagerType = other.resourceJobManagerType;
    }
    if (other.isSetPushMonitoringEndpoint()) {
      this.pushMonitoringEndpoint = other.pushMonitoringEndpoint;
    }
    if (other.isSetJobManagerBinPath()) {
      this.jobManagerBinPath = other.jobManagerBinPath;
    }
    if (other.isSetJobManagerCommands()) {
      Map<JobManagerCommand, String> __this__jobManagerCommands =
          new HashMap<JobManagerCommand, String>(other.jobManagerCommands.size());
      for (Map.Entry<JobManagerCommand, String> other_element :
          other.jobManagerCommands.entrySet()) {

        JobManagerCommand other_element_key = other_element.getKey();
        String other_element_value = other_element.getValue();

        JobManagerCommand __this__jobManagerCommands_copy_key = other_element_key;

        String __this__jobManagerCommands_copy_value = other_element_value;

        __this__jobManagerCommands.put(
            __this__jobManagerCommands_copy_key, __this__jobManagerCommands_copy_value);
      }
      this.jobManagerCommands = __this__jobManagerCommands;
    }
  }
Beispiel #2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ResourceJobManager struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.resourceJobManagerId != null) {
        oprot.writeFieldBegin(RESOURCE_JOB_MANAGER_ID_FIELD_DESC);
        oprot.writeString(struct.resourceJobManagerId);
        oprot.writeFieldEnd();
      }
      if (struct.resourceJobManagerType != null) {
        oprot.writeFieldBegin(RESOURCE_JOB_MANAGER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.resourceJobManagerType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.pushMonitoringEndpoint != null) {
        if (struct.isSetPushMonitoringEndpoint()) {
          oprot.writeFieldBegin(PUSH_MONITORING_ENDPOINT_FIELD_DESC);
          oprot.writeString(struct.pushMonitoringEndpoint);
          oprot.writeFieldEnd();
        }
      }
      if (struct.jobManagerBinPath != null) {
        if (struct.isSetJobManagerBinPath()) {
          oprot.writeFieldBegin(JOB_MANAGER_BIN_PATH_FIELD_DESC);
          oprot.writeString(struct.jobManagerBinPath);
          oprot.writeFieldEnd();
        }
      }
      if (struct.jobManagerCommands != null) {
        if (struct.isSetJobManagerCommands()) {
          oprot.writeFieldBegin(JOB_MANAGER_COMMANDS_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.I32,
                    org.apache.thrift.protocol.TType.STRING,
                    struct.jobManagerCommands.size()));
            for (Map.Entry<JobManagerCommand, String> _iter4 :
                struct.jobManagerCommands.entrySet()) {
              oprot.writeI32(_iter4.getKey().getValue());
              oprot.writeString(_iter4.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Beispiel #3
0
  public boolean equals(ResourceJobManager that) {
    if (that == null) return false;

    boolean this_present_resourceJobManagerId = true && this.isSetResourceJobManagerId();
    boolean that_present_resourceJobManagerId = true && that.isSetResourceJobManagerId();
    if (this_present_resourceJobManagerId || that_present_resourceJobManagerId) {
      if (!(this_present_resourceJobManagerId && that_present_resourceJobManagerId)) return false;
      if (!this.resourceJobManagerId.equals(that.resourceJobManagerId)) return false;
    }

    boolean this_present_resourceJobManagerType = true && this.isSetResourceJobManagerType();
    boolean that_present_resourceJobManagerType = true && that.isSetResourceJobManagerType();
    if (this_present_resourceJobManagerType || that_present_resourceJobManagerType) {
      if (!(this_present_resourceJobManagerType && that_present_resourceJobManagerType))
        return false;
      if (!this.resourceJobManagerType.equals(that.resourceJobManagerType)) return false;
    }

    boolean this_present_pushMonitoringEndpoint = true && this.isSetPushMonitoringEndpoint();
    boolean that_present_pushMonitoringEndpoint = true && that.isSetPushMonitoringEndpoint();
    if (this_present_pushMonitoringEndpoint || that_present_pushMonitoringEndpoint) {
      if (!(this_present_pushMonitoringEndpoint && that_present_pushMonitoringEndpoint))
        return false;
      if (!this.pushMonitoringEndpoint.equals(that.pushMonitoringEndpoint)) return false;
    }

    boolean this_present_jobManagerBinPath = true && this.isSetJobManagerBinPath();
    boolean that_present_jobManagerBinPath = true && that.isSetJobManagerBinPath();
    if (this_present_jobManagerBinPath || that_present_jobManagerBinPath) {
      if (!(this_present_jobManagerBinPath && that_present_jobManagerBinPath)) return false;
      if (!this.jobManagerBinPath.equals(that.jobManagerBinPath)) return false;
    }

    boolean this_present_jobManagerCommands = true && this.isSetJobManagerCommands();
    boolean that_present_jobManagerCommands = true && that.isSetJobManagerCommands();
    if (this_present_jobManagerCommands || that_present_jobManagerCommands) {
      if (!(this_present_jobManagerCommands && that_present_jobManagerCommands)) return false;
      if (!this.jobManagerCommands.equals(that.jobManagerCommands)) return false;
    }

    return true;
  }
Beispiel #4
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ResourceJobManager struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.resourceJobManagerId = iprot.readString();
   struct.setResourceJobManagerIdIsSet(true);
   struct.resourceJobManagerType =
       org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType.findByValue(
           iprot.readI32());
   struct.setResourceJobManagerTypeIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.pushMonitoringEndpoint = iprot.readString();
     struct.setPushMonitoringEndpointIsSet(true);
   }
   if (incoming.get(1)) {
     struct.jobManagerBinPath = iprot.readString();
     struct.setJobManagerBinPathIsSet(true);
   }
   if (incoming.get(2)) {
     {
       org.apache.thrift.protocol.TMap _map6 =
           new org.apache.thrift.protocol.TMap(
               org.apache.thrift.protocol.TType.I32,
               org.apache.thrift.protocol.TType.STRING,
               iprot.readI32());
       struct.jobManagerCommands = new HashMap<JobManagerCommand, String>(2 * _map6.size);
       JobManagerCommand _key7;
       String _val8;
       for (int _i9 = 0; _i9 < _map6.size; ++_i9) {
         _key7 =
             org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand.findByValue(
                 iprot.readI32());
         _val8 = iprot.readString();
         struct.jobManagerCommands.put(_key7, _val8);
       }
     }
     struct.setJobManagerCommandsIsSet(true);
   }
 }
Beispiel #5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ResourceJobManager struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeString(struct.resourceJobManagerId);
   oprot.writeI32(struct.resourceJobManagerType.getValue());
   BitSet optionals = new BitSet();
   if (struct.isSetPushMonitoringEndpoint()) {
     optionals.set(0);
   }
   if (struct.isSetJobManagerBinPath()) {
     optionals.set(1);
   }
   if (struct.isSetJobManagerCommands()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetPushMonitoringEndpoint()) {
     oprot.writeString(struct.pushMonitoringEndpoint);
   }
   if (struct.isSetJobManagerBinPath()) {
     oprot.writeString(struct.jobManagerBinPath);
   }
   if (struct.isSetJobManagerCommands()) {
     {
       oprot.writeI32(struct.jobManagerCommands.size());
       for (Map.Entry<JobManagerCommand, String> _iter5 : struct.jobManagerCommands.entrySet()) {
         oprot.writeI32(_iter5.getKey().getValue());
         oprot.writeString(_iter5.getValue());
       }
     }
   }
 }
Beispiel #6
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, ResourceJobManager 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: // RESOURCE_JOB_MANAGER_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.resourceJobManagerId = iprot.readString();
           struct.setResourceJobManagerIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // RESOURCE_JOB_MANAGER_TYPE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.resourceJobManagerType =
               org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType
                   .findByValue(iprot.readI32());
           struct.setResourceJobManagerTypeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // PUSH_MONITORING_ENDPOINT
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.pushMonitoringEndpoint = iprot.readString();
           struct.setPushMonitoringEndpointIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // JOB_MANAGER_BIN_PATH
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.jobManagerBinPath = iprot.readString();
           struct.setJobManagerBinPathIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // JOB_MANAGER_COMMANDS
         if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
           {
             org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
             struct.jobManagerCommands = new HashMap<JobManagerCommand, String>(2 * _map0.size);
             JobManagerCommand _key1;
             String _val2;
             for (int _i3 = 0; _i3 < _map0.size; ++_i3) {
               _key1 =
                   org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand
                       .findByValue(iprot.readI32());
               _val2 = iprot.readString();
               struct.jobManagerCommands.put(_key1, _val2);
             }
             iprot.readMapEnd();
           }
           struct.setJobManagerCommandsIsSet(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();
 }
Beispiel #7
0
  @Override
  public int compareTo(ResourceJobManager other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison =
        Boolean.valueOf(isSetResourceJobManagerId()).compareTo(other.isSetResourceJobManagerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResourceJobManagerId()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.resourceJobManagerId, other.resourceJobManagerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetResourceJobManagerType())
            .compareTo(other.isSetResourceJobManagerType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResourceJobManagerType()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.resourceJobManagerType, other.resourceJobManagerType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetPushMonitoringEndpoint())
            .compareTo(other.isSetPushMonitoringEndpoint());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPushMonitoringEndpoint()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.pushMonitoringEndpoint, other.pushMonitoringEndpoint);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetJobManagerBinPath()).compareTo(other.isSetJobManagerBinPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetJobManagerBinPath()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.jobManagerBinPath, other.jobManagerBinPath);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetJobManagerCommands()).compareTo(other.isSetJobManagerCommands());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetJobManagerCommands()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.jobManagerCommands, other.jobManagerCommands);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }