[jboss-svn-commits] JBL Code SVN: r16949 - in labs/jbosslabs/trunk/portal-extensions: forge-ejb3 and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Nov 30 15:10:21 EST 2007
Author: wrzep
Date: 2007-11-30 15:10:21 -0500 (Fri, 30 Nov 2007)
New Revision: 16949
Added:
labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ejb3/LabsWebService.java
labs/jbosslabs/trunk/portal-extensions/forge-ejb3/src/java/org/jboss/forge/ejb3/ws/
labs/jbosslabs/trunk/portal-extensions/forge-ejb3/src/java/org/jboss/forge/ejb3/ws/LabsWebServiceBean.java
Modified:
labs/jbosslabs/trunk/portal-extensions/forge-ejb3/project.xml
Log:
simple webservice to be used by metrics (don't treat it as a final webservices solution for labs ;) )
Added: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ejb3/LabsWebService.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ejb3/LabsWebService.java (rev 0)
+++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/ejb3/LabsWebService.java 2007-11-30 20:10:21 UTC (rev 16949)
@@ -0,0 +1,35 @@
+ /*
+ * JBoss, a division of Red Hat
+ * Copyright 2007, Red Hat Middleware LLC and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.forge.common.ejb3;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+public interface LabsWebService {
+
+ public String getProjectName(String projectId);
+ public String getProjectJIRA(String projectId);
+ public String getProjectSVN(String projetId);
+
+ public String[] getProjectIds();
+}
Modified: labs/jbosslabs/trunk/portal-extensions/forge-ejb3/project.xml
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-ejb3/project.xml 2007-11-30 19:54:35 UTC (rev 16948)
+++ labs/jbosslabs/trunk/portal-extensions/forge-ejb3/project.xml 2007-11-30 20:10:21 UTC (rev 16949)
@@ -32,6 +32,11 @@
<artifactId>jboss-ejb3x</artifactId>
<jar>jboss-ejb3x.jar</jar>
</dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <jar>jboss-jaxws.jar</jar>
+ </dependency>
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-j2ee</artifactId>
Added: labs/jbosslabs/trunk/portal-extensions/forge-ejb3/src/java/org/jboss/forge/ejb3/ws/LabsWebServiceBean.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-ejb3/src/java/org/jboss/forge/ejb3/ws/LabsWebServiceBean.java (rev 0)
+++ labs/jbosslabs/trunk/portal-extensions/forge-ejb3/src/java/org/jboss/forge/ejb3/ws/LabsWebServiceBean.java 2007-11-30 20:10:21 UTC (rev 16949)
@@ -0,0 +1,100 @@
+ /*
+ * JBoss, a division of Red Hat
+ * Copyright 2007, Red Hat Middleware LLC and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.jboss.forge.ejb3.ws;
+
+import java.util.Collection;
+import org.jboss.forge.common.ejb3.LabsServices;
+import org.jboss.forge.common.ejb3.LabsWebService;
+import org.jboss.forge.common.projects.project.IssueTracker;
+import org.jboss.forge.common.projects.project.Project;
+import org.jboss.forge.common.projects.project.RepoType;
+import org.jboss.forge.common.projects.project.rw.IssueTrackerTypeRW;
+import org.jboss.forge.common.projects.project.rw.RepoTypeRW;
+import org.jboss.forge.common.exceptions.ServiceRetrievalException;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+
+ at Stateless
+ at Remote(LabsWebService.class)
+ at WebService
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public class LabsWebServiceBean implements LabsWebService {
+
+ @WebMethod
+ public String getProjectName(String projectId) {
+ Project p = null;
+ try {
+ p = LabsServices.getProjectsService().getProjectById(projectId);
+ } catch (ServiceRetrievalException e) {
+ e.printStackTrace(); //TODO
+ return null;
+ }
+ return (p == null ? null : p.getName());
+ }
+
+ @WebMethod
+ public String[] getProjectIds() {
+ try {
+ Collection<String> c = LabsServices.getProjectsService().getProjectsIds();
+ return c.toArray(new String[0]);
+ } catch (ServiceRetrievalException e) {
+ e.printStackTrace(); //TODO
+ }
+ return null;
+ }
+
+ @WebMethod
+ public String getProjectJIRA(String projectId) {
+ try {
+ IssueTracker it = LabsServices.getProjectsService().getProjectIssueTracker(projectId);
+ if ((it != null) && (IssueTrackerTypeRW.JIRA.equals(it.getType()))) {
+ return it.getValue();
+ }
+ } catch (ServiceRetrievalException e) {
+ e.printStackTrace(); //TODO
+ }
+ return null;
+ }
+
+ @WebMethod
+ public String getProjectSVN(String projectId) {
+ try {
+ RepoType rt = LabsServices.getProjectsService().getProjectRepoType(projectId);
+ if ((rt != null) && (RepoTypeRW.SVN.equals(rt))) {
+ return LabsServices.getProjectsService().getProjectAnonRepo(projectId);
+ }
+ } catch (ServiceRetrievalException e) {
+ e.printStackTrace(); //TODO
+ }
+ return null;
+ }
+}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list