Author: sohil.shah(a)jboss.com
Date: 2008-04-17 17:43:34 -0400 (Thu, 17 Apr 2008)
New Revision: 10626
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralObject.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralState.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralStateContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/ConstraintViolationException.java
Log:
code cleanup
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateContext.java 2008-04-17
21:12:58 UTC (rev 10625)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/AbstractStructuralStateContext.java 2008-04-17
21:43:34 UTC (rev 10626)
@@ -1,57 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.presentation.model.state.structural;
-
-import org.jboss.portal.presentation.model.state.StateChangeVetoException;
-import org.jboss.portal.presentation.model.state.StateException;
-import org.jboss.portal.presentation.model.UIObject;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class AbstractStructuralStateContext implements StructuralStateContext
-{
-
- public StructuralObject.Creation create(StructuralObject parent, Class<? extends
UIObject> type, String name, Map<String, String> properties) throws
StateChangeVetoException, StateException, IllegalArgumentException
- {
- throw new StateChangeVetoException();
- }
-
- public StructuralObject.Destruction destroy(StructuralObject object) throws
StateException, IllegalArgumentException
- {
- throw new StateChangeVetoException();
- }
-
- public StructuralObject.Move move(StructuralObject source, StructuralObject
destination) throws StateException, IllegalArgumentException
- {
- throw new StateChangeVetoException();
- }
-
- public StructuralObject.Update update(StructuralObject object, Map<String,
String> changes) throws StateException, IllegalArgumentException
- {
- throw new StateChangeVetoException();
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralObject.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralObject.java 2008-04-17
21:12:58 UTC (rev 10625)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralObject.java 2008-04-17
21:43:34 UTC (rev 10626)
@@ -1,306 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.presentation.model.state.structural;
-
-import java.util.List;
-import java.util.Set;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface StructuralObject
-{
-
- String getId();
-
- StructuralState getState();
-
- boolean compareTo(StructuralObject other);
-
- /**
- * A comparison between two structural objects.
- */
- public static class Refresh
- {
-
- /** . */
- private final StructuralObject parent;
-
- /** . */
- private final StructuralObject object;
-
- /** . */
- private final Set<StructuralObject> addedChildren;
-
- /** . */
- private final Set<String> removedChildren;
-
- /** . */
-// private final Set<String> destroyedChildren;
-
- /** . */
- private final Map<String, StructuralObject> staleChildren;
-
- /** . */
- private final Set<String> validChildren;
-
- public Refresh(
- StructuralObject parent,
- StructuralObject object,
- Set<StructuralObject> addedChildren,
- Set<String> removedChildren,
- Map<String, StructuralObject> staleChildren,
- Set<String> validChildren/*,
- Set<String> destroyedChildren*/)
- {
- if (addedChildren == null)
- {
- throw new IllegalArgumentException();
- }
- if (validChildren == null)
- {
- throw new IllegalArgumentException();
- }
- if (staleChildren == null)
- {
- throw new IllegalArgumentException();
- }
- if (removedChildren == null)
- {
- throw new IllegalArgumentException();
- }
-// if (destroyedChildren == null)
-// {
-// throw new IllegalArgumentException();
-// }
- this.parent = parent;
- this.object = object;
- this.addedChildren = addedChildren;
- this.validChildren = validChildren;
- this.staleChildren = staleChildren;
- this.removedChildren = removedChildren;
-// this.destroyedChildren = destroyedChildren;
- }
-
- public StructuralObject getParent()
- {
- return parent;
- }
-
- public StructuralObject getObject()
- {
- return object;
- }
-
-// public Set<String> getDestroyedChildren()
-// {
-// return destroyedChildren;
-// }
-
- public Set<StructuralObject> getAddedChildren()
- {
- return addedChildren;
- }
-
- public Map<String, StructuralObject> getStaleChildren()
- {
- return staleChildren;
- }
-
- public Set<String> getValidChildren()
- {
- return validChildren;
- }
-
- public Set<String> getRemovedChildren()
- {
- return removedChildren;
- }
- }
-
- public static class Change
- {
- }
-
- public static class Update extends Change
- {
-
- /** . */
- private final StructuralObject object;
-
- /** . */
- private final Map<String, String> changes;
-
- public Update(StructuralObject object, Map<String, String> changes)
- {
- if (object == null)
- {
- throw new IllegalArgumentException();
- }
- if (changes == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.object = object;
- this.changes = changes;
- }
-
- public StructuralObject getObject()
- {
- return object;
- }
-
- public Map<String, String> getChanges()
- {
- return changes;
- }
- }
-
- public static class Move extends Change
- {
-
- /** . */
- private final StructuralObject parent;
-
- /** . */
- private final StructuralObject source;
-
- /** . */
- private final StructuralObject destination;
-
- public Move(
- StructuralObject parent,
- StructuralObject source,
- StructuralObject destination)
- {
- if (parent == null)
- {
- throw new IllegalArgumentException();
- }
- if (source == null)
- {
- throw new IllegalArgumentException();
- }
- if (destination == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.parent = parent;
- this.source = source;
- this.destination = destination;
- }
-
- public StructuralObject getParent()
- {
- return parent;
- }
-
- public StructuralObject getSource()
- {
- return source;
- }
-
- public StructuralObject getDestination()
- {
- return destination;
- }
- }
-
- public static class Creation extends Change
- {
-
- /** . */
- private final StructuralObject child;
-
- /** . */
- private final StructuralObject parent;
-
- public Creation(StructuralObject parent, StructuralObject child)
- {
- if (parent == null)
- {
- throw new IllegalArgumentException();
- }
- if (child == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.parent = parent;
- this.child = child;
- }
-
- public StructuralObject getParent()
- {
- return parent;
- }
-
- public StructuralObject getChild()
- {
- return child;
- }
- }
-
- public static class Destruction extends Change
- {
-
- /** . */
- private final StructuralObject parent;
-
- /** . */
- private final List<String> ids;
-
- public Destruction(StructuralObject parent, List<String> ids)
- {
- if (parent == null)
- {
- throw new IllegalArgumentException();
- }
- if (ids == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.parent = parent;
- this.ids = ids;
- }
-
- public StructuralObject getParent()
- {
- return parent;
- }
-
- public List<String> getIds()
- {
- return ids;
- }
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralState.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralState.java 2008-04-17
21:12:58 UTC (rev 10625)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralState.java 2008-04-17
21:43:34 UTC (rev 10626)
@@ -1,43 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.presentation.model.state.structural;
-
-import org.jboss.portal.presentation.model.UIObject;
-
-import java.util.Map;
-
-/**
- * The structural state.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface StructuralState
-{
-
- Class<? extends UIObject> getType();
-
- String getName();
-
- Map<String, String> getProperties();
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralStateContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralStateContext.java 2008-04-17
21:12:58 UTC (rev 10625)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/state/structural/StructuralStateContext.java 2008-04-17
21:43:34 UTC (rev 10626)
@@ -1,144 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.presentation.model.state.structural;
-
-import org.jboss.portal.presentation.model.UIObject;
-import org.jboss.portal.presentation.model.state.StateChangeVetoException;
-import org.jboss.portal.presentation.model.state.StateException;
-
-import java.util.Map;
-import java.util.Collection;
-
-/**
- * The structural state context.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface StructuralStateContext
-{
-
- /**
- * Load the state of the specified object.
- *
- * @param objectId the object id
- * @return the state of the object or null if such state does not exist
- * @throws IllegalArgumentException if the object id argument is null
- */
- StructuralObject load(String objectId) throws IllegalArgumentException;
-
- /**
- * Load the children of the provided object.
- *
- * @param parent the parent
- * @return the list of children as structural objects
- * @throws IllegalArgumentException if the provided object is null
- * @throws StateException any useful exception that would make the object non valid
- */
- Collection<StructuralObject> loadChildren(StructuralObject parent) throws
IllegalArgumentException, StateException;
-
- /**
- * Load the parent of the specified object.
- *
- * @param child the child
- * @return the parent or null if it does not exist
- * @throws IllegalArgumentException if the provided object is null
- * @throws StateException any useful exception that would make the object non valid
- */
- StructuralObject loadParent(StructuralObject child) throws IllegalArgumentException,
StateException;
-
- /**
- * Returns the id of the root object.
- *
- * @return the id of the root object.
- */
- String getRootId();
-
- /**
- * Validate the state of the provided object. The operation is idempotent and does not
modify any state.
- * If validation is succesfull the method returns otherwise it throws an exception
that indicates
- * the nature of the non validation failure.
- *
- * @param object the object to check
- * @throws IllegalArgumentException if the provided object is null
- * @throws StateException any useful exception that would make the object non valid
- */
- void validate(StructuralObject object) throws IllegalArgumentException,
StateException;
-
- /**
- * Attempt to return an object that contains the difference between the provided
object
- * and the up to date object.
- *
- * @param object the object to refresh
- * @return the refresh
- * @throws IllegalArgumentException if the object argument is null
- * @throws StateException if the object cannot be refreshed
- */
- StructuralObject.Refresh refresh(StructuralObject object) throws
IllegalArgumentException, StateException;
-
- /**
- * Create an object.
- *
- * @param parent the parent
- * @param type the type of the child
- * @param name the name of the child
- * @param properties the initial properties of the child @return the id of the newly
created structural state
- * @return the creation object
- * @throws IllegalArgumentException if an argument is null or not valid
- * @throws StateException if the provided state prevents the operation to be done
- */
- StructuralObject.Creation create(StructuralObject parent, Class<? extends
UIObject> type, String name, Map<String, String> properties) throws
StateException, IllegalArgumentException;
-
- /**
- * Destroy a specified object.
- *
- * @param object the object to destroy
- * @return the destruction object
- * @throws IllegalArgumentException if an argument is null or not valid
- * @throws StateException if the provided state prevents the operation to be done
- */
- StructuralObject.Destruction destroy(StructuralObject object) throws
IllegalArgumentException, StateException;
-
- /**
- * Move an object to a new parent.
- *
- * @param source the source object
- * @param destination the destination object
- * @return the move object
- * @throws IllegalArgumentException if an argument is null or not valid
- * @throws StateException if the provided state prevents the operation to be done
- */
- StructuralObject.Move move(StructuralObject source, StructuralObject destination)
throws IllegalArgumentException, StateException;
-
- /**
- * Update the state of a specified object.
- *
- * @param object the object to udpate
- * @param changes the changes
- * @throws StateChangeVetoException if the creation is vetoed
- * @return the update object
- * @throws IllegalArgumentException if an argument is null or not valid
- * @throws StateException if the provided state prevents the operation to be done
- */
- StructuralObject.Update update(StructuralObject object, Map<String, String>
changes) throws IllegalArgumentException, StateException;
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/ConstraintViolationException.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/ConstraintViolationException.java 2008-04-17
21:12:58 UTC (rev 10625)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/ConstraintViolationException.java 2008-04-17
21:43:34 UTC (rev 10626)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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.jboss.portal.presentation.state;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ConstraintViolationException extends StateException
-{
- public ConstraintViolationException()
- {
- }
-
- public ConstraintViolationException(String s)
- {
- super(s);
- }
-
- public ConstraintViolationException(String s, Throwable throwable)
- {
- super(s, throwable);
- }
-
- public ConstraintViolationException(Throwable throwable)
- {
- super(throwable);
- }
-}
\ No newline at end of file