Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Synchronize with Bitbucket

  • Loading branch information...
commit 24660781c5f6b219d95af02ddc3d6af7ec072094 1 parent 35454fd
@longkerdandy authored
Showing with 21,360 additions and 3,034 deletions.
  1. +5 −0 .hg_archival.txt
  2. +3 −1 README
  3. BIN  assembly/bin/felix.jar
  4. BIN  assembly/bundle/asm-all-3.3.1.jar
  5. BIN  assembly/bundle/async-http-client-1.6.5.jar
  6. BIN  assembly/bundle/commons-collections-3.2.1.jar
  7. BIN  assembly/bundle/commons-io-2.1.jar
  8. BIN  assembly/bundle/commons-lang-2.6.jar
  9. BIN  assembly/bundle/commons-pool-1.5.6.jar
  10. BIN  assembly/bundle/derby-10.8.2.2.jar
  11. BIN  assembly/bundle/geronimo-j2ee-connector_1.6_spec-1.0.jar
  12. BIN  assembly/bundle/geronimo-jpa_2.0_spec-1.1.jar
  13. BIN  assembly/bundle/geronimo-jta_1.1_spec-1.1.1.jar
  14. BIN  assembly/bundle/geronimo-transaction-3.1.1.jar
  15. BIN  assembly/bundle/jackson-core-asl-1.9.2.jar
  16. BIN  assembly/bundle/jackson-mapper-asl-1.9.2.jar
  17. BIN  assembly/bundle/jcl-over-slf4j-1.6.4.jar
  18. BIN  assembly/bundle/jpathwatch-0.94.jar
  19. BIN  assembly/bundle/logback-classic-1.0.0.jar
  20. BIN  assembly/bundle/logback-core-1.0.0.jar
  21. BIN  assembly/bundle/netty-3.2.6.Final.jar
  22. BIN  assembly/bundle/openjpa-2.0.1.jar
  23. BIN  assembly/bundle/openjpa-2.1.1.jar
  24. BIN  assembly/bundle/org.apache.aries.blueprint-0.3.jar
  25. BIN  assembly/bundle/org.apache.aries.jndi-0.3.jar
  26. BIN  assembly/bundle/org.apache.aries.jpa.api-0.3.jar
  27. BIN  assembly/bundle/org.apache.aries.jpa.blueprint.aries-0.3.jar
  28. BIN  assembly/bundle/org.apache.aries.jpa.container-0.3.jar
  29. BIN  assembly/bundle/org.apache.aries.jpa.container.context-0.3.jar
  30. BIN  assembly/bundle/org.apache.aries.proxy-0.3.jar
  31. BIN  assembly/bundle/org.apache.aries.transaction.blueprint-0.3.jar
  32. BIN  assembly/bundle/org.apache.aries.transaction.manager-0.3.jar
  33. BIN  assembly/bundle/org.apache.aries.transaction.wrappers-0.3.jar
  34. BIN  assembly/bundle/org.apache.aries.util-0.3.jar
  35. BIN  assembly/bundle/org.apache.felix.bundlerepository-1.6.6.jar
  36. BIN  assembly/bundle/org.apache.felix.configadmin-1.2.8.jar
  37. BIN  assembly/bundle/org.apache.felix.eventadmin-1.2.14.jar
  38. BIN  assembly/bundle/org.apache.felix.fileinstall-3.1.10.jar
  39. BIN  assembly/bundle/org.apache.felix.gogo.command-0.12.0.jar
  40. BIN  assembly/bundle/org.apache.felix.gogo.runtime-0.10.0.jar
  41. BIN  assembly/bundle/org.apache.felix.gogo.shell-0.10.0.jar
  42. BIN  assembly/bundle/org.apache.felix.http.bundle-2.2.0.jar
  43. BIN  assembly/bundle/org.apache.httpcomponents.httpclient_4.1.2.jar
  44. BIN  assembly/bundle/org.apache.httpcomponents.httpcore_4.1.3.jar
  45. BIN  assembly/bundle/org.apache.servicemix.bundles.serp-1.13.1_4.jar
  46. BIN  assembly/bundle/sanselan-0.97-incubator.jar
  47. BIN  assembly/bundle/slf4j-api-1.6.4.jar
  48. +3 −3 assembly/conf/chii2/org.chii2.medialibrary.file.cfg
  49. +1 −1  assembly/conf/chii2/org.chii2.transcoder.core.cfg
  50. +1 −0  assembly/conf/config.properties
  51. +377 −7 assembly/pom.xml
  52. +0 −4 medialibrary.api/pom.xml
  53. +57 −1 medialibrary.api/src/main/java/org/chii2/medialibrary/api/core/MediaLibraryService.java
  54. +10 −2 medialibrary.api/src/main/java/org/chii2/medialibrary/api/file/FileService.java
  55. +42 −9 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/PersistenceService.java
  56. +2 −2 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/Image.java
  57. +14 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/ImageFile.java
  58. +4 −4 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/MovieFile.java
  59. +47 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/ImageFileInfoProviderService.java
  60. +0 −48 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/ImageInfoProviderService.java
  61. +6 −4 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/MovieFileInfoProviderService.java
  62. +2 −0  medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/MovieInfoProviderService.java
  63. +5 −7 medialibrary.api/src/main/java/org/chii2/medialibrary/api/shell/command/MediaLibraryCommand.java
  64. +0 −4 medialibrary.core/pom.xml
  65. +53 −24 medialibrary.core/src/main/java/org/chii2/medialibrary/MediaLibraryServiceImpl.java
  66. +40 −34 medialibrary.core/src/main/java/org/chii2/medialibrary/event/ImageHandler.java
  67. +51 −37 medialibrary.core/src/main/java/org/chii2/medialibrary/event/MovieHandler.java
  68. +8 −2 medialibrary.core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  69. +0 −4 medialibrary.datasource/pom.xml
  70. +4 −4 medialibrary.datasource/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  71. +2 −6 medialibrary.file/pom.xml
  72. +76 −57 medialibrary.file/src/main/java/org/chii2/medialibrary/file/FileServiceImpl.java
  73. +22 −20 medialibrary.file/src/main/java/org/chii2/medialibrary/file/filter/FileExtensionFilter.java
  74. +67 −46 medialibrary.file/src/main/java/org/chii2/medialibrary/file/scanner/FileScanner.java
  75. +9 −0 medialibrary.file/src/main/java/org/chii2/medialibrary/file/watcher/AbstractFileWatcher.java
  76. +178 −130 medialibrary.file/src/main/java/org/chii2/medialibrary/file/watcher/FileWatcher.java
  77. +266 −0 medialibrary.file/src/main/java/org/chii2/medialibrary/file/watcher/WinFileWatcher.java
  78. +11 −11 medialibrary.file/src/test/java/org/chii2/medialibrary/file/FileExtensionFilterTest.java
  79. +30 −5 medialibrary.persistence/pom.xml
  80. +219 −91 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/PersistenceServiceImpl.java
  81. +24 −2 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/ImageFileImpl.java
  82. +30 −29 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/ImageImpl.java
  83. +16 −10 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieFileImpl.java
  84. +2 −2 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieImpl.java
  85. +1 −1  medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieInfoImpl.java
  86. +1 −1  medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/factory/ImageFactoryImpl.java
  87. +1 −1  medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/factory/MovieFactoryImpl.java
  88. +2 −2 medialibrary.persistence/src/main/resources/META-INF/persistence.xml
  89. +0 −15 medialibrary.provider.mediainfo/pom.xml
  90. +30 −35 ...der.mediainfo/src/main/java/org/chii2/medialibrary/provider/mediainfo/MovieFileInfoProviderServiceImpl.java
  91. +196 −195 ...rg/chii2/medialibrary/provider/mediainfo/{consumer/RequestConsumer.java → analyzer/MovieAnalyzer.java}
  92. +1 −1  ...vider.mediainfo/src/main/java/org/chii2/medialibrary/provider/mediainfo/{consumer → util}/XMLChar.java
  93. +1 −1  ...ainfo/src/main/java/org/chii2/medialibrary/provider/mediainfo/{consumer → util}/Xml10FilterReader.java
  94. +25 −22 ...chii2/medialibrary/provider/mediainfo/{consumer/RequestConsumerTest.java → analyzer/AnalyzerTest.java}
  95. +29 −24 ...alibrary/provider/sanselan/{ImageInfoProviderServiceImpl.java → ImageFileInfoProviderServiceImpl.java}
  96. +313 −0 ...ibrary.provider.sanselan/src/main/java/org/chii2/medialibrary/provider/sanselan/analyzer/ImageAnalyzer.java
  97. +0 −301 ...ibrary.provider.sanselan/src/main/java/org/chii2/medialibrary/provider/sanselan/consumer/ImageAnalyzer.java
  98. +3 −3 medialibrary.provider.sanselan/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  99. +0 −15 medialibrary.provider.tmdb/pom.xml
  100. +20 −13 ...alibrary.provider.tmdb/src/main/java/org/chii2/medialibrary/provider/tmdb/MovieInfoProviderServiceImpl.java
  101. +28 −29 ...n/java/org/chii2/medialibrary/provider/tmdb/{consumer/RequestConsumer.java → fetcher/TMDbFetcher.java}
  102. +1 −1  ...alibrary.provider.tmdb/src/main/java/org/chii2/medialibrary/provider/tmdb/handler/ImageResponseHandler.java
  103. +6 −6 ...alibrary.provider.tmdb/src/main/java/org/chii2/medialibrary/provider/tmdb/handler/MovieResponseHandler.java
  104. +49 −43 medialibrary.provider.tmdb/src/main/java/org/chii2/medialibrary/provider/tmdb/parser/JsonParser.java
  105. +56 −37 medialibrary.provider.tmdb/src/test/java/org/chii2/medialibrary/provider/tmdb/parser/JsonParserTest.java
  106. +15 −0 medialibrary.shell/pom.xml
  107. +112 −110 medialibrary.shell/src/main/java/org/chii2/medialibrary/shell/command/MediaLibraryCommandImpl.java
  108. +16 −0 medialibrary.shell/src/main/java/org/chii2/medialibrary/shell/command/parser/OptException.java
  109. +4 −2 medialibrary.shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  110. +37 −0 medialibrary.shell/src/test/java/org/chii2/medialibrary/shell/command/MediaLibraryCommandTest.java
  111. +1 −5 mediaserver.api/pom.xml
  112. +0 −4 mediaserver.core/pom.xml
  113. +2 −10 mediaserver.http/pom.xml
  114. +2 −1  mediaserver.http/src/main/java/org/chii2/mediaserver/http/bio/HttpHandler.java
  115. +14 −11 mediaserver.http/src/main/java/org/chii2/mediaserver/http/bio/RangeFileEntity.java
  116. +58 −61 pom.xml
  117. +0 −4 transcoder.api/pom.xml
  118. +2 −11 transcoder.core/pom.xml
  119. +2 −2 transcoder.core/src/main/java/org/chii2/transcoder/core/mencoder/MencoderMP3LameOpts.java
  120. +1 −1  transcoder.core/src/main/java/org/chii2/transcoder/core/mencoder/MencoderXvidMP3Profile.java
  121. +20 −24 transcoder.core/src/main/java/org/chii2/transcoder/core/mencoder/MencoderXvidMP3ProfileSet.java
  122. +2 −2 transcoder.core/src/main/java/org/chii2/transcoder/core/mencoder/MencoderXvidOpts.java
  123. +89 −52 transcoder.core/src/main/java/org/im4java/core/CommandException.java
  124. +6 −24 transcoder.core/src/main/java/org/im4java/core/DCRAWOps.java
  125. +3 −143 transcoder.core/src/main/java/org/im4java/core/ETOps.java
  126. +987 −404 transcoder.core/src/main/java/org/im4java/core/GMOps.java
  127. +1,599 −654 transcoder.core/src/main/java/org/im4java/core/IMOps.java
  128. +16 −2 transcoder.core/src/main/java/org/im4java/core/ImageCommand.java
  129. +151 −4 transcoder.core/src/main/java/org/im4java/core/Info.java
  130. +0 −99 transcoder.core/src/main/java/org/im4java/core/JPTOps.java
  131. +0 −44 transcoder.core/src/main/java/org/im4java/core/UFRawOps.java
  132. +27 −2 transcoder.core/src/main/java/org/im4java/process/ArrayListOutputConsumer.java
  133. +1 −1  transcoder.core/src/test/java/org/chii2/transcoder/core/mencoder/MencoderTest.java
  134. +60 −0 upnp.core/pom.xml
  135. +337 −0 upnp.core/src/main/java/org/fourthline/cling/DefaultUpnpServiceConfiguration.java
  136. +107 −0 upnp.core/src/main/java/org/fourthline/cling/Main.java
  137. +243 −0 upnp.core/src/main/java/org/fourthline/cling/ManagedUpnpService.java
  138. +232 −0 upnp.core/src/main/java/org/fourthline/cling/ManagedUpnpServiceConfiguration.java
  139. +67 −0 upnp.core/src/main/java/org/fourthline/cling/UpnpService.java
  140. +195 −0 upnp.core/src/main/java/org/fourthline/cling/UpnpServiceConfiguration.java
  141. +138 −0 upnp.core/src/main/java/org/fourthline/cling/UpnpServiceImpl.java
  142. +228 −0 upnp.core/src/main/java/org/fourthline/cling/android/AndroidNetworkAddressFactory.java
  143. +93 −0 upnp.core/src/main/java/org/fourthline/cling/android/AndroidUpnpService.java
  144. +173 −0 upnp.core/src/main/java/org/fourthline/cling/android/AndroidUpnpServiceConfiguration.java
  145. +132 −0 upnp.core/src/main/java/org/fourthline/cling/android/AndroidUpnpServiceImpl.java
  146. +140 −0 upnp.core/src/main/java/org/fourthline/cling/android/AndroidWifiSwitchableRouter.java
  147. +52 −0 upnp.core/src/main/java/org/fourthline/cling/binding/LocalServiceBinder.java
  148. +34 −0 upnp.core/src/main/java/org/fourthline/cling/binding/LocalServiceBindingException.java
  149. +337 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/AnnotationActionBinder.java
  150. +284 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/AnnotationLocalServiceBinder.java
  151. +272 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/AnnotationStateVariableBinder.java
  152. +32 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpAction.java
  153. +33 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpInputArgument.java
  154. +34 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpOutputArgument.java
  155. +37 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpService.java
  156. +33 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpServiceId.java
  157. +34 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpServiceType.java
  158. +48 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpStateVariable.java
  159. +35 −0 upnp.core/src/main/java/org/fourthline/cling/binding/annotations/UpnpStateVariables.java
  160. +47 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableAction.java
  161. +36 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableActionArgument.java
  162. +31 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableAllowedValueRange.java
  163. +122 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableDevice.java
  164. +38 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableIcon.java
  165. +73 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableService.java
  166. +60 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableStateVariable.java
  167. +26 −0 upnp.core/src/main/java/org/fourthline/cling/binding/staging/MutableUDAVersion.java
  168. +103 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/Descriptor.java
  169. +35 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/DescriptorBindingException.java
  170. +43 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/DeviceDescriptorBinder.java
  171. +40 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/ServiceDescriptorBinder.java
  172. +548 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/UDA10DeviceDescriptorBinderImpl.java
  173. +430 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/UDA10DeviceDescriptorBinderSAXImpl.java
  174. +479 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/UDA10ServiceDescriptorBinderImpl.java
  175. +442 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/UDA10ServiceDescriptorBinderSAXImpl.java
  176. +342 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/schema/backup.txt
  177. +344 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/schema/uda10-device.xsd
  178. +291 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/schema/uda10-service.xsd
  179. +330 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/schema/uda11-device.xsd
  180. +293 −0 upnp.core/src/main/java/org/fourthline/cling/binding/xml/schema/uda11-service.xsd
  181. +198 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/ActionCallback.java
  182. +43 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/ControlPoint.java
  183. +114 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/ControlPointImpl.java
  184. +337 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/SubscriptionCallback.java
  185. +36 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/event/ExecuteAction.java
  186. +55 −0 upnp.core/src/main/java/org/fourthline/cling/controlpoint/event/Search.java
  187. +328 −0 upnp.core/src/main/java/org/fourthline/cling/mock/MockUpnpService.java
  188. +28 −0 upnp.core/src/main/java/org/fourthline/cling/model/Command.java
  189. +73 −0 upnp.core/src/main/java/org/fourthline/cling/model/Constants.java
  190. +245 −0 upnp.core/src/main/java/org/fourthline/cling/model/DefaultServiceManager.java
  191. +86 −0 upnp.core/src/main/java/org/fourthline/cling/model/ExpirationDetails.java
  192. +82 −0 upnp.core/src/main/java/org/fourthline/cling/model/Location.java
  193. +246 −0 upnp.core/src/main/java/org/fourthline/cling/model/ModelUtil.java
  194. +206 −0 upnp.core/src/main/java/org/fourthline/cling/model/Namespace.java
  195. +77 −0 upnp.core/src/main/java/org/fourthline/cling/model/NetworkAddress.java
  196. +155 −0 upnp.core/src/main/java/org/fourthline/cling/model/ServerClientTokens.java
  197. +139 −0 upnp.core/src/main/java/org/fourthline/cling/model/ServiceManager.java
  198. +94 −0 upnp.core/src/main/java/org/fourthline/cling/model/ServiceReference.java
  199. +33 −0 upnp.core/src/main/java/org/fourthline/cling/model/Validatable.java
  200. +60 −0 upnp.core/src/main/java/org/fourthline/cling/model/ValidationError.java
  201. +48 −0 upnp.core/src/main/java/org/fourthline/cling/model/ValidationException.java
  202. +111 −0 upnp.core/src/main/java/org/fourthline/cling/model/VariableValue.java
  203. +220 −0 upnp.core/src/main/java/org/fourthline/cling/model/XMLUtil.java
  204. +168 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/AbstractActionExecutor.java
  205. +43 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/ActionArgumentValue.java
  206. +60 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/ActionException.java
  207. +30 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/ActionExecutor.java
  208. +164 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/ActionInvocation.java
  209. +169 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/MethodActionExecutor.java
  210. +83 −0 upnp.core/src/main/java/org/fourthline/cling/model/action/QueryStateVariableExecutor.java
  211. +31 −0 upnp.core/src/main/java/org/fourthline/cling/model/gena/CancelReason.java
  212. +98 −0 upnp.core/src/main/java/org/fourthline/cling/model/gena/GENASubscription.java
  213. +250 −0 upnp.core/src/main/java/org/fourthline/cling/model/gena/LocalGENASubscription.java
  214. +132 −0 upnp.core/src/main/java/org/fourthline/cling/model/gena/RemoteGENASubscription.java
  215. +71 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/IncomingDatagramMessage.java
  216. +51 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/OutgoingDatagramMessage.java
  217. +76 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/StreamRequestMessage.java
  218. +80 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/StreamResponseMessage.java
  219. +181 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/UpnpHeaders.java
  220. +198 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/UpnpMessage.java
  221. +36 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/UpnpOperation.java
  222. +109 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/UpnpRequest.java
  223. +102 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/UpnpResponse.java
  224. +38 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/ActionMessage.java
  225. +25 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/ActionRequestMessage.java
  226. +24 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/ActionResponseMessage.java
  227. +71 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/IncomingActionRequestMessage.java
  228. +52 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/IncomingActionResponseMessage.java
  229. +98 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/OutgoingActionRequestMessage.java
  230. +79 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/control/OutgoingActionResponseMessage.java
  231. +102 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/IncomingNotificationRequest.java
  232. +57 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/IncomingSearchRequest.java
  233. +94 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/IncomingSearchResponse.java
  234. +62 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingNotificationRequest.java
  235. +39 −0 ....core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingNotificationRequestDeviceType.java
  236. +47 −0 ....core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingNotificationRequestRootDevice.java
  237. +44 −0 ...core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingNotificationRequestServiceType.java
  238. +38 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingNotificationRequestUDN.java
  239. +55 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchRequest.java
  240. +56 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponse.java
  241. +41 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponseDeviceType.java
  242. +40 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponseRootDevice.java
  243. +40 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponseRootDeviceUDN.java
  244. +43 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponseServiceType.java
  245. +39 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/discovery/OutgoingSearchResponseUDN.java
  246. +92 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/IncomingEventRequestMessage.java
  247. +65 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/IncomingSubscribeRequestMessage.java
  248. +49 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/IncomingSubscribeResponseMessage.java
  249. +55 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/IncomingUnsubscribeRequestMessage.java
  250. +68 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingEventRequestMessage.java
  251. +35 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingEventResponseMessage.java
  252. +48 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingRenewalRequestMessage.java
  253. +62 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingSubscribeRequestMessage.java
  254. +45 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingSubscribeResponseMessage.java
  255. +40 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/gena/OutgoingUnsubscribeRequestMessage.java
  256. +79 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/CallbackHeader.java
  257. +54 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/ContentRangeHeader.java
  258. +58 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/ContentTypeHeader.java
  259. +51 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/DeviceTypeHeader.java
  260. +52 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/DeviceUSNHeader.java
  261. +41 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/EXTHeader.java
  262. +54 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/EventSequenceHeader.java
  263. +63 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/HostHeader.java
  264. +56 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/InterfaceMacHeader.java
  265. +31 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/InvalidHeaderException.java
  266. +55 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/LocationHeader.java
  267. +80 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/MANHeader.java
  268. +59 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/MXHeader.java
  269. +55 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/MaxAgeHeader.java
  270. +39 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/NTEventHeader.java
  271. +50 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/NTSHeader.java
  272. +52 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/PragmaHeader.java
  273. +52 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/RangeHeader.java
  274. +39 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/RootDeviceHeader.java
  275. +41 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/STAllHeader.java
  276. +127 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/ServerHeader.java
  277. +51 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/ServiceTypeHeader.java
  278. +52 −0 upnp.core/src/main/java/org/fourthline/cling/model/message/header/ServiceUSNHeader.java
