Java Doc for LRC.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » common » catalog » replica » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » pegasus 2.1.0 » org.griphyn.common.catalog.replica 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.griphyn.common.catalog.replica.LRC

LRC
public class LRC implements ReplicaCatalog(Code)
This class implements the VDS replica catalog interface on top of the LRC. This class implementation ends up talking to a single LRC. It is accessed internally from the RLI implementation. RLS Exceptions are being caught here. They probably should be thrown and caught at the calling class (i.e the RLI implementation).
author:
   Karan Vahi
author:
   Gaurang Mehta
version:
   $Revision: 50 $


Field Summary
final public static  StringDEFAULT_LRC_TIMEOUT
     The default timeout in seconds to be used while querying the LRC.
final public static  StringLRC_NOT_CONNECTED_MSG
     The error message for not connected to LRC.
final public static  StringLRC_TIMEOUT_KEY
     The key that is used to get hold of the timeout value from the properties object.
final public static  StringPROXY_KEY
     The key that if set, specifies the proxy to be picked up while connecting to the RLS.
final public static  intRLS_BULK_QUERY_SIZE
     The number of entries searched in each bulk query to RLS.
final public static  StringRLS_TIMEOUT_KEY
     The key that is used to get hold of the timeout value from the properties object.
final public static  StringSITE_ATTRIBUTE
     The attribute in RLS that maps to a site handle.
final public static  StringUNDEFINED_SITE
     The undefined pool attribute value.
final public static  StringURL_KEY
     The key that is used to get hold of the url from the properties object.

Constructor Summary
public  LRC()
     The default constructor, that creates an object which is not linked with any RLS.

Method Summary
public  intclear()
     Removes everything.
public  voidclose()
     Explicitely free resources before the garbage collection hits.
public  booleanconnect(Properties props)
     Establishes a connection to the LRC.
Parameters:
  props - contains all necessary data to establish the link.
public  booleanconnect(String url)
     Establishes a connection to the LRC, picking up the proxy from the default location usually /tmp/ directory.
Parameters:
  url - the url to lrc to connect to.
public  booleanconnect(String url, String proxy)
     Establishes a connection to the LRC.
Parameters:
  url - the url to lrc to connect to.
Parameters:
  proxy - the path to the proxy file to be picked up.
public  intdelete(Map x, boolean matchAttributes)
     Deletes multiple mappings into the replica catalog.
public  intdelete(String lfn, String pfn)
     Deletes a specific mapping from the replica catalog.
public  intdelete(String lfn, ReplicaCatalogEntry tuple)
     Deletes a very specific mapping from the replica catalog.
public  intdelete(String lfn, String name, Object value)
     Deletes all PFN entries for a given LFN from the replica catalog where the PFN attribute is found, and matches exactly the object value.
public  intdeleteByResource(String lfn, String handle)
     Deletes all PFN entries for a given LFN from the replica catalog where the resource handle is found.
public  RLSClient.LRCgetLRC()
     Gets a handle to the LRC that is associated with the RLS running at url.
protected  intgetTimeout(Properties properties)
     It returns the timeout value in seconds after which to timeout in case of no activity from the LRC.
public  intinsert(Map x)
     Inserts multiple mappings into the replica catalog.
public  intinsert(String lfn, ReplicaCatalogEntry tuple)
     Inserts a new mapping into the replica catalog.
public  intinsert(String lfn, String pfn, String handle)
     Inserts a new mapping into the replica catalog.
public  booleanisClosed()
     Returns whether the connection to the RLS with which this instance is associated is closed or not.
public  Setlist()
     Lists all logical filenames in the catalog.
public  Setlist(String constraint)
     Lists a subset of all logical filenames in the catalog.
Parameters:
  constraint - is a constraint for the logical filename only.
public  ListlistLFNPFN(String constraint, boolean lfnConstraint)
     Lists a subset of all LFN,PFN pairs in the catalog matching to a pfn or a lfn constraint.
Parameters:
  constraint - is a constraint for the logical filename only.
public  Stringlookup(String lfn, String handle)
     Retrieves the entry for a given filename and resource handle from the LRC.
Parameters:
  lfn - is the logical filename to obtain information for.
Parameters:
  handle - is the resource handle to obtain entries for.
public  Collectionlookup(String lfn)
     Retrieves all entries for a given LFN from the LRC. Each entry in the result set is a tuple of a PFN and all its attributes.
