Java Doc for TransferEvent.java in  » Code-Analyzer » apache-ivy » org » apache » ivy » plugins » repository » 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 » Code Analyzer » apache ivy » org.apache.ivy.plugins.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.ivy.core.event.IvyEvent
      org.apache.ivy.plugins.repository.TransferEvent

TransferEvent
public class TransferEvent extends IvyEvent (Code)
TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to the respository This class is LARGELY inspired by org.apache.maven.wagon.events.TransferEvent released under the following copyright license:
 Copyright 2001-2005 The Apache Software Foundation.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 
Orginal class written by Michal Maczka.


Field Summary
final public static  intREQUEST_GET
    
final public static  intREQUEST_PUT
    
final public static  intTRANSFER_COMPLETED
     A transfer is completed.
final public static  StringTRANSFER_COMPLETED_NAME
    
final public static  intTRANSFER_ERROR
    
final public static  StringTRANSFER_ERROR_NAME
    
final public static  intTRANSFER_INITIATED
     A transfer was attempted, but has not yet commenced.
final public static  StringTRANSFER_INITIATED_NAME
    
final public static  intTRANSFER_PROGRESS
     A transfer is in progress.
final public static  StringTRANSFER_PROGRESS_NAME
    
final public static  intTRANSFER_STARTED
     A transfer was started.
final public static  StringTRANSFER_STARTED_NAME
    

Constructor Summary
public  TransferEvent(Repository repository, Resource resource, int eventType, int requestType)
    
public  TransferEvent(Repository repository, Resource resource, Exception exception, int requestType)
    
public  TransferEvent(Repository repository, Resource resource, long length, int requestType)
    

Method Summary
public  longgetElapsedTime(int fromEventType, int toEventType)
     Returns the elapsed time (in ms) between when the event entered one type until it entered another event time.
public  intgetEventType()
    
public  ExceptiongetException()
    
public  longgetLength()
    
public  FilegetLocalFile()
    
public  RepositorygetRepository()
    
public  intgetRequestType()
     Returns the request type. Returns the request type.
public  ResourcegetResource()
    
public  longgetTotalLength()
    
public  booleanisTotalLengthSet()
    
protected  voidsetEventType(int eventType)
    
public  voidsetException(Exception exception)
    
protected  voidsetLength(long length)
    
protected  voidsetLocalFile(File localFile)
    
protected  voidsetRequestType(int requestType)
     Sets the request type
Parameters:
  requestType - The requestType to set.
protected  voidsetResource(Resource resource)
    
protected  voidsetTotalLength(long totalLength)
    
public  voidsetTotalLengthSet(boolean isTotalLengthSet)
    

Field Detail
REQUEST_GET
final public static int REQUEST_GET(Code)
Indicates GET transfer (from the repository)



REQUEST_PUT
final public static int REQUEST_PUT(Code)
Indicates PUT transfer (to the repository)



TRANSFER_COMPLETED
final public static int TRANSFER_COMPLETED(Code)
A transfer is completed.



TRANSFER_COMPLETED_NAME
final public static String TRANSFER_COMPLETED_NAME(Code)



TRANSFER_ERROR
final public static int TRANSFER_ERROR(Code)
An error occured during transfer



TRANSFER_ERROR_NAME
final public static String TRANSFER_ERROR_NAME(Code)



TRANSFER_INITIATED
final public static int TRANSFER_INITIATED(Code)
A transfer was attempted, but has not yet commenced.



TRANSFER_INITIATED_NAME
final public static String TRANSFER_INITIATED_NAME(Code)



TRANSFER_PROGRESS
final public static int TRANSFER_PROGRESS(Code)
A transfer is in progress.



TRANSFER_PROGRESS_NAME
final public static String TRANSFER_PROGRESS_NAME(Code)



TRANSFER_STARTED
final public static int TRANSFER_STARTED(Code)
A transfer was started.



TRANSFER_STARTED_NAME
final public static String TRANSFER_STARTED_NAME(Code)




Constructor Detail
TransferEvent
public TransferEvent(Repository repository, Resource resource, int eventType, int requestType)(Code)



TransferEvent
public TransferEvent(Repository repository, Resource resource, Exception exception, int requestType)(Code)



TransferEvent
public TransferEvent(Repository repository, Resource resource, long length, int requestType)(Code)




Method Detail
getElapsedTime
public long getElapsedTime(int fromEventType, int toEventType)(Code)
Returns the elapsed time (in ms) between when the event entered one type until it entered another event time.

This is especially useful to get the elapsed transfer time:

 getElapsedTime(TransferEvent.TRANSFER_STARTED, TransferEvent.TRANSFER_COMPLETED);
 

Special cases:

  • returns -1 if the event never entered the fromEventType or the toEventType.
  • returns 0 if the event entered toEventType before fromEventType


Parameters:
  fromEventType - the event type constant from which time should be measured
Parameters:
  toEventType - the event type constant to which time should be measured the elapsed time (in ms) between when the event entered fromEventType until itentered toEventType.
throws:
  IllegalArgumentException - if either type is not a known constant event type.



getEventType
public int getEventType()(Code)
Returns the eventType.



getException
public Exception getException()(Code)
Returns the exception.



getLength
public long getLength()(Code)



getLocalFile
public File getLocalFile()(Code)
Returns the local file.



getRepository
public Repository getRepository()(Code)



getRequestType
public int getRequestType()(Code)
Returns the request type. Returns the request type. The Request type is one ofTransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT



getResource
public Resource getResource()(Code)
Returns the resource.



getTotalLength
public long getTotalLength()(Code)



isTotalLengthSet
public boolean isTotalLengthSet()(Code)



setEventType
protected void setEventType(int eventType)(Code)

Parameters:
  eventType - The eventType to set.



setException
public void setException(Exception exception)(Code)



setLength
protected void setLength(long length)(Code)



setLocalFile
protected void setLocalFile(File localFile)(Code)

Parameters:
  localFile - The local file to set.



setRequestType
protected void setRequestType(int requestType)(Code)
Sets the request type
Parameters:
  requestType - The requestType to set. The Request type value should be eitherTransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT.
throws:
  IllegalArgumentException - when



setResource
protected void setResource(Resource resource)(Code)

Parameters:
  resource - The resource to set.



setTotalLength
protected void setTotalLength(long totalLength)(Code)



setTotalLengthSet
public void setTotalLengthSet(boolean isTotalLengthSet)(Code)



Methods inherited from org.apache.ivy.core.event.IvyEvent
protected void addAttribute(String key, String value)(Code)(Java Doc)
protected void addAttributes(Map attributes)(Code)(Java Doc)
protected void addConfsAttribute(String[] confs)(Code)(Java Doc)
protected void addMDAttributes(ModuleDescriptor md)(Code)(Java Doc)
protected void addModuleIdAttributes(ModuleId moduleId)(Code)(Java Doc)
protected void addMridAttributes(ModuleRevisionId mrid)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public Map getAttributes()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public EventManager getSource()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.