Sorry, we could not display the entire diff because too many files (467) changed.
View
5 .hg_archival.txt
@@ -0,0 +1,5 @@
+repo: 251a8923440f229833086f368f608850fed32a99
+node: 3f511cd8a63c0de11b73866bde7df9d5ea0c73bd
+branch: default
+latesttag: null
+latesttagdistance: 45
View
4 README
@@ -1 +1,3 @@
-Chii2
+Chii2 - Open Source Multimedia & Home Automation Solution !!!
+
+The Chii2 project is tend to be a home media server and home automation system.
View
BIN  assembly/bin/felix.jar
Binary file not shown
View
BIN  assembly/bundle/asm-all-3.3.1.jar
Binary file not shown
View
BIN  assembly/bundle/async-http-client-1.6.5.jar
Binary file not shown
View
BIN  assembly/bundle/commons-collections-3.2.1.jar
Binary file not shown
View
BIN  assembly/bundle/commons-io-2.1.jar
Binary file not shown
View
BIN  assembly/bundle/commons-lang-2.6.jar
Binary file not shown
View
BIN  assembly/bundle/commons-pool-1.5.6.jar
Binary file not shown
View
BIN  assembly/bundle/derby-10.8.2.2.jar
Binary file not shown
View
BIN  assembly/bundle/geronimo-j2ee-connector_1.6_spec-1.0.jar
Binary file not shown
View
BIN  assembly/bundle/geronimo-jpa_2.0_spec-1.1.jar
Binary file not shown
View
BIN  assembly/bundle/geronimo-jta_1.1_spec-1.1.1.jar
Binary file not shown
View
BIN  assembly/bundle/geronimo-transaction-3.1.1.jar
Binary file not shown
View
BIN  assembly/bundle/jackson-core-asl-1.9.2.jar
Binary file not shown
View
BIN  assembly/bundle/jackson-mapper-asl-1.9.2.jar
Binary file not shown
View
BIN  assembly/bundle/jcl-over-slf4j-1.6.4.jar
Binary file not shown
View
BIN  assembly/bundle/jpathwatch-0.94.jar
Binary file not shown
View
BIN  assembly/bundle/logback-classic-1.0.0.jar
Binary file not shown
View
BIN  assembly/bundle/logback-core-1.0.0.jar
Binary file not shown
View
BIN  assembly/bundle/netty-3.2.6.Final.jar
Binary file not shown
View
BIN  assembly/bundle/openjpa-2.0.1.jar
Binary file not shown
View
BIN  assembly/bundle/openjpa-2.1.1.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.blueprint-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.jndi-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.jpa.api-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.jpa.blueprint.aries-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.jpa.container-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.jpa.container.context-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.proxy-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.transaction.blueprint-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.transaction.manager-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.transaction.wrappers-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.aries.util-0.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.bundlerepository-1.6.6.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.configadmin-1.2.8.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.eventadmin-1.2.14.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.fileinstall-3.1.10.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.gogo.command-0.12.0.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.gogo.runtime-0.10.0.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.gogo.shell-0.10.0.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.felix.http.bundle-2.2.0.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.httpcomponents.httpclient_4.1.2.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.httpcomponents.httpcore_4.1.3.jar
Binary file not shown
View
BIN  assembly/bundle/org.apache.servicemix.bundles.serp-1.13.1_4.jar
Binary file not shown
View
BIN  assembly/bundle/sanselan-0.97-incubator.jar
Binary file not shown
View
BIN  assembly/bundle/slf4j-api-1.6.4.jar
Binary file not shown
View
6 assembly/conf/chii2/org.chii2.medialibrary.file.cfg
@@ -1,14 +1,14 @@
# Configuration for Chii2 Media Library File Service
# The Movie Directories
-movie.directory=${user.home}/Videos/Movies
+movie.directory=${user.home}/Movies
# Acceptable Video File Extensions
-video.extension=3g2:2gp:asf:avi:bsf:divx:dvdmedia:dvr-ms:f4v:flv:hdmov:m2p:m4v:mkv:mov:mp4:mpeg:mpg:ogm:rm:rmvb:swf:trp:ts:vob:vro:wmv:wtv:xvid
+video.extension=3g2|2gp|asf|avi|bsf|divx|dvdmedia|dvr-ms|f4v|flv|hdmov|m2p|m4v|mkv|mov|mp4|mpeg|mpg|ogm|rm|rmvb|swf|trp|ts|vob|vro|wmv|wtv|xvid
# The Image Directories
image.directory=${user.home}/Pictures
# Acceptable Image File Extensions
-image.extension=jpg:jpeg:jif:jfif:jfi:jp2:j2k:jpf:jpx:jpm:mj2:tiff:tif:3fr:ari:arw:srf:sr2:bay:crw:cr2:cap:iiq:eip:dcs:dcr:drf:k25:kdc:dng:erf:fff:mef:mos:mrw:nef:nrw:orf:ptx:pef:pxn:R3D:raf:raw:rw1:rw2:rwz:x3f:png:gif:bmp:dib:ppm:pbm:pgm:pnm:webp:cgm:svg:svgz:ai:cdr:odg:xps
+image.extension=jpg|jpeg|jif|jfif|jfi|jp2|j2k|jpf|jpx|jpm|mj2|tiff|tif|3fr|ari|arw|srf|sr2|bay|crw|cr2|cap|iiq|eip|dcs|dcr|drf|k25|kdc|dng|erf|fff|mef|mos|mrw|nef|nrw|orf|ptx|pef|pxn|R3D|raf|raw|rw1|rw2|rwz|x3f|png|gif|bmp|dib|ppm|pbm|pgm|pnm|webp|cgm|svg|svgz|ai|cdr|odg|xps
View
2  assembly/conf/chii2/org.chii2.transcoder.core.cfg
@@ -1,4 +1,4 @@
# Configuration for Chii2 Transcoder Service
# The Movie Transcoded Directory
-movie.transcoded.directory=${user.home}/Videos/.Transcoded/Movies
+movie.transcoded.directory=${user.home}/Videos/.Transcoded/Movies
View
1  assembly/conf/config.properties
@@ -641,6 +641,7 @@ jre-1.7=, \
org.xml.sax; \
org.xml.sax.ext; \
org.xml.sax.helpers; \
+ com.sun.nio.file; \
sun.text; \
sun.security.action; \
sun.net.www.protocol.http; \
View
384 assembly/pom.xml
@@ -15,10 +15,6 @@
<name>Chii2 Assembly</name>
<url>http://www.chii2.org</url>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.chii2</groupId>
@@ -98,24 +94,398 @@
</dependencies>
<build>
- <directory>dropin</directory>
<plugins>
+ <!-- Clean -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/bundle</directory>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>**/cling-core-*.jar</exclude>
+ <exclude>**/cling-support-*.jar</exclude>
+ <exclude>**/teleal-common-*.jar</exclude>
+ </excludes>
+ </fileset>
+ <fileset>
+ <directory>${basedir}/dropin</directory>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>${basedir}/log</directory>
+ <includes>
+ <include>**/*.log</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>${basedir}/felix-cache</directory>
+ </fileset>
+ <fileset>
+ <directory>${basedir}/data</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <!-- Copy Dependency -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>copy-dependencies</id>
+ <id>copy-chii2</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeTransitive>true</excludeTransitive>
- <outputDirectory>${project.build.directory}</outputDirectory>
+ <outputDirectory>${basedir}/dropin</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
+ <execution>
+ <id>copy-bundle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>asm</groupId>
+ <artifactId>asm-all</artifactId>
+ <version>3.3.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.ning</groupId>
+ <artifactId>async-http-client</artifactId>
+ <version>1.7.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.4</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.6</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.6</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.8.2.2</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
+ <version>1.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <version>1.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-transaction</artifactId>
+ <version>3.1.1</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.4</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>1.0.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ <version>3.2.7.Final</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>2.2.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.jndi</groupId>
+ <artifactId>org.apache.aries.jndi</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.jpa</groupId>
+ <artifactId>org.apache.aries.jpa.api</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.jpa</groupId>
+ <artifactId>org.apache.aries.jpa.blueprint.aries</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.jpa</groupId>
+ <artifactId>org.apache.aries.jpa.container</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.jpa</groupId>
+ <artifactId>org.apache.aries.jpa.container.context</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.proxy</groupId>
+ <artifactId>org.apache.aries.proxy</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.blueprint</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.manager</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries.transaction</groupId>
+ <artifactId>org.apache.aries.transaction.wrappers</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ <version>0.3</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.bundlerepository</artifactId>
+ <version>1.6.6</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <version>1.2.8</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.eventadmin</artifactId>
+ <version>1.2.14</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.fileinstall</artifactId>
+ <version>3.1.10</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.gogo.command</artifactId>
+ <version>0.12.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.gogo.runtime</artifactId>
+ <version>0.10.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.gogo.shell</artifactId>
+ <version>0.10.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.http.bundle</artifactId>
+ <version>2.2.0</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient-osgi</artifactId>
+ <version>4.1.2</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore-osgi</artifactId>
+ <version>4.1.4</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.serp</artifactId>
+ <version>1.13.1_4</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.sanselan</groupId>
+ <artifactId>sanselan</artifactId>
+ <version>0.97-incubator</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ <type>jar</type>
+ <outputDirectory>${basedir}/bundle</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
View
4 medialibrary.api/pom.xml
@@ -13,10 +13,6 @@
<name>Chii2 Media Library Api</name>
<url>http://www.chii2.org</url>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
<build>
<plugins>
<plugin>
View
58 medialibrary.api/src/main/java/org/chii2/medialibrary/api/core/MediaLibraryService.java
@@ -87,7 +87,7 @@
* Get all possible movie records by movie name
* The Sort Field must prefix with "file." or "info."
* eg. "file.duration" will reference to MovieFile duration
- * "info.language" will reference to MovieInfo language
+ * eg. "info.language" will reference to MovieInfo language
*
* @param movieName Movie Name
* @param firstResult First Result
@@ -122,6 +122,22 @@
/**
* Get all the Images
*
+ * @return Image List
+ */
+ public List<? extends Image> getImages();
+
+ /**
+ * Get all the Images
+ *
+ * @param firstResult First Result
+ * @param maxResults Max Result
+ * @return Image List
+ */
+ public List<? extends Image> getImages(int firstResult, int maxResults);
+
+ /**
+ * Get all the Images
+ *
* @param firstResult First Result
* @param maxResults Max Result
* @param sorts Sort (by <field, sortType>, sort type maybe "asc" or "desc")
@@ -141,6 +157,30 @@
* Get all possible image records by specific image field
* Add "file." before ImageFile field
*
+ * @param fieldName Field Name
+ * @param fieldValue Field Value
+ * @param strict Strict compare field value equal, else will use %fieldValue%
+ * @return Image List
+ */
+ public List<? extends Image> getImagesByField(String fieldName, String fieldValue, boolean strict);
+
+ /**
+ * Get all possible image records by specific image field
+ * Add "file." before ImageFile field
+ *
+ * @param fieldName Field Name
+ * @param fieldValue Field Value
+ * @param strict Strict compare field value equal, else will use %fieldValue%
+ * @param firstResult First Result
+ * @param maxResults Max Result
+ * @return Image List
+ */
+ public List<? extends Image> getImagesByField(String fieldName, String fieldValue, boolean strict, int firstResult, int maxResults);
+
+ /**
+ * Get all possible image records by specific image field
+ * Add "file." before ImageFile field
+ *
* @param fieldName Field Name
* @param fieldValue Field Value
* @param strict Strict compare field value equal, else will use %fieldValue%
@@ -154,6 +194,22 @@
/**
* Get image albums from index with max limit
*
+ * @return Image Albums
+ */
+ public List<String> getImageAlbums();
+
+ /**
+ * Get image albums from index with max limit
+ *
+ * @param firstResult First Result
+ * @param maxResults Max Result
+ * @return Image Albums
+ */
+ public List<String> getImageAlbums(int firstResult, int maxResults);
+
+ /**
+ * Get image albums from index with max limit
+ *
* @param firstResult First Result
* @param maxResults Max Result
* @param sorts Sort (by <field, sortType>, sort type maybe "asc" or "desc")
View
12 medialibrary.api/src/main/java/org/chii2/medialibrary/api/file/FileService.java
@@ -14,6 +14,12 @@
public final static String MOVIE_SCAN_PROVIDED_TOPIC = "org/chii2/medialibrary/file/movie/SCAN_PROVIDED";
// Event Topic for image scan
public final static String IMAGE_SCAN_PROVIDED_TOPIC = "org/chii2/medialibrary/file/image/SCAN_PROVIDED";
+ // Event Topic for movie watch create
+ public final static String MOVIE_WATCH_CREATE_TOPIC = "org/chii2/medialibrary/file/movie/WATCH_CREATE";
+ // Event Topic for movie watch modify
+ public final static String MOVIE_WATCH_MODIFY_TOPIC = "org/chii2/medialibrary/file/movie/WATCH_MODIFY";
+ // Event Topic for movie watch delete
+ public final static String MOVIE_WATCH_DELETE_TOPIC = "org/chii2/medialibrary/file/movie/WATCH_DELETE";
// Event Topic for image watch create
public final static String IMAGE_WATCH_CREATE_TOPIC = "org/chii2/medialibrary/file/image/WATCH_CREATE";
// Event Topic for image watch modify
@@ -26,8 +32,10 @@
public final static String FILTER_PROPERTY = "filter";
// Topic property in the internal event
public final static String TOPIC_PROPERTY = "topic";
- // File information property in the provided event, which should contains the scanned file list
- public final static String FILE_PROPERTY = "files";
+ // File information property in the scan provided event, which should contains the scanned file list
+ public final static String SCAN_PATH_PROPERTY = "scan_files";
+ // File information property in the watch event, which should contains the single file
+ public final static String WATCH_PATH_PROPERTY = "watch_file";
/**
* Scan default directories (from configuration) for movies files
View
51 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/PersistenceService.java
@@ -29,6 +29,14 @@
public Movie getMovieById(String id);
/**
+ * Get Movie by MovieFile
+ *
+ * @param movieFile MovieFile
+ * @return Movie
+ */
+ public Movie getMovieByMovieFile(MovieFile movieFile);
+
+ /**
* Get all possible movie records by movie name
* The Sort Field must prefix with "file." or "info."
* eg. "file.duration" will reference to MovieFile duration
@@ -102,6 +110,20 @@
public long getMovieFilesCount();
/**
+ * Delete Movie based on MovieFile's Absolute Path or Parent Directory
+ *
+ * @param path MovieFile's Absolute Path or Parent Directory
+ */
+ public void deleteMovie(String path);
+
+ /**
+ * Delete all movies in library
+ *
+ * @return the number of instances that were deleted
+ */
+ public int deleteAllMovies();
+
+ /**
* Get all the Images
*
* @param firstResult First Result
@@ -174,23 +196,25 @@
public ImageFile getImageFileById(String id);
/**
- * Delete all images in library
+ * Delete Image based on Original File's Absolute Path or Parent Directory
*
- * @return the number of instances that were deleted
+ * @param path Original File's Absolute Path or Parent Directory
*/
- public int deleteImages();
+ public void deleteImage(String path);
/**
- * Delete all Movie Information
+ * Delete all images in library
+ *
+ * @return the number of instances that were deleted
*/
- public void deleteMovieInfo();
+ public int deleteAllImages();
/**
- * Synchronize Movie Files to database
+ * Synchronize Movie File to database
*
- * @param movieFiles Movie Files
+ * @param movieFile Movie File
*/
- public void synchronize(List<MovieFile> movieFiles);
+ public void synchronizeMovie(MovieFile movieFile);
/**
* Synchronize Movie Information to database
@@ -198,7 +222,16 @@
* @param movieId Movie ID
* @param info Movie Information List
*/
- public void synchronize(String movieId, List<MovieInfo> info);
+ public void synchronizeMovie(String movieId, List<MovieInfo> info);
+
+ /**
+ * Synchronize ImageFile to dataBase
+ * If File already in database, it will keep current Image, update ImageFile (by replace ImageFile)
+ * If File not present in database, it will create new Image & ImageFile
+ *
+ * @param imageFile ImageFile
+ */
+ public void synchronizeImage(ImageFile imageFile);
/**
* Persis entity into database, proxy to EntityManager.persist
View
4 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/Image.java
@@ -68,14 +68,14 @@
*
* @return Image File
*/
- public ImageFile getFile();
+ public ImageFile getOriginalFile();
/**
* Set the Image File
*
* @param imageFile Image File
*/
- public void setFile(ImageFile imageFile);
+ public void setOriginalFile(ImageFile imageFile);
/**
* Image is photo
View
14 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/ImageFile.java
@@ -342,4 +342,18 @@
* @param flash Flash
*/
public void setFlash(int flash);
+
+ /**
+ * Get Image Reference
+ *
+ * @return Image
+ */
+ public Image getImage();
+
+ /**
+ * Set Image Reference
+ *
+ * @param image Image
+ */
+ public void setImage(Image image);
}
View
8 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/MovieFile.java
@@ -1,6 +1,6 @@
package org.chii2.medialibrary.api.persistence.entity;
-import java.io.File;
+import java.nio.file.Path;
import java.util.Date;
/**
@@ -27,7 +27,7 @@
*
* @return File
*/
- public File getFile();
+ public Path getFile();
/**
* Get Movie File Name
@@ -62,14 +62,14 @@
*
* @return Absolute File Name (Including Path)
*/
- public String getAbsoluteName();
+ public String getAbsolutePath();
/**
* Set Movie Absolute File Name (Including Path)
*
* @param absoluteName Absolute File Name (Including Path)
*/
- public void setAbsoluteName(String absoluteName);
+ public void setAbsolutePath(String absoluteName);
/**
* Get Movie Name (Guessed from File Name)
View
47 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/ImageFileInfoProviderService.java
@@ -0,0 +1,47 @@
+package org.chii2.medialibrary.api.provider;
+
+import java.nio.file.Path;
+import java.util.List;
+
+/**
+ * Image Information Provider Service
+ */
+public interface ImageFileInfoProviderService {
+ // Event Topic for image file information request
+ // This Event should contains a IMAGE_PATH_PROPERTY, which is a File/Path
+ public final static String IMAGE_FILE_INFO_REQUEST_TOPIC = "org/chii2/medialibrary/provider/image/FILE_INFO_REQUEST";
+ // Event Topic for image file information provided
+ // This Event should contains a IMAGE_FILE_INFO_PROPERTY, which is a ImageFile
+ public final static String IMAGE_FILE_INFO_PROVIDED_TOPIC = "org/chii2/medialibrary/provider/image/FILE_INFO_PROVIDED";
+ // Event Topic for image file information failed (with parse or fetch)
+ public final static String IMAGE_FILE_INFO_FAILED_TOPIC = "org/chii2/medialibrary/provider/image/FILE_INFO_FAILED";
+ // Image file property key in the image file info REQUEST & PROVIDED & FAIL events, this should be the file list from the request
+ public final static String IMAGE_PATH_PROPERTY = "image_path";
+ // Image information property key in the image file info PROVIDED events, this should be the image information result from provider
+ public final static String IMAGE_FILE_INFO_PROPERTY = "image_file_info";
+ // Fail reason property key in the image file info FAILED events
+ public final static String FAIL_MESSAGE_PROPERTY = "fail_msg";
+
+ /**
+ * Get the provider name
+ *
+ * @return Provider name
+ */
+ public String getProviderName();
+
+ /**
+ * Get Image Information.
+ * This should be done in a asynchronous way, through Event Admin
+ *
+ * @param imageFile Image File
+ */
+ public void getImageInformation(Path imageFile);
+
+ /**
+ * Get Image Information.
+ * This should be done in a asynchronous way, through Event Admin
+ *
+ * @param imageFiles Image File List
+ */
+ public void getImageInformation(List<Path> imageFiles);
+}
View
48 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/ImageInfoProviderService.java
@@ -1,48 +0,0 @@
-package org.chii2.medialibrary.api.provider;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * Image Information Provider Service
- */
-public interface ImageInfoProviderService {
-
- // Event Topic for image information request
- // This Event should contains a IMAGE_FILE_PROPERTY, which is a List of File
- public final static String IMAGE_INFO_REQUEST_TOPIC = "org/chii2/medialibrary/provider/image/INFO_REQUEST";
- // Event Topic for image information provided
- // This Event should contains a IMAGE_INFO_PROPERTY, which is a List of Image
- public final static String IMAGE_INFO_PROVIDED_TOPIC = "org/chii2/medialibrary/provider/image/INFO_PROVIDED";
- // Event Topic for image information failed (with parse or fetch)
- public final static String IMAGE_INFO_FAILED_TOPIC = "org/chii2/medialibrary/provider/image/INFO_FAILED";
- // Image file property key in the image info REQUEST & PROVIDED & FAIL events, this should be the file list from the request
- public final static String IMAGE_FILE_PROPERTY = "image_file";
- // Image information property key in the image info PROVIDED events, this should be the image information result from provider
- public final static String IMAGE_INFO_PROPERTY = "image_info";
- // Fail reason property key in the image info FAILED events
- public final static String FAIL_MESSAGE_PROPERTY = "fail_msg";
-
- /**
- * Get the provider name
- *
- * @return Provider name
- */
- public String getProviderName();
-
- /**
- * Get Image Information.
- * This should be done in a asynchronous way, through Event Admin
- *
- * @param imageFile Image File
- */
- public void getImageInformation(File imageFile);
-
- /**
- * Get Image Information.
- * This should be done in a asynchronous way, through Event Admin
- *
- * @param imageFiles Image File List
- */
- public void getImageInformation(List<File> imageFiles);
-}
View
10 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/MovieFileInfoProviderService.java
@@ -1,6 +1,6 @@
package org.chii2.medialibrary.api.provider;
-import java.io.File;
+import java.nio.file.Path;
import java.util.List;
/**
@@ -14,9 +14,11 @@
// Event Topic for movie file information failed (with parse or fetch)
public final static String MOVIE_FILE_INFO_FAILED_TOPIC = "org/chii2/medialibrary/provider/movie/FILE_INFO_FAILED";
// Movie file property key in the movie file info request/failed events, this should be the file list from the request
- public final static String MOVIE_FILE_PROPERTY = "movie_file";
+ public final static String MOVIE_PATH_PROPERTY = "movie_path";
// Movie file information property key in the movie file info provided events, this should be the movie file information result from provider
public final static String MOVIE_FILE_INFO_PROPERTY = "movie_file_info";
+ // Fail reason property key in the movie file info FAILED events
+ public final static String FAIL_MESSAGE_PROPERTY = "fail_msg";
/**
* Get the provider name
@@ -31,7 +33,7 @@
*
* @param movieFile Movie File
*/
- public void getMovieFileInformation(File movieFile);
+ public void getMovieFileInformation(Path movieFile);
/**
* Get Movie Files Information.
@@ -39,5 +41,5 @@
*
* @param movieFiles Image File List
*/
- public void getMovieFileInformation(List<File> movieFiles);
+ public void getMovieFileInformation(List<Path> movieFiles);
}
View
2  medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/MovieInfoProviderService.java
@@ -25,6 +25,8 @@
public final static String BACKDROP_COUNT_PROPERTY = "backdrop_count";
// Movie information property key in the movie info provided events
public final static String MOVIE_INFO_PROPERTY = "movie_info";
+ // Fail reason property key in the movie info failed events
+ public final static String FAIL_MESSAGE_PROPERTY = "fail_msg";
/**
* Get the provider name
View
12 medialibrary.api/src/main/java/org/chii2/medialibrary/api/shell/command/MediaLibraryCommand.java
@@ -1,22 +1,20 @@
package org.chii2.medialibrary.api.shell.command;
-import java.util.List;
-
/**
* Media Library Shell Command
*/
public interface MediaLibraryCommand {
/**
- * Command scanAll, scanAll all kinds of media and save them in library, this may also trigger information update from providers
+ * Command scan, scan all kinds of media and save them in library, this may also trigger different providers
*
- * @param media Media type, currently supported type are: <movies>
+ * @param options Command Options
*/
- public void scan(String media);
+ public void scan(String[] options);
/**
* Command show, show all kinds of media in chii2 media library
*
- * @param arguments Show command arguments, currently support arguments are: <movies>
+ * @param options Command Options
*/
- public void show(String[] arguments);
+ public void show(String[] options);
}
View
4 medialibrary.core/pom.xml
@@ -13,10 +13,6 @@
<name>Chii2 Media Library Core</name>
<url>http://www.chii2.org</url>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.chii2</groupId>
View
77 medialibrary.core/src/main/java/org/chii2/medialibrary/MediaLibraryServiceImpl.java
@@ -20,13 +20,12 @@
* Media Library Core Interface, provide major functionality & operations.
*/
public class MediaLibraryServiceImpl implements MediaLibraryService {
-
// Persistence Service
private PersistenceService persistenceService;
// Injected EventAdmin Service
private EventAdmin eventAdmin;
// Logger
- private Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.core");
+ private final Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.core");
/**
* Life Cycle Init
@@ -53,111 +52,141 @@ public void scanAll() {
@Override
public void scanMovies() {
// Prepare properties
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
+ Dictionary<String, Object> properties = new Hashtable<>();
// Send a event
Event event = new Event(FileService.MOVIE_SCAN_REQUEST_TOPIC, properties);
logger.debug("Send a movie scan request event.");
- eventAdmin.postEvent(event);
+ this.eventAdmin.postEvent(event);
}
@Override
public void scanImages() {
// Prepare properties
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
+ Dictionary<String, Object> properties = new Hashtable<>();
// Send a event
Event event = new Event(FileService.IMAGE_SCAN_REQUEST_TOPIC, properties);
logger.debug("Send a image scan request event.");
- eventAdmin.postEvent(event);
+ this.eventAdmin.postEvent(event);
}
@Override
public List<? extends Movie> getMovies() {
- return persistenceService.getMovies(-1, -1, null);
+ return this.persistenceService.getMovies(-1, -1, null);
}
@Override
public List<? extends Movie> getMovies(int firstResult, int maxResults) {
- return persistenceService.getMovies(firstResult, maxResults, null);
+ return this.persistenceService.getMovies(firstResult, maxResults, null);
}
@Override
public List<? extends Movie> getMovies(int firstResult, int maxResults, Map<String, String> sorts) {
- return persistenceService.getMovies(firstResult, maxResults, sorts);
+ return this.persistenceService.getMovies(firstResult, maxResults, sorts);
}
@Override
public Movie getMovieById(String id) {
- return persistenceService.getMovieById(id);
+ return this.persistenceService.getMovieById(id);
}
@Override
public List<? extends Movie> getMoviesByName(String movieName) {
- return persistenceService.getMoviesByName(movieName, -1, -1, null);
+ return this.persistenceService.getMoviesByName(movieName, -1, -1, null);
}
@Override
public List<? extends Movie> getMoviesByName(String movieName, int firstResult, int maxResults) {
- return persistenceService.getMoviesByName(movieName, firstResult, maxResults, null);
+ return this.persistenceService.getMoviesByName(movieName, firstResult, maxResults, null);
}
@Override
public List<? extends Movie> getMoviesByName(String movieName, int firstResult, int maxResults, Map<String, String> sorts) {
- return persistenceService.getMoviesByName(movieName, firstResult, maxResults, sorts);
+ return this.persistenceService.getMoviesByName(movieName, firstResult, maxResults, sorts);
}
@Override
public byte[] getMovieThumbnailById(String movieId) {
- return persistenceService.getMovieThumbnailById(movieId);
+ return this.persistenceService.getMovieThumbnailById(movieId);
}
@Override
public long getMoviesCount() {
- return persistenceService.getMoviesCount();
+ return this.persistenceService.getMoviesCount();
}
@Override
public long getMovieFilesCount() {
- return persistenceService.getMovieFilesCount();
+ return this.persistenceService.getMovieFilesCount();
+ }
+
+ @Override
+ public List<? extends Image> getImages() {
+ return this.persistenceService.getImages(-1, -1, null);
+ }
+
+ @Override
+ public List<? extends Image> getImages(int firstResult, int maxResults) {
+ return this.persistenceService.getImages(firstResult, maxResults, null);
}
@Override
public List<? extends Image> getImages(int firstResult, int maxResults, Map<String, String> sorts) {
- return persistenceService.getImages(firstResult, maxResults, sorts);
+ return this.persistenceService.getImages(firstResult, maxResults, sorts);
}
@Override
public Image getImageById(String id) {
- return persistenceService.getImageById(id);
+ return this.persistenceService.getImageById(id);
+ }
+
+ @Override
+ public List<? extends Image> getImagesByField(String fieldName, String fieldValue, boolean strict) {
+ return this.persistenceService.getImagesByField(fieldName, fieldValue, strict, -1, -1, null);
+ }
+
+ @Override
+ public List<? extends Image> getImagesByField(String fieldName, String fieldValue, boolean strict, int firstResult, int maxResults) {
+ return this.persistenceService.getImagesByField(fieldName, fieldValue, strict, firstResult, maxResults, null);
}
@Override
public List<? extends Image> getImagesByField(String fieldName, String fieldValue, boolean strict, int firstResult, int maxResults, Map<String, String> sorts) {
- return persistenceService.getImagesByField(fieldName, fieldValue, strict, firstResult, maxResults, sorts);
+ return this.persistenceService.getImagesByField(fieldName, fieldValue, strict, firstResult, maxResults, sorts);
+ }
+
+ @Override
+ public List<String> getImageAlbums() {
+ return this.persistenceService.getImageAlbums(-1, -1, null);
+ }
+
+ @Override
+ public List<String> getImageAlbums(int firstResult, int maxResults) {
+ return this.persistenceService.getImageAlbums(firstResult, maxResults, null);
}
@Override
public List<String> getImageAlbums(int firstResult, int maxResults, Map<String, String> sorts) {
- return persistenceService.getImageAlbums(firstResult, maxResults, sorts);
+ return this.persistenceService.getImageAlbums(firstResult, maxResults, sorts);
}
@Override
public long getImagesCount() {
- return persistenceService.getImagesCount();
+ return this.persistenceService.getImagesCount();
}
@Override
public long getImageAlbumsCount() {
- return persistenceService.getImageAlbumsCount();
+ return this.persistenceService.getImageAlbumsCount();
}
@Override
public long getImagesCountByAlbum(String album) {
- return persistenceService.getImagesCountByAlbum(album);
+ return this.persistenceService.getImagesCountByAlbum(album);
}
@Override
public ImageFile getImageFileById(String id) {
- return persistenceService.getImageFileById(id);
+ return this.persistenceService.getImageFileById(id);
}
/**
View
74 medialibrary.core/src/main/java/org/chii2/medialibrary/event/ImageHandler.java
@@ -1,9 +1,10 @@
package org.chii2.medialibrary.event;
+import org.apache.commons.lang.exception.ExceptionUtils;
import org.chii2.medialibrary.api.file.FileService;
import org.chii2.medialibrary.api.persistence.PersistenceService;
-import org.chii2.medialibrary.api.persistence.entity.Image;
-import org.chii2.medialibrary.api.provider.ImageInfoProviderService;
+import org.chii2.medialibrary.api.persistence.entity.ImageFile;
+import org.chii2.medialibrary.api.provider.ImageFileInfoProviderService;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.event.Event;
@@ -12,8 +13,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.List;
@@ -31,7 +33,7 @@
//Configuration FIle
private final static String CONFIG_FILE = "org.chii2.medialibrary.core";
// Logger
- private Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.event");
+ private final Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.event");
/**
* Life Cycle Init
@@ -45,7 +47,7 @@ public void init() {
Configuration config = configAdmin.getConfiguration(CONFIG_FILE);
props = config.getProperties();
} catch (IOException e) {
- logger.error("ImageHandler fail to load configuration with exception: {}.", e.getMessage());
+ logger.error("ImageHandler fail to load configuration with exception: {}.", ExceptionUtils.getMessage(e));
}
// Load each configuration
if (props == null || props.isEmpty()) {
@@ -63,33 +65,37 @@ public void destroy() {
}
@Override
+ @SuppressWarnings("unchecked")
public void handleEvent(Event event) {
- // Image Scan Event
if (FileService.IMAGE_SCAN_PROVIDED_TOPIC.equals(event.getTopic())) {
- // Get List of file names from event, this should be fine
- @SuppressWarnings("unchecked")
- List<File> files = (List<File>) event.getProperty(FileService.FILE_PROPERTY);
+ List<Path> files = (List<Path>) event.getProperty(FileService.SCAN_PATH_PROPERTY);
logger.debug("Receive a image scan event with {} records.", files.size());
- this.postImageInfoRequestEvent(files);
- } else if (ImageInfoProviderService.IMAGE_INFO_PROVIDED_TOPIC.equals(event.getTopic())) {
- // Get List of Image Information from event, this should be fine
- @SuppressWarnings("unchecked")
- List<Image> images = (List<Image>) event.getProperty(ImageInfoProviderService.IMAGE_INFO_PROPERTY);
- logger.debug("Receive a image information provided event with {} records.", images.size());
- // Purge current images
- persistenceService.deleteImages();
- // Merge into DB
- if (images != null) {
- logger.info("Merge {} images into database", images.size());
- for (Image image : images) {
- persistenceService.merge(image);
- }
- }
- } else if (ImageInfoProviderService.IMAGE_INFO_FAILED_TOPIC.equals(event.getTopic())) {
- // Get List of file names from event, this should be fine
- @SuppressWarnings("unchecked")
- List<File> files = (List<File>) event.getProperty(ImageInfoProviderService.IMAGE_FILE_PROPERTY);
- logger.debug("Receive a image information failed event with {} records.", files.size());
+ this.postImageFileInfoRequestEvent(files);
+ } else if (FileService.IMAGE_WATCH_CREATE_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ List<Path> files = new ArrayList<>();
+ files.add(path);
+ logger.debug("Receive a image watch create event for: {}.", path);
+ this.postImageFileInfoRequestEvent(files);
+ } else if (FileService.IMAGE_WATCH_DELETE_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ logger.debug("Receive a image watch delete event for: {}.", path);
+ this.persistenceService.deleteImage(path.toString());
+ } else if (FileService.IMAGE_WATCH_MODIFY_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ List<Path> files = new ArrayList<>();
+ files.add(path);
+ logger.debug("Receive a image watch modify event for: {}.", path);
+ this.postImageFileInfoRequestEvent(files);
+ } else if (ImageFileInfoProviderService.IMAGE_FILE_INFO_PROVIDED_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(ImageFileInfoProviderService.IMAGE_PATH_PROPERTY);
+ ImageFile imageFile = (ImageFile) event.getProperty(ImageFileInfoProviderService.IMAGE_FILE_INFO_PROPERTY);
+ logger.debug("Receive a image file information provided event for {}.", path);
+ // Synchronize to DB
+ this.persistenceService.synchronizeImage(imageFile);
+ } else if (ImageFileInfoProviderService.IMAGE_FILE_INFO_FAILED_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(ImageFileInfoProviderService.IMAGE_PATH_PROPERTY);
+ logger.debug("Receive a image file information failed event for: {}.", path);
}
}
@@ -98,14 +104,14 @@ public void handleEvent(Event event) {
*
* @param files Files to be parsed
*/
- private void postImageInfoRequestEvent(List<File> files) {
+ private void postImageFileInfoRequestEvent(List<Path> files) {
// Prepare properties
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
- properties.put(ImageInfoProviderService.IMAGE_FILE_PROPERTY, files);
+ Dictionary<String, Object> properties = new Hashtable<>();
+ properties.put(ImageFileInfoProviderService.IMAGE_PATH_PROPERTY, files);
// Send a event
- Event event = new Event(ImageInfoProviderService.IMAGE_INFO_REQUEST_TOPIC, properties);
+ Event event = new Event(ImageFileInfoProviderService.IMAGE_FILE_INFO_REQUEST_TOPIC, properties);
logger.debug("Send a image information request event with {} files.", files.size());
- eventAdmin.postEvent(event);
+ this.eventAdmin.postEvent(event);
}
/**
View
88 medialibrary.core/src/main/java/org/chii2/medialibrary/event/MovieHandler.java
@@ -1,6 +1,7 @@
package org.chii2.medialibrary.event;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.exception.ExceptionUtils;
import org.chii2.medialibrary.api.file.FileService;
import org.chii2.medialibrary.api.persistence.PersistenceService;
import org.chii2.medialibrary.api.persistence.entity.Movie;
@@ -18,8 +19,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
import java.io.IOException;
+import java.nio.file.Path;
import java.util.*;
/**
@@ -50,7 +51,7 @@
// Backdrop Fetch Count Config Key
private final static String MOVIE_BACKDROP_COUNT = "movie.backdrop.count";
// Logger
- private Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.event");
+ private final Logger logger = LoggerFactory.getLogger("org.chii2.medialibrary.event");
/**
* Life Cycle Init
@@ -64,7 +65,7 @@ public void init() {
Configuration config = configAdmin.getConfiguration(CONFIG_FILE);
props = config.getProperties();
} catch (IOException e) {
- logger.error("MovieHandler fail to load configuration with exception: {}.", e.getMessage());
+ logger.error("MovieHandler fail to load configuration with exception: {}.", ExceptionUtils.getMessage(e));
}
// Load each configuration
if (props == null || props.isEmpty()) {
@@ -108,54 +109,67 @@ public void destroy() {
}
@Override
+ @SuppressWarnings("unchecked")
public void handleEvent(Event event) {
// Movie Scan Event
if (FileService.MOVIE_SCAN_PROVIDED_TOPIC.equals(event.getTopic())) {
- // Get list of File from event, this should be fine
- @SuppressWarnings("unchecked")
- List<File> files = (List<File>) event.getProperty(FileService.FILE_PROPERTY);
+ List<Path> files = (List<Path>) event.getProperty(FileService.SCAN_PATH_PROPERTY);
logger.debug("Receive a movie scan event with {} records.", files.size());
- postMovieFileInfoRequestEvent(files);
+ this.postMovieFileInfoRequestEvent(files);
}
- // Movie FIle Information Provided Event
+ // Movie Watch Create Event
+ else if (FileService.MOVIE_WATCH_CREATE_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ List<Path> files = new ArrayList<>();
+ files.add(path);
+ logger.debug("Receive a movie watch create event for: {}.", path);
+ this.postMovieFileInfoRequestEvent(files);
+ }
+ // Movie Watch Delete Event
+ else if (FileService.MOVIE_WATCH_DELETE_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ logger.debug("Receive a movie watch delete event for: {}.", path);
+ this.persistenceService.deleteMovie(path.toString());
+ }
+ // Movie Watch Modify Event
+ else if (FileService.MOVIE_WATCH_MODIFY_TOPIC.equals(event.getTopic())) {
+ Path path = (Path) event.getProperty(FileService.WATCH_PATH_PROPERTY);
+ List<Path> files = new ArrayList<>();
+ files.add(path);
+ logger.debug("Receive a movie watch modify event for: {}.", path);
+ this.postMovieFileInfoRequestEvent(files);
+ }
+ // Movie File Information Provided Event
else if (MovieFileInfoProviderService.MOVIE_FILE_INFO_PROVIDED_TOPIC.equals(event.getTopic())) {
- // Get list of Movie from event, this should be fine
- @SuppressWarnings("unchecked")
- List<MovieFile> movieFiles = (List<MovieFile>) event.getProperty(MovieFileInfoProviderService.MOVIE_FILE_INFO_PROPERTY);
- logger.debug("Receive a movie file information provided event with {} records.", movieFiles.size());
+ Path path = (Path) event.getProperty(MovieFileInfoProviderService.MOVIE_PATH_PROPERTY);
+ MovieFile movieFile = (MovieFile) event.getProperty(MovieFileInfoProviderService.MOVIE_FILE_INFO_PROPERTY);
+ logger.debug("Receive a movie file information provided event for: {}.", path);
// Synchronize
- persistenceService.synchronize(movieFiles);
- // Delete old movie information
- if (forceInfoUpdate) {
- persistenceService.deleteMovieInfo();
- }
- // Notify providers fetch movie info (online information)
- List<? extends Movie> movies = persistenceService.getMovies(-1, -1, null);
- for (Movie movie : movies) {
- if (movie.getFilesCount() > 0 && (forceInfoUpdate || movie.getInfoCount() == 0)) {
- MovieFile movieFile = movie.getFiles().get(0);
- postMovieInfoRequestEvent(movie.getId(), movieFile.getMovieName(), movieFile.getYear(), 1, posterCount, backdropCount);
- }
+ this.persistenceService.synchronizeMovie(movieFile);
+ // Get Movie (since it is lazy loading)
+ Movie movie = this.persistenceService.getMovieByMovieFile(movieFile);
+ // Request movie information
+ if (forceInfoUpdate || movie.getInfoCount() == 0) {
+ this.postMovieInfoRequestEvent(movie.getId(), movieFile.getMovieName(), movieFile.getYear(), 1, this.posterCount, this.backdropCount);
}
}
- // Movie FIle Information Failed Event
+ // Movie File Information Failed Event
else if (MovieFileInfoProviderService.MOVIE_FILE_INFO_FAILED_TOPIC.equals(event.getTopic())) {
- // Currently, do nothing here
- logger.debug("Receive a movie file information failed event.");
+ Path path = (Path) event.getProperty(MovieFileInfoProviderService.MOVIE_PATH_PROPERTY);
+ logger.debug("Receive a movie file information failed event for: {}.", path);
}
// Movie Information Provided Event
else if (MovieInfoProviderService.MOVIE_INFO_PROVIDED_TOPIC.equals(event.getTopic())) {
String movieId = (String) event.getProperty(MovieInfoProviderService.MOVIE_ID_PROPERTY);
- @SuppressWarnings("unchecked")
List<MovieInfo> info = (List<MovieInfo>) event.getProperty(MovieInfoProviderService.MOVIE_INFO_PROPERTY);
logger.debug("Receive a movie information provided event with {} information.", info.size());
// Synchronize
- persistenceService.synchronize(movieId, info);
+ this.persistenceService.synchronizeMovie(movieId, info);
}
// Movie Information provided Failed Event
else if (MovieInfoProviderService.MOVIE_INFO_FAILED_TOPIC.equals(event.getTopic())) {
- // Currently, do nothing here
- logger.debug("Receive a movie information failed event.");
+ String movieId = (String) event.getProperty(MovieInfoProviderService.MOVIE_ID_PROPERTY);
+ logger.debug("Receive a movie information failed event for: {}.", movieId);
}
}
@@ -164,14 +178,14 @@ else if (MovieInfoProviderService.MOVIE_INFO_FAILED_TOPIC.equals(event.getTopic(
*
* @param files Files to be parsed
*/
- private void postMovieFileInfoRequestEvent(List<File> files) {
+ private void postMovieFileInfoRequestEvent(List<Path> files) {
// Prepare properties
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
- properties.put(MovieFileInfoProviderService.MOVIE_FILE_PROPERTY, files);
+ Dictionary<String, Object> properties = new Hashtable<>();
+ properties.put(MovieFileInfoProviderService.MOVIE_PATH_PROPERTY, files);
// Send a event
Event event = new Event(MovieFileInfoProviderService.MOVIE_FILE_INFO_REQUEST_TOPIC, properties);
logger.debug("Send a movie file information request event with {} files.", files.size());
- eventAdmin.postEvent(event);
+ this.eventAdmin.postEvent(event);
}
/**
@@ -186,7 +200,7 @@ private void postMovieFileInfoRequestEvent(List<File> files) {
*/
private void postMovieInfoRequestEvent(String movieId, String movieName, int movieYear, int resultCount, int posterCount, int backdropCount) {
// Prepare properties
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
+ Dictionary<String, Object> properties = new Hashtable<>();
properties.put(MovieInfoProviderService.MOVIE_ID_PROPERTY, movieId);
properties.put(MovieInfoProviderService.MOVIE_NAME_PROPERTY, movieName);
properties.put(MovieInfoProviderService.MOVIE_YEAR_PROPERTY, movieYear);
@@ -196,7 +210,7 @@ private void postMovieInfoRequestEvent(String movieId, String movieName, int mov
// Send a event
Event event = new Event(MovieInfoProviderService.MOVIE_INFO_REQUEST_TOPIC, properties);
logger.debug("Send a movie <{}> information request event.", movieId);
- eventAdmin.postEvent(event);
+ this.eventAdmin.postEvent(event);
}
/**
View
10 medialibrary.core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -56,6 +56,9 @@
<entry key="event.topics">
<list>
<value>org/chii2/medialibrary/file/movie/SCAN_PROVIDED</value>
+ <value>org/chii2/medialibrary/file/movie/WATCH_CREATE</value>
+ <value>org/chii2/medialibrary/file/movie/WATCH_MODIFY</value>
+ <value>org/chii2/medialibrary/file/movie/WATCH_DELETE</value>
<value>org/chii2/medialibrary/provider/movie/FILE_INFO_PROVIDED</value>
<value>org/chii2/medialibrary/provider/movie/FILE_INFO_FAILED</value>
<value>org/chii2/medialibrary/provider/movie/INFO_PROVIDED</value>
@@ -72,8 +75,11 @@
<entry key="event.topics">
<list>
<value>org/chii2/medialibrary/file/image/SCAN_PROVIDED</value>
- <value>org/chii2/medialibrary/provider/image/INFO_PROVIDED</value>
- <value>org/chii2/medialibrary/provider/image/INFO_FAILED</value>
+ <value>org/chii2/medialibrary/file/image/WATCH_CREATE</value>
+ <value>org/chii2/medialibrary/file/image/WATCH_MODIFY</value>
+ <value>org/chii2/medialibrary/file/image/WATCH_DELETE</value>
+ <value>org/chii2/medialibrary/provider/image/FILE_INFO_PROVIDED</value>
+ <value>org/chii2/medialibrary/provider/image/FILE_INFO_FAILED</value>
</list>
</entry>
</service-properties>
View
4 medialibrary.datasource/pom.xml
@@ -15,10 +15,6 @@