public synchronized OServerAdmin setGlobalConfiguration( final OGlobalConfiguration config, final Object iValue) throws IOException { networkAdminOperation( new OStorageRemoteOperation<Void>() { @Override public Void execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session) throws IOException { storage.beginRequest(network, OChannelBinaryProtocol.REQUEST_CONFIG_SET, session); network.writeString(config.getKey()); network.writeString(iValue != null ? iValue.toString() : ""); storage.endRequest(network); storage.getResponse(network, session); return null; } }, "Cannot set the configuration value: " + config.getKey()); return this; }
public synchronized String getGlobalConfiguration(final OGlobalConfiguration config) throws IOException { return networkAdminOperation( new OStorageRemoteOperation<String>() { @Override public String execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session) throws IOException { storage.beginRequest(network, OChannelBinaryProtocol.REQUEST_CONFIG_GET, session); network.writeString(config.getKey()); storage.endRequest(network); try { storage.beginResponse(network, session); return network.readString(); } finally { storage.endResponse(network); } } }, "Cannot retrieve the configuration value: " + config.getKey()); }