Jump to content


P4Java Can I register for a submit event to a given Perforce server

submit event p4java

  • Please log in to reply
1 reply to this topic

#1 beastie

beastie

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 18 December 2014 - 02:46 PM

Hey eveyrone,

I want to check if someone submitted a file with specific name to a perforce sever? I couldn't find in the documentation weather there is an event for that, so I am asking here.

Currently my approach is to login to the server, list all branches, lilst all files with given name for each branch, get file's latest revision and get its contents. This approach seems like overhead to me so I was wondering weather there is an event-oriented approach.


Regards,
beastie

#2 beastie

beastie

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 09 January 2015 - 10:02 AM

Ok I found something that is close to what I want, but still. The IOptionsServer have getChangelists method where I can receive range of lastly submitted CLs, from there I can obtain the files sumbitted in the CL. I'm just requesting the last 10 CLs every 10 minutes but there might be a gap between two getChangelists(..) calls.

Can you suggest workaround for that?

List<IChangelistSummary> changeSummaries = server
                    .getChangelists(
                            null,
                            new GetChangelistsOptions().setType(
                                    IChangelist.Type.SUBMITTED)
                                    .setMaxMostRecent(range));





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users