Permalink
Browse files

Init

  • Loading branch information...
1 parent a9cf1fb commit 28e8af5e678e61f3fb58826376be810905de1785 @longkerdandy committed Dec 29, 2010
Showing with 12,762 additions and 0 deletions.
  1. +38 −0 medialibrary.api/pom.xml
  2. +48 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/core/MediaLibraryService.java
  3. +32 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/file/FileService.java
  4. +160 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/PersistenceService.java
  5. +243 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/Movie.java
  6. +190 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/MovieFile.java
  7. +119 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/MovieImage.java
  8. +318 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/entity/MovieInfo.java
  9. +40 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/persistence/factory/MovieFactory.java
  10. +89 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/provider/MovieInfoProviderService.java
  11. +22 −0 medialibrary.api/src/main/java/org/chii2/medialibrary/api/shell/command/MediaLibraryCommand.java
  12. +61 −0 medialibrary.core/pom.xml
  13. +88 −0 medialibrary.core/src/main/java/org/chii2/medialibrary/MediaLibraryServiceImpl.java
  14. +648 −0 medialibrary.core/src/main/java/org/chii2/medialibrary/event/MovieHandler.java
  15. +68 −0 medialibrary.core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  16. +50 −0 medialibrary.datasource/pom.xml
  17. +32 −0 medialibrary.datasource/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  18. +67 −0 medialibrary.file/pom.xml
  19. +48 −0 medialibrary.file/src/main/java/org/chii2/medialibrary/file/FileExtensionFilter.java
  20. +92 −0 medialibrary.file/src/main/java/org/chii2/medialibrary/file/FileScanner.java
  21. +188 −0 medialibrary.file/src/main/java/org/chii2/medialibrary/file/FileServiceImpl.java
  22. +25 −0 medialibrary.file/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  23. +91 −0 medialibrary.persistence/pom.xml
  24. +218 −0 ...alibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/PersistenceServiceImpl.java
  25. +207 −0 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieFileImpl.java
  26. +137 −0 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieImageImpl.java
  27. +488 −0 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieImpl.java
  28. +354 −0 medialibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/entity/MovieInfoImpl.java
  29. +65 −0 ...ibrary.persistence/src/main/java/org/chii2/medialibrary/persistence/factory/MovieFactoryImpl.java
  30. +27 −0 medialibrary.persistence/src/main/resources/META-INF/persistence.xml
  31. +35 −0 medialibrary.persistence/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  32. +47 −0 medialibrary.shell/pom.xml
  33. +195 −0 medialibrary.shell/src/main/java/org/chii2/medialibrary/shell/command/MediaLibraryCommandImpl.java
  34. +28 −0 medialibrary.shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  35. +75 −0 medialibrary.tmdbprovider/pom.xml
  36. +312 −0 ...tmdbprovider/src/main/java/org/chii2/medialibrary/provider/tmdb/MovieInfoProviderServiceImpl.java
  37. +88 −0 ...tmdbprovider/src/main/java/org/chii2/medialibrary/provider/tmdb/handler/ImageResponseHandler.java
  38. +185 −0 ...tmdbprovider/src/main/java/org/chii2/medialibrary/provider/tmdb/handler/MovieResponseHandler.java
  39. +27 −0 medialibrary.tmdbprovider/src/main/java/org/chii2/medialibrary/provider/tmdb/parser/Parser.java
  40. +243 −0 medialibrary.tmdbprovider/src/main/java/org/chii2/medialibrary/provider/tmdb/parser/YamlParser.java
  41. +30 −0 medialibrary.tmdbprovider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
  42. +43 −0 utility/pom.xml
  43. +122 −0 utility/src/main/java/org/chii2/util/ConfigUtils.java
  44. +256 −0 utility/src/main/java/regex2/ASCII.java
  45. +171 −0 utility/src/main/java/regex2/MatchResult.java
  46. +1,265 −0 utility/src/main/java/regex2/Matcher.java
  47. +5,281 −0 utility/src/main/java/regex2/Pattern.java
  48. +106 −0 utility/src/main/java/regex2/PatternSyntaxException.java
View
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>chii2</artifactId>
+ <groupId>org.chii2</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>chii2.medialibrary.api</artifactId>
+ <packaging>bundle</packaging>
+
+ <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>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Export-Package>org.chii2.medialibrary.api.*</Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
@@ -0,0 +1,48 @@
+package org.chii2.medialibrary.api.core;
+
+import org.chii2.medialibrary.api.persistence.entity.Movie;
+
+import java.util.List;
+
+/**
+ * Media Library Core Interface, provide major functionality & operations.
+ */
+public interface MediaLibraryService {
+
+ /**
+ * Scan for all kinds of media files in directories.
+ * (Media type extensions and Directories are configured in configuration file)
+ */
+ public void scan();
+
+ /**
+ * Get all the Movies in the Media Library.
+ *
+ * @return Movie List
+ */
+ public List<? extends Movie> getAllMovies();
+
+ /**
+ * Get Movie by Movie ID
+ *
+ * @param id Movie ID
+ * @return Movie
+ */
+ public Movie getMovieById(String id);
+
+ /**
+ * Get all possible movie records by movie name
+ *
+ * @param movieName Movie Name
+ * @return Movie List
+ */
+ public List<? extends Movie> getAllMoviesByName(String movieName);
+
+ /**
+ * Get single movie record by movie name, usually return first result
+ *
+ * @param movieName Movie name
+ * @return Movie
+ */
+ public Movie getSingleMovieByName(String movieName);
+}
@@ -0,0 +1,32 @@
+package org.chii2.medialibrary.api.file;
+
+import java.util.List;
+
+/**
+ * FileService provide watcher and scanner functionality
+ */
+public interface FileService {
+
+ // Event Topic for movie scan
+ public final static String MOVIE_SCAN_TOPIC = "org/chii2/medialibrary/file/movie/SCAN";
+
+ /**
+ * Scan default directories (from configuration) for movies files
+ */
+ public void scanMovies();
+
+ /**
+ * Scan directories for movie files
+ *
+ * @param directories Directories to be scanned
+ */
+ public void scanMovies(List<String> directories);
+
+ /**
+ * Scan directories for movie files
+ *
+ * @param directories Directories to be scanned
+ * @param extensions File extensions to be accepted, like " .avi .mkv "
+ */
+ public void scanMovies(List<String> directories, List<String> extensions);
+}
@@ -0,0 +1,160 @@
+package org.chii2.medialibrary.api.persistence;
+
+import org.chii2.medialibrary.api.persistence.entity.Movie;
+import org.chii2.medialibrary.api.persistence.entity.MovieFile;
+import org.chii2.medialibrary.api.persistence.entity.MovieImage;
+import org.chii2.medialibrary.api.persistence.entity.MovieInfo;
+
+import java.util.List;
+
+/**
+ * Persistence layer for media library
+ */
+public interface PersistenceService {
+
+ /**
+ * Get all the movie records from database
+ *
+ * @return List of movie records
+ */
+ public List<? extends Movie> getAllMovies();
+
+ /**
+ * Get Movie by Movie ID
+ *
+ * @param id Movie ID
+ * @return Movie
+ */
+ public Movie getMovieById(String id);
+
+ /**
+ * Get all possible movie records by movie name
+ *
+ * @param movieName Movie Name
+ * @return Movie List
+ */
+ public List<? extends Movie> getAllMoviesByName(String movieName);
+
+ /**
+ * Get single movie record by movie name, usually return first result
+ *
+ * @param movieName Movie name
+ * @return Movie
+ */
+ public Movie getSingleMovieByName(String movieName);
+
+ /**
+ * Get movie file by id
+ *
+ * @param id Movie file id
+ * @return Movie file
+ */
+ public MovieFile getMovieFileById(String id);
+
+ /**
+ * Get movie Information by id
+ *
+ * @param id Movie information id
+ * @return Movie information
+ */
+ public MovieInfo getMovieInfoById(String id);
+
+ /**
+ * Get Movie Image by Image ID
+ *
+ * @param imageId Movie Image ID
+ * @return Image
+ */
+ public MovieImage getMovieImageById(String imageId);
+
+ /**
+ * Persist a list of movies into database
+ *
+ * @param movies List of movies
+ */
+ public void persist(List<Movie> movies);
+
+ /**
+ * Persist a movie into database
+ *
+ * @param movie Movie
+ */
+ public void persist(Movie movie);
+
+ /**
+ * Persist a movie file into database
+ *
+ * @param movieFile Movie file
+ */
+ public void persist(MovieFile movieFile);
+
+ /**
+ * Persist a movie information into database
+ *
+ * @param movieInfo Movie information
+ */
+ public void persist(MovieInfo movieInfo);
+
+ /**
+ * Persist a movie image into database
+ *
+ * @param movieImage Movie image
+ */
+ public void persist(MovieImage movieImage);
+
+ /**
+ * Merge a movie into database
+ *
+ * @param movie Movie
+ */
+ public void merge(Movie movie);
+
+ /**
+ * Merge a movie file into database
+ *
+ * @param movieFile Movie File
+ */
+ public void merge(MovieFile movieFile);
+
+ /**
+ * Merge a movie information into database
+ *
+ * @param movieInfo Movie information
+ */
+ public void merge(MovieInfo movieInfo);
+
+ /**
+ * Merge a movie image into database
+ *
+ * @param movieImage Movie Image
+ */
+ public void merge(MovieImage movieImage);
+
+ /**
+ * Remove a movie from database
+ *
+ * @param movie Movie
+ */
+ public void remove(Movie movie);
+
+ /**
+ * Remove a movie file from database
+ *
+ * @param movieFile Movie File
+ */
+ public void remove(MovieFile movieFile);
+
+ /**
+ * Remove a movie information from database
+ *
+ * @param movieInfo Movie Information
+ */
+ public void remove(MovieInfo movieInfo);
+
+ /**
+ * Remove a movie image from database
+ *
+ * @param movieImage Movie Image
+ */
+ public void remove(MovieImage movieImage);
+}
Oops, something went wrong.

0 comments on commit 28e8af5

Please sign in to comment.