Author: mwringe
Date: 2010-09-24 13:56:39 -0400 (Fri, 24 Sep 2010)
New Revision: 4385
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportException.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationFailedException.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationNotSupportedException.java
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java
Log:
GTNWSRP-64: finish removing wsrp 2.0 specific classes from the export manager interfaces.
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportException.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportException.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportException.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.exports;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class ExportException extends Exception
+{
+ public ExportException()
+ {
+ }
+
+ public ExportException(String message)
+ {
+ super(message);
+ }
+
+ public ExportException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ExportException(Throwable cause)
+ {
+ super(cause);
+ }
+}
+
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java 2010-09-24
14:22:28 UTC (rev 4384)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -24,8 +24,6 @@
import org.gatein.exports.data.ExportContext;
import org.gatein.exports.data.ExportPortletData;
-import org.oasis.wsrp.v2.OperationFailed;
-import org.oasis.wsrp.v2.OperationNotSupported;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -44,17 +42,17 @@
ExportContext createExportContext(boolean exportByValueRequired, long currentTime,
long terminationTime, long refreshDuration) throws UnsupportedEncodingException;
- ExportContext createExportContext(byte[] bytes) throws OperationFailed;
+ ExportContext createExportContext(byte[] bytes) throws OperationFailedException;
ExportPortletData createExportPortletData(ExportContext exportContextData, String
portletHandle, byte[] portletState) throws UnsupportedEncodingException;
- ExportPortletData createExportPortletData(ExportContext exportContext, long
currentime, long terminationTime, long refreshDuration, byte[] bytes) throws
OperationFailed;
+ ExportPortletData createExportPortletData(ExportContext exportContext, long
currentime, long terminationTime, long refreshDuration, byte[] bytes) throws
OperationFailedException;
byte[] encodeExportPortletData(ExportContext exportContextData, ExportPortletData
exportPortletData) throws UnsupportedEncodingException, IOException;
byte[] encodeExportContextData(ExportContext exportContextData) throws
UnsupportedEncodingException, IOException;
- ExportContext setExportLifetime(byte[] exportContextBytes, long currentTime, long
terminationTime, long refreshDuration) throws OperationFailed, OperationNotSupported;
+ ExportContext setExportLifetime(byte[] exportContextBytes, long currentTime, long
terminationTime, long refreshDuration) throws OperationFailedException,
OperationNotSupportedException;
void releaseExport(byte[] bytes) throws IOException;
}
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportPersistenceManager.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportPersistenceManager.java 2010-09-24
14:22:28 UTC (rev 4384)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportPersistenceManager.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -27,7 +27,6 @@
import org.gatein.exports.data.ExportContext;
import org.gatein.exports.data.ExportPortletData;
-import org.oasis.wsrp.v2.Lifetime;
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationFailedException.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationFailedException.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationFailedException.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.exports;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class OperationFailedException extends ExportException
+{
+
+ public OperationFailedException(String message)
+ {
+ super(message);
+ }
+}
+
Added:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationNotSupportedException.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationNotSupportedException.java
(rev 0)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/OperationNotSupportedException.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.gatein.exports;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class OperationNotSupportedException extends ExportException
+{
+
+ public OperationNotSupportedException(String message)
+ {
+ super(message);
+ }
+}
+
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java 2010-09-24
14:22:28 UTC (rev 4384)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -24,12 +24,12 @@
import org.gatein.exports.ExportManager;
import org.gatein.exports.ExportPersistenceManager;
+import org.gatein.exports.OperationFailedException;
+import org.gatein.exports.OperationNotSupportedException;
import org.gatein.exports.data.ExportContext;
import org.gatein.exports.data.ExportData;
import org.gatein.exports.data.ExportPortletData;
import org.gatein.wsrp.WSRPExceptionFactory;
-import org.oasis.wsrp.v2.OperationFailed;
-import org.oasis.wsrp.v2.OperationNotSupported;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -81,7 +81,7 @@
this.preferExportByValue = preferExportByValue;
}
- public ExportContext createExportContext(byte[] bytes) throws OperationFailed
+ public ExportContext createExportContext(byte[] bytes) throws
OperationFailedException
{
try
{
@@ -99,16 +99,16 @@
}
else
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class,
"Byte array format not compatible.", null);
+ throw new OperationFailedException("Byte array format not
compatible");
}
}
catch (UnsupportedEncodingException e)
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could
not decode the byte array.", e);
+ throw new OperationFailedException("Could not decode the byte
array.");
}
catch (IOException e)
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could
not decode the byte array.", e);
+ throw new OperationFailedException("Could not decode the byte
array.");
}
}
@@ -118,7 +118,7 @@
return new ExportPortletData(portletHandle, portletState);
}
- public ExportPortletData createExportPortletData(ExportContext exportContextData, long
currentTime, long terminationTime, long refreshDuration, byte[] bytes) throws
OperationFailed
+ public ExportPortletData createExportPortletData(ExportContext exportContextData, long
currentTime, long terminationTime, long refreshDuration, byte[] bytes) throws
OperationFailedException
{
try
{
@@ -131,16 +131,16 @@
}
else
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class,
"Bytes array format not compatible", null);
+ throw new OperationFailedException("Bytes array format not
compatible");
}
}
catch (UnsupportedEncodingException e)
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could
not decode the byte array.", e);
+ throw new OperationFailedException("Could not decode the byte
array.");
}
catch (IOException e)
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could
not decode the byte array.", e);
+ throw new OperationFailedException("Could not decode the byte
array.");
}
}
@@ -170,11 +170,11 @@
}
}
- public ExportContext setExportLifetime(byte[] exportContextBytes, long currentTime,
long terminationTime, long refreshDuration) throws OperationFailed, OperationNotSupported
+ public ExportContext setExportLifetime(byte[] exportContextBytes, long currentTime,
long terminationTime, long refreshDuration) throws OperationNotSupportedException,
OperationFailedException
{
if (getPersistenceManager() == null)
{
- WSRPExceptionFactory.throwWSException(OperationNotSupported.class, "The
producer only supports export by value. Cannot call setExportLifetime on this
producer", null);
+ throw new OperationNotSupportedException("The producer only supports export
by value. Cannot call setExportLifetime on this producer");
}
try
@@ -189,7 +189,7 @@
if (exportContext.isExportByValue())
{
- WSRPExceptionFactory.throwWSException(OperationFailed.class, "Cannot
set the lifetime for an export that was exported by value.", null);
+ throw new OperationFailedException("Cannot set the lifetime for an
export that was exported by value.");
}
exportContext.setCurrentTime(currentTime);
@@ -201,12 +201,12 @@
}
else
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class,
"Byte array format not recognized.", null);
+ throw new OperationFailedException("Byte array format not
recognized.");
}
}
catch (IOException e)
{
- throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could
not decode the byte array.", e);
+ throw new OperationFailedException("Could not decode the byte
array.");
}
}
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java 2010-09-24
14:22:28 UTC (rev 4384)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java 2010-09-24
17:56:39 UTC (rev 4385)
@@ -22,13 +22,10 @@
*/
package org.gatein.wsrp.support;
-import org.gatein.common.NotYetImplemented;
import org.gatein.exports.ExportPersistenceManager;
import org.gatein.exports.data.ExportContext;
import org.gatein.exports.data.ExportPortletData;
import org.gatein.exports.data.PersistedExportData;
-import org.oasis.wsrp.v2.Lifetime;
-
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;