com.sun.slamd.db
Class JobFolder

java.lang.Object
  extended bycom.sun.slamd.db.JobFolder

public class JobFolder
extends java.lang.Object

This class defines a structure for storing information about a job folder. This includes the name of the folder, the jobs and optimizing jobs that it contains, the parent and child folders, and the permissions associated with it.


Field Summary
static java.lang.String ELEMENT_CHILDREN
          The name of the enocded element that holds the names of the child folders.
static java.lang.String ELEMENT_DESCRIPTION
          The name of the enocded element that holds the description for this folder.
static java.lang.String ELEMENT_FILE_NAMES
          The name of the encoded element that holds the names of the uploaded files.
static java.lang.String ELEMENT_IS_VIRTUAL
          The name of the encoded element that indicates whether this is a virtual folder.
static java.lang.String ELEMENT_JOB_IDS
          The name of the enocded element that holds the job IDs.
static java.lang.String ELEMENT_NAME
          The name of the enocded element that holds the name of this job folder.
static java.lang.String ELEMENT_OPTIMIZING_JOB_IDS
          The name of the enocded element that holds the optimizing job IDs.
static java.lang.String ELEMENT_PARENT
          The name of the enocded element that holds the name of the parent folder.
static java.lang.String ELEMENT_PERMISSIONS
          The name of the enocded element that holds the permissions.
 
Constructor Summary
JobFolder(java.lang.String folderName, boolean isVirtual, java.lang.String parentName, java.lang.String[] childNames, java.lang.String description, java.lang.String[] jobIDs, java.lang.String[] optimizingJobIDs, java.lang.String[] fileNames, SLAMDPermission[] permissions)
          Creates a new job folder with the provided information.
 
Method Summary
 void addChildName(java.lang.String childName)
          Adds the specified folder as a child of this folder.
 void addFileName(java.lang.String fileName)
          Adds the specified file name to the set of uploaded files for this job folder.
 void addJobID(java.lang.String jobID)
          Adds the provided job ID to the set of jobs associated with this folder.
 void addOptimizingJobID(java.lang.String optimizingJobID)
          Adds the provided optimizing job ID to the set of optimizing jobs associated with this folder.
static JobFolder decode(byte[] encodedFolder)
          Decodes the provided byte array as a job folder.
 byte[] encode()
          Encodes the information in this job folder to a byte array.
 java.lang.String[] getChildNames()
          Retrieves the names of the job folders that are children of this folder.
 java.lang.String getDescription()
          Retrieves the description for this job folder.
 java.lang.String[] getFileNames()
          Retrieves the names of the uploaded files associated with this job folder.
 java.lang.String getFolderName()
          Retrieves the name of this job folder.
 java.lang.String[] getJobIDs()
          Retrieves the job IDs of all jobs associated with this folder.
 java.lang.String[] getOptimizingJobIDs()
          Retrieves the optimizing job IDs of all optimizing jobs associated with this folder.
 java.lang.String getParentName()
          Retrieves the name of the job folder that is the parent of this job folder.
 SLAMDPermission[] getPermissions()
          Retrieves the set of permissions associated with this job folder.
 boolean isVirtual()
          Indicates whether this is a virtual job folder.
 void removeChildName(java.lang.String childName)
          Removes the specified folder as a child of this folder.
 void removeFileName(java.lang.String fileName)
          Removes the specified file name from the set of uploaded files for this job folder.
 void removeJobID(java.lang.String jobID)
          Removes the provided job ID from the set of jobs associated with this folder.
 void removeOptimizingJobID(java.lang.String optimizingJobID)
          Removes the provided optimizing job ID from the set of optimizing jobs associated with this folder.
 void removePermission(java.lang.String permissionName)
          Removes the permission with the specified name from this job folder.
 void setChildNames(java.lang.String[] childNames)
          Specifies the names of the job folders that are children of this folder.
 void setDescription(java.lang.String description)
          Specifies the description for this job folder.
 void setFileNames(java.lang.String[] fileNames)
          Specifies the names of the uploaded files associated with this job folder.
 void setJobIDs(java.lang.String[] jobIDs)
          Specifies the job IDs of all jobs associated with this folder.
 void setOptimzizingJobIDs(java.lang.String[] optimizingJobIDs)
          Specifies the optimizing job IDs of all optimizing jobs associated with this folder.
 void setPermission(SLAMDPermission permission)
          Sets the provided permisson for this group.
 void setPermissions(SLAMDPermission[] permissions)
          Specifies the set of permissions to use for this folder.
 boolean userHasPermission(SLAMDUser user, java.lang.String permissionName)
          Determines whether the provided user has the specified permission for this job folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