Parameters:
  lfn - is the logical filename to obtain information for.
public  Maplookup(Set lfns)
     Retrieves multiple entries for a given logical filename, up to the complete LRC.
public  Maplookup(Set lfns, String handle)
     Retrieves multiple entries for a given logical filename, up to the complete LRC. The noAttributes flag is missing on purpose, because due to the resource handle, attribute lookups are already required.
Parameters:
  lfns - is a set of logical filename strings to look up.
Parameters:
  handle - is the resource handle, restricting the LFNs.
public  Maplookup(Set lfns, String name, Object value)
     Retrieves multiple entries for a given logical filename, up to the complete LRC.
public  Maplookup(Map constraints)
     Retrieves multiple entries for a given logical filename, up to the complete catalog.
public  ListlookupLFNPFN(Map constraints)
     Retrieves multiple entries for a given logical filename, up to the complete catalog.
public  SetlookupNoAttributes(String lfn)
     Retrieves all entries for a given LFN from the replica catalog. Each entry in the result set is just a PFN string.
public  MaplookupNoAttributes(Set lfns)
     Retrieves multiple entries for a given logical filename, up to the complete catalog.
public  MaplookupNoAttributes(Set lfns, String handle)
     Retrieves multiple entries for a given logical filename, up to the complete catalog.
public  MaplookupNoAttributes(Set lfns, String name, Object value)
     Retrieves multiple entries for a given logical filename, up to the complete catalog.
public static  voidmain(String[] args)
     Testing function.
public  intremove(String lfn)
     Removes all mappings for a set of LFNs.
Parameters:
  lfn - is a set of logical filename to remove all mappings for.
public  intremove(Set lfns)
     Removes all mappings for a set of LFNs.
Parameters:
  lfns - is a set of logical filename to remove all mappings for.
public  intremoveByAttribute(String handle)
     Removes all entries associated with a particular resource handle. This is useful, if a site goes offline.
public  intremoveByAttribute(String name, Object value)
     Removes all entries from the replica catalog where the PFN attribute is found, and matches exactly the object value.
Parameters:
  name - is the PFN attribute name to look for.
Parameters:
  value - is an exact match of the attribute value to match.

Field Detail
DEFAULT_LRC_TIMEOUT
final public static String DEFAULT_LRC_TIMEOUT(Code)
The default timeout in seconds to be used while querying the LRC.



LRC_NOT_CONNECTED_MSG
final public static String LRC_NOT_CONNECTED_MSG(Code)
The error message for not connected to LRC.



LRC_TIMEOUT_KEY
final public static String LRC_TIMEOUT_KEY(Code)
The key that is used to get hold of the timeout value from the properties object.



PROXY_KEY
final public static String PROXY_KEY(Code)
The key that if set, specifies the proxy to be picked up while connecting to the RLS.



RLS_BULK_QUERY_SIZE
final public static int RLS_BULK_QUERY_SIZE(Code)
The number of entries searched in each bulk query to RLS.



RLS_TIMEOUT_KEY
final public static String RLS_TIMEOUT_KEY(Code)
The key that is used to get hold of the timeout value from the properties object.



SITE_ATTRIBUTE
final public static String SITE_ATTRIBUTE(Code)
The attribute in RLS that maps to a site handle.



UNDEFINED_SITE
final public static String UNDEFINED_SITE(Code)
The undefined pool attribute value. The pool attribute is assigned this value if the pfn queried does not have a pool associated with it.



URL_KEY
final public static String URL_KEY(Code)
The key that is used to get hold of the url from the properties object.




Constructor Detail
LRC
public LRC()(Code)
The default constructor, that creates an object which is not linked with any RLS. Use the connect method to connect to the LRC and use it.
See Also:    #connect(Properties).




Method Detail
clear
public int clear()(Code)
Removes everything. Use with caution! the number of removed entries.



close
public void close()(Code)
Explicitely free resources before the garbage collection hits.



connect
public boolean connect(Properties props)(Code)
Establishes a connection to the LRC.
Parameters:
  props - contains all necessary data to establish the link. true if connected now, or false to indicate a failure.



connect
public boolean connect(String url)(Code)
Establishes a connection to the LRC, picking up the proxy from the default location usually /tmp/ directory.
Parameters:
  url - the url to lrc to connect to. true if connected now, or false to indicate a failure.



