com.partnersoft.v3x.apps.Staker.server
Class LocalJobLibrarian

java.lang.Object
  extended by com.partnersoft.v3x.apps.Staker.server.LocalJobLibrarian
All Implemented Interfaces:
JobLibrarian

public class LocalJobLibrarian
extends java.lang.Object
implements JobLibrarian

A friendly local librarian, in the same VM as the JobLibrary.


Constructor Summary
LocalJobLibrarian(JobLibrary daLibrary)
           
 
Method Summary
 void addJob(Job newJob)
          Add a new job to the library.
 void addJobLibraryListener(JobLibraryListener nosey)
           
 java.util.Iterator allHeaders()
          Get a list of all the job headers in the library.
 java.util.Iterator allJobNumbers()
          Get a list of all the job numbers.
 java.util.ArrayList allJobNumbersList()
          Get a list of all the job numbers.
 java.util.Iterator allJobsAssignedTo(java.lang.String stakerName)
          Get a list of all the job numbers assigned to the given staker
 void checkinAndRemember(java.lang.String holder, CheckedOutJobHeader header)
           
 void checkinHeader(CheckedOutJobHeader header)
          Check in a job header; merges it with any other versions in the library.
 void checkinJob(CheckedOutJob job)
          Check in job with modifications.
 CheckedOutJobHeader checkoutAndRemember(java.lang.String holder, java.lang.String jobNumber)
           
 CheckedOutJobHeader checkoutHeader(java.lang.String jobNumber)
          Check out a job header for modifications.
 CheckedOutJobHeader checkoutHeader(java.lang.String jobNumber, java.lang.String customer)
           
 CheckedOutJob checkoutJob(java.lang.String jobNumber)
          Check out a job for modifications.
 CheckedOutJobHeader checkoutLatestAndRemember(java.lang.String holder, java.lang.String jobNumber)
           
 void close()
          Close 'er down.
 void createJob(java.lang.String newJobName)
          Create a new job in the library.
 void fireJobChanged(java.lang.String jobNumber)
          Fires a changed event for the named job.
 void forceReleaseJob(java.lang.String jobNumber)
          Release job; this will eject the checkout for that job - use with caution.
 boolean jobExists(java.lang.String jobNumber)
          Check if a job exists in the library.
 java.lang.String jobStatus(java.lang.String jobNumber)
          Get status for a job.
 java.lang.Object processCustomRequest(CustomLibraryRequest request)
          Process a special request.
 void releaseHeader(CheckedOutJobHeader header)
          Release a job header from checkout; doesn't modify.
 void releaseJob(CheckedOutJob job)
          Release job - checks in without modifications.
 void removeJobLibraryListener(JobLibraryListener nosey)
           
 JobHeader viewHeader(java.lang.String jobNumber)
          See the job header corresponding to the job number.
 Job viewJob(java.lang.String jobNumber)
          See the job corresponding to the job number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalJobLibrarian

public LocalJobLibrarian(JobLibrary daLibrary)
Method Detail

allHeaders

public java.util.Iterator allHeaders()
                              throws JobLibraryException
Get a list of all the job headers in the library.

Specified by:
allHeaders in interface JobLibrarian
Throws:
JobLibraryException

allJobNumbers

public java.util.Iterator allJobNumbers()
                                 throws JobLibraryException
Get a list of all the job numbers.

Specified by:
allJobNumbers in interface JobLibrarian
Throws:
JobLibraryException

allJobNumbersList

public java.util.ArrayList allJobNumbersList()
                                      throws JobLibraryException
Get a list of all the job numbers.

Specified by:
allJobNumbersList in interface JobLibrarian
Throws:
JobLibraryException

allJobsAssignedTo

public java.util.Iterator allJobsAssignedTo(java.lang.String stakerName)
                                     throws JobLibraryException
Get a list of all the job numbers assigned to the given staker

Specified by:
allJobsAssignedTo in interface JobLibrarian
Throws:
JobLibraryException

addJob

public void addJob(Job newJob)
            throws JobLibraryException
Add a new job to the library.

Specified by:
addJob in interface JobLibrarian
Throws:
JobLibraryException

createJob

public void createJob(java.lang.String newJobName)
               throws JobLibraryException
Create a new job in the library.

Specified by:
createJob in interface JobLibrarian
Throws:
JobLibraryException

viewHeader

