Jump to content


P4Java over HTTP

http p4java connectivity dmz firewall

  • Please log in to reply
3 replies to this topic

#1 vinz

vinz

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 25 February 2015 - 03:23 PM

Hi all,
I'm currently using P4Java API and as far as I understand they're based on TCP/IP network protocol.
Because of networking restrictions, I should now switch to HTTP-based communication.
My online research did not provide much results.
Is anyone aware of how this can be achieved?

Thanks, regards
Vincenzo

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 06 March 2015 - 12:58 AM

Hi Vincenzo,

I am not quite sure what you are asking in regard to the network protocol. The basic P4Java Usage Model here:

    http://www.perforce....va.html#1064272

shows that a Java application uses the P4Java ServerFactory class to obtain a IServer interface onto a specific Perforce server at a known network address and port, and connects to this Perforce server through the IServer interface that is returned from the factory.

An HTTP session is, in fact, a sequence of request/response transactions that occur on the network. The client puts forth the request and establishes a TCP connection to a particular port on a specific host. The HTTP server ‘listens in’ on that particular port and awaits a request message from the client. Once this request is received, the server sends the line back to the client with its own message –which is comprised of the requested resource, an error message, or any other piece of information.

So you are always connecting to the Perforce server with an address/host name and a port regardless. Are you looking for a different type of setup such as SSL? Have you tried to connect to Perforce with modified network settings without success?



- Common Usage Patterns for P4Java
http://answers.perfo...rticles/KB/2605

- Unable to determine client host name exception
http://answers.perfo...rticles/KB/2613

#3 P4JoelK

P4JoelK

    Member

  • Staff Moderators
  • 15 posts

Posted 06 March 2015 - 09:13 PM

Hi Vincenzo,

Like all of our APIs, P4Java uses our RPC protocol over TCP/IP to talk to P4D.  A java-based web application could use P4Java to talk to P4D.  And one could build web services around that.  But P4Java cannot talk to P4D using HTTP directly.

But surely you have plenty of clients or APIs connecting directly to P4D in your company.  If you are building out some application to expose information in Perforce, you might explain what you are trying to do a bit more.  Somebody might have some suggestions.

#4 vinz

vinz

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 09 March 2015 - 02:04 PM

View PostP4JoelK, on 06 March 2015 - 09:13 PM, said:

Hi Vincenzo,

Like all of our APIs, P4Java uses our RPC protocol over TCP/IP to talk to P4D.  A java-based web application could use P4Java to talk to P4D.  And one could build web services around that.  But P4Java cannot talk to P4D using HTTP directly.

But surely you have plenty of clients or APIs connecting directly to P4D in your company.  If you are building out some application to expose information in Perforce, you might explain what you are trying to do a bit more.  Somebody might have some suggestions.

Hi, thanks a lot for your kind help.
I've developed a web application which interacts with Perforce server through P4Java api. It is working very well when deployed in the corporate intranet.
Actually now I need to deploy the web application in a cloud environment.
Such cloud web application server is allowed to connect to on premise systems, but only through HTTP protocol.
Thus: unless HTTP protocol can be enabled for P4Java APIs I'd be unable to get the web app on cloud to connect to on premise systems.
I know that I could create a custom bridge component to be deployed in the intranet acting as an adapter between HTTP and Perforce protocol.
However, it does not look as a very stable solution to me, I'd be in favor of some solid technical architecture here.
Any idea?
Thanks a lot, regards
Vincenzo





Also tagged with one or more of these keywords: http, p4java, connectivity, dmz, firewall

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users