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

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

public class SocketJobLibrarian
extends java.lang.Object
implements JobLibrarian

A front end to the JobLibrary. Handles locking, merging, checkout, etc. Library clients should use this class to access the library; administrators can use the library directly. Also encapsulates any network transfers necessary.


Constructor Summary
SocketJobLibrarian(java.lang.String portedServerAddress)
           
SocketJobLibrarian(java.lang.String portedServerAddress, boolean loadUnitLookups)
           
SocketJobLibrarian(java.lang.String serverAddress, int serverPort)
           
SocketJobLibrarian(java.lang.String serverAddress, int serverPort, boolean loadUnitLookups)
           
 
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 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 checkoutHeader(java.lang.String jobNumber)
          Check out a job header for modifications.
 CheckedOutJob checkoutJob(java.lang.String jobNumber)
          Check out a job for modifications.
 void close()
          Close down for the day.
 void createJob(java.lang.String newJobName)
          Create a new job in the library.
 void fireJobChanged(java.lang.String jobNumber)
          Fire a job change 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 of 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)
           
 void verifyCompatibility()
          Verify compatibility with Hub.
 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

SocketJobLibrarian

public SocketJobLibrarian(java.lang.String portedServerAddress,
                          boolean loadUnitLookups)
                   throws JobLibraryException
Throws:
JobLibraryException

SocketJobLibrarian

public SocketJobLibrarian(java.lang.String portedServerAddress)
                   throws JobLibraryException
Throws:
JobLibraryException

SocketJobLibrarian

public SocketJobLibrarian(java.lang.String serverAddress,
                          int serverPort)
                   throws JobLibraryException
Throws:
JobLibraryException

SocketJobLibrarian

public SocketJobLibrarian(java.lang.String serverAddress,
                          int serverPort,
                          boolean loadUnitLookups)
                   throws JobLibraryException
Throws:
JobLibraryException
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

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

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

verifyCompatibility

public void verifyCompatibility()
                         throws JobLibraryException
Verify compatibility with Hub.

Throws:
JobLibraryException

fireJobChanged

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

Specified by:
fireJobChanged 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
Description copied from interface: JobLibrarian
Close down for the day.

Specified by:
close in interface JobLibrarian
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 of 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