use of org.bimserver.database.actions.ServerSettingsSetter in project BIMserver by opensourceBIM.
the class SettingsServiceImpl method setCheckinMergingEnabled.
@Override
public void setCheckinMergingEnabled(final Boolean checkinMergingEnabled) throws ServerException, UserException {
requireAdminAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetServerSettingDatabaseAction action = new SetServerSettingDatabaseAction(getBimServer(), session, getInternalAccessMethod(), new ServerSettingsSetter() {
@Override
public void set(ServerSettings serverSettings) {
serverSettings.setCheckinMergingEnabled(checkinMergingEnabled);
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.actions.ServerSettingsSetter in project BIMserver by opensourceBIM.
the class SettingsServiceImpl method setPluginStrictVersionChecking.
@Override
public void setPluginStrictVersionChecking(Boolean strict) throws UserException, ServerException {
requireAdminAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetServerSettingDatabaseAction action = new SetServerSettingDatabaseAction(getBimServer(), session, getInternalAccessMethod(), new ServerSettingsSetter() {
@Override
public void set(ServerSettings serverSettings) {
serverSettings.setPluginStrictVersionChecking(strict);
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.actions.ServerSettingsSetter in project BIMserver by opensourceBIM.
the class SettingsServiceImpl method setSiteAddress.
@Override
public void setSiteAddress(final String siteAddress) throws ServerException, UserException {
if (getBimServer().getServerInfo().getServerState() != ServerState.NOT_SETUP) {
requireAdminAuthentication();
}
if (siteAddress.trim().isEmpty()) {
throw new UserException("Site Address cannot be empty");
} else if (!siteAddress.startsWith("http://") && !(siteAddress.startsWith("https://"))) {
throw new UserException("Site Address must start with either \"http://\" or \"https://\"");
}
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetServerSettingDatabaseAction action = new SetServerSettingDatabaseAction(getBimServer(), session, getInternalAccessMethod(), new ServerSettingsSetter() {
@Override
public void set(ServerSettings serverSettings) {
serverSettings.setSiteAddress(siteAddress);
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.actions.ServerSettingsSetter in project BIMserver by opensourceBIM.
the class SettingsServiceImpl method setServiceRepositoryUrl.
@Override
public void setServiceRepositoryUrl(final String url) throws ServerException, UserException {
requireAdminAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetServerSettingDatabaseAction action = new SetServerSettingDatabaseAction(getBimServer(), session, getInternalAccessMethod(), new ServerSettingsSetter() {
@Override
public void set(ServerSettings serverSettings) {
serverSettings.setServiceRepositoryUrl(url);
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.actions.ServerSettingsSetter in project BIMserver by opensourceBIM.
the class SettingsServiceImpl method setHideUserListForNonAdmin.
@Override
public void setHideUserListForNonAdmin(final Boolean hideUserListForNonAdmin) throws ServerException, UserException {
requireAdminAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
SetServerSettingDatabaseAction action = new SetServerSettingDatabaseAction(getBimServer(), session, getInternalAccessMethod(), new ServerSettingsSetter() {
@Override
public void set(ServerSettings serverSettings) {
serverSettings.setHideUserListForNonAdmin(hideUserListForNonAdmin);
}
});
session.executeAndCommitAction(action);
} catch (BimserverDatabaseException e) {
handleException(e);
} finally {
session.close();
}
}
Aggregations