This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
#156 support for multiple mailboxes #183
Open
piotr-wilczynski
wants to merge
2
commits into
master
Choose a base branch
from
156
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
bb-email/src/main/java/com/cognifide/qa/bb/email/EmailClientFactory.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,25 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.email; | ||
|
||
public interface EmailClientFactory { | ||
|
||
EmailClient create(String id); | ||
} |
53 changes: 53 additions & 0 deletions
53
bb-email/src/main/java/com/cognifide/qa/bb/email/EmailConfig.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,53 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.email; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
import org.apache.commons.lang3.text.StrSubstitutor; | ||
|
||
import com.cognifide.qa.bb.email.constants.EmailConfigKeys; | ||
import com.google.inject.Injector; | ||
import com.google.inject.Key; | ||
import com.google.inject.assistedinject.Assisted; | ||
import com.google.inject.assistedinject.AssistedInject; | ||
import com.google.inject.name.Names; | ||
|
||
public class EmailConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing javadocs on all public methods and the class itself - and same applies to other classes in this PR. |
||
|
||
private final Map<String, String> map; | ||
private final Injector injector; | ||
|
||
@AssistedInject | ||
public EmailConfig(@Assisted String id, Injector injector) { | ||
this.map = Collections.singletonMap(EmailConfigKeys.ID, id); | ||
this.injector = injector; | ||
} | ||
|
||
public String getParameter(String name) { | ||
return getParameter(String.class, name); | ||
} | ||
|
||
public <T> T getParameter(Class<T> type, String name) { | ||
String realId = StrSubstitutor.replace(name, map); | ||
return injector.getInstance(Key.get(type, Names.named(realId))); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
bb-email/src/main/java/com/cognifide/qa/bb/email/EmailConfigFactory.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,25 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.email; | ||
|
||
public interface EmailConfigFactory { | ||
|
||
EmailConfig create(String id); | ||
} |
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 |
---|---|---|
|
@@ -36,7 +36,6 @@ | |
import com.cognifide.qa.bb.email.connector.EmailException; | ||
import com.cognifide.qa.bb.email.constants.EmailConfigKeys; | ||
import com.google.inject.Inject; | ||
import com.google.inject.name.Named; | ||
|
||
/** | ||
* This class creates EmailData. | ||
|
@@ -45,11 +44,11 @@ public final class EmailDataFactory { | |
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(EmailDataFactory.class); | ||
|
||
private final Pattern addressPattern; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is |
||
private Pattern addressPattern; | ||
|
||
@Inject | ||
public EmailDataFactory( | ||
@Named(EmailConfigKeys.EMAIL_ADDRESS_PATTERN) String addressPatternString) { | ||
public EmailDataFactory(EmailConfig emailConfig) { | ||
String addressPatternString = emailConfig.getParameter(EmailConfigKeys.EMAIL_ADDRESS_PATTERN); | ||
this.addressPattern = Pattern.compile(addressPatternString); | ||
} | ||
|
||
|
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
25 changes: 25 additions & 0 deletions
25
bb-email/src/main/java/com/cognifide/qa/bb/email/EmailSenderFactory.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,25 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.email; | ||
|
||
public interface EmailSenderFactory { | ||
|
||
EmailSender create(String id); | ||
} |
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
25 changes: 25 additions & 0 deletions
25
bb-email/src/main/java/com/cognifide/qa/bb/email/connector/ConnectorFactory.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,25 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.email.connector; | ||
|
||
public interface ConnectorFactory { | ||
|
||
ConnectorProvider create(String id); | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Javadocs