|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.common.catalog.transformation.File
public class File
This is the new file based TC implementation storing the contents of the file in memory. For the old tc file implemenation see OldTC.java
| Field Summary | |
|---|---|
protected LogManager |
mLogger
The LogManager object which is used to log all the messages. |
private PegasusProperties |
mProps
The handle to the properties object. |
private String |
mTCFile
The path to the file based TC. |
private static File |
mTCFileHandle
The singleton handler to the contents of the transformation catalog. |
private Map |
mTreeMap
The Tree Map which stores the contents of the file. |
protected List |
mvExecPools
The List containing the user specified list of pools on which he wants the dag to run. |
| Fields inherited from interface org.griphyn.common.catalog.Catalog |
|---|
DB_ALL_PREFIX |
| Constructor Summary | |
|---|---|
private |
File()
The private constructor. |
private |
File(InputStream reader)
The overloaded constructor. |
private |
File(String path)
The overloaded constructor. |
| Method Summary | |
|---|---|
boolean |
addTCEntry(List entries)
Add multiple TCEntries to the Catalog. |
boolean |
addTCEntry(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system)
Add an single entry into the transformation catalog. |
boolean |
addTCEntry(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system,
boolean write)
Add an single entry into the transformation catalog. |
boolean |
addTCEntry(TransformationCatalogEntry entry)
Add a single TCEntry to the Catalog. |
boolean |
addTCEntry(TransformationCatalogEntry entry,
boolean write)
Add a single TCEntry to the Catalog. |
boolean |
addTCLfnProfile(String namespace,
String name,
String version,
List profiles)
Add additional profiles to a matching logical transformation. |
boolean |
addTCPfnProfile(String pfn,
TCType type,
String resourcename,
List profiles)
Adds additional profiles to a physical transformation. |
void |
close()
Explicitely free resources before the garbage collection hits. |
private static void |
columnLength(String[] s,
int[] count)
Computes the maximum column lenght for pretty printing. |
boolean |
connect(Properties props)
Establishes a link between the implementation and the thing the implementation is build upon. |
boolean |
deleteTC()
Deletes the entire transformation catalog. |
boolean |
deleteTCbyLogicalName(String namespace,
String name,
String version,
String resourceid,
TCType type)
Delete all entries in the transformation catalog of the logical transformation either at all resource or on a particular resource |
boolean |
deleteTCbyPhysicalName(String physicalname,
String namespace,
String name,
String version,
String resourceid,
TCType type)
Delete all entries in the transformation catalog for pair of logical and physical transformation. |
boolean |
deleteTCbyResourceId(String resourceid)
Delete an entire resource from the transformation catalog. |
boolean |
deleteTCbySysInfo(SysInfo sysinfo)
Delete entries in the catalog of a particular systeminfo. |
boolean |
deleteTCbyType(TCType type,
String resourceid)
Delete a paricular type of transformation, additionally either on all resources or on a particular resource. |
boolean |
deleteTCLfnProfile(String namespace,
String name,
String version,
List profiles)
Delete a list of profiles or all the profiles associated with a logical transformation. |
boolean |
deleteTCPfnProfile(String physicalname,
TCType type,
String resourceid,
List profiles)
Delete a list of profiles or all the profiles associated with a pfn on a resource and of a type. |
static TransformationCatalog |
getInstance()
Returns an instance of the File TC. |
static TransformationCatalog |
getNonSingletonInstance()
Returns a non singleton instance to the file transformation catalog. |
static TransformationCatalog |
getNonSingletonInstance(InputStream reader)
Returns a non singleton instance to the file transformation catalog. |
static TransformationCatalog |
getNonSingletonInstance(String path)
Returns a non singleton instance to the file transformation catalog. |
List |
getTC()
List all the contents of the TC in a column format. |
List |
getTCEntries(String namespace,
String name,
String version,
List resourceids,
TCType type)
Returns TC entries for a particular logical transformation and/or on a number of resources and/or of a particular type. |
List |
getTCEntries(String namespace,
String name,
String version,
String resourceid,
TCType type)
Returns TC entries for a particular logical transformation and/or on a particular resource and/or of a particular type. |
List |
getTCLfnProfiles(String namespace,
String name,
String version)
Get the list of Profiles associated with a particular logical transformation. |
List |
getTCLogicalNames(String resourceid,
TCType type)
Gets the list of LogicalNames available on a particular resource. |
String |
getTCMode()
Returns a textual description of the transformation mode. |
List |
getTCPfnProfiles(String pfn,
String resourceid,
TCType type)
Get the list of Profiles associated with a particular physical transformation. |
List |
getTCPhysicalNames(String namespace,
String name,
String version,
String resourceid,
TCType type)
Get the list of PhysicalNames for a particular transformation on a site/sites for a particular type/types. |
List |
getTCResourceIds(String namespace,
String name,
String version,
TCType type)
Get the list of Resource ID's where a particular transformation may reside. |
private void |
initialize(String path)
Initializes the various class members. |
boolean |
isClosed()
Predicate to check, if the connection with the catalog's implementation is still active. |
protected void |
logMessage(String msg)
Logs the message to a logging stream. |
private boolean |
populateTC()
Populates the internal copy of the transformation catalog from the file containing the transformation catalog in the 6 column format. |
private boolean |
populateTC(InputStream reader)
Populates the internal copy of the transformation catalog from a byte stream (input stream). |
private boolean |
populateTC(Reader reader)
Adds multiple entries into the TC. |
private void |
writeTC()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static File mTCFileHandle
protected LogManager mLogger
protected List mvExecPools
private Map mTreeMap
private String mTCFile
private PegasusProperties mProps
| Constructor Detail |
|---|
private File()
private File(String path)
path - the path to the file containing the transformation catalog
in six column format.private File(InputStream reader)
reader - the InputStrean containing the bytes to be
read.| Method Detail |
|---|
public static TransformationCatalog getInstance()
public static TransformationCatalog getNonSingletonInstance()
public static TransformationCatalog getNonSingletonInstance(String path)
path - the path to the file containing the transformation
catalog in ths six column format
public static TransformationCatalog getNonSingletonInstance(InputStream reader)
reader - the InputStrean containing the bytes to be
read.
private void initialize(String path)
path - the path to file containing the transformation
catalog. can be null.public String getTCMode()
getTCMode in interface TransformationCatalog
public List getTCEntries(String namespace,
String name,
String version,
List resourceids,
TCType type)
throws Exception
getTCEntries in interface TransformationCatalognamespace - the namespace of the logical transformation.name - the name of the logical transformation.version - the version of the logical transformation.resourceids - the List resourceid where the transformation is located.
If NULL it returns all resources.type - TCType the type of the transformation to search for. If
NULL it returns all types.
TransformationCatalogEntry objects
containing the corresponding entries from the TC.
Returns null if no entry found.
ExceptionTCType,
TransformationCatalogEntry
public List getTCEntries(String namespace,
String name,
String version,
String resourceid,
TCType type)
throws Exception
getTCEntries in interface TransformationCatalognamespace - the namespace of the logical transformation.name - the name of the logical transformation.version - the version of the logical transformation.resourceid - the resourceid where the transformation is located.
If NULL it returns all resources.type - TCType the type of the transformation to search for.
If NULL it returns all types.
TransformationCatalogEntry objects
containing the corresponding entries from the TC.
Returns null if no entry found.
ExceptionTCType,
TransformationCatalogEntry
public List getTCResourceIds(String namespace,
String name,
String version,
TCType type)
throws Exception
getTCResourceIds in interface TransformationCatalognamespace - String The namespace of the transformation to search for.name - String The name of the transformation to search for.version - String The version of the transformation to search for.type - TCType The type of the transformation to search for.ExceptionTCType
public List getTCPhysicalNames(String namespace,
String name,
String version,
String resourceid,
TCType type)
throws Exception
getTCPhysicalNames in interface TransformationCatalognamespace - the namespace of the transformation to search for.name - the name of the transformation to search for.version - the version of the transformation to search for.resourceid - the id of the resource on which you want to search. type - the type of the transformation to search for. ExceptionTCType,
SysInfo
public List getTCLogicalNames(String resourceid,
TCType type)
throws Exception
getTCLogicalNames in interface TransformationCatalogresourceid - the id of the resource on which you want to searchtype - the type of the transformation to search for. Exception
public List getTCLfnProfiles(String namespace,
String name,
String version)
throws Exception
getTCLfnProfiles in interface TransformationCatalognamespace - the namespace of the transformation to search for.name - the name of the transformation to search for.version - the version of the transformation to search for.
NotImplementedException - as not implemented as yet.
ExceptionProfile
public List getTCPfnProfiles(String pfn,
String resourceid,
TCType type)
throws Exception
getTCPfnProfiles in interface TransformationCatalogpfn - the physical file name to search the transformation by.resourceid - the id of the resource on which you want to search.type - the type of the transformation to search for. Profile containing profiles assocaited with
the transformation. Returns NULL if no profiless found.
ExceptionProfile
public List getTC()
throws Exception
getTC in interface TransformationCatalogException
public boolean addTCEntry(List entries)
throws Exception
addTCEntry in interface TransformationCatalogentries - list of TransformationCatalogEntry
objects as input.
ExceptionTransformationCatalogEntry
public boolean addTCEntry(TransformationCatalogEntry entry)
throws Exception
addTCEntry in interface TransformationCatalogentry - a single TransformationCatalogEntry
object as input.
ExceptionTransformationCatalogEntry
public boolean addTCEntry(TransformationCatalogEntry entry,
boolean write)
throws Exception
addTCEntry in interface TransformationCatalogentry - a single TransformationCatalogEntry
object as input.write - boolean to commit additions to backend catalog.
ExceptionTransformationCatalogEntry
public boolean addTCEntry(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system)
throws Exception
addTCEntry in interface TransformationCatalognamespace - the namespace of the transformation to be added (Can be null)name - the name of the transformation to be added.version - the version of the transformation to be added. (Can be null)physicalname - the physical name/location of the transformation to be added.type - the type of the physical transformation.resourceid - the resource location id where the transformation is located.lfnprofiles - the List of Profile objects associated
with a Logical Transformation. (can be null)pfnprofiles - the list of Profile objects associated
with a Physical Transformation. (can be null)system - the System information associated with a physical
transformation.
ExceptionTransformationCatalogEntry,
SysInfo,
Profile
public boolean addTCEntry(String namespace,
String name,
String version,
String physicalname,
TCType type,
String resourceid,
List pfnprofiles,
List lfnprofiles,
SysInfo system,
boolean write)
throws Exception
namespace - the namespace of the transformation to be added (Can be null)name - the name of the transformation to be added.version - the version of the transformation to be added. (Can be null)physicalname - the physical name/location of the transformation to be added.type - the type of the physical transformation.resourceid - the resource location id where the transformation is located.lfnprofiles - the List of Profile objects associated
with a Logical Transformation. (can be null)pfnprofiles - the list of Profile objects associated
with a Physical Transformation. (can be null)system - the System information associated with a physical
transformation.write - boolean to commit changes to backend catalog
ExceptionTransformationCatalogEntry,
SysInfo,
Profile
public boolean addTCLfnProfile(String namespace,
String name,
String version,
List profiles)
throws Exception
addTCLfnProfile in interface TransformationCatalognamespace - the nsamespace of the transformation to be added. (can be null)name - the name of the transformation to be added.version - the version of the transformation to be added.profiles - list of Profile objects that are to be
added to the transformation.
Exception - as function not implemented.Profile
public boolean addTCPfnProfile(String pfn,
TCType type,
String resourcename,
List profiles)
throws Exception
addTCPfnProfile in interface TransformationCatalogpfn - the physical name of the transformationtype - the type of transformation that the profile is
associated with. If null the profile is associated
with all the types.resourcename - the resource on which the physical transformation exists.profiles - the List of Profile objects that are to
be added to the transformation.
Exception - as function not implemented.Profile
public boolean deleteTCbyLogicalName(String namespace,
String name,
String version,
String resourceid,
TCType type)
throws Exception
deleteTCbyLogicalName in interface TransformationCatalognamespace - the nsamespace of the transformation to be added. (can be null)name - the name of the transformation to be added.version - the version of the transformation to be added.resourceid - the resource id for which the transformation is to be
deleted. If null then transformation on all resource
are deleted.type - the type of the transformation
ExceptionTCType
public boolean deleteTCbyPhysicalName(String physicalname,
String namespace,
String name,
String version,
String resourceid,
TCType type)
throws Exception
TransformationCatalog
deleteTCbyPhysicalName in interface TransformationCatalogphysicalname - String The physical name of the transformationnamespace - String The namespace assocaited in the logical name of the transformation.name - String The name of the logical transformation.version - String The version number of the logical transformation.resourceid - String The resource on which the transformation is to be deleted.
If NULL then it searches all the resource id.type - TCType The type of transformation. If NULL then it search and deletes entries for all types.
ExceptionTCType
public boolean deleteTCbyType(TCType type,
String resourceid)
throws Exception
deleteTCbyType in interface TransformationCatalogtype - the type of the transformation.resourceid - the resource on which the transformation exists.
If null then that type of transformation is deleted
from all the resources.
Exception - as function not implemented.TCType
public boolean deleteTCbySysInfo(SysInfo sysinfo)
throws Exception
deleteTCbySysInfo in interface TransformationCatalogsysinfo - SysInfo
Exception - as function not implemented.SysInfo
public boolean deleteTCbyResourceId(String resourceid)
throws Exception
deleteTCbyResourceId in interface TransformationCatalogresourceid - String
Exception - as function not implemented.
public boolean deleteTC()
throws Exception
deleteTC in interface TransformationCatalogException
public boolean deleteTCPfnProfile(String physicalname,
TCType type,
String resourceid,
List profiles)
throws Exception
TransformationCatalog
deleteTCPfnProfile in interface TransformationCatalogphysicalname - String The physical name of the transformation.type - TCType The type of the transformation.resourceid - String The resource of the transformation.profiles - List The list of profiles to be deleted. If NULL then all profiles for that pfn+resource+type are deleted.
ExceptionProfile
public boolean deleteTCLfnProfile(String namespace,
String name,
String version,
List profiles)
throws Exception
TransformationCatalog
deleteTCLfnProfile in interface TransformationCatalognamespace - String The namespace of the logical transformation.name - String The name of the logical transformation.version - String The version of the logical transformation.profiles - List The List of profiles to be deleted. If NULL then all profiles for the logical transformation are deleted.
ExceptionProfilepublic boolean connect(Properties props)
CatalogFIXME: The cause for failure is lost without exceptions.
connect in interface Catalogprops - contains all necessary data to establish the link.
public boolean isClosed()
Catalogclose().
isClosed in interface CatalogCatalog.close()public void close()
Catalog
close in interface Catalogprivate void writeTC()
private static void columnLength(String[] s,
int[] count)
s - String[]count - int[]private boolean populateTC(InputStream reader)
reader - the InputStrean containing the bytes to be
read.
private boolean populateTC()
private boolean populateTC(Reader reader)
reader - the input stream from where to read the contents of the
transformation catalog.
protected void logMessage(String msg)
msg - the message to be logged.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||