connect
public boolean connect(String url, String proxy)(Code)
Establishes a connection to the LRC.
Parameters:
  url - the url to lrc to connect to.
Parameters:
  proxy - the path to the proxy file to be picked up. null denotesdefault location. true if connected now, or false to indicate a failure.
throws:
  ReplicaCatalogException - in case of



delete
public int delete(Map x, boolean matchAttributes)(Code)
Deletes multiple mappings into the replica catalog. The input is a map indexed by the LFN. The value for each LFN key is a collection of replica catalog entries. On setting matchAttributes to false, all entries having matching lfn pfn mapping to an entry in the Map are deleted. However, upon removal of an entry, all attributes associated with the pfn also evaporate (cascaded deletion). The deletes are done in batches.
Parameters:
  x - is a map from logical filename string to list ofreplica catalog entries.
Parameters:
  matchAttributes - whether mapping should be deleted only if allattributes match. the number of deletions.
See Also:   ReplicaCatalogEntry



delete
public int delete(String lfn, String pfn)(Code)
Deletes a specific mapping from the replica catalog. We don't care about the resource handle. More than one entry could theoretically be removed. Upon removal of an entry, all attributes associated with the PFN also evaporate (cascading deletion) automatically at the RLS server end.
Parameters:
  lfn - is the logical filename in the tuple.
Parameters:
  pfn - is the physical filename in the tuple. the number of removed entries.



delete
public int delete(String lfn, ReplicaCatalogEntry tuple)(Code)
Deletes a very specific mapping from the replica catalog. The LFN must be matches, the PFN, and all PFN attributes specified in the replica catalog entry. More than one entry could theoretically be removed. Upon removal of an entry, all attributes associated with the PFN also evaporate (cascading deletion).
Parameters:
  lfn - is the logical filename in the tuple.
Parameters:
  tuple - is a description of the PFN and its attributes. the number of removed entries, either 0 or 1.



delete
public int delete(String lfn, String name, Object value)(Code)
Deletes all PFN entries for a given LFN from the replica catalog where the PFN attribute is found, and matches exactly the object value. This method may be useful to remove all replica entries that have a certain MD5 sum associated with them. It may also be harmful overkill.
Parameters:
  lfn - is the logical filename to look for.
Parameters:
  name - is the PFN attribute name to look for.
Parameters:
  value - is an exact match of the attribute value to match. the number of removed entries.



deleteByResource
public int deleteByResource(String lfn, String handle)(Code)
Deletes all PFN entries for a given LFN from the replica catalog where the resource handle is found. Karan requested this convenience method, which can be coded like
 delete( lfn, SITE_ATTRIBUTE, handle )
 

Parameters:
  lfn - is the logical filename to look for.
Parameters:
  handle - is the resource handle the number of entries removed.
See Also:   LRC.SITE_ATTRIBUTE



getLRC
public RLSClient.LRC getLRC()(Code)
Gets a handle to the LRC that is associated with the RLS running at url. RLSClient.LRC that points to the RLI that isrunning , or null in case connect method not being called.
See Also:   LRC.mLRCURL



getTimeout
protected int getTimeout(Properties properties)(Code)
It returns the timeout value in seconds after which to timeout in case of no activity from the LRC. Referred to by the "lrc.timeout" property. the timeout value if specified else,the value specified by "rls.timeout" property, elseDEFAULT_LRC_TIMEOUT.
See Also:   LRC.DEFAULT_LRC_TIMEOUT



insert
public int insert(Map x)(Code)
Inserts multiple mappings into the replica catalog. The input is a map indexed by the LFN. The value for each LFN key is a collection of replica catalog entries. Ends up doing a sequential insert for all the entries instead of doing a bulk insert. Easier to track failure this way.
Parameters:
  x - is a map from logical filename string to list of replicacatalog entries. the number of insertions.
See Also:   ReplicaCatalogEntry



insert
public int insert(String lfn, ReplicaCatalogEntry tuple)(Code)
Inserts a new mapping into the replica catalog. The attributes are added in bulk assuming the attribute definitions already exist. If an attribute definition does not exist, it is created and inserted. Note there is no notion of transactions in LRC. It assumes all the attributes are of type String.
Parameters:
  lfn - is the logical filename under which to book the entry.
