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

Quick Search    Search Deep

com.flexstor.flexdbserver.services.asset
Class ImportRsrcForkService  view ImportRsrcForkService download ImportRsrcForkService.java

java.lang.Object
  extended bycom.flexstor.flexdbserver.services.asset.ImportRsrcForkService
All Implemented Interfaces:
com.flexstor.flexdbserver.services.Service

public class ImportRsrcForkService
extends java.lang.Object
implements com.flexstor.flexdbserver.services.Service

ImportResourceForkService

Converts Macintosh files stored in either UNIX or NT file systems to MacBinary format and vice versa. This service supports files stored using the following AppleTalk vendors and softwares: Helios, IPT, Xinet, and DAVE.
The following rules will be applied for updating or creating new assets:
If action = combine or action = separate:
If Input Asset is equal to Output Asset:
Input asset path will be replaced with path of output file.
If Input Asset is not equal to Output Asset and Output Asset exists:
Output asset path will be replaced with path of output file.
If Input Asset is not equal to Output Assetand Output Asset does not exist:
Creates a new asset which is added as child of the input asset and which path points to the the output file path.
If action = copy:
If Input Asset is equal to Output Asset:
Paths are not replaced.
If Input Asset is not equal to Output Asset and Output Asset exists:
Output asset path will be replaced with path of output file.
If Input Asset is not equal to Output Assetand Output Asset does not exist:
Creates a new asset which is added as child of the input asset and which path points to the the output file path.
If action = move:
If Input Asset is equal to Output Asset:
Input asset path will be replaced with path of output file.
If Input Asset is not equal to Output Asset and Output Asset exists:
Output asset path will be replaced with path of output file.
Input asset is deleted from ImportData object.
If Input Asset is not equal to Output Assetand Output Asset does not exist:
Input asset is deleted from ImportData object.
If action = delete:
If Input Asset is equal to Output Asset:
Input asset is deleted from ImportData object.
If Input Asset is not equal to Output Asset and Output Asset exists:
Input asset is deleted from ImportData object.
If Input Asset is not equal to Output Assetand Output Asset does not exist:
Input asset is deleted from ImportData object.

Configurable Properties in roletype_services.config (or *.ctl file if run as a preservice)
In/Out Properties for Assets
Attribute IN OUT Default IN Default OUT
ROLE     ALL ALL
Highres X X    
Lowres X X    
Thumbnail X X    
Layout X X    
Video X X    
Audio X X    
TYPE X X ALL ALL
FLAG
PARENT X X X X
CHLDREN X X    
ALL X X    
TEMP_PARENT X X    
TEMP_CHILDREN X X    
TEMP_ALL X X    

action: The action to be performed by this ImportResourceForkService.
Legal values: combine, copy, separate, or delete

destination: Path where output files will be located if action specified is combine, copy, or separate. This property is not used if action is delete.
Legal values: Full path

Input Data Object

com.flexstor.common.importprocessor.ImportData

Output Data Object

com.flexstor.common.importprocessor.ImportResult


Field Summary
protected  com.flexstor.flexdbserver.services.ServiceContext context
           
private static int DIFF_ASSET
           
private  com.flexstor.common.data.ejb.disguiserecord.DisguiseRecordData disguiseRecord
           
protected  java.lang.String fileSeparator
           
protected  int id
           
static java.lang.String IDENTIFIER
           
private  com.flexstor.common.importprocessor.ImportData importData
           
private  int nAction
           
private  int nAppleTalkVendor
           
private static int NEW_ASSET
           
private static int SAME_ASSET
           
protected  com.flexstor.common.services.ServiceBrokerI serviceBroker
           
private  java.lang.String sFlagIn
           
private  java.lang.String sFlagOut
           
private  java.lang.String sRoleIn
           
private  java.lang.String sRoleOut
           
private  java.lang.String sThisService
           
private  java.lang.String sTypeIn
           
