From: <ma...@rh...> - 2009-06-29 23:17:20
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [4211] merge trunk - up to svn rev 4210</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>4211</dd> <dt>Author</dt> <dd>mazz</dd> <dt>Date</dt> <dd>2009-06-29 18:16:14 -0500 (Mon, 29 Jun 2009)</dd> </dl> <h3>Log Message</h3> <pre>merge trunk - up to svn rev 4210</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqbranchesAGENT_PLUGIN_CLASSLOADINGmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseserversupportSupportManagerBeanjava">rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerBean.java</a></li> <li><a href="#rhqbranchesAGENT_PLUGIN_CLASSLOADINGmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseserversupportSupportManagerLocaljava">rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerLocal.java</a></li> <li><a href="#rhqbranchesAGENT_PLUGIN_CLASSLOADINGpomxml">rhq/branches/AGENT_PLUGIN_CLASSLOADING/pom.xml</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqbranchesAGENT_PLUGIN_CLASSLOADINGmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseserversupportSupportManagerBeanjava"></a> <div class="modfile"><h4>Modified: rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerBean.java (4210 => 4211)</h4> <pre class="diff"> <span class="info">--- rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerBean.java 2009-06-29 23:05:22 UTC (rev 4210) +++ rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerBean.java 2009-06-29 23:16:14 UTC (rev 4211) </span><span class="lines">@@ -42,27 +42,46 @@ </span><span class="cx"> import org.rhq.enterprise.server.authz.RequiredPermission; import org.rhq.enterprise.server.core.AgentManagerLocal; </span><span class="add">+/** + * Provides some methods that are useful for supporting managed resources. This includes being + * able to take a snapshot report of a managed resource, such as its log files, data files, and anything + * the managed resource wants to expose. + * + * This Support subsystem provides things like snapshot reports that are potentially very sensitive and + * gives the user access to far sweeping data, (e.g. they can contain configuration settings, data files + * and logs - all of which can contain confidential information). Because of this, most of the methods + * in this subsystem will require the user to be an "inventory manager" with {@link Permission#MANAGE_INVENTORY} + * permissions. + * + * @author John Mazzitelli + */ </span><span class="cx"> @Stateless public class SupportManagerBean implements SupportManagerLocal { @EJB private AgentManagerLocal agentManager; </span><span class="rem">- // a snapshot report is potentially very sensitive - it can contain configuration settings, data files and logs - all - // of which can contain confidential information. Therefore, because the amount of data the user has access to - // is far sweeping, we require the user to be an inventory manager. </span><span class="cx"> @RequiredPermission(Permission.MANAGE_INVENTORY) </span><span class="rem">- public URL getSnapshotReport(Subject subject, int resourceId, String name, String description) throws Exception { </span><span class="add">+ public InputStream getSnapshotReportStream(Subject subject, int resourceId, String name, String description) + throws Exception { </span><span class="cx"> AgentClient agentClient = this.agentManager.getAgentClient(resourceId); SupportAgentService supportService = agentClient.getSupportAgentService(); </span><span class="rem">- InputStream snapshot = supportService.getSnapshotReport(resourceId, name, description); </span><span class="add">+ InputStream snapshotStream = supportService.getSnapshotReport(resourceId, name, description); </span><span class="cx"> </span><span class="add">+ return snapshotStream; + } + + @RequiredPermission(Permission.MANAGE_INVENTORY) + public URL getSnapshotReport(Subject subject, int resourceId, String name, String description) throws Exception { + + InputStream snapshotStream = getSnapshotReportStream(subject, resourceId, name, description); + </span><span class="cx"> // TODO: not sure what we should really do with it, for now, put it in the downloads location. // you can retrieve this by going to http://localhost:7080/downloads File dir = getDownloadsDir(); File downloadFile = File.createTempFile(name + "-" + resourceId + "-", ".zip", dir); </span><span class="rem">- StreamUtil.copy(snapshot, new FileOutputStream(downloadFile)); </span><span class="add">+ StreamUtil.copy(snapshotStream, new FileOutputStream(downloadFile)); </span><span class="cx"> return downloadFile.toURI().toURL(); } </span><span class="lines">@@ -79,3 +98,4 @@ </span><span class="cx"> return downloadDir; } } </span><span class="add">+ </span></pre></div> <a id="rhqbranchesAGENT_PLUGIN_CLASSLOADINGmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseserversupportSupportManagerLocaljava"></a> <div class="modfile"><h4>Modified: rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerLocal.java (4210 => 4211)</h4> <pre class="diff"> <span class="info">--- rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerLocal.java 2009-06-29 23:05:22 UTC (rev 4210) +++ rhq/branches/AGENT_PLUGIN_CLASSLOADING/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerLocal.java 2009-06-29 23:16:14 UTC (rev 4211) </span><span class="lines">@@ -18,13 +18,25 @@ </span><span class="cx"> */ package org.rhq.enterprise.server.support; </span><span class="add">+import java.io.InputStream; </span><span class="cx"> import java.net.URL; import javax.ejb.Local; import org.rhq.core.domain.auth.Subject; </span><span class="add">+/** + * Provides some methods that are useful for supporting managed resources. This includes being + * able to take a snapshot report of a managed resource, such as its log files, data files, and anything + * the managed resource wants to expose. + * + * @author John Mazzitelli + */ </span><span class="cx"> @Local public interface SupportManagerLocal { </span><span class="add">+ InputStream getSnapshotReportStream(Subject subject, int resourceId, String name, String description) + throws Exception; + </span><span class="cx"> URL getSnapshotReport(Subject subject, int resourceId, String name, String description) throws Exception; } </span><span class="add">+ </span></pre></div> <a id="rhqbranchesAGENT_PLUGIN_CLASSLOADINGpomxml"></a> <div class="modfile"><h4>Modified: rhq/branches/AGENT_PLUGIN_CLASSLOADING/pom.xml (4210 => 4211)</h4> <pre class="diff"> <span class="info">--- rhq/branches/AGENT_PLUGIN_CLASSLOADING/pom.xml 2009-06-29 23:05:22 UTC (rev 4210) +++ rhq/branches/AGENT_PLUGIN_CLASSLOADING/pom.xml 2009-06-29 23:16:14 UTC (rev 4211) </span><span class="lines">@@ -371,7 +371,7 @@ </span><span class="cx"> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> </span><span class="rem">- <version>5.7</version> </span><span class="add">+ <version>5.8</version> </span><span class="cx"> <scope>test</scope> <classifier>jdk15</classifier> </dependency> </span><span class="lines">@@ -476,15 +476,60 @@ </span><span class="cx"> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> </span><span class="add">+ <artifactId>build-helper-maven-plugin</artifactId> + <version>1.3</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> </span><span class="cx"> <artifactId>buildnumber-maven-plugin</artifactId> </span><span class="rem">- <version>1.0-beta-2</version> </span><span class="add">+ <version>1.0-beta-3</version> </span><span class="cx"> </plugin> </plugins> </pluginManagement> <plugins> </span><span class="add">+ <!-- Set the 'maven.version' property to the version of Maven being used, + so we can include the Maven version in the MANIFEST.MF files of all + build artifacts. --> </span><span class="cx"> <plugin> </span><span class="add">+ <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>maven-version</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- Set the 'buildNumber' property to the current SVN revision, or to '0' + if an SVN revision cannot be determined, so we can include the SVN + revision in the MANIFEST.MF files of all build artifacts. --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>create</goal> + </goals> + </execution> + </executions> + <configuration> + <getRevisionOnlyOnce>true</getRevisionOnlyOnce> + <revisionOnScmFailure>0</revisionOnScmFailure> + <doCheck>false</doCheck> + <doUpdate>false</doUpdate> + <timestampFormat>{0, date, long} {0, time, long}</timestampFormat> + </configuration> + </plugin> + + <!-- Ensure all code compiles and runs on Java 5 or later. --> + <plugin> </span><span class="cx"> <artifactId>maven-compiler-plugin</artifactId> <configuration> <optimize>false</optimize> </span><span class="lines">@@ -502,7 +547,14 @@ </span><span class="cx"> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> <manifestEntries> </span><span class="add">+ <Maven-Version>${maven.version}</Maven-Version> + <Java-Version>${java.version}</Java-Version> + <Java-Vendor>${java.vendor}</Java-Vendor> + <Os-Name>${os.name}</Os-Name> + <Os-Arch>${os.arch}</Os-Arch> + <Os-Version>${os.version}</Os-Version> </span><span class="cx"> <Build-Number>${buildNumber}</Build-Number> </span><span class="add">+ <Build-Time>${timestamp}</Build-Time> </span><span class="cx"> </manifestEntries> </archive> </configuration> </span><span class="lines">@@ -725,7 +777,7 @@ </span><span class="cx"> </build> </profile> </span><span class="rem">- <!-- use buildnumber plugin only if SVN metadata is present --> </span><span class="add">+ <!-- Use buildnumber plugin only if SVN metadata is present. --> </span><span class="cx"> <profile> <id>build-number-generation</id> <activation> </span><span class="lines">@@ -747,6 +799,7 @@ </span><span class="cx"> </execution> </executions> <configuration> </span><span class="add">+ <getRevisionOnlyOnce>true</getRevisionOnlyOnce> </span><span class="cx"> <revisionOnScmFailure>0</revisionOnScmFailure> <doCheck>false</doCheck> <doUpdate>false</doUpdate> </span><span class="lines">@@ -756,23 +809,6 @@ </span><span class="cx"> </build> </profile> </span><span class="rem">- <!-- If SVN meta data is not configured, set buildNumber to 0 --> - <!-- I think this can get removed - before buildnumber-maven-plugin 1.0-beta-2 --> - <!-- there was no <revisionOnScmFailure> option, so this was our custom solution. --> - <!-- - <profile> - <id>build-number-provided</id> - <activation> - <file> - <missing>.svn</missing> - </file> - </activation> - - <properties> - <buildNumber>0</buildNumber> - </properties> - </profile> - --> </span><span class="cx"> </profiles> </project> \ No newline at end of file </span> </pre> </div> </div> </body> </html> |