The name of the enocded element that holds the name of this job folder.

See Also:
Constant Field Values

ELEMENT_IS_VIRTUAL

public static final java.lang.String ELEMENT_IS_VIRTUAL
The name of the encoded element that indicates whether this is a virtual folder.

See Also:
Constant Field Values

ELEMENT_PARENT

public static final java.lang.String ELEMENT_PARENT
The name of the enocded element that holds the name of the parent folder.

See Also:
Constant Field Values

ELEMENT_CHILDREN

public static final java.lang.String ELEMENT_CHILDREN
The name of the enocded element that holds the names of the child folders.

See Also:
Constant Field Values

ELEMENT_DESCRIPTION

public static final java.lang.String ELEMENT_DESCRIPTION
The name of the enocded element that holds the description for this folder.

See Also:
Constant Field Values

ELEMENT_JOB_IDS

public static final java.lang.String ELEMENT_JOB_IDS
The name of the enocded element that holds the job IDs.

See Also:
Constant Field Values

ELEMENT_OPTIMIZING_JOB_IDS

public static final java.lang.String ELEMENT_OPTIMIZING_JOB_IDS
The name of the enocded element that holds the optimizing job IDs.

See Also:
Constant Field Values

ELEMENT_FILE_NAMES

public static final java.lang.String ELEMENT_FILE_NAMES
The name of the encoded element that holds the names of the uploaded files.

See Also:
Constant Field Values

ELEMENT_PERMISSIONS

public static final java.lang.String ELEMENT_PERMISSIONS
The name of the enocded element that holds the permissions.

See Also:
Constant Field Values
Constructor Detail

JobFolder

public JobFolder(java.lang.String folderName,
                 boolean isVirtual,
                 java.lang.String parentName,
                 java.lang.String[] childNames,
                 java.lang.String description,
                 java.lang.String[] jobIDs,
                 java.lang.String[] optimizingJobIDs,
                 java.lang.String[] fileNames,
                 SLAMDPermission[] permissions)
Creates a new job folder with the provided information.

Parameters:
folderName - The name of this job folder.
isVirtual - Indicates whether this is a virtual job folder.
parentName - The name of the folder that is the parent of this job folder.
childNames - The names of the folders that are children of this job folder.
description - The description for this job folder.
jobIDs - The job IDs of the jobs stored in this folder.
optimizingJobIDs - The job IDs of the optimizing jobs stored in this folder.
fileNames - The names of the uploaded files associated with this folder.
permissions - The set of permissions that have been granted for this folder.
Method Detail

getFolderName

public java.lang.String getFolderName()
Retrieves the name of this job folder.

Returns:
The name of this job folder.

isVirtual

public boolean isVirtual()
Indicates whether this is a virtual job folder.

Returns:
true if this is a virtual job folder, or false if it is a real job folder.

getParentName

public java.lang.String getParentName()
Retrieves the name of the job folder that is the parent of this job folder.

Returns:
The name of the parent job folder, or null if it is a top-level folder.

getChildNames

public java.lang.String[] getChildNames()
Retrieves the names of the job folders that are children of this folder.

Returns:
The names of the job folders that are children of this folder.

setChildNames

public void setChildNames(java.lang.String[] childNames)
Specifies the names of the job folders that are children of this folder.

Parameters:
childNames - The names of the job folders that are children of this folder.

addChildName

public void addChildName(java.lang.String childName)
Adds the specified folder as a child of this folder.

Parameters:
childName - The name of the job folder to add as a child of this folder.

removeChildName

public void removeChildName(java.lang.String childName)
Removes the specified folder as a child of this folder.

Parameters:
childName - The name of the job folder to remove from the set of children for this folder.

getDescription

public java.lang.String getDescription()
Retrieves the description for this job folder.

Returns:
The description for this job folder.

setDescription

