001: /****************************************************************************
002: * CruiseControl, a Continuous Integration Toolkit
003: * Copyright (c) 2001, ThoughtWorks, Inc.
004: * 200 E. Randolph, 25th Floor
005: * Chicago, IL 60601 USA
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * + Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * + Redistributions in binary form must reproduce the above
016: * copyright notice, this list of conditions and the following
017: * disclaimer in the documentation and/or other materials provided
018: * with the distribution.
019: *
020: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
021: * names of its contributors may be used to endorse or promote
022: * products derived from this software without specific prior
023: * written permission.
024: *
025: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
026: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
027: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
028: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
029: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
030: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
031: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
032: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
033: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
034: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
035: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
036: ****************************************************************************/package net.sourceforge.cruisecontrol.distributed;
037:
038: import java.rmi.Remote;
039: import java.rmi.RemoteException;
040: import java.util.Map;
041: import java.util.Date;
042:
043: import org.jdom.Element;
044: import net.sourceforge.cruisecontrol.Builder;
045: import net.sourceforge.cruisecontrol.distributed.core.ProgressRemote;
046: import net.sourceforge.cruisecontrol.distributed.core.RemoteResult;
047:
048: public interface BuildAgentService extends Remote {
049:
050: /**
051: * Exists for backwards compatibility.
052: * @deprecated use {@link #doBuild(Builder, Map, Map, ProgressRemote, RemoteResult[])} instead
053: * @param nestedBuilder the builder to execute on the agent
054: * @param projectProperties cc properties for the current project
055: * @param distributedAgentProperties ccdist properties for this remote build
056: * @return the build log xml document
057: * @throws RemoteException if the remote call fails
058: */
059: public Element doBuild(Builder nestedBuilder,
060: Map projectProperties, Map distributedAgentProperties)
061: throws RemoteException;
062:
063: /**
064: * Performs a build on a build agent.
065: * @deprecated use {@link #doBuild(Builder, Map, Map, ProgressRemote, RemoteResult[])} instead
066: * @param nestedBuilder the builder to execute on the agent
067: * @param projectProperties cc properties for the current project
068: * @param distributedAgentProperties ccdist properties for this remote build
069: * @param progressRemote callback object to provide progress info as the build progresses,
070: * can be null.
071: * @return the build log xml document
072: * @throws RemoteException if the remote call fails
073: */
074: public Element doBuild(Builder nestedBuilder,
075: Map projectProperties, Map distributedAgentProperties,
076: ProgressRemote progressRemote) throws RemoteException;
077:
078: /**
079: * Performs a build on a build agent.
080: * @param nestedBuilder the builder to execute on the agent
081: * @param projectProperties cc properties for the current project
082: * @param distributedAgentProperties ccdist properties for this remote build
083: * @param progressRemote callback object to provide progress info as the build progresses,
084: * can be null.
085: * @param remoteResults build artifacts to be returned from the agent to the master, used to agent clear results.
086: * @return the build log xml document
087: * @throws RemoteException if the remote call fails
088: */
089: public Element doBuild(Builder nestedBuilder,
090: Map projectProperties, Map distributedAgentProperties,
091: ProgressRemote progressRemote, RemoteResult[] remoteResults)
092: throws RemoteException;
093:
094: public String getMachineName() throws RemoteException;
095:
096: /**
097: * @return the date this Build Agent started running (not when a specific build started).
098: * @throws RemoteException if the remote call fails
099: */
100: public Date getDateStarted() throws RemoteException;
101:
102: public void claim() throws RemoteException;
103:
104: public Date getDateClaimed() throws RemoteException;
105:
106: public boolean isBusy() throws RemoteException;
107:
108: /**
109: * @return the project being built now, or null if no project is being built.
110: * @throws RemoteException if the remote call fails
111: */
112: public String getProjectName() throws RemoteException;
113:
114: public boolean resultsExist(String resultsType)
115: throws RemoteException;
116:
117: public byte[] retrieveResultsAsZip(String resultsType)
118: throws RemoteException;
119:
120: public boolean remoteResultExists(int idx) throws RemoteException;
121:
122: public byte[] retrieveRemoteResult(int resultIdx)
123: throws RemoteException;
124:
125: public void clearOutputFiles() throws RemoteException;
126:
127: public void kill(boolean afterBuildFinished) throws RemoteException;
128:
129: public void restart(boolean afterBuildFinished)
130: throws RemoteException;
131:
132: public boolean isPendingKill() throws RemoteException;
133:
134: public Date getPendingKillSince() throws RemoteException;
135:
136: public boolean isPendingRestart() throws RemoteException;
137:
138: public Date getPendingRestartSince() throws RemoteException;
139:
140: public String asString() throws RemoteException;
141:
142: public void setEntryOverrides(PropertyEntry[] entryOverrides)
143: throws RemoteException;
144:
145: public PropertyEntry[] getEntryOverrides() throws RemoteException;
146: }
|