public JobHeader viewHeader(java.lang.String jobNumber)
                     throws JobLibraryException
See the job header corresponding to the job number.

Specified by:
viewHeader in interface JobLibrarian
Throws:
JobLibraryException

checkoutHeader

public CheckedOutJobHeader checkoutHeader(java.lang.String jobNumber)
                                   throws JobLibraryException
Check out a job header for modifications.

Specified by:
checkoutHeader in interface JobLibrarian
Throws:
JobLibraryException

checkoutHeader

public CheckedOutJobHeader checkoutHeader(java.lang.String jobNumber,
                                          java.lang.String customer)
                                   throws JobLibraryException
Throws:
JobLibraryException

releaseHeader

public void releaseHeader(CheckedOutJobHeader header)
                   throws JobLibraryException
Release a job header from checkout; doesn't modify.

Specified by:
releaseHeader in interface JobLibrarian
Throws:
JobLibraryException

checkinHeader

public void checkinHeader(CheckedOutJobHeader header)
                   throws JobLibraryException
Check in a job header; merges it with any other versions in the library.

Specified by:
checkinHeader in interface JobLibrarian
Throws:
JobLibraryException

viewJob

public Job viewJob(java.lang.String jobNumber)
            throws JobLibraryException
See the job corresponding to the job number.

Specified by:
viewJob in interface JobLibrarian
Throws:
JobLibraryException

checkoutJob

public CheckedOutJob checkoutJob(java.lang.String jobNumber)
                          throws JobLibraryException
Check out a job for modifications. This grants an exclusive lock.

Specified by:
checkoutJob in interface JobLibrarian
Throws:
JobLibraryException

releaseJob

public void releaseJob(CheckedOutJob job)
                throws JobLibraryException
Release job - checks in without modifications.

Specified by:
releaseJob in interface JobLibrarian
Throws:
JobLibraryException

forceReleaseJob

public void forceReleaseJob(java.lang.String jobNumber)
                     throws JobLibraryException
Release job; this will eject the checkout for that job - use with caution.

Specified by:
forceReleaseJob in interface JobLibrarian
Throws:
JobLibraryException

fireJobChanged

public void fireJobChanged(java.lang.String jobNumber)
                    throws JobLibraryException
Fires a changed event for the named job.

Specified by:
fireJobChanged in interface JobLibrarian
Throws:
JobLibraryException

checkinJob

public void checkinJob(CheckedOutJob job)
                throws JobLibraryException
Check in job with modifications. Merges header with current version in library; replaces other job information with new copy.

Specified by:
checkinJob in interface JobLibrarian
Throws:
JobLibraryException

processCustomRequest

public java.lang.Object processCustomRequest(CustomLibraryRequest request)
                                      throws JobLibraryException
Process a special request.

Specified by:
processCustomRequest in interface JobLibrarian
Throws:
JobLibraryException

close

public void close()
           throws JobLibraryException
Close 'er down.

Specified by:
close in interface JobLibrarian
Throws:
JobLibraryException

checkoutAndRemember

public CheckedOutJobHeader checkoutAndRemember(java.lang.String holder,
                                               java.lang.String jobNumber)
                                        throws JobLibraryException
Throws:
JobLibraryException

checkoutLatestAndRemember

public CheckedOutJobHeader checkoutLatestAndRemember(java.lang.String holder,
                                                     java.lang.String jobNumber)
                                              throws JobLibraryException
Throws:
JobLibraryException

checkinAndRemember

public void checkinAndRemember(java.lang.String holder,
                               CheckedOutJobHeader header)
                        throws JobLibraryException
Throws:
JobLibraryException

jobExists

public boolean jobExists(java.lang.String jobNumber)
                  throws JobLibraryException
Check if a job exists in the library.

Specified by:
jobExists in interface JobLibrarian
Throws:
JobLibraryException

jobStatus

public java.lang.String jobStatus(java.lang.String jobNumber)
                           throws JobLibraryException
Get status for a job.

Specified by:
jobStatus in interface JobLibrarian
Throws:
JobLibraryException

addJobLibraryListener

public void addJobLibraryListener(JobLibraryListener nosey)
Specified by:
addJobLibraryListener in interface JobLibrarian

removeJobLibraryListener

public void removeJobLibraryListener(JobLibraryListener nosey)
Specified by:
removeJobLibraryListener in interface JobLibrarian