public void setDescription(java.lang.String description)
Specifies the description for this job folder.

Parameters:
description - The description for this job folder.

getJobIDs

public java.lang.String[] getJobIDs()
Retrieves the job IDs of all jobs associated with this folder.

Returns:
The job IDs of all jobs associated with this folder.

setJobIDs

public void setJobIDs(java.lang.String[] jobIDs)
Specifies the job IDs of all jobs associated with this folder.

Parameters:
jobIDs - The job IDs of all jobs associated with this folder.

addJobID

public void addJobID(java.lang.String jobID)
Adds the provided job ID to the set of jobs associated with this folder.

Parameters:
jobID - The job ID to add to the set of jobs associated with this folder.

removeJobID

public void removeJobID(java.lang.String jobID)
Removes the provided job ID from the set of jobs associated with this folder.

Parameters:
jobID - The job ID to remove from the set of jobs associated with this folder.

getOptimizingJobIDs

public java.lang.String[] getOptimizingJobIDs()
Retrieves the optimizing job IDs of all optimizing jobs associated with this folder.

Returns:
The optimizing job IDs of all optimizing jobs associated with this folder.

setOptimzizingJobIDs

public void setOptimzizingJobIDs(java.lang.String[] optimizingJobIDs)
Specifies the optimizing job IDs of all optimizing jobs associated with this folder.

Parameters:
optimizingJobIDs - The optimizing job IDs of all optimizing jobs associated with this folder.

addOptimizingJobID

public void addOptimizingJobID(java.lang.String optimizingJobID)
Adds the provided optimizing job ID to the set of optimizing jobs associated with this folder.

Parameters:
optimizingJobID - The optimizing job ID to add to the set of optimizing jobs associated with this folder.

removeOptimizingJobID

public void removeOptimizingJobID(java.lang.String optimizingJobID)
Removes the provided optimizing job ID from the set of optimizing jobs associated with this folder.

Parameters:
optimizingJobID - The optimizing job ID to remove from the set of optimizing jobs associated with this folder.

getFileNames

public java.lang.String[] getFileNames()
Retrieves the names of the uploaded files associated with this job folder.

Returns:
The names of the uploaded files associated with this job folder.

setFileNames

public void setFileNames(java.lang.String[] fileNames)
Specifies the names of the uploaded files associated with this job folder.

Parameters:
fileNames - The names of the uploaded files associated with this job folder.

addFileName

public void addFileName(java.lang.String fileName)
Adds the specified file name to the set of uploaded files for this job folder.

Parameters:
fileName - The name of the file to add to the uploaded files for this job folder.

removeFileName

public void removeFileName(java.lang.String fileName)
Removes the specified file name from the set of uploaded files for this job folder.

Parameters:
fileName - The name of the file to remove from the set of uploaded files for this job folder.

getPermissions

public SLAMDPermission[] getPermissions()
Retrieves the set of permissions associated with this job folder.

Returns:
The set of permissions associated with this job folder.

userHasPermission

public boolean userHasPermission(SLAMDUser user,
                                 java.lang.String permissionName)
Determines whether the provided user has the specified permission for this job folder.

Parameters:
user - The user for which to make the determination.
permissionName - The name of the permission to check for the provided user.
Returns:
true if the user has the specified permission or false if not.

setPermissions

public void setPermissions(SLAMDPermission[] permissions)
Specifies the set of permissions to use for this folder.

Parameters:
permissions - The set of permissions to use for this folder.

setPermission

public void setPermission(SLAMDPermission permission)
Sets the provided permisson for this group. If a permission already exists with the provided name, then it will be replaced, otherwise it will be added.

Parameters:
permission - The permission to set for this folder.

removePermission

public void removePermission(java.lang.String permissionName)
Removes the permission with the specified name from this job folder.

Parameters:
permissionName - The name of the permission to remove from this folder.

encode

public byte[] encode()
Encodes the information in this job folder to a byte array.

Returns:
The byte array containing the encoded job folder.

decode

public static JobFolder decode(byte[] encodedFolder)
                        throws DecodeException
Decodes the provided byte array as a job folder.

Parameters:
encodedFolder - The byte array containing the encoded folder data.
Returns:
The decoded job folder.
Throws:
DecodeException - If a problem occurs while attempting to decode the job folder.