com.vinculumtech.carrierwave.session
Class QueryClient

java.lang.Object
  extended bycom.vinculumtech.carrierwave.session.QueryClient

public class QueryClient
extends java.lang.Object

The QueryClient class provides the client interface to the 'modify', 'select', 'delete', and 'invoke' functionality on the server.

Methods taking graph plan names will consult the authoritative

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/session/QueryClient.java#18 $
See Also:
ClientSession, RepositoryClient

Method Summary
 void deleteAllImageablesFor(java.util.List icons)
          Deletes all Imageable instances referenced by the given List of Icon instances.
This method will ignore Icon instances that reference dependent objects, unlike the deleteObjectFor method.
 void deleteImageableFor(Icon icon)
          Delete the Imageable instance referenced by the given Icon instance.
This method will fail if the given Icon instance refers to a dependent object.
Note this method cannot dereference a dependent object as lists are not ordered and there would be no guarantee the object was removed.
 Icon[] findAllIconsFor(java.lang.String imageType)
          Returns an array of Icons for the Imageable objects of given imageType class name.
This method will fail if the objects found are not ImageableIdentifiable.
 Icon[] findAllIconsWith(CollectionFinder finder)
          Returns an array of Icon instances for the Imageable objects found by the given CollectionFinder.
This method will fail if the objects found are not ImageableIdentifiable.
 Icon findIconWith(ObjectFinder finder)
          Returns an Icon instance for the Imageable found by the given ObjectFinder instance.
This method will fail if the object found is not ImageableIdentifiable.
 ClientSession getClientSession()
           
protected  CommonClient getCommonClient()
           
 Icon invokeImageableGraphWith(Action action)
          Invokes the given Action instance and returns an Icon instance for the resulting ImageableIdentifiable.
If the given Action instance has a dirty Image instance child that represents an ImageableIdentifiable object, the ImageableIdentifiable will be modified before the action is invoked.
 Image invokeImageableGraphWith(Action action, GraphPlan resultPlan)
          Invokes the given Action instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.
 Image invokeImageableGraphWith(Action action, java.lang.String resultPlanName)
          Invokes the given Action instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.
 Image invokeImageableGraphWith(GraphPlan graphPlan, Action action, GraphPlan resultPlan)
          Invokes the given Action instance described the given graphPlan GraphPlan instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.
 Image invokeImageableGraphWith(java.lang.String graphPlanName, Action action, java.lang.String resultPlanName)
          Invokes the given Action instance described the given graphPlan GraphPlan instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.
 Icon modifyImageableGraphFor(GraphPlan graphPlan, Image originImage)
          Creates or modifies the graph represented by the graph rooted by given Image instance and described by the given GraphPlan instance.
