org.bdware.doip.dbrepo.DBTableDO Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-audit-tool Show documentation
Show all versions of doip-audit-tool Show documentation
doip audit tool developed by bdware
package org.bdware.doip.dbrepo;
import org.bdware.doip.codec.digitalObject.DigitalObject;
import org.bdware.doip.codec.digitalObject.DoType;
import org.bdware.doip.codec.doipMessage.DoipMessage;
import org.bdware.doip.codec.doipMessage.DoipMessageFactory;
import org.bdware.doip.codec.operations.BasicOperations;
public class DBTableDO extends DigitalObject {
static DoipMessageFactory factory = new DoipMessageFactory();
public DBTableDO(String id, DoType type) {
super(id, type);
}
public static DBTableDO createDO(String url, String tableName, String userName, String password) {
DBTableDO digitalObject = new DBTableDO(null, DoType.DO);
digitalObject.addAttribute("url", url);
digitalObject.addAttribute("tableName", tableName);
digitalObject.addAttribute("userName", userName);
digitalObject.addAttribute("password", password);
return digitalObject;
}
public static DoipMessage retrieveMsg(String doid, int offset, int count) {
DoipMessageFactory.DoipMessageBuilder builder = new DoipMessageFactory.DoipMessageBuilder();
builder.createRequest(doid, BasicOperations.Retrieve.getName());
builder.addAttributes("offset", offset);
builder.addAttributes("count", count);
return builder.create();
}
public static DoipMessage helloMsg(String doid) {
DoipMessageFactory.DoipMessageBuilder builder = new DoipMessageFactory.DoipMessageBuilder();
builder.createRequest(doid, BasicOperations.Hello.getName());
return builder.create();
}
//update is not supported
//delete is not supported
}