use of com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException in project binnavi by google.
the class TraceList method setName.
public void setName(final String name) throws CouldntSaveDataException {
Preconditions.checkNotNull(name, "IE00784: Name can not be null");
if (traceName.equals(name)) {
return;
}
sqlProvider.setName(this, name);
traceName = name;
for (final ITraceListListener listener : listeners) {
try {
listener.changedName(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
}
use of com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException in project binnavi by google.
the class TraceList method setDescription.
public void setDescription(final String description) throws CouldntSaveDataException {
Preconditions.checkNotNull(description, "IE00783: Comment can not be null");
if (traceDescription.equals(description)) {
return;
}
sqlProvider.setDescription(this, description);
traceDescription = description;
for (final ITraceListListener listener : listeners) {
try {
listener.changedDescription(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
}
use of com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException in project binnavi by google.
the class DebuggerTemplate method setPort.
/**
* Updates the port of the debug client.
*
* @param port The new debug client port.
*
* @throws CouldntSaveDataException Thrown if the port could not be updated.
*/
public void setPort(final int port) throws CouldntSaveDataException {
Preconditions.checkArgument(NetHelpers.isValidPort(port), "IE00804: Invalid port");
if (debugClientPort == port) {
return;
}
sqlProvider.setPort(this, port);
debugClientPort = port;
for (final IDebuggerTemplateListener listener : listeners) {
try {
listener.changedPort(this);
} catch (final Exception e) {
CUtilityFunctions.logException(e);
}
}
}
use of com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException in project binnavi by google.
the class DebuggerTemplate method setHost.
/**
* Sets the host of the debug client.
*
* @param host The host of the debug client.
*
* @throws CouldntSaveDataException Thrown if the debug host could not be updated.
*/
public void setHost(final String host) throws CouldntSaveDataException {
Preconditions.checkNotNull(host, "IE00802: Host argument can not be null");
if (debugClientHost.equals(host)) {
return;
}
sqlProvider.setHost(this, host);
debugClientHost = host;
for (final IDebuggerTemplateListener listener : listeners) {
try {
listener.changedHost(this);
} catch (final Exception e) {
CUtilityFunctions.logException(e);
}
}
}
use of com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException in project binnavi by google.
the class AbstractModuleCreator method initializeModule.
@Override
public void initializeModule(final SQLProvider sqlProvider, final INaviModule module, final CModuleInitializeReporter reporter) throws CouldntSaveDataException {
final int moduleId = module.getConfiguration().getId();
final INaviRawModule rawModule = module.getConfiguration().getRawModule();
if (!rawModule.isComplete()) {
throw new CouldntSaveDataException("E00008: Raw module is incomplete");
}
try {
reporter.report(ModuleInitializeEvents.Starting);
final String query = " { call import(?,?,?) } ";
final CallableStatement call = getProvider().getConnection().getConnection().prepareCall(query);
call.setInt(1, rawModule.getId());
call.setInt(2, moduleId);
call.setInt(3, CUserManager.get(getProvider()).getCurrentActiveUser().getUserId());
call.execute();
module.setInitialized();
} catch (final SQLException exception) {
throw new CouldntSaveDataException(exception);
} finally {
reporter.report(ModuleInitializeEvents.Finished);
}
}
Aggregations