continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r726472 - in /continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent: buildcontext/ buildcontext/manager/ utils/
Date Sun, 14 Dec 2008 15:32:44 GMT
Author: ctan
Date: Sun Dec 14 07:32:44 2008
New Revision: 726472

URL: http://svn.apache.org/viewvc?rev=726472&view=rev
Log:
- added build context manager and utility

Submitted By: Jan Stevens Ancajas

Added:
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
  (with props)
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
  (with props)
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
  (with props)

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java?rev=726472&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
Sun Dec 14 07:32:44 2008
@@ -0,0 +1,19 @@
+package org.apache.continuum.buildagent.buildcontext.manager;
+
+import java.util.List;
+
+import org.apache.continuum.buildagent.model.BuildContext;
+
+/**
+ * @author Jan Stevens Ancajas
+ */
+public interface BuildContextManager
+{
+    String ROLE = BuildContextManager.class.getName();
+    
+    public void setBuildContextList(List<BuildContext> buildContext);
+    
+    public List<BuildContext> getBuildContextList();
+    
+    public BuildContext getBuildContext(int projectId);
+}

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/BuildContextManager.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java?rev=726472&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
Sun Dec 14 07:32:44 2008
@@ -0,0 +1,45 @@
+package org.apache.continuum.buildagent.buildcontext.manager;
+
+import java.util.List;
+
+import org.apache.continuum.buildagent.model.BuildContext;
+
+/**
+ * @author Jan Steven Ancajas
+ * @plexus.component role="org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager"
+ */
+public class DefaultBuildContextManager
+    implements BuildContextManager
+{
+    public List<BuildContext> buildContexts;
+
+    public BuildContext getBuildContext( int projectId )
+    {
+        BuildContext context = null;
+
+        if (buildContexts!= null)
+        {
+            for ( BuildContext item : buildContexts )
+            {
+                if (item.getProjectId() == projectId)
+                {
+                    context = item;
+                    break;
+                }
+            }
+        }
+
+        return context;
+    }
+
+    public List<BuildContext> getBuildContextList()
+    {
+        return buildContexts;
+    }
+
+    public void setBuildContextList( List<BuildContext> buildContexts )
+    {
+        this.buildContexts = buildContexts;
+    }
+
+}

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/manager/DefaultBuildContextManager.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java?rev=726472&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
Sun Dec 14 07:32:44 2008
@@ -0,0 +1,30 @@
+package org.apache.continuum.buildagent.utils;
+
+import org.apache.continuum.buildagent.model.BuildContext;
+import org.apache.maven.continuum.model.project.Project;
+
+/**
+ * @author Jan Stevens Ancajas
+ */
+public class BuildContextToProject
+{
+    public static Project getProject( BuildContext buildContext )
+    {
+        Project project = new Project();    
+
+        project.setId( buildContext.getProjectId() );
+
+        project.setScmUrl( buildContext.getScmUrl() );
+
+        project.setScmUsername( buildContext.getScmPassword());
+
+        project.setScmPassword( buildContext.getScmPassword() );
+
+        project.setExecutorId( buildContext.getExecutorId() );
+        
+        //rename ?
+        project.setName( "distributed-build-[projectId="+buildContext.getProjectId()+"]"
);
+        
+        return project;
+    }
+}

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToProject.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message