AGServerInfo.java
package com.franz.ag.examples;
import com.franz.ag.*;
public class AGServerInfo {
@param
@throws
public static void main(String[] args) throws AllegroGraphException {
showDefaultConnectionInfo();
AllegroGraphConnection ags = new AllegroGraphConnection();
try {
ags.enable();
} catch (Exception e) {
throw new AllegroGraphException("Server connection problem", e);
}
showConnectionInstanceInfo(ags);
ags.disable();
}
public static void showDefaultConnectionInfo() {
System.out.println("Server default settings:");
System.out.println(" Command: " + AllegroGraphConnection.getDefaultCommand());
System.out.println(" Debug: " + AllegroGraphConnection.getDefaultDebug());
System.out.println(" Host: " + AllegroGraphConnection.getDefaultHost());
System.out.println(" Mode: " + AllegroGraphConnection.getDefaultMode());
System.out.println(" PollCount: " + AllegroGraphConnection.getDefaultPollCount());
System.out.println(" PollInterval: " + AllegroGraphConnection.getDefaultPollInterval());
System.out.println(" Port: " + AllegroGraphConnection.getDefaultPort());
System.out.println(" Port2: " + AllegroGraphConnection.getDefaultPort2());
System.out.println(" ServerKeep: " + AllegroGraphConnection.getDefaultServerKeep());
}
public static void showConnectionInstanceInfo(AllegroGraphConnection ags) throws AllegroGraphException {
System.out.println("Server current settings:");
System.out.println(" ChunkSize: " + ags.getChunkSize());
System.out.println(" Command: " + ags.getCommand());
System.out.println(" Debug: " + ags.getDebug());
System.out.println(" ExpectedResources: " + ags.getDefaultExpectedResources());
System.out.println(" Host: " + ags.getHost());
System.out.println(" Mode: " + ags.getMode());
System.out.println(" PollCount: " + ags.getPollCount());
System.out.println(" PollInterval: " + ags.getPollInterval());
System.out.println(" Port: " + ags.getPort());
System.out.println(" Port2: " + ags.getPort2());
System.out.println(" ServerKeep: " + ags.getServerKeep());
System.out.println(" isBusy: " + ags.isBusy());
System.out.println(" isEnabled: " + ags.isEnabled());
System.out.println(" serverLevel: " + ags.serverLevel(0));
}
}
Up |
Next