title: Subscribe to CheckinEvent with TFS server using TFS Java SDK
body: <ul>
  <li>I am looking for information on how to subscribe for CheckinEvents in
  TFS server using <a href="http://www.microsoft.com/en-in/download/details.aspx?id=22616" rel="nofollow">TFS Java SDK</a>.</li>
  </ul>
  
  <p>I came across <a href="http://techstarvation.wordpress.com/tag/tfs-sdk/" rel="nofollow">this link</a> that shows how to do this using TFS .Net SDK.</p>
  
  <pre><code>TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(txtTfsURL.Text), new UICredentialsProvider());
  tpc.EnsureAuthenticated();
  IEventService eventService = tpc.GetService(typeof(IEventService)) as IEventService;
  DeliveryPreference delPref = new DeliveryPreference();
  delPref.Address = “http://” + System.Environment.MachineName + “:8001/CheckInNotify”;
  delPref.Schedule = DeliverySchedule.Immediate;
  delPref.Type = DeliveryType.Soap;
  subscriptionId = eventService.SubscribeEvent(System.Environment.UserDomainName + “\\” + System.Environment.UserName, “CheckInEvent”, “”, delPref);
  lblSubscription.Content = string.Format("A checkin subscription is created with subscription id : {0}",subscriptionId.ToString());
  </code></pre>
  
  <p>What are corresponding Java APIs? Are they the same as below?</p>
  
  <pre><code>TFSTeamProjectCollection.getVersionControlClient().getEventEngine().addCheckinListener(CheckinListener listener);
  </code></pre>
  
  <p>Also I suspect this listener is notified only when we checkin using the same client.  Is that correct?</p>
  
  <ul>
  <li>Also how do we identify TFS collection &amp; project from Notification SOAP response?</li>
  </ul>
  
  <p>There is a GUID which is guid of collection but it is part of someother data so not sure if its available all the time and projectname. Any ideas?</p>
  
  <ul>
  <li>How do you make sure you do not subscribe to same collection twice? Can we subscribe to just a project?</li>
  </ul>