private  java.lang.String sTypeOut
           
 
Constructor Summary
ImportRsrcForkService()
           
 
Method Summary
private  int getActionId(java.lang.String sAction)
           
private  com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData getInputAsset(com.flexstor.common.data.AssetRecordData record, java.util.Vector vAssetsIn)
           
private  com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData getOutputAsset(com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetIn, java.util.Vector vAssetsIn, java.util.Vector vAssetsOut, int[] naAssetInOutRelation)
           
private  int getRoleId(java.lang.String sRole)
           
 com.flexstor.common.data.ActionResult go()
          This methods carries the load of the business logic for the service.
 void initData(com.flexstor.common.data.ActionData actionData)
          A data initialization method called at the beginning of the service.
private  boolean processResult(com.flexstor.common.data.ActionResult result, java.util.Vector vAssetsIn, java.util.Vector vAssetsOut)
           
private  void setPath(com.flexstor.common.data.AssetRecordData record, com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetOut, com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetIn)
           
 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  void updateAssetsInProcess(com.flexstor.common.data.ActionData actionData, int nAction)
           
 
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

SAME_ASSET

private static final int SAME_ASSET
See Also:
Constant Field Values

DIFF_ASSET

private static final int DIFF_ASSET
See Also:
Constant Field Values

NEW_ASSET

private static final int NEW_ASSET
See Also:
Constant Field Values

context

protected com.flexstor.flexdbserver.services.ServiceContext context

serviceBroker

protected com.flexstor.common.services.ServiceBrokerI serviceBroker

id

protected int id

fileSeparator

protected java.lang.String fileSeparator

importData

private com.flexstor.common.importprocessor.ImportData importData

disguiseRecord

private com.flexstor.common.data.ejb.disguiserecord.DisguiseRecordData disguiseRecord

sThisService

private java.lang.String sThisService

sRoleIn

private java.lang.String sRoleIn

sRoleOut

private java.lang.String sRoleOut

sTypeIn

private java.lang.String sTypeIn

sTypeOut

private java.lang.String sTypeOut

sFlagIn

private java.lang.String sFlagIn

sFlagOut

private java.lang.String sFlagOut

nAppleTalkVendor

private int nAppleTalkVendor

nAction

private int nAction
Constructor Detail

ImportRsrcForkService

public ImportRsrcForkService()
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 interface com.flexstor.flexdbserver.services.Service

initData

public void initData(com.flexstor.common.data.ActionData actionData)
Description copied from interface: com.flexstor.flexdbserver.services.Service
A data initialization method called at the beginning of the service. Not business logic, relevant to the functionality of the service, should be added here, other than initializing some variables, etc.

Specified by:
initData in interface com.flexstor.flexdbserver.services.Service

go

public com.flexstor.common.data.ActionResult go()
Description copied from interface: com.flexstor.flexdbserver.services.Service
This methods carries the load of the business logic for the service.

Specified by:
go in interface com.flexstor.flexdbserver.services.Service

getActionId

private int getActionId(java.lang.String sAction)

updateAssetsInProcess

private void updateAssetsInProcess(com.flexstor.common.data.ActionData actionData,
                                   int nAction)

processResult

private boolean processResult(com.flexstor.common.data.ActionResult result,
                              java.util.Vector vAssetsIn,
                              java.util.Vector vAssetsOut)

getInputAsset

private com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData getInputAsset(com.flexstor.common.data.AssetRecordData record,
                                                                                          java.util.Vector vAssetsIn)

getOutputAsset

private com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData getOutputAsset(com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetIn,
                                                                                           java.util.Vector vAssetsIn,
                                                                                           java.util.Vector vAssetsOut,
                                                                                           int[] naAssetInOutRelation)

setPath

private void setPath(com.flexstor.common.data.AssetRecordData record,
                     com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetOut,
                     com.flexstor.common.data.ejb.disguiserecord.DisguiseAssetRecordData assetIn)

getRoleId

private int getRoleId(java.lang.String sRole)