com.trifork.p4.api
Class P4Controller

java.lang.Object
  extended bycom.trifork.p4.api.P4Controller

public abstract class P4Controller
extends java.lang.Object

This class is the starting point of the P4 API.

Use the connect() method to establish a connection to the P4 agent (represented by a P4RemoteAgent instance).

Use the readXML() method to convert P4 Timestamps stored in XML format to live P4Timestamp instances.

Author:
Trifork P4 team (support@trifork.com)

Constructor Summary
P4Controller()
           
 
Method Summary
static P4RemoteAgent connect(java.lang.String host, int port)
          Connect to the P4 agent and return a P4RemoteAgent representing that connection.
static P4Timestamp readXML(java.io.InputStream in)
          Import a timestamp from an XML structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P4Controller

public P4Controller()
Method Detail

connect

public static P4RemoteAgent connect(java.lang.String host,
                                    int port)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Connect to the P4 agent and return a P4RemoteAgent representing that connection.

Parameters:
host - The host on which the P4 agent is running
port - The port on which the P4 agent is listening
Returns:
The resulting P4RemoteAgent instance
Throws:
java.net.UnknownHostException
java.io.IOException

readXML

public static P4Timestamp readXML(java.io.InputStream in)
                           throws javax.xml.parsers.FactoryConfigurationError,
                                  javax.xml.parsers.ParserConfigurationException,
                                  java.io.IOException,
                                  org.xml.sax.SAXException
Import a timestamp from an XML structure.

This method reads the file format created by P4Timestamp.writeXML.

Parameters:
in - An InputStream from which to read the XML structure.
Returns:
The resulting P4Timestamp instance
Throws:
javax.xml.parsers.FactoryConfigurationError
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException