Franz Inc, AllegroGraph

com.franz.agraph.repository
Class AGServer

java.lang.Object
  extended by com.franz.agraph.repository.AGServer
All Implemented Interfaces:
Closeable

public class AGServer
extends Object
implements Closeable

The starting point for interacting with an AllegroGraph server. An AGServer references AGCatalogs, which reference AGRepositories, from which connections may be obtained, on which data is manipulated and queried. AGServer also provides federated repositories.


Constructor Summary
AGServer(String username, String password, com.franz.agraph.http.AGHTTPClient httpClient)
           
AGServer(String serverURL, String username, String password)
          Creates an AGServer instance for interacting with an AllegroGraph server at serverURL.
 
Method Summary
 void close()
          Close the HTTP connection resources to the AllegroGraph server.
 AGCatalog createCatalog(String catalogID)
          Returns an AGCatalog instance for the given catalogID.
 void deleteCatalog(String catalogID)
          Deletes any catalog with the given repository id.
 AGVirtualRepository federate(AGAbstractRepository... repositories)
          Creates a federated view of multiple repositories.
 String getBuildDate()
          Returns the server's build date.
 AGCatalog getCatalog()
          Returns the unnamed root catalog for this AllegroGraph server.
 AGCatalog getCatalog(String catalogID)
          Gets the catalog instance for a given catalog id.
 com.franz.agraph.http.AGHTTPClient getHTTPClient()
           
 String getRevision()
          Returns the server's revision info.
 AGCatalog getRootCatalog()
          Returns the unnamed root catalog for this AllegroGraph server.
 String getServerURL()
          Returns the URL of this AllegroGraph server.
 String getVersion()
          Returns the server version.
 List<String> listCatalogs()
          Returns a List of catalog ids known to this AllegroGraph server.
 AGVirtualRepository virtualRepository(String storeSpec)
          Creates a virtual repository with the given store specification.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGServer

public AGServer(String serverURL,
                String username,
                String password)
Creates an AGServer instance for interacting with an AllegroGraph server at serverURL.

Parameters:
serverURL - the URL of the server.
username - a user id for authenticating with the server
password - a password for authenticating with the server

AGServer

public AGServer(String username,
                String password,
                com.franz.agraph.http.AGHTTPClient httpClient)
Method Detail

getServerURL

public String getServerURL()
Returns the URL of this AllegroGraph server.

Returns:
the URL of this AllegroGraph server.

getHTTPClient

public com.franz.agraph.http.AGHTTPClient getHTTPClient()

getVersion

public String getVersion()
                  throws com.franz.agraph.http.exception.AGHttpException
Returns the server version.

Throws:
com.franz.agraph.http.exception.AGHttpException

getBuildDate

public String getBuildDate()
                    throws com.franz.agraph.http.exception.AGHttpException
Returns the server's build date.

Throws:
com.franz.agraph.http.exception.AGHttpException

getRevision

public String getRevision()
                   throws com.franz.agraph.http.exception.AGHttpException
Returns the server's revision info.

Throws:
com.franz.agraph.http.exception.AGHttpException

getRootCatalog

public AGCatalog getRootCatalog()
Returns the unnamed root catalog for this AllegroGraph server. Note: this method may be deprecated in an upcoming release.

Returns:
the root catalog.
See Also:
getCatalog()

listCatalogs

public List<String> listCatalogs()
                          throws com.franz.agraph.http.exception.AGHttpException
Returns a List of catalog ids known to this AllegroGraph server.

Returns:
List of catalog ids.
Throws:
OpenRDFException
com.franz.agraph.http.exception.AGHttpException

getCatalog

public AGCatalog getCatalog(String catalogID)
                     throws com.franz.agraph.http.exception.AGHttpException
Gets the catalog instance for a given catalog id. Returns the root catalog if the id is a root id. If the catalog Id is not found on the server, returns null.

Parameters:
catalogID - a catalog id.
Returns:
the corresponding catalog instance.
Throws:
com.franz.agraph.http.exception.AGHttpException

getCatalog

public AGCatalog getCatalog()
Returns the unnamed root catalog for this AllegroGraph server.

Returns:
the root catalog.

createCatalog

public AGCatalog createCatalog(String catalogID)
                        throws com.franz.agraph.http.exception.AGHttpException
Returns an AGCatalog instance for the given catalogID. If the catalog already exists on the server, an AGCatalog instance is simply returned. If the catalog does not exist, it is created if the server has been configured to allow dynamic catalogs; otherwise, an exception is thrown.

Parameters:
catalogID - the id (the name) of the catalog
Returns:
an AGCatalog instance.
Throws:
com.franz.agraph.http.exception.AGHttpException

deleteCatalog

public void deleteCatalog(String catalogID)
                   throws com.franz.agraph.http.exception.AGHttpException
Deletes any catalog with the given repository id. This method only applies to dynamically created catalogs.

Parameters:
catalogID - the name of the catalog to delete.
Throws:
com.franz.agraph.http.exception.AGHttpException

virtualRepository

public AGVirtualRepository virtualRepository(String storeSpec)
Creates a virtual repository with the given store specification.

The storeSpec parameter is a string using the minilanguage for store specification described in the HTTP protocol document (see the store parameter there).

This syntax can be used to create federations, graph-filtered stores, reasoning stores, and compositions thereof.

Parameters:
storeSpec - the store specification

federate

public AGVirtualRepository federate(AGAbstractRepository... repositories)
Creates a federated view of multiple repositories. See Managing Massive Data - Federation.

Returns:
a virtual repository that federates queries across multiple physical repositories

close

public void close()
Close the HTTP connection resources to the AllegroGraph server.

Specified by:
close in interface Closeable
See Also:
Closeable.close()

Copyright © 2008-2011 Franz Inc.