Parameters:
  tuple - is the physical filename and associated PFN attributes. number of insertions, should always be 1. On failure,throws an exception instead of returning zero.



insert
public int insert(String lfn, String pfn, String handle)(Code)
Inserts a new mapping into the replica catalog. This is a convenience function exposing the resource handle. Internally, the ReplicaCatalogEntry element will be contructed, and passed to the appropriate insert function.
Parameters:
  lfn - is the logical filename under which to book the entry.
Parameters:
  pfn - is the physical filename associated with it.
Parameters:
  handle - is a resource handle where the PFN resides. number of insertions, should always be 1. On failure,throw an exception, don't use zero.
See Also:   LRC.insert(String,ReplicaCatalogEntry)
See Also:   ReplicaCatalogEntry



isClosed
public boolean isClosed()(Code)
Returns whether the connection to the RLS with which this instance is associated is closed or not. true, if the implementation is disassociated, false otherwise.
See Also:   LRC.close()



list
public Set list()(Code)
Lists all logical filenames in the catalog. a set of all logical filenames known to the catalog or null incase of not connected to the LRC or error.



list
public Set list(String constraint)(Code)
Lists a subset of all logical filenames in the catalog.
Parameters:
  constraint - is a constraint for the logical filename only. Itis a string that has some meaning to the implementing system. Thiscan be a SQL wildcard for queries, or a regular expression forJava-based memory collections. A set of logical filenames that match. The set may be empty



listLFNPFN
public List listLFNPFN(String constraint, boolean lfnConstraint) throws ReplicaCatalogException(Code)
Lists a subset of all LFN,PFN pairs in the catalog matching to a pfn or a lfn constraint.
Parameters:
  constraint - is a constraint for the logical filename only. Itis a string that has some meaning to the implementing system. Thiscan be a SQL wildcard for queries, or a regular expression forJava-based memory collections. A set a list of MyRLSString2Bulk objects containingthe lfn in s1 field, and pfn in s2 field. The list isgrouped by lfns. The set may be empty.
See Also:   LRC.getAttributes(List,String,Object)



lookup
public String lookup(String lfn, String handle)(Code)
Retrieves the entry for a given filename and resource handle from the LRC.
Parameters:
  lfn - is the logical filename to obtain information for.
Parameters:
  handle - is the resource handle to obtain entries for. the (first) matching physical filename, ornull if no match was found.
throws:
  ReplicaCatalogException - in case of any error that is throw by LRCthat can't be handled.



lookup
public Collection lookup(String lfn) throws ReplicaCatalogException(Code)
Retrieves all entries for a given LFN from the LRC. Each entry in the result set is a tuple of a PFN and all its attributes.
Parameters:
  lfn - is the logical filename to obtain information for. a collection of replica catalog entries, or null in case ofunable to connect to RLS or error.
throws:
  ReplicaCatalogException - in case of any error that is throw by LRCthat can't be handled.
See Also:   ReplicaCatalogEntry



lookup
public Map lookup(Set lfns) throws ReplicaCatalogException(Code)
Retrieves multiple entries for a given logical filename, up to the complete LRC. It uses the bulk query api to the LRC to query for stuff. Bulk query has been in RLS since version 2.0.8. Internally, the bulk queries are done is sizes specified by variable mBatchSize.
Parameters:
  lfns - is a set of logical filename strings to look up. a map indexed by the LFN. Each value is a collectionof replica catalog entries for the LFN.
See Also:   ReplicaCatalogEntry
See Also:   LRC.getBatchSize()



lookup
public Map lookup(Set lfns, String handle)(Code)
Retrieves multiple entries for a given logical filename, up to the complete LRC. The noAttributes flag is missing on purpose, because due to the resource handle, attribute lookups are already required.
Parameters:
  lfns - is a set of logical filename strings to look up.
Parameters:
  handle - is the resource handle, restricting the LFNs. a map indexed by the LFN. Each value is a collectionof replica catalog entries.
See Also:   ReplicaCatalogEntry



lookup
public Map lookup(Set lfns, String name, Object value)(Code)
Retrieves multiple entries for a given logical filename, up to the complete LRC. It returns the complete RCE for each entry i.e all the attributes a pfn is associated with in addition to the one that is the key for matching.
Parameters:
  lfns - is a set of logical filename strings to look up.
