AGSetServerParams.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGSetServerParams {
@param
@throws
public static void main(String[] args) throws AllegroGraphException {
int db = AllegroGraphConnection.getDefaultDebug();
int pollcount = AllegroGraphConnection.getDefaultPollCount();
int pollinterval = AllegroGraphConnection.getDefaultPollInterval();
int port = AllegroGraphConnection.getDefaultPort();
AllegroGraphConnection.setDefaultDebug(0);
AllegroGraphConnection.setDefaultPolling(3, 600);
AllegroGraphConnection.setDefaultPort(4126);
AllegroGraphConnection ags = new AllegroGraphConnection();
try {
ags.enable();
} catch (Exception e) {
throw new AllegroGraphException("Server connection problem -- please start a server on port 4126.", e);
}
AGServerInfo.showConnectionInstanceInfo(ags);
ags.setChunkSize(1000000);
ags.setDebug(1);
ags.setDefaultExpectedResources(2000000);
ags.setHost("foo.example.com");
ags.setPolling(2, 500);
ags.setPort(5678);
ags.setServerKeep(true);
ags.setDefaultServerKeep(false);
AGServerInfo.showConnectionInstanceInfo(ags);
ags.disable();
AllegroGraphConnection.setDefaultDebug(db);
AllegroGraphConnection.setDefaultPolling(pollcount, pollinterval);
AllegroGraphConnection.setDefaultPort(port);
}
}
Up |
Next