summaryrefslogtreecommitdiffstats
path: root/Dozentenmodulserver/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodulserver/src/server')
-rw-r--r--Dozentenmodulserver/src/server/BinaryListener.java2
-rw-r--r--Dozentenmodulserver/src/server/Server.java620
-rw-r--r--Dozentenmodulserver/src/server/ServerHandler.java71
-rw-r--r--Dozentenmodulserver/src/server/startServer.java21
4 files changed, 614 insertions, 100 deletions
diff --git a/Dozentenmodulserver/src/server/BinaryListener.java b/Dozentenmodulserver/src/server/BinaryListener.java
index 97793778..a48b381e 100644
--- a/Dozentenmodulserver/src/server/BinaryListener.java
+++ b/Dozentenmodulserver/src/server/BinaryListener.java
@@ -31,5 +31,5 @@ public class BinaryListener implements Runnable
log.info(new Date() +" - Started running BinaryListener");
server.serve();
}
-
+
}
diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java
index 91afb099..ef434865 100644
--- a/Dozentenmodulserver/src/server/Server.java
+++ b/Dozentenmodulserver/src/server/Server.java
@@ -42,7 +42,7 @@ public class Server {
public String getPathOfImage(String image_id, String version) throws org.apache.thrift.TException;
- public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath) throws org.apache.thrift.TException;
+ public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize) throws org.apache.thrift.TException;
public List<Image> getImageList() throws org.apache.thrift.TException;
@@ -58,7 +58,7 @@ public class Server {
public Map<String,String> getImageData(String imageid, String imageversion) throws org.apache.thrift.TException;
- public boolean updateImageData(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version) throws org.apache.thrift.TException;
+ public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize) throws org.apache.thrift.TException;
public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException;
@@ -82,7 +82,7 @@ public class Server {
public void getPathOfImage(String image_id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getImageList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -98,7 +98,7 @@ public class Server {
public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void updateImageData(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getLectureData(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -203,13 +203,13 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathOfImage failed: unknown result");
}
- public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath) throws org.apache.thrift.TException
+ public boolean writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize) throws org.apache.thrift.TException
{
- send_writeVLdata(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath);
+ send_writeVLdata(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize);
return recv_writeVLdata();
}
- public void send_writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath) throws org.apache.thrift.TException
+ public void send_writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize) throws org.apache.thrift.TException
{
writeVLdata_args args = new writeVLdata_args();
args.setImagename(imagename);
@@ -225,6 +225,8 @@ public class Server {
args.setRam(ram);
args.setCpu(cpu);
args.setImagePath(imagePath);
+ args.setIsTemplate(isTemplate);
+ args.setFilesize(filesize);
sendBase("writeVLdata", args);
}
@@ -411,23 +413,26 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageData failed: unknown result");
}
- public boolean updateImageData(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version) throws org.apache.thrift.TException
+ public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize) throws org.apache.thrift.TException
{
- send_updateImageData(name, newName, license, internet, ram, cpu, id, version);
+ send_updateImageData(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize);
return recv_updateImageData();
}
- public void send_updateImageData(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version) throws org.apache.thrift.TException
+ public void send_updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize) throws org.apache.thrift.TException
{
updateImageData_args args = new updateImageData_args();
args.setName(name);
args.setNewName(newName);
+ args.setImage_path(image_path);
args.setLicense(license);
args.setInternet(internet);
args.setRam(ram);
args.setCpu(cpu);
args.setId(id);
args.setVersion(version);
+ args.setIsTemplate(isTemplate);
+ args.setFilesize(filesize);
sendBase("updateImageData", args);
}
@@ -712,9 +717,9 @@ public class Server {
}
}
- public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void writeVLdata(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- writeVLdata_call method_call = new writeVLdata_call(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, resultHandler, this, ___protocolFactory, ___transport);
+ writeVLdata_call method_call = new writeVLdata_call(imagename, login, firstname, lastname, university, Mail, Tel, Fak, license, internet, ram, cpu, imagePath, isTemplate, filesize, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -733,7 +738,9 @@ public class Server {
private long ram;
private long cpu;
private String imagePath;
- public writeVLdata_call(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private boolean isTemplate;
+ private long filesize;
+ public writeVLdata_call(String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback 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.imagename = imagename;
this.login = login;
@@ -748,6 +755,8 @@ public class Server {
this.ram = ram;
this.cpu = cpu;
this.imagePath = imagePath;
+ this.isTemplate = isTemplate;
+ this.filesize = filesize;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -766,6 +775,8 @@ public class Server {
args.setRam(ram);
args.setCpu(cpu);
args.setImagePath(imagePath);
+ args.setIsTemplate(isTemplate);
+ args.setFilesize(filesize);
args.write(prot);
prot.writeMessageEnd();
}
@@ -1040,9 +1051,9 @@ public class Server {
}
}
- public void updateImageData(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- updateImageData_call method_call = new updateImageData_call(name, newName, license, internet, ram, cpu, id, version, resultHandler, this, ___protocolFactory, ___transport);
+ updateImageData_call method_call = new updateImageData_call(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -1050,22 +1061,28 @@ public class Server {
public static class updateImageData_call extends org.apache.thrift.async.TAsyncMethodCall {
private String name;
private String newName;
+ private String image_path;
private boolean license;
private boolean internet;
private long ram;
private long cpu;
private String id;
private String version;
- public updateImageData_call(String name, String newName, boolean license, boolean internet, long ram, long cpu, String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private boolean isTemplate;
+ private long filesize;
+ public updateImageData_call(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, org.apache.thrift.async.AsyncMethodCallback 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.name = name;
this.newName = newName;
+ this.image_path = image_path;
this.license = license;
this.internet = internet;
this.ram = ram;
this.cpu = cpu;
this.id = id;
this.version = version;
+ this.isTemplate = isTemplate;
+ this.filesize = filesize;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -1073,12 +1090,15 @@ public class Server {
updateImageData_args args = new updateImageData_args();
args.setName(name);
args.setNewName(newName);
+ args.setImage_path(image_path);
args.setLicense(license);
args.setInternet(internet);
args.setRam(ram);
args.setCpu(cpu);
args.setId(id);
args.setVersion(version);
+ args.setIsTemplate(isTemplate);
+ args.setFilesize(filesize);
args.write(prot);
prot.writeMessageEnd();
}
@@ -1452,7 +1472,7 @@ public class Server {
public writeVLdata_result getResult(I iface, writeVLdata_args args) throws org.apache.thrift.TException {
writeVLdata_result result = new writeVLdata_result();
- result.success = iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath);
+ result.success = iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize);
result.setSuccessIsSet(true);
return result;
}
@@ -1615,7 +1635,7 @@ public class Server {
public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException {
updateImageData_result result = new updateImageData_result();
- result.success = iface.updateImageData(args.name, args.newName, args.license, args.internet, args.ram, args.cpu, args.id, args.version);
+ result.success = iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize);
result.setSuccessIsSet(true);
return result;
}
@@ -1982,7 +2002,7 @@ public class Server {
}
public void start(I iface, writeVLdata_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath,resultHandler);
+ iface.writeVLdata(args.imagename, args.login, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.license, args.internet, args.ram, args.cpu, args.imagePath, args.isTemplate, args.filesize,resultHandler);
}
}
@@ -2393,7 +2413,7 @@ public class Server {
}
public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.updateImageData(args.name, args.newName, args.license, args.internet, args.ram, args.cpu, args.id, args.version,resultHandler);
+ iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize,resultHandler);
}
}
@@ -4847,6 +4867,8 @@ public class Server {
private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-11);
private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-12);
private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)-13);
+ private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-14);
+ private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-15);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -4867,6 +4889,8 @@ public class Server {
public long ram; // required
public long cpu; // required
public String imagePath; // required
+ public boolean isTemplate; // required
+ public long filesize; // 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 {
@@ -4882,7 +4906,9 @@ public class Server {
INTERNET((short)-10, "internet"),
RAM((short)-11, "ram"),
CPU((short)-12, "cpu"),
- IMAGE_PATH((short)-13, "imagePath");
+ IMAGE_PATH((short)-13, "imagePath"),
+ IS_TEMPLATE((short)-14, "isTemplate"),
+ FILESIZE((short)-15, "filesize");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -4923,6 +4949,10 @@ public class Server {
return CPU;
case -13: // IMAGE_PATH
return IMAGE_PATH;
+ case -14: // IS_TEMPLATE
+ return IS_TEMPLATE;
+ case -15: // FILESIZE
+ return FILESIZE;
default:
return null;
}
@@ -4967,6 +4997,8 @@ public class Server {
private static final int __INTERNET_ISSET_ID = 1;
private static final int __RAM_ISSET_ID = 2;
private static final int __CPU_ISSET_ID = 3;
+ private static final int __ISTEMPLATE_ISSET_ID = 4;
+ private static final int __FILESIZE_ISSET_ID = 5;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
@@ -4997,6 +5029,10 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int")));
tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("imagePath", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(writeVLdata_args.class, metaDataMap);
}
@@ -5017,7 +5053,9 @@ public class Server {
boolean internet,
long ram,
long cpu,
- String imagePath)
+ String imagePath,
+ boolean isTemplate,
+ long filesize)
{
this();
this.imagename = imagename;
@@ -5037,6 +5075,10 @@ public class Server {
this.cpu = cpu;
setCpuIsSet(true);
this.imagePath = imagePath;
+ this.isTemplate = isTemplate;
+ setIsTemplateIsSet(true);
+ this.filesize = filesize;
+ setFilesizeIsSet(true);
}
/**
@@ -5075,6 +5117,8 @@ public class Server {
if (other.isSetImagePath()) {
this.imagePath = other.imagePath;
}
+ this.isTemplate = other.isTemplate;
+ this.filesize = other.filesize;
}
public writeVLdata_args deepCopy() {
@@ -5100,6 +5144,10 @@ public class Server {
setCpuIsSet(false);
this.cpu = 0;
this.imagePath = null;
+ setIsTemplateIsSet(false);
+ this.isTemplate = false;
+ setFilesizeIsSet(false);
+ this.filesize = 0;
}
public String getImagename() {
@@ -5410,6 +5458,52 @@ public class Server {
}
}
+ public boolean isIsTemplate() {
+ return this.isTemplate;
+ }
+
+ public writeVLdata_args setIsTemplate(boolean isTemplate) {
+ this.isTemplate = isTemplate;
+ setIsTemplateIsSet(true);
+ return this;
+ }
+
+ public void unsetIsTemplate() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID);
+ }
+
+ /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */
+ public boolean isSetIsTemplate() {
+ return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID);
+ }
+
+ public void setIsTemplateIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value);
+ }
+
+ public long getFilesize() {
+ return this.filesize;
+ }
+
+ public writeVLdata_args setFilesize(long filesize) {
+ this.filesize = filesize;
+ setFilesizeIsSet(true);
+ return this;
+ }
+
+ public void unsetFilesize() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID);
+ }
+
+ /** Returns true if field filesize is set (has been assigned a value) and false otherwise */
+ public boolean isSetFilesize() {
+ return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID);
+ }
+
+ public void setFilesizeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case IMAGENAME:
@@ -5516,6 +5610,22 @@ public class Server {
}
break;
+ case IS_TEMPLATE:
+ if (value == null) {
+ unsetIsTemplate();
+ } else {
+ setIsTemplate((Boolean)value);
+ }
+ break;
+
+ case FILESIZE:
+ if (value == null) {
+ unsetFilesize();
+ } else {
+ setFilesize((Long)value);
+ }
+ break;
+
}
}
@@ -5560,6 +5670,12 @@ public class Server {
case IMAGE_PATH:
return getImagePath();
+ case IS_TEMPLATE:
+ return Boolean.valueOf(isIsTemplate());
+
+ case FILESIZE:
+ return Long.valueOf(getFilesize());
+
}
throw new IllegalStateException();
}
@@ -5597,6 +5713,10 @@ public class Server {
return isSetCpu();
case IMAGE_PATH:
return isSetImagePath();
+ case IS_TEMPLATE:
+ return isSetIsTemplate();
+ case FILESIZE:
+ return isSetFilesize();
}
throw new IllegalStateException();
}
@@ -5731,6 +5851,24 @@ public class Server {
return false;
}
+ boolean this_present_isTemplate = true;
+ boolean that_present_isTemplate = true;
+ if (this_present_isTemplate || that_present_isTemplate) {
+ if (!(this_present_isTemplate && that_present_isTemplate))
+ return false;
+ if (this.isTemplate != that.isTemplate)
+ return false;
+ }
+
+ boolean this_present_filesize = true;
+ boolean that_present_filesize = true;
+ if (this_present_filesize || that_present_filesize) {
+ if (!(this_present_filesize && that_present_filesize))
+ return false;
+ if (this.filesize != that.filesize)
+ return false;
+ }
+
return true;
}
@@ -5877,6 +6015,26 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetIsTemplate()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFilesize()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -5984,6 +6142,14 @@ public class Server {
sb.append(this.imagePath);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("isTemplate:");
+ sb.append(this.isTemplate);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("filesize:");
+ sb.append(this.filesize);
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -6133,6 +6299,22 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case -14: // IS_TEMPLATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.isTemplate = iprot.readBool();
+ struct.setIsTemplateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -15: // FILESIZE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.filesize = iprot.readI64();
+ struct.setFilesizeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -6148,6 +6330,12 @@ public class Server {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(FILESIZE_FIELD_DESC);
+ oprot.writeI64(struct.filesize);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC);
+ oprot.writeBool(struct.isTemplate);
+ oprot.writeFieldEnd();
if (struct.imagePath != null) {
oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC);
oprot.writeString(struct.imagePath);
@@ -6262,7 +6450,13 @@ public class Server {
if (struct.isSetImagePath()) {
optionals.set(12);
}
- oprot.writeBitSet(optionals, 13);
+ if (struct.isSetIsTemplate()) {
+ optionals.set(13);
+ }
+ if (struct.isSetFilesize()) {
+ optionals.set(14);
+ }
+ oprot.writeBitSet(optionals, 15);
if (struct.isSetImagename()) {
oprot.writeString(struct.imagename);
}
@@ -6302,12 +6496,18 @@ public class Server {
if (struct.isSetImagePath()) {
oprot.writeString(struct.imagePath);
}
+ if (struct.isSetIsTemplate()) {
+ oprot.writeBool(struct.isTemplate);
+ }
+ if (struct.isSetFilesize()) {
+ oprot.writeI64(struct.filesize);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, writeVLdata_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(13);
+ BitSet incoming = iprot.readBitSet(15);
if (incoming.get(0)) {
struct.imagename = iprot.readString();
struct.setImagenameIsSet(true);
@@ -6360,6 +6560,14 @@ public class Server {
struct.imagePath = iprot.readString();
struct.setImagePathIsSet(true);
}
+ if (incoming.get(13)) {
+ struct.isTemplate = iprot.readBool();
+ struct.setIsTemplateIsSet(true);
+ }
+ if (incoming.get(14)) {
+ struct.filesize = iprot.readI64();
+ struct.setFilesizeIsSet(true);
+ }
}
}
@@ -13115,12 +13323,15 @@ public class Server {
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1);
private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2);
- private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-3);
- private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-4);
- private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-5);
- private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-6);
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-7);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-8);
+ private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("image_path", org.apache.thrift.protocol.TType.STRING, (short)-3);
+ private static final org.apache.thrift.protocol.TField LICENSE_FIELD_DESC = new org.apache.thrift.protocol.TField("license", org.apache.thrift.protocol.TType.BOOL, (short)-4);
+ private static final org.apache.thrift.protocol.TField INTERNET_FIELD_DESC = new org.apache.thrift.protocol.TField("internet", org.apache.thrift.protocol.TType.BOOL, (short)-5);
+ private static final org.apache.thrift.protocol.TField RAM_FIELD_DESC = new org.apache.thrift.protocol.TField("ram", org.apache.thrift.protocol.TType.I64, (short)-6);
+ private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.I64, (short)-7);
+ private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-8);
+ private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-9);
+ private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)-10);
+ private static final org.apache.thrift.protocol.TField FILESIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("filesize", org.apache.thrift.protocol.TType.I64, (short)-11);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -13130,23 +13341,29 @@ public class Server {
public String name; // required
public String newName; // required
+ public String image_path; // required
public boolean license; // required
public boolean internet; // required
public long ram; // required
public long cpu; // required
public String id; // required
public String version; // required
+ public boolean isTemplate; // required
+ public long filesize; // 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 {
NAME((short)-1, "name"),
NEW_NAME((short)-2, "newName"),
- LICENSE((short)-3, "license"),
- INTERNET((short)-4, "internet"),
- RAM((short)-5, "ram"),
- CPU((short)-6, "cpu"),
- ID((short)-7, "id"),
- VERSION((short)-8, "version");
+ IMAGE_PATH((short)-3, "image_path"),
+ LICENSE((short)-4, "license"),
+ INTERNET((short)-5, "internet"),
+ RAM((short)-6, "ram"),
+ CPU((short)-7, "cpu"),
+ ID((short)-8, "id"),
+ VERSION((short)-9, "version"),
+ IS_TEMPLATE((short)-10, "isTemplate"),
+ FILESIZE((short)-11, "filesize");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -13165,18 +13382,24 @@ public class Server {
return NAME;
case -2: // NEW_NAME
return NEW_NAME;
- case -3: // LICENSE
+ case -3: // IMAGE_PATH
+ return IMAGE_PATH;
+ case -4: // LICENSE
return LICENSE;
- case -4: // INTERNET
+ case -5: // INTERNET
return INTERNET;
- case -5: // RAM
+ case -6: // RAM
return RAM;
- case -6: // CPU
+ case -7: // CPU
return CPU;
- case -7: // ID
+ case -8: // ID
return ID;
- case -8: // VERSION
+ case -9: // VERSION
return VERSION;
+ case -10: // IS_TEMPLATE
+ return IS_TEMPLATE;
+ case -11: // FILESIZE
+ return FILESIZE;
default:
return null;
}
@@ -13221,6 +13444,8 @@ public class Server {
private static final int __INTERNET_ISSET_ID = 1;
private static final int __RAM_ISSET_ID = 2;
private static final int __CPU_ISSET_ID = 3;
+ private static final int __ISTEMPLATE_ISSET_ID = 4;
+ private static final int __FILESIZE_ISSET_ID = 5;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
@@ -13229,6 +13454,8 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("image_path", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LICENSE, new org.apache.thrift.meta_data.FieldMetaData("license", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.INTERNET, new org.apache.thrift.meta_data.FieldMetaData("internet", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -13241,6 +13468,10 @@ public class Server {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IS_TEMPLATE, new org.apache.thrift.meta_data.FieldMetaData("isTemplate", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.FILESIZE, new org.apache.thrift.meta_data.FieldMetaData("filesize", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateImageData_args.class, metaDataMap);
}
@@ -13251,16 +13482,20 @@ public class Server {
public updateImageData_args(
String name,
String newName,
+ String image_path,
boolean license,
boolean internet,
long ram,
long cpu,
String id,
- String version)
+ String version,
+ boolean isTemplate,
+ long filesize)
{
this();
this.name = name;
this.newName = newName;
+ this.image_path = image_path;
this.license = license;
setLicenseIsSet(true);
this.internet = internet;
@@ -13271,6 +13506,10 @@ public class Server {
setCpuIsSet(true);
this.id = id;
this.version = version;
+ this.isTemplate = isTemplate;
+ setIsTemplateIsSet(true);
+ this.filesize = filesize;
+ setFilesizeIsSet(true);
}
/**
@@ -13284,6 +13523,9 @@ public class Server {
if (other.isSetNewName()) {
this.newName = other.newName;
}
+ if (other.isSetImage_path()) {
+ this.image_path = other.image_path;
+ }
this.license = other.license;
this.internet = other.internet;
this.ram = other.ram;
@@ -13294,6 +13536,8 @@ public class Server {
if (other.isSetVersion()) {
this.version = other.version;
}
+ this.isTemplate = other.isTemplate;
+ this.filesize = other.filesize;
}
public updateImageData_args deepCopy() {
@@ -13304,6 +13548,7 @@ public class Server {
public void clear() {
this.name = null;
this.newName = null;
+ this.image_path = null;
setLicenseIsSet(false);
this.license = false;
setInternetIsSet(false);
@@ -13314,6 +13559,10 @@ public class Server {
this.cpu = 0;
this.id = null;
this.version = null;
+ setIsTemplateIsSet(false);
+ this.isTemplate = false;
+ setFilesizeIsSet(false);
+ this.filesize = 0;
}
public String getName() {
@@ -13364,6 +13613,30 @@ public class Server {
}
}
+ public String getImage_path() {
+ return this.image_path;
+ }
+
+ public updateImageData_args setImage_path(String image_path) {
+ this.image_path = image_path;
+ return this;
+ }
+
+ public void unsetImage_path() {
+ this.image_path = null;
+ }
+
+ /** Returns true if field image_path is set (has been assigned a value) and false otherwise */
+ public boolean isSetImage_path() {
+ return this.image_path != null;
+ }
+
+ public void setImage_pathIsSet(boolean value) {
+ if (!value) {
+ this.image_path = null;
+ }
+ }
+
public boolean isLicense() {
return this.license;
}
@@ -13504,6 +13777,52 @@ public class Server {
}
}
+ public boolean isIsTemplate() {
+ return this.isTemplate;
+ }
+
+ public updateImageData_args setIsTemplate(boolean isTemplate) {
+ this.isTemplate = isTemplate;
+ setIsTemplateIsSet(true);
+ return this;
+ }
+
+ public void unsetIsTemplate() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID);
+ }
+
+ /** Returns true if field isTemplate is set (has been assigned a value) and false otherwise */
+ public boolean isSetIsTemplate() {
+ return EncodingUtils.testBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID);
+ }
+
+ public void setIsTemplateIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISTEMPLATE_ISSET_ID, value);
+ }
+
+ public long getFilesize() {
+ return this.filesize;
+ }
+
+ public updateImageData_args setFilesize(long filesize) {
+ this.filesize = filesize;
+ setFilesizeIsSet(true);
+ return this;
+ }
+
+ public void unsetFilesize() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID);
+ }
+
+ /** Returns true if field filesize is set (has been assigned a value) and false otherwise */
+ public boolean isSetFilesize() {
+ return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID);
+ }
+
+ public void setFilesizeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
@@ -13522,6 +13841,14 @@ public class Server {
}
break;
+ case IMAGE_PATH:
+ if (value == null) {
+ unsetImage_path();
+ } else {
+ setImage_path((String)value);
+ }
+ break;
+
case LICENSE:
if (value == null) {
unsetLicense();
@@ -13570,6 +13897,22 @@ public class Server {
}
break;
+ case IS_TEMPLATE:
+ if (value == null) {
+ unsetIsTemplate();
+ } else {
+ setIsTemplate((Boolean)value);
+ }
+ break;
+
+ case FILESIZE:
+ if (value == null) {
+ unsetFilesize();
+ } else {
+ setFilesize((Long)value);
+ }
+ break;
+
}
}
@@ -13581,6 +13924,9 @@ public class Server {
case NEW_NAME:
return getNewName();
+ case IMAGE_PATH:
+ return getImage_path();
+
case LICENSE:
return Boolean.valueOf(isLicense());
@@ -13599,6 +13945,12 @@ public class Server {
case VERSION:
return getVersion();
+ case IS_TEMPLATE:
+ return Boolean.valueOf(isIsTemplate());
+
+ case FILESIZE:
+ return Long.valueOf(getFilesize());
+
}
throw new IllegalStateException();
}
@@ -13614,6 +13966,8 @@ public class Server {
return isSetName();
case NEW_NAME:
return isSetNewName();
+ case IMAGE_PATH:
+ return isSetImage_path();
case LICENSE:
return isSetLicense();
case INTERNET:
@@ -13626,6 +13980,10 @@ public class Server {
return isSetId();
case VERSION:
return isSetVersion();
+ case IS_TEMPLATE:
+ return isSetIsTemplate();
+ case FILESIZE:
+ return isSetFilesize();
}
throw new IllegalStateException();
}
@@ -13661,6 +14019,15 @@ public class Server {
return false;
}
+ boolean this_present_image_path = true && this.isSetImage_path();
+ boolean that_present_image_path = true && that.isSetImage_path();
+ if (this_present_image_path || that_present_image_path) {
+ if (!(this_present_image_path && that_present_image_path))
+ return false;
+ if (!this.image_path.equals(that.image_path))
+ return false;
+ }
+
boolean this_present_license = true;
boolean that_present_license = true;
if (this_present_license || that_present_license) {
@@ -13715,6 +14082,24 @@ public class Server {
return false;
}
+ boolean this_present_isTemplate = true;
+ boolean that_present_isTemplate = true;
+ if (this_present_isTemplate || that_present_isTemplate) {
+ if (!(this_present_isTemplate && that_present_isTemplate))
+ return false;
+ if (this.isTemplate != that.isTemplate)
+ return false;
+ }
+
+ boolean this_present_filesize = true;
+ boolean that_present_filesize = true;
+ if (this_present_filesize || that_present_filesize) {
+ if (!(this_present_filesize && that_present_filesize))
+ return false;
+ if (this.filesize != that.filesize)
+ return false;
+ }
+
return true;
}
@@ -13751,6 +14136,16 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetImage_path()).compareTo(other.isSetImage_path());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImage_path()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.image_path, other.image_path);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
lastComparison = Boolean.valueOf(isSetLicense()).compareTo(other.isSetLicense());
if (lastComparison != 0) {
return lastComparison;
@@ -13811,6 +14206,26 @@ public class Server {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetIsTemplate()).compareTo(other.isSetIsTemplate());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetIsTemplate()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isTemplate, other.isTemplate);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFilesize()).compareTo(other.isSetFilesize());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFilesize()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filesize, other.filesize);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -13847,6 +14262,14 @@ public class Server {
}
first = false;
if (!first) sb.append(", ");
+ sb.append("image_path:");
+ if (this.image_path == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.image_path);
+ }
+ first = false;
+ if (!first) sb.append(", ");
sb.append("license:");
sb.append(this.license);
first = false;
@@ -13878,6 +14301,14 @@ public class Server {
sb.append(this.version);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("isTemplate:");
+ sb.append(this.isTemplate);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("filesize:");
+ sb.append(this.filesize);
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -13939,7 +14370,15 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -3: // LICENSE
+ case -3: // IMAGE_PATH
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.image_path = iprot.readString();
+ struct.setImage_pathIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -4: // LICENSE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
@@ -13947,7 +14386,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -4: // INTERNET
+ case -5: // INTERNET
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
@@ -13955,7 +14394,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -5: // RAM
+ case -6: // RAM
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
@@ -13963,7 +14402,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -6: // CPU
+ case -7: // CPU
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
@@ -13971,7 +14410,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -7: // ID
+ case -8: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
@@ -13979,7 +14418,7 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case -8: // VERSION
+ case -9: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
@@ -13987,6 +14426,22 @@ public class Server {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case -10: // IS_TEMPLATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.isTemplate = iprot.readBool();
+ struct.setIsTemplateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case -11: // FILESIZE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.filesize = iprot.readI64();
+ struct.setFilesizeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -14002,6 +14457,12 @@ public class Server {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(FILESIZE_FIELD_DESC);
+ oprot.writeI64(struct.filesize);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(IS_TEMPLATE_FIELD_DESC);
+ oprot.writeBool(struct.isTemplate);
+ oprot.writeFieldEnd();
if (struct.version != null) {
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeString(struct.version);
@@ -14024,6 +14485,11 @@ public class Server {
oprot.writeFieldBegin(LICENSE_FIELD_DESC);
oprot.writeBool(struct.license);
oprot.writeFieldEnd();
+ if (struct.image_path != null) {
+ oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC);
+ oprot.writeString(struct.image_path);
+ oprot.writeFieldEnd();
+ }
if (struct.newName != null) {
oprot.writeFieldBegin(NEW_NAME_FIELD_DESC);
oprot.writeString(struct.newName);
@@ -14058,31 +14524,43 @@ public class Server {
if (struct.isSetNewName()) {
optionals.set(1);
}
- if (struct.isSetLicense()) {
+ if (struct.isSetImage_path()) {
optionals.set(2);
}
- if (struct.isSetInternet()) {
+ if (struct.isSetLicense()) {
optionals.set(3);
}
- if (struct.isSetRam()) {
+ if (struct.isSetInternet()) {
optionals.set(4);
}
- if (struct.isSetCpu()) {
+ if (struct.isSetRam()) {
optionals.set(5);
}
- if (struct.isSetId()) {
+ if (struct.isSetCpu()) {
optionals.set(6);
}
- if (struct.isSetVersion()) {
+ if (struct.isSetId()) {
optionals.set(7);
}
- oprot.writeBitSet(optionals, 8);
+ if (struct.isSetVersion()) {
+ optionals.set(8);
+ }
+ if (struct.isSetIsTemplate()) {
+ optionals.set(9);
+ }
+ if (struct.isSetFilesize()) {
+ optionals.set(10);
+ }
+ oprot.writeBitSet(optionals, 11);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
if (struct.isSetNewName()) {
oprot.writeString(struct.newName);
}
+ if (struct.isSetImage_path()) {
+ oprot.writeString(struct.image_path);
+ }
if (struct.isSetLicense()) {
oprot.writeBool(struct.license);
}
@@ -14101,12 +14579,18 @@ public class Server {
if (struct.isSetVersion()) {
oprot.writeString(struct.version);
}
+ if (struct.isSetIsTemplate()) {
+ oprot.writeBool(struct.isTemplate);
+ }
+ if (struct.isSetFilesize()) {
+ oprot.writeI64(struct.filesize);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateImageData_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(8);
+ BitSet incoming = iprot.readBitSet(11);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
@@ -14116,29 +14600,41 @@ public class Server {
struct.setNewNameIsSet(true);
}
if (incoming.get(2)) {
+ struct.image_path = iprot.readString();
+ struct.setImage_pathIsSet(true);
+ }
+ if (incoming.get(3)) {
struct.license = iprot.readBool();
struct.setLicenseIsSet(true);
}
- if (incoming.get(3)) {
+ if (incoming.get(4)) {
struct.internet = iprot.readBool();
struct.setInternetIsSet(true);
}
- if (incoming.get(4)) {
+ if (incoming.get(5)) {
struct.ram = iprot.readI64();
struct.setRamIsSet(true);
}
- if (incoming.get(5)) {
+ if (incoming.get(6)) {
struct.cpu = iprot.readI64();
struct.setCpuIsSet(true);
}
- if (incoming.get(6)) {
+ if (incoming.get(7)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
- if (incoming.get(7)) {
+ if (incoming.get(8)) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
}
+ if (incoming.get(9)) {
+ struct.isTemplate = iprot.readBool();
+ struct.setIsTemplateIsSet(true);
+ }
+ if (incoming.get(10)) {
+ struct.filesize = iprot.readI64();
+ struct.setFilesizeIsSet(true);
+ }
}
}
diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java
index 7c93422f..95b261d3 100644
--- a/Dozentenmodulserver/src/server/ServerHandler.java
+++ b/Dozentenmodulserver/src/server/ServerHandler.java
@@ -18,19 +18,23 @@ import java.util.UUID;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
+import models.Configuration;
+
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
+import org.ini4j.Wini;
import sql.SQL;
import util.XMLCreator;
public class ServerHandler implements Server.Iface {
-
static SQL sql = new SQL();
static Connection con = sql.getConnection();
private static Logger log = Logger.getLogger(ServerHandler.class);
+
+
@Override
public User getFtpUser() throws TException {
log.info(new Date() + " - returing FTPUser...");
@@ -38,7 +42,7 @@ public class ServerHandler implements Server.Iface {
user.setUserName(UUID.randomUUID().toString().substring(0, 8));
user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString()
.substring(0, 8)));
- user.setPath("/srv/openslx/nfs/temp");
+ user.setPath(Configuration.config.getAbsolute_path());
SQL sql = new SQL();
Connection con = sql.getConnection();
sql.writeFTPUser(con, user.getUserName(), user.getPassword());
@@ -85,15 +89,15 @@ public class ServerHandler implements Server.Iface {
public boolean writeVLdata(String imagename, String login,
String firstname, String lastname, String university, String Mail,
String Tel, String Fak, boolean license, boolean internet,
- long ram, long cpu, String imagePath) throws TException {
+ long ram, long cpu, String imagePath, boolean isTemplate ,long filesize) throws TException {
- int pk_institution = sql.setInstitution(con, university);
+ String pk_institution = sql.setInstitution(con, university);
- int pk_person = sql.setPerson(con, login, lastname, firstname, Mail,
+ String pk_person = sql.setPerson(con, login, lastname, firstname, Mail,
new Date(), pk_institution);
sql.setImageData(con, pk_person, license, internet, cpu, ram,
- imagename, imagePath);
+ imagename, imagePath,isTemplate ,filesize);
log.info(new Date() + " - written VLdata");
// TODO Auto-generated method stub
@@ -177,18 +181,18 @@ public class ServerHandler implements Server.Iface {
String imagename, String login, String firstname, String lastname,
String university, String Mail, String Tel, String Fak)
throws TException {
- int pk_image = 0;
+ String pk_image = null;
int imageversion = 0;
- int pk_institution = sql.setInstitution(con, university);
- int pk_person = sql.setPerson(con, login, lastname, firstname, Mail,
+ String pk_institution = sql.setInstitution(con, university);
+ String pk_person = sql.setPerson(con, login, lastname, firstname, Mail,
new Date(), pk_institution);
ResultSet image = sql.getImageIDandVersion(con, imagename);
try {
while (image.next()) {
- pk_image = image.getInt("GUID_imageID");
+ pk_image = image.getString("GUID_imageID");
imageversion = image.getInt("imageVersion");
}
} catch (SQLException e) {
@@ -216,28 +220,21 @@ public class ServerHandler implements Server.Iface {
}
@Override
- public boolean startFileCopy(String file) throws TException {
+ public boolean startFileCopy(String filename) throws TException {
+ String file=Configuration.config.getAbsolute_path()+"temp/"+filename;
File tmpFile = new File(file);
-
+
+ log.info(new Date() + " - Trying to move file to '/srv/openslx/nfs/prod/"+tmpFile.getName() +"'");
try {
// der übergebene Filename ist falsch - hier muss der generierte
// name geholt werden, nicht der ursprüngliche name. wo wird dieser
// eingelesen?
- FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"
- + tmpFile.getName()));
-
- // der übergebene Filename ist falsch - hier muss der generierte
- // name geholt werden, nicht der ursprüngliche name. wo wird dieser
- // eingelesen?
- FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"
- + tmpFile.getName()));
-
- // der übergebene Filename ist falsch - hier muss der generierte
- // name geholt werden, nicht der ursprüngliche name. wo wird dieser
- // eingelesen?
- FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"
- + tmpFile.getName()));
+ //FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"
+ // + tmpFile.getName()));
+ FileUtils.moveFile(tmpFile, new File(Configuration.config.getAbsolute_path()+"prod/"+filename));
+ int ret=sql.UpdateImagePath(con, filename);
+ log.info(new Date() + " - update "+ret);
log.info(new Date() + " - file moved");
} catch (IOException e) {
@@ -282,11 +279,11 @@ public class ServerHandler implements Server.Iface {
}
@Override
- public boolean updateImageData(String name, String newName,
+ public boolean updateImageData(String name, String newName, String image_path,
boolean license, boolean internet, long ram, long cpu, String id,
- String version) throws TException {
- sql.UpdateImageData(con, name, newName, license, internet, cpu, ram,
- id, version);
+ String version, boolean isTemplate, long filesize) throws TException {
+ sql.UpdateImageData(con, name, newName,image_path, license, internet, cpu, ram,
+ id, version, isTemplate, filesize);
return false;
}
@@ -330,13 +327,13 @@ public class ServerHandler implements Server.Iface {
boolean isActive, String imagename, String firstname,
String lastname, String university, String Mail, String Tel,
String Fak, String id) throws TException {
- int pk_image = 0;
+ String pk_image = "";
int imageversion = 0;
ResultSet image = sql.getImageIDandVersion(con, imagename);
try {
while (image.next()) {
- pk_image = image.getInt("GUID_imageID");
+ pk_image = image.getString("GUID_imageID");
imageversion = image.getInt("imageVersion");
}
} catch (SQLException e) {
@@ -355,9 +352,8 @@ public class ServerHandler implements Server.Iface {
e.printStackTrace();
}
- sql.updateLectureData(con, pk_image, imageversion, lastname, newName,
- desc, shortdesc, startDate, endDate, isActive, id);
- log.info(new Date() + " - Failed to execute updateLecturedata.");
+ //sql.updateLectureData(con, pk_image, imageversion, lastname, newName,
+ // desc, shortdesc, startDate, endDate, isActive, id);
return false;
}
@@ -368,7 +364,7 @@ public class ServerHandler implements Server.Iface {
String stringFile = sql.getFile(con, imageid, imageversion);
log.info(new Date() + " - File to Delete: " + stringFile);
- File tmpFile = new File(stringFile);
+ File tmpFile = new File(Configuration.config.getAbsolute_path()+stringFile);
try {
// File wird von Server gelöscht
@@ -404,7 +400,7 @@ public class ServerHandler implements Server.Iface {
String date = rs.getString("admin_createTime").replace(" ", "")
.replace("-", "").replace(":", "");
String name = rs.getString("name");
- String path = "/srv/openslx/nfs/temp/"
+ String path = Configuration.config.getAbsolute_path()+"temp/"
+ date.substring(0, date.length() - 2) + "_" + hs + "_"
+ user + "_" + name + ".xml";
File xmlFile = new File(path);
@@ -420,4 +416,5 @@ public class ServerHandler implements Server.Iface {
}
+
}
diff --git a/Dozentenmodulserver/src/server/startServer.java b/Dozentenmodulserver/src/server/startServer.java
index 542c92b8..949b3538 100644
--- a/Dozentenmodulserver/src/server/startServer.java
+++ b/Dozentenmodulserver/src/server/startServer.java
@@ -1,11 +1,17 @@
package server;
+import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import models.Configuration;
+
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.BinaryListener;
@@ -22,6 +28,21 @@ public class startServer {
public static void main(String[] args) {
+ //get Configuration
+ try {
+ Wini ini=new Wini(new File("Server_Config.ini"));
+ Configuration.config.setAbsolute_path(ini.get("ftp", "path_absolute"));
+ Configuration.config.setSql_connection(ini.get("sql", "connection"));
+ Configuration.config.setSql_pass(ini.get("sql", "pass"));
+ Configuration.config.setSql_user(ini.get("sql", "user"));
+ } catch (InvalidFileFormatException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ //Start Server
BasicConfigurator.configure();
log.info( new Date() + " - starting Application\n" );
Thread t;