Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acs.damsel.srvr.collection
Class Collection  view Collection download Collection.java

java.lang.Object
  extended byorg.acs.damsel.srvr.collection.Collection
All Implemented Interfaces:
java.io.Serializable

public class Collection
extends java.lang.Object
implements java.io.Serializable

Class Name: Collection

Description: This class provides services to interface with the database by setting and getting any collection information including assets located within a collection. Instances maintain a copy of all information stored in the database about a collection.

Version:
1.1

Field Summary
 java.lang.String collectionName
           
 java.lang.String description
           
 java.lang.String groupName
           
private static org.apache.log4j.Logger log
           
 java.lang.String ownerName
           
 java.lang.String permissionID
           
 java.lang.String repositoryName
           
 java.lang.String schemaName
           
 
Constructor Summary
Collection()
          Default constructor.
Collection(java.lang.String name)
          Constructor with name as parameter.
 
Method Summary
 boolean addAsset(org.acs.damsel.srvr.asset.Asset asset)
          Adds the specified asset to the database and associates it with this collection.
 boolean contains(org.acs.damsel.srvr.asset.Asset asset)
          Checks if current collection contains specified asset.
 java.util.Enumeration enumerator()
           
 boolean equals(java.lang.Object col)
          Determine whether this Object is semantically equal to another Object.
 CollectionView getAllAssets()
          Returns a CollectionView containing all of the Assets associated with this Collection.
 org.acs.damsel.srvr.asset.Asset getAsset(java.lang.String fileName)
          Returns the asset with the specified fileName
 java.lang.String getCollectionName()
           
 java.lang.String getDescription()
           
 java.lang.String getGroupName()
           
 java.lang.String getOwnerName()
           
 java.lang.String getPermissionID()
           
 java.lang.String getRepositoryName()
           
 java.lang.String getSchemaName()
           
 boolean isEmpty()
          Checks if collection is empty.
 boolean isPublic()
          Check if the Collection can be viewed by the default user (definition of public)
 boolean removeAsset(org.acs.damsel.srvr.asset.Asset asset)
          Removes the specified asset from this collection and the database by searching for the fileName
 void setCollectionName(java.lang.String collectionName)
           
 void setDescription(java.lang.String description)
           
 void setGroupName(java.lang.String groupName)
           
 void setOwnerName(java.lang.String ownerName)
           
 void setPermissionID(java.lang.String permissionID)
           
 void setRepositoryName(java.lang.String repositoryName)
           
 void setSchemaName(java.lang.String schemaName)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collectionName

public java.lang.String collectionName

schemaName

public java.lang.String schemaName

ownerName

public java.lang.String ownerName

description

public java.lang.String description

repositoryName

public java.lang.String repositoryName

permissionID

public java.lang.String permissionID

groupName

public java.lang.String groupName

log

private static org.apache.log4j.Logger log
Constructor Detail

Collection

public Collection()
Default constructor. Initializes the collection's instance variables to null and sets up the default configuration.


Collection

public Collection(java.lang.String name)
Constructor with name as parameter. NOTE: Only sets the name of the collection to be name! Does not grab from the database the named collection.

Method Detail

addAsset

public boolean addAsset(org.acs.damsel.srvr.asset.Asset asset)
Adds the specified asset to the database and associates it with this collection. The asset will not be added if it already exists in the database. If it is already associated with the given collection, then it won't be associated twice.


getAsset

public org.acs.damsel.srvr.asset.Asset getAsset(java.lang.String fileName)
Returns the asset with the specified fileName


getAllAssets

public CollectionView getAllAssets()
Returns a CollectionView containing all of the Assets associated with this Collection. CollectionView will be empty if this Collection's collectionName is not found in the Repository (db's CollectionTable) (or if the collectionName is blank!!)


removeAsset

public boolean removeAsset(org.acs.damsel.srvr.asset.Asset asset)
Removes the specified asset from this collection and the database by searching for the fileName


size

public int size()

isEmpty

public boolean isEmpty()
                throws org.acs.damsel.srvr.schema.SchemaException,
                       java.sql.SQLException
Checks if collection is empty.


isPublic

public boolean isPublic()
                 throws java.sql.SQLException
Check if the Collection can be viewed by the default user (definition of public)


contains

public boolean contains(org.acs.damsel.srvr.asset.Asset asset)
Checks if current collection contains specified asset.


getCollectionName

public java.lang.String getCollectionName()

setCollectionName

public void setCollectionName(java.lang.String collectionName)

enumerator

public java.util.Enumeration enumerator()

equals

public boolean equals(java.lang.Object col)
Description copied from class: java.lang.Object
Determine whether this Object is semantically equal to another Object.

There are some fairly strict requirements on this method which subclasses must follow:

  • It must be transitive. If a.equals(b) and b.equals(c), then a.equals(c) must be true as well.
  • It must be symmetric. a.equals(b) and b.equals(a) must have the same value.
  • It must be reflexive. a.equals(a) must always be true.
  • It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
  • a.equals(null) must be false.
  • It must be consistent with hashCode(). That is, a.equals(b) must imply a.hashCode() == b.hashCode(). The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.

This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for a.equals(b) to be true even though a.getClass() != b.getClass(). Also, it is typical to never cause a java.lang.NullPointerException.

In general, the Collections API (java.util) use the equals method rather than the == operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.

The default implementation returns this == o.


getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getGroupName

public java.lang.String getGroupName()

setGroupName

public void setGroupName(java.lang.String groupName)

getOwnerName

public java.lang.String getOwnerName()

setOwnerName

public void setOwnerName(java.lang.String ownerName)

getPermissionID

public java.lang.String getPermissionID()

setPermissionID

public void setPermissionID(java.lang.String permissionID)

getRepositoryName

public java.lang.String getRepositoryName()

setRepositoryName

public void setRepositoryName(java.lang.String repositoryName)

getSchemaName

public java.lang.String getSchemaName()

setSchemaName

public void setSchemaName(java.lang.String schemaName)