Author: julien(a)jboss.com
Date: 2008-04-01 17:33:11 -0400 (Tue, 01 Apr 2008)
New Revision: 10465
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/RedirectResponse.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ShowUIObjectResponse.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/StreamResponse.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ViewUIObjectAction.java
Log:
update of protocol objects
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/RedirectResponse.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/RedirectResponse.java 2008-04-01
21:03:57 UTC (rev 10464)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/RedirectResponse.java 2008-04-01
21:33:11 UTC (rev 10465)
@@ -23,6 +23,8 @@
package org.jboss.portal.presentation.protocol;
/**
+ * Instruct the client to show a new URL to the end user.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
@@ -32,8 +34,20 @@
/** . */
private final String location;
- public RedirectResponse(String location)
+ /**
+ * Build a new redirect response object.
+ *
+ * @param location the new location
+ * @throws IllegalArgumentException if the location argument is null
+ */
+ public RedirectResponse(String location) throws IllegalArgumentException
{
+ if (location == null)
+ {
+ throw new IllegalArgumentException("No null location argument
accepted");
+ }
+
+ //
this.location = location;
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ShowUIObjectResponse.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ShowUIObjectResponse.java 2008-04-01
21:03:57 UTC (rev 10464)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ShowUIObjectResponse.java 2008-04-01
21:33:11 UTC (rev 10465)
@@ -23,7 +23,7 @@
package org.jboss.portal.presentation.protocol;
/**
- * Tell the client to show a particular page.
+ * Tell the client to show a particular user interface object to the end user.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/StreamResponse.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/StreamResponse.java 2008-04-01
21:03:57 UTC (rev 10464)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/StreamResponse.java 2008-04-01
21:33:11 UTC (rev 10465)
@@ -22,30 +22,53 @@
******************************************************************************/
package org.jboss.portal.presentation.protocol;
+import org.jboss.portal.common.net.media.ContentType;
+
import java.io.InputStream;
/**
+ * Build a stream response.
+ *
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*/
public class StreamResponse extends ServerResponse
{
/** . */
- private String contentType = null;
+ private ContentType contentType = null;
/** . */
- private InputStream is = null;
+ private InputStream stream = null;
/**
- *
- * @param contentType
- * @param is
+ * Build a new stream response object.
+ *
+ * @param contentType the content type
+ * @param stream the media type
+ * @throws IllegalArgumentException if an argument is null
*/
- public StreamResponse(String contentType, InputStream is)
+ public StreamResponse(ContentType contentType, InputStream stream) throws
IllegalArgumentException
{
-
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("No content type provided");
+ }
+ if (stream == null)
+ {
+ throw new IllegalArgumentException("No input stream provided");
+ }
this.contentType = contentType;
- this.is = is;
+ this.stream = stream;
}
+
+ public ContentType getContentType()
+ {
+ return contentType;
+ }
+
+ public InputStream getStream()
+ {
+ return stream;
+ }
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ViewUIObjectAction.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ViewUIObjectAction.java 2008-04-01
21:03:57 UTC (rev 10464)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/ViewUIObjectAction.java 2008-04-01
21:33:11 UTC (rev 10465)
@@ -23,7 +23,7 @@
package org.jboss.portal.presentation.protocol;
/**
- * Shows a page.
+ * The client wants to display a user interface object.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
Show replies by date