com.bigbross.bossa.resource
Class Resource

java.lang.Object
  extended bycom.bigbross.bossa.resource.Resource
All Implemented Interfaces:
Container, Serializable

public class Resource
extends Object
implements Container, Serializable

This class represents a single resource or a group of resources. A group of resources may include or exclude other resources.

Author:
BigBross Team
See Also:
Serialized Form

Method Summary
 boolean contains(Resource resource)
          Determines if a resource is contained in this resource.
 boolean exclude(Resource resource)
          Excludes a resource from this resource.
 boolean excludeImpl(Resource resource, boolean notify)
          Excludes a resource from this resource.
 Set getExcludes()
          Returns the excludes list of this resource.
 String getId()
          Returns the resource identifier.
 Set getIncludes()
          Returns the includes list of this resource.
 boolean include(Resource resource)
          Includes a resource in this resource.
 boolean includeImpl(Resource resource, boolean notify)
          Includes a resource in this resource.
 boolean isGroup()
          Returns true if this resource includes any other resources, so it is a group.
 void remove(Resource resource)
          Removes a resource from this resource.
 void removeImpl(Resource resource, boolean notify)
          Removes a resource from this resource.
 String toString()
          Returns a string with the resource identifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getId

public String getId()
Returns the resource identifier.

Returns:
the resource id.

isGroup

public boolean isGroup()
Returns true if this resource includes any other resources, so it is a group.

Returns:
true if it is a group, false otherwise.

getIncludes

public Set getIncludes()
Returns the includes list of this resource.

Returns:
the includes list of this resource.

getExcludes

public Set getExcludes()
Returns the excludes list of this resource.

Returns:
the excludes list of this resource.

include

public boolean include(Resource resource)
                throws BossaException
Includes a resource in this resource. Removes the resource from the excludes list if needed.

Parameters:
resource - the resource to be included.
Returns:
false if resource includes this resource, true otherwise.
Throws:
PersistenceException - if an error occours when making the execution of this method persistent.
BossaException

includeImpl

public boolean includeImpl(Resource resource,
                           boolean notify)
Includes a resource in this resource. Removes the resource from the excludes list if needed.

This method does not create a transaction in the prevalent system. The execution of this method will not be persistent unless it is called inside an appropriate transaction.

Parameters:
resource - the resource to be included.
notify - if this operation should be notified.
Returns:
false if resource includes this resource, true otherwise.

exclude

public boolean exclude(Resource resource)
                throws BossaException
Excludes a resource from this resource. Removes the resource from the includes list if needed.

Parameters:
resource - the resource to be excluded.
Returns:
false if resource excludes this resource, true otherwise.
Throws:
PersistenceException - if an error occours when making the execution of this method persistent.
BossaException

excludeImpl

public boolean excludeImpl(Resource resource,
                           boolean notify)
Excludes a resource from this resource. Removes the resource from the includes list if needed.

This method does not create a transaction in the prevalent system. The execution of this method will not be persistent unless it is called inside an appropriate transaction.

Parameters:
resource - the resource to be excluded.
notify - if this operation should be notified.
Returns:
false if resource excludes this resource, true otherwise.

remove

public void remove(Resource resource)
            throws BossaException
Removes a resource from this resource. Effectively removes it from any of the includes or excludes list.

Parameters:
resource - the resource to be removed.
Throws:
PersistenceException - if an error occours when making the execution of this method persistent.
BossaException

removeImpl

public void removeImpl(Resource resource,
                       boolean notify)
Removes a resource from this resource. Effectively removes it from any of the includes or excludes list.

This method does not create a transaction in the prevalent system. The execution of this method will not be persistent unless it is called inside an appropriate transaction.

Parameters:
resource - the resource to be removed.
notify - if this operation should be notified.

contains

public boolean contains(Resource resource)
Determines if a resource is contained in this resource.

Specified by:
contains in interface Container
Parameters:
resource - the resource to be looked for.
Returns:
true if the resource is found, false otherwise.

toString

public String toString()
Returns a string with the resource identifier.

Returns:
a string representation of this resource.


Copyright © 2003,2004 OpenBR Sistemas S/C Ltda.