Parameters:
  name - is the name of the attribute.
Parameters:
  value - is the value of the attribute. a map indexed by the LFN. Each value is a collectionof replica catalog entries.
See Also:   ReplicaCatalogEntry



lookup
public Map lookup(Map constraints) throws ReplicaCatalogException(Code)
Retrieves multiple entries for a given logical filename, up to the complete catalog. Retrieving full catalogs should be harmful, but may be helpful in online display or portal.

At present it DOES NOT SUPPORT ATTRIBUTE MATCHING.
Parameters:
  constraints - is mapping of keys 'lfn', 'pfn', to a string thathas some meaning to the implementing system. This can be a SQLwildcard for queries, or a regular expression for Java-based memorycollections. Unknown keys are ignored. Using an empty map requeststhe complete catalog. a map indexed by the LFN. Each value is a collectionof replica catalog entries.
See Also:   ReplicaCatalogEntry




lookupLFNPFN
public List lookupLFNPFN(Map constraints)(Code)
Retrieves multiple entries for a given logical filename, up to the complete catalog. Retrieving full catalogs should be harmful, but may be helpful in online display or portal. At present it does not support attribute matching.
Parameters:
  constraints - is mapping of keys 'lfn', 'pfn', or anyattribute name, e.g. the resource handle 'site', to a string thathas some meaning to the implementing system. This can be a SQLwildcard for queries, or a regular expression for Java-based memorycollections. Unknown keys are ignored. Using an empty map requeststhe complete catalog. A list of MyRLSString2Bulk objects containingthe lfn in s1 field, and pfn in s2 field. The list isgrouped by lfns. The set may be empty.



lookupNoAttributes
public Set lookupNoAttributes(String lfn)(Code)
Retrieves all entries for a given LFN from the replica catalog. Each entry in the result set is just a PFN string. Duplicates are reduced through the set paradigm.
Parameters:
  lfn - is the logical filename to obtain information for. a set of PFN strings, or null in case of unable to connectto RLS.



lookupNoAttributes
public Map lookupNoAttributes(Set lfns)(Code)
Retrieves multiple entries for a given logical filename, up to the complete catalog. Retrieving full catalogs should be harmful, but may be helpful in an online display or portal.
Parameters:
  lfns - is a set of logical filename strings to look up. a map indexed by the LFN. Each value is a setof PFN strings.



lookupNoAttributes
public Map lookupNoAttributes(Set lfns, String handle)(Code)
Retrieves multiple entries for a given logical filename, up to the complete catalog. Retrieving full catalogs should be harmful, but may be helpful in online display or portal.


Parameters:
  lfns - is a set of logical filename strings to look up.
Parameters:
  handle - is the resource handle, restricting the LFNs. a map indexed by the LFN. Each value is a set ofphysical filenames.




lookupNoAttributes
public Map lookupNoAttributes(Set lfns, String name, Object value)(Code)
Retrieves multiple entries for a given logical filename, up to the complete catalog. Retrieving full catalogs should be harmful, but may be helpful in online display or portal.


Parameters:
  lfns - is a set of logical filename strings to look up.
Parameters:
  name - is the PFN attribute name to look for.
Parameters:
  value - is an exact match of the attribute value to match. a map indexed by the LFN. Each value is a set ofphysical filenames.




main
public static void main(String[] args)(Code)
Testing function.



remove
public int remove(String lfn)(Code)
Removes all mappings for a set of LFNs.
Parameters:
  lfn - is a set of logical filename to remove all mappings for. the number of removed entries.



remove
public int remove(Set lfns)(Code)
Removes all mappings for a set of LFNs.
Parameters:
  lfns - is a set of logical filename to remove all mappings for. the number of removed entries.



removeByAttribute
public int removeByAttribute(String handle)(Code)
Removes all entries associated with a particular resource handle. This is useful, if a site goes offline. It is a convenience method, which calls the generic removeByAttribute method.
Parameters:
  handle - is the site handle to remove all entries for. the number of removed entries.
See Also:   LRC.removeByAttribute(String,Object)



removeByAttribute
public int removeByAttribute(String name, Object value)(Code)
Removes all entries from the replica catalog where the PFN attribute is found, and matches exactly the object value.
Parameters:
  name - is the PFN attribute name to look for.
Parameters:
  value - is an exact match of the attribute value to match. the number of removed entries.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.