Note that only the children described by the given GraphPlan will be consulted.
 Icon[] modifyImageableGraphFor(GraphPlan graphPlan, ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.
 Icon modifyImageableGraphFor(Image originImage)
          Creates or modifies the graph represented by the graph rooted by given Image instance.
 Icon[] modifyImageableGraphFor(ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.
 Icon modifyImageableGraphFor(java.lang.String graphPlanName, Image originImage)
          Creates or modifies the graph represented by the graph rooted by given Image instance and described by the given GraphPlan instance.
Note that only the children described by the given GraphPlan will be consulted.
 Icon[] modifyImageableGraphFor(java.lang.String graphPlanName, ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.
 Image modifySelectGraphFor(GraphPlan graphPlan, Image originImage)
          Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance and described by the given GraphPlan instance.
 ImageGraph modifySelectGraphFor(GraphPlan graphPlan, ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.
 Image modifySelectGraphFor(Image originImage)
          Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance.
 ImageGraph modifySelectGraphFor(ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.
 Image modifySelectGraphFor(java.lang.String graphPlanName, Image originImage)
          Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance and described by the given GraphPlan instance.
 ImageGraph modifySelectGraphFor(java.lang.String graphPlanName, ImageGraph imageGraph)
          Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.
 Image[] selectAllImageGraphsWith(GraphPlan graphPlan, CollectionFinder finder)
          Returns an array of Image instances found as described by the given GraphPlan and CollectionFinder instances.
 Image[] selectAllImageGraphsWith(java.lang.String graphPlanName, CollectionFinder finder)
          Returns an array of Image instances found as described by the given GraphPlan and CollectionFinder instances.
 Image selectImageGraphFor(GraphPlan graphPlan, Icon originIcon)
          Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable referenced by the given originIcon value.
 Image selectImageGraphFor(GraphPlan graphPlan, java.lang.String imageType, java.lang.String referenceableName)
          Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable with the given referenceableName.
 Image selectImageGraphFor(java.lang.String graphPlanName, Icon originIcon)
          Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable referenced by the given originIcon value.
 Image selectImageGraphFor(java.lang.String graphPlanName, java.lang.String imageType, java.lang.String referenceableName)
          Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable with the given referenceableName.
 Image selectImageGraphWith(GraphPlan graphPlan, ObjectFinder finder)
          Returns an Image instance found as described by the given GraphPlan and ObjectFinder instances.
 Image selectImageGraphWith(java.lang.String graphPlanName, ObjectFinder finder)
          Returns an Image instance found as described by the given GraphPlan and ObjectFinder instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClientSession

public ClientSession getClientSession()

getCommonClient

protected CommonClient getCommonClient()
                                throws NotConnectedException,
                                       ClientSessionException
Throws:
NotConnectedException
ClientSessionException

findIconWith

public Icon findIconWith(ObjectFinder finder)
                  throws GraphException,
                         ClientSessionException
Returns an Icon instance for the Imageable found by the given ObjectFinder instance.
This method will fail if the object found is not ImageableIdentifiable.

Parameters:
finder -
Returns:
an Icon instance identifying the found ImageableIdentifiable instance
Throws:
GraphException
ClientSessionException

findAllIconsWith

public Icon[] findAllIconsWith(CollectionFinder finder)
                        throws GraphException,
                               ClientSessionException
Returns an array of Icon instances for the Imageable objects found by the given CollectionFinder.
This method will fail if the objects found are not ImageableIdentifiable.

Parameters:
finder -
Returns:
an array of Icon instances identifying the found ImageableIdentifiable instances
Throws:
GraphException
ClientSessionException

findAllIconsFor

public Icon[] findAllIconsFor(java.lang.String imageType)
                       throws GraphException,
                              ClientSessionException
Returns an array of Icons for the Imageable objects of given imageType class name.
This method will fail if the objects found are not ImageableIdentifiable.

Parameters:
imageType - the base ImageableIdentifiable class name
Returns:
an array of Icon instances identifying the found ImageableIdentifiable instances
Throws:
GraphException
ClientSessionException

selectAllImageGraphsWith

public Image[] selectAllImageGraphsWith(java.lang.String graphPlanName,
                                        CollectionFinder finder)
                                 throws GraphException,
                                        ClientSessionException
Returns an array of Image instances found as described by the given GraphPlan and CollectionFinder instances.

Parameters:
graphPlanName -
finder -
Returns:
Throws:
GraphException
ClientSessionException

selectAllImageGraphsWith

public Image[] selectAllImageGraphsWith(GraphPlan graphPlan,
                                        CollectionFinder finder)
                                 throws GraphException,
                                        ClientSessionException
Returns an array of Image instances found as described by the given GraphPlan and CollectionFinder instances.

Parameters:
graphPlan -
finder -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphWith

public Image selectImageGraphWith(java.lang.String graphPlanName,
                                  ObjectFinder finder)
                           throws GraphException,
                                  ClientSessionException
Returns an Image instance found as described by the given GraphPlan and ObjectFinder instances.

Parameters:
graphPlanName -
finder -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphWith

public Image selectImageGraphWith(GraphPlan graphPlan,
                                  ObjectFinder finder)
                           throws GraphException,
                                  ClientSessionException
Returns an Image instance found as described by the given GraphPlan and ObjectFinder instances.

Parameters:
graphPlan -
finder -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphFor

public Image selectImageGraphFor(java.lang.String graphPlanName,
                                 Icon originIcon)
                          throws GraphException,
                                 ClientSessionException
Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable referenced by the given originIcon value.

Parameters:
graphPlanName -
originIcon -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphFor

public Image selectImageGraphFor(GraphPlan graphPlan,
                                 Icon originIcon)
                          throws GraphException,
                                 ClientSessionException
Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable referenced by the given originIcon value.

Parameters:
graphPlan -
originIcon -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphFor

public Image selectImageGraphFor(java.lang.String graphPlanName,
                                 java.lang.String imageType,
                                 java.lang.String referenceableName)
                          throws GraphException,
                                 ClientSessionException
Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable with the given referenceableName.

Parameters:
graphPlanName -
imageType -
referenceableName -
Returns:
Throws:
GraphException
ClientSessionException

selectImageGraphFor

public Image selectImageGraphFor(GraphPlan graphPlan,
                                 java.lang.String imageType,
                                 java.lang.String referenceableName)
                          throws GraphException,
                                 ClientSessionException
Returns an Image instance representing the graph defined by the given GraphPlan instance and rooted with the Imageable with the given referenceableName.

Parameters:
graphPlan -
imageType -
referenceableName -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public Image modifySelectGraphFor(Image originImage)
                           throws GraphException,
                                  ClientSessionException
Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance. The resulting graph is returned.

Parameters:
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public Image modifySelectGraphFor(java.lang.String graphPlanName,
                                  Image originImage)
                           throws GraphException,
                                  ClientSessionException
Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance and described by the given GraphPlan instance. The resulting graph is returned.

Parameters:
graphPlanName -
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public Image modifySelectGraphFor(GraphPlan graphPlan,
                                  Image originImage)
                           throws GraphException,
                                  ClientSessionException
Creates a new or modifies an existing Imageable object graph rooted with the given originImage Image instance and described by the given GraphPlan instance. The resulting graph is returned.

Parameters:
graphPlan -
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public ImageGraph modifySelectGraphFor(ImageGraph imageGraph)
                                throws GraphException,
                                       ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.

Parameters:
imageGraph -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public ImageGraph modifySelectGraphFor(java.lang.String graphPlanName,
                                       ImageGraph imageGraph)
                                throws GraphException,
                                       ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.

Parameters:
graphPlanName -
imageGraph -
Returns:
Throws:
GraphException
ClientSessionException

modifySelectGraphFor

public ImageGraph modifySelectGraphFor(GraphPlan graphPlan,
                                       ImageGraph imageGraph)
                                throws GraphException,
                                       ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance, and returns an ImageGraph that represents the changes.

Parameters:
graphPlan -
imageGraph -
Returns:
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon modifyImageableGraphFor(Image originImage)
                             throws GraphException,
                                    ClientSessionException
Creates or modifies the graph represented by the graph rooted by given Image instance.

Parameters:
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon modifyImageableGraphFor(java.lang.String graphPlanName,
                                    Image originImage)
                             throws GraphException,
                                    ClientSessionException
Creates or modifies the graph represented by the graph rooted by given Image instance and described by the given GraphPlan instance.
Note that only the children described by the given GraphPlan will be consulted.

Parameters:
graphPlanName -
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon modifyImageableGraphFor(GraphPlan graphPlan,
                                    Image originImage)
                             throws GraphException,
                                    ClientSessionException
Creates or modifies the graph represented by the graph rooted by given Image instance and described by the given GraphPlan instance.
Note that only the children described by the given GraphPlan will be consulted.

Parameters:
graphPlan -
originImage -
Returns:
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon[] modifyImageableGraphFor(ImageGraph imageGraph)
                               throws GraphException,
                                      ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.

Parameters:
imageGraph -
Returns:
an array of Icon instances referencing the origin Imageable instances
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon[] modifyImageableGraphFor(java.lang.String graphPlanName,
                                      ImageGraph imageGraph)
                               throws GraphException,
                                      ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.

Parameters:
graphPlanName -
imageGraph -
Returns:
an array of Icon instances referencing the origin Imageable instances
Throws:
GraphException
ClientSessionException

modifyImageableGraphFor

public Icon[] modifyImageableGraphFor(GraphPlan graphPlan,
                                      ImageGraph imageGraph)
                               throws GraphException,
                                      ClientSessionException
Creates or modifies the graph represented by the given ImageGraph instance.
It is expected that the given ImageGraph instance may have one or more origin Image instances in the List of origins (ImageGraph.getOriginImages()).
Also note that if an Image instance in the ImageGraph is not an origin, and is not a child (at any depth) of any of the available origin Image instances, it will be ignored.

Parameters:
graphPlan -
imageGraph -
Returns:
an array of Icon instances referencing the origin Imageable instances
Throws:
GraphException
ClientSessionException

deleteAllImageablesFor

public void deleteAllImageablesFor(java.util.List icons)
                            throws GraphException,
                                   ClientSessionException
Deletes all Imageable instances referenced by the given List of Icon instances.
This method will ignore Icon instances that reference dependent objects, unlike the deleteObjectFor method.

Parameters:
icons -
Throws:
GraphException
ClientSessionException

deleteImageableFor

public void deleteImageableFor(Icon icon)
                        throws GraphException,
                               ClientSessionException
Delete the Imageable instance referenced by the given Icon instance.
This method will fail if the given Icon instance refers to a dependent object.
Note this method cannot dereference a dependent object as lists are not ordered and there would be no guarantee the object was removed.

Parameters:
icon -
Throws:
GraphException
ClientSessionException

invokeImageableGraphWith

public Image invokeImageableGraphWith(java.lang.String graphPlanName,
                                      Action action,
                                      java.lang.String resultPlanName)
                               throws GraphException,
                                      ClientSessionException
Invokes the given Action instance described the given graphPlan GraphPlan instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.

Parameters:
graphPlanName -
action -
resultPlanName -
Returns:
Throws:
GraphException
ClientSessionException

invokeImageableGraphWith

public Image invokeImageableGraphWith(GraphPlan graphPlan,
                                      Action action,
                                      GraphPlan resultPlan)
                               throws GraphException,
                                      ClientSessionException
Invokes the given Action instance described the given graphPlan GraphPlan instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.

Parameters:
graphPlan -
action -
resultPlan -
Returns:
Throws:
GraphException
ClientSessionException

invokeImageableGraphWith

public Image invokeImageableGraphWith(Action action,
                                      java.lang.String resultPlanName)
                               throws GraphException,
                                      ClientSessionException
Invokes the given Action instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.

Parameters:
action -
resultPlanName -
Returns:
Throws:
GraphException
ClientSessionException

invokeImageableGraphWith

public Image invokeImageableGraphWith(Action action,
                                      GraphPlan resultPlan)
                               throws GraphException,
                                      ClientSessionException
Invokes the given Action instance and returns an Image instance rooted by the result Imageable described by the given resultPlan GraphPlan instance.

Parameters:
action -
resultPlan -
Returns:
Throws:
GraphException
ClientSessionException

invokeImageableGraphWith

public Icon invokeImageableGraphWith(Action action)
                              throws GraphException,
                                     ClientSessionException
Invokes the given Action instance and returns an Icon instance for the resulting ImageableIdentifiable.
If the given Action instance has a dirty Image instance child that represents an ImageableIdentifiable object, the ImageableIdentifiable will be modified before the action is invoked.

Parameters:
action -
Returns:
Throws:
GraphException
ClientSessionException


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.