|
|||||||||
Home >> All >> com >> flexstor >> flexdbserver >> services >> [ checkincheckout overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
com.flexstor.flexdbserver.services.checkincheckout
Class CheckOutService

java.lang.Objectcom.flexstor.flexdbserver.services.checkincheckout.CheckOutService
- All Implemented Interfaces:
- com.flexstor.flexdbserver.services.Service, com.flexstor.common.threadmgr.ThreadCallbackI
- public class CheckOutService
- extends java.lang.Object
- implements com.flexstor.flexdbserver.services.Service, com.flexstor.common.threadmgr.ThreadCallbackI
- extends java.lang.Object
CheckOutService
Checks out and locks a file for modifications.
The CheckOut Service is performed in two steps, depending on whether the check-out location is in the server or in the client's local machine.
- The first step is to change the database status to in-progress and copy the files to the place specified by the client.
- The second step is to update the status in the database to either checked-out (upon success) or checked-in (upon failure); delete the temporary files if the checked-out location is not local to the server; and finally send an email confirmation if requested by the client.
In the case where the checked-out location is local to the client's machine, both steps will be carried on separately; first the client requests to perform the first step of the service; after completion, the client copies the files from the temporary location to the its machine, and finally it calls the service once more to perform the second step.
If the checked-out location is local to the server, the service will complete both steps without the client intervention.
It is very important to call the second step when the checked-out location is local to the client's machine; otherwise the assets' status will remain in-progress permanently.
The CheckOut Service supports the following cases:
1.- Destination is in client machine, preserve resource fork (assume MacBinary will be created)
Create MacBinary in temp location specified by client2.- Destination is in client machine, do not preserve resource fork
Client then copies file to local machine
Copy data fork in temp location specified by client3.- Destination is in FlexDBServer, prserve resource fork by creating MacBinary
Client then copies file to local machine
Create MacBinary in destination4.- Destination is in FlexDBServer, preserve resource fork by copying data+rsrc fork
Copy data+rsrc fork in destination5.- Destination is in FlexDBServer, do not preserve resource fork
Copy data fork in destination6.- Destination is in another server, preserve resource fork (assume MacBinary will be created)
Create MacBinary in FlexDBServer's temp location7.- Destination is in another server, do not preserve resource fork
NFS copy file to server
NFS copy data fork to server
Input Data Object
com.flexstor.common.data.ActionData
Output Data Object
com.flexstor.common.data.ActionResultProgrammable Properties (passed inside data object)
Global Properties (apply to all assets)
SourceLocation: Full path where files will be checked out; if files are to be checked out to a local machine or another server, this property needs to be set to a directory called after the transaction ID inside the public temp directory.
Data type: String
Legal values: Full path to destination location for checked out files
IsLocationInServer: Used by the service to determine if the checked out location is in another machine or in this server. If checked out location is in this server and KeepResourceFork is true, the service will copy the file to the specified location, preserving the resource fork (defaults to true).
Data type: Boolean
Legal values: true or false
KeepResourceFork: If set to true, the service will preserve the resource fork according to the following rules (defaults to true):
- If IsLocationInServer is true, the file is copied along with its resource fork
- If IsLocationInServer is set to false, a MacBinary file is created to be moved to the remote machine
- Otherwise, the resource fork is ignored
Data type: Boolean
Legal values: true or false
StepNumber: Defines what step of the check-out service is to be performed. It default to 1.
Data type: Integer
Legal values: 1 (check-out, first step) or 2 (check-out, second step)
BadRecordsVector: A Vector containing the list of bad records; this property must be set by the client before calling the second step of the service. This list is the original list sent by the service to the client, plus any update made by the client itself in case a file failed to be copied.
Data type: java.util.Vector
Legal values: A Vector containing CheckOutRecordData objects
ConfirmData: An optional ActionData object to be used for email confirmation.
Data type: com.flexstor.common.data.ActionData
Legal values: A ActionData object with the email address of the sender, subject, cc, and body text included. The CheckOut Service will attach the path to the successful assets at the end of the body.
Specific Properties (apply to each individual asset)
UrlString: An optional html/url path to be added at the end of the body of the MimeData.
Data type: java.lang.String
Legal values: The path of the checked-out location for the record in url form
Field Summary protected boolean
bFirstStepSuccessful
protected boolean
bIsLocationInServer
protected com.flexstor.flexdbserver.services.ServiceContext
context
protected com.flexstor.common.data.ActionData
data
protected java.lang.String
fileSeparator
protected int
id
static java.lang.String
IDENTIFIER
protected int
nManagerRunning
protected com.flexstor.common.data.ActionResult
result
protected com.flexstor.common.services.ServiceBrokerI
serviceBroker
protected java.lang.String
sThisService
protected java.util.Vector
vBadRecords
protected java.util.Vector
vRecords
Constructor Summary CheckOutService()
Method Summary private java.util.Hashtable
createSubSets()
create a Hashtable containing a list of objects to be sent to the service manager.private void
deleteTemporaryDir()
Deletes the temporary directory used to store the filesprivate boolean
doCheckOutFirstStep()
Performs the following check-out steps: - Change the database status to in-progress - Copy the file to the place specified by the client This service will return false only if the status could not be changed to in-progress.protected void
doCheckOutSecondStep()
Performs the following check-out steps: - Update the status in the database to either checked-out (upon success) or checked-in (upon failure) - If the checked out location is not in server, deletes the temporary files created - If confirmation email is requested, send itcom.flexstor.common.data.ActionResult
go()
The start of the CheckOut Service.void
initData(com.flexstor.common.data.ActionData actionData)
A data initialization method called at the beginning of the service.private void
notify(com.flexstor.common.data.ActionResult result)
update the ImportData after the set of services are executed for a ImportData sub set.void
setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running.private boolean
setStatusFromInProgress()
Change the database status from in-progress to: - checked-out for successful assets - checked-in for failed assetsprivate boolean
setStatusToInProgress()
Set the status in the database to in-progressvoid
threadTaskEnd(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
Called when a thread task has just finished.void
threadTaskStart(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
Called when a thread task is about to begin.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail IDENTIFIER
public static final java.lang.String IDENTIFIER
- See Also:
- Constant Field Values
data
protected com.flexstor.common.data.ActionData data
result
protected com.flexstor.common.data.ActionResult result
vRecords
protected java.util.Vector vRecords
vBadRecords
protected java.util.Vector vBadRecords
nManagerRunning
protected int nManagerRunning
sThisService
protected java.lang.String sThisService
bIsLocationInServer
protected boolean bIsLocationInServer
bFirstStepSuccessful
protected boolean bFirstStepSuccessful
context
protected com.flexstor.flexdbserver.services.ServiceContext context
id
protected int id
fileSeparator
protected java.lang.String fileSeparator
serviceBroker
protected com.flexstor.common.services.ServiceBrokerI serviceBroker
Constructor Detail CheckOutService
public CheckOutService()
Method Detail setServiceContext
public void setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
- Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running. This environment consists of information about the properties set for the service in one of these files (services.config, roletype_services.config, or *.ctl), plus methods to access other information such as an instance of the service broker to invoke other services, the transaction id for the service, file separator character and local path for the installation directory and configuration directory.
- Specified by:
setServiceContext
in interfacecom.flexstor.flexdbserver.services.Service
initData
public void initData(com.flexstor.common.data.ActionData actionData)
- A data initialization method called at the beginning of the service. The input argument, ActionData must be cast into its subclass in order to extract the CheckOutService specific data from it.
- Specified by:
initData
in interfacecom.flexstor.flexdbserver.services.Service
go
public com.flexstor.common.data.ActionResult go()
- The start of the CheckOut Service.
- Specified by:
go
in interfacecom.flexstor.flexdbserver.services.Service
doCheckOutFirstStep
private boolean doCheckOutFirstStep()
- Performs the following check-out steps: - Change the database status to in-progress - Copy the file to the place specified by the client This service will return false only if the status could not be changed to in-progress.
doCheckOutSecondStep
protected void doCheckOutSecondStep()
- Performs the following check-out steps: - Update the status in the database to either checked-out (upon success) or checked-in (upon failure) - If the checked out location is not in server, deletes the temporary files created - If confirmation email is requested, send it
setStatusToInProgress
private boolean setStatusToInProgress()
- Set the status in the database to in-progress
setStatusFromInProgress
private boolean setStatusFromInProgress()
- Change the database status from in-progress to: - checked-out for successful assets - checked-in for failed assets
deleteTemporaryDir
private void deleteTemporaryDir()
- Deletes the temporary directory used to store the files
createSubSets
private java.util.Hashtable createSubSets()
- create a Hashtable containing a list of objects to be sent to the service manager. key = server name; value = ServiceManagerData
notify
private void notify(com.flexstor.common.data.ActionResult result)
- update the ImportData after the set of services are executed for a ImportData sub set.
threadTaskStart
public void threadTaskStart(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
- Called when a thread task is about to begin.
- Specified by:
threadTaskStart
in interfacecom.flexstor.common.threadmgr.ThreadCallbackI
threadTaskEnd
public void threadTaskEnd(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
- Called when a thread task has just finished.
- Specified by:
threadTaskEnd
in interfacecom.flexstor.common.threadmgr.ThreadCallbackI
Overview Package Class Use Deprecated Index Home >> All >> com >> flexstor >> flexdbserver >> services >> [ checkincheckout overview ] PREV CLASS NEXT CLASS SUMMARY: JAVADOC |
SOURCE |
DOWNLOAD | NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD