-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from CSCI3130/development
Development
- Loading branch information
Showing
52 changed files
with
1,412 additions
and
692 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
compute/src/main/java/com/piccritic/compute/MasterConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.piccritic.compute; | ||
|
||
import com.piccritic.database.feedback.CommentConnector; | ||
import com.piccritic.database.feedback.JPACommentConnector; | ||
import com.piccritic.database.feedback.JPARatingConnector; | ||
import com.piccritic.database.feedback.JPAVoteConnector; | ||
import com.piccritic.database.feedback.RatingConnector; | ||
import com.piccritic.database.feedback.VoteConnector; | ||
import com.piccritic.database.license.JPALicenseConnector; | ||
import com.piccritic.database.license.LicenseConnector; | ||
import com.piccritic.database.post.AlbumConnector; | ||
import com.piccritic.database.post.JPAAlbumConnector; | ||
import com.piccritic.database.post.JPAPostConnector; | ||
import com.piccritic.database.post.PostConnector; | ||
import com.piccritic.database.tag.JPATagConnector; | ||
import com.piccritic.database.tag.TagConnector; | ||
import com.piccritic.database.user.JPAUserConnector; | ||
import com.piccritic.database.user.UserConnector; | ||
|
||
public class MasterConnector { | ||
|
||
public static PostConnector postConnector; | ||
public static AlbumConnector albumConnector; | ||
public static UserConnector userConnector; | ||
public static LicenseConnector licenseConnector; | ||
public static CommentConnector commentConnector; | ||
public static VoteConnector voteConnector; | ||
public static RatingConnector ratingConnector; | ||
public static TagConnector tagConnector; | ||
|
||
public static void init() { | ||
if (postConnector == null) postConnector = new JPAPostConnector(); | ||
if (albumConnector == null) albumConnector = new JPAAlbumConnector(); | ||
if (userConnector == null) userConnector = new JPAUserConnector(); | ||
if (licenseConnector == null) licenseConnector = new JPALicenseConnector(); | ||
if (commentConnector == null) commentConnector = new JPACommentConnector(); | ||
if (voteConnector == null) voteConnector = new JPAVoteConnector(); | ||
if (ratingConnector == null) ratingConnector = new JPARatingConnector(); | ||
if (tagConnector == null) tagConnector = new JPATagConnector(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
compute/src/main/java/com/piccritic/compute/MasterService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.piccritic.compute; | ||
|
||
import com.piccritic.compute.feedback.FeedbackService; | ||
import com.piccritic.compute.feedback.FeedbackServiceInterface; | ||
import com.piccritic.compute.license.LicenseService; | ||
import com.piccritic.compute.license.LicenseServiceInterface; | ||
import com.piccritic.compute.post.PostService; | ||
import com.piccritic.compute.post.PostServiceInterface; | ||
import com.piccritic.compute.tag.TagInterface; | ||
import com.piccritic.compute.tag.TagService; | ||
import com.piccritic.compute.user.UserService; | ||
import com.piccritic.compute.user.UserServiceInterface; | ||
|
||
public class MasterService { | ||
|
||
public static FeedbackServiceInterface feedbackService; | ||
public static UserServiceInterface userService; | ||
public static LicenseServiceInterface licenseService; | ||
public static PostServiceInterface postService; | ||
public static TagInterface tagService; | ||
|
||
public static void init() { | ||
if (feedbackService == null) feedbackService = FeedbackService.createService(); | ||
if (userService == null) userService = UserService.createService(); | ||
if (licenseService == null) licenseService = new LicenseService(); | ||
if (postService == null) postService = new PostService(); | ||
if (tagService == null) tagService = new TagService(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
compute/src/main/java/com/piccritic/compute/tag/TagInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.piccritic.compute.tag; | ||
|
||
import com.piccritic.database.tag.TagConnector; | ||
|
||
public interface TagInterface extends TagConnector{ | ||
|
||
|
||
} |
36 changes: 36 additions & 0 deletions
36
compute/src/main/java/com/piccritic/compute/tag/TagService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.piccritic.compute.tag; | ||
|
||
import java.util.List; | ||
|
||
import com.piccritic.compute.MasterConnector; | ||
import com.piccritic.database.post.Post; | ||
import com.piccritic.database.tag.Tag; | ||
import com.piccritic.database.tag.TagException; | ||
import com.piccritic.database.user.Critic; | ||
|
||
public class TagService implements TagInterface { | ||
|
||
@Override | ||
public void insertTag(Tag tag) throws TagException { | ||
MasterConnector.tagConnector.insertTag(tag); | ||
} | ||
|
||
@Override | ||
public List<Tag> findTags(String query) { | ||
if (query == null) { | ||
return null; | ||
} | ||
return MasterConnector.tagConnector.findTags(query); | ||
} | ||
|
||
@Override | ||
public boolean deleteTag(Tag tag) throws TagException { | ||
return MasterConnector.tagConnector.deleteTag(tag); | ||
} | ||
|
||
@Override | ||
public List<Post> findPosts(List<String> tags, Critic critic) { | ||
return MasterConnector.tagConnector.findPosts(tags, critic); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.