org.dftproject.pgvagent.core.soap
Class GenService

java.lang.Object
  extended by org.dftproject.pgvagent.core.soap.GenService

public class GenService
extends java.lang.Object

GenService handles communication with a PGV website using the PGV SOAP API.


Field Summary
 java.lang.String USER_AGENT
          The PGV user agent string.
 
Constructor Summary
GenService(java.net.URL url)
          Creates a GenService object for communication with the given PGV website.
 
Method Summary
 AuthResult authenticate(java.lang.String user, java.lang.String password, java.lang.String gedcom)
          Authenticates against the PGV website.
protected  org.apache.axis.client.Call createCall()
          Creates a call for use in communicating with the PGV website.
 java.lang.String getGedcomRecord(java.lang.String sid, java.lang.String pid)
          Returns the record for the given GEDCOM ID.
 Person getPersonByID(java.lang.String sid, java.lang.String pid)
          Returns the record for the given person ID.
 ServiceInfoResult getServiceInfo()
          Gets and returns the service info object.
protected  java.net.URL getServiceURL(java.net.URL url)
          Returns the web services URL for the given PGV website URL
 java.net.URL getURL()
          Returns the URL of the PGV website with which this GenService object communicates.
 SearchResult search(java.lang.String sid, java.lang.String query, int offset, int limit)
          Searches using the given search terms query, starting at the given offset and limited to the given number of results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_AGENT

public final java.lang.String USER_AGENT
The PGV user agent string.

See Also:
Constant Field Values
Constructor Detail

GenService

public GenService(java.net.URL url)
Creates a GenService object for communication with the given PGV website.

Parameters:
url - the URL of a PGV website
Method Detail

getURL

public java.net.URL getURL()
Returns the URL of the PGV website with which this GenService object communicates.

Returns:
the URL of the PGV website

getServiceURL

protected java.net.URL getServiceURL(java.net.URL url)
Returns the web services URL for the given PGV website URL

Parameters:
url - a PGV website URL
Returns:
the web services URL

getServiceInfo

public ServiceInfoResult getServiceInfo()
Gets and returns the service info object. Subsequent calls return a cached copy.

Returns:
the service info

authenticate

public AuthResult authenticate(java.lang.String user,
                               java.lang.String password,
                               java.lang.String gedcom)
Authenticates against the PGV website. Fails and returns null if getServiceInfo() hasn't been called yet.

Parameters:
user - a user name
password - a password
gedcom - the name of a GEDCOM file
Returns:
the result of authenticating

search

public SearchResult search(java.lang.String sid,
                           java.lang.String query,
                           int offset,
                           int limit)
Searches using the given search terms query, starting at the given offset and limited to the given number of results.

Parameters:
sid - the session ID
query - the query
offset - the offset
limit - the limit
Returns:
the search results

getPersonByID

public Person getPersonByID(java.lang.String sid,
                            java.lang.String pid)
Returns the record for the given person ID.

Parameters:
sid - the session ID
pid - the person ID
Returns:
the person record

getGedcomRecord

public java.lang.String getGedcomRecord(java.lang.String sid,
                                        java.lang.String pid)
Returns the record for the given GEDCOM ID.

Parameters:
sid - the session ID
pid - the record ID
Returns:
the GEDCOM record

createCall

protected org.apache.axis.client.Call createCall()
                                          throws javax.xml.rpc.ServiceException
Creates a call for use in communicating with the PGV website.

Returns:
a call
Throws:
javax.xml.rpc.ServiceException