beautypg.com

Onebox modules settings – Google Search Appliance Administrative API Developers Guide: Java User Manual

Page 18

background image

Google Search Appliance: Administrative API Developer’s Guide: Java

18

Retrieving a List of Connector Managers

Retrieve a list of connector managers as follows:

// Send the request and print the response
GsaFeed myFeed = myClient.getFeed("connectorManager");

for(GsaEntry myEntry : myFeed.getEntries()) {

System.out.println("Status: " + myEntry.getGsaContent("status"));
System.out.println("Description: " + myEntry.getGsaContent("description"));
System.out.println("URL: " + myEntry.getGsaContent("url"));

}

Retrieve an individual connector manager as follows:

// Send the request and print the response
GsaEntry myEntry = myClient.getEntry("connectorManager", "ConnectorManagerOne");
System.out.println("Status: " + myEntry.getGsaContent("status"));
System.out.println("Description: " + myEntry.getGsaContent("description"));
System.out.println("URL: " + myEntry.getGsaContent("url"));

Updating a Connector Manager

Update the description and URL for a connector manager as follows:

// Create an entry to hold the properties to update
GsaEntry updateEntry = new GsaEntry();

// Add properties to updateEntry
updateEntry.addGsaContent("description", "new description");
updateEntry.addGsaContent("url", "#new URL");

// Send the request
myClient.updateEntry("connectorManager", "ConnectorManagerOne", updateEntry);

Deleting a Connector Manager

Delete a connector manager as follows:

myClient.deleteEntry("connectorManager", "ConnectorManagerOne");

OneBox Modules Settings

Retrieve and update OneBox module settings for the search appliance using the config feed.

Retrieving OneBox Module Settings

Retrieve OneBox information for a search appliance as follows:

// Send the request and print the response
GsaEntry myEntry = myClient.getEntry("config", "oneboxSetting");
System.out.println("Max Results: " + myEntry.getGsaContent("maxResults"));
System.out.println("Timeout: " + myEntry.getGsaContent("timeout"));