generated from openMF/ph-ee-start-here
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding configuration for channel connector (#31)
- Loading branch information
Showing
4 changed files
with
157 additions
and
16 deletions.
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
55 changes: 55 additions & 0 deletions
55
src/main/java/org/mifos/connector/channel/camel/utils/AMSProps.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,55 @@ | ||
package org.mifos.connector.channel.camel.utils; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
|
||
@Component | ||
@ConfigurationProperties(prefix = "ams") | ||
public class AMSProps { | ||
|
||
|
||
private List<AMS> groups; | ||
|
||
|
||
public List<AMS> getGroups() { | ||
return groups; | ||
} | ||
|
||
public void setGroups(List<AMS> groups) { | ||
this.groups = groups; | ||
} | ||
public static class AMS{ | ||
private String identifier; | ||
private String value; | ||
|
||
public String getIdentifier() { | ||
return identifier; | ||
} | ||
|
||
public void setIdentifier(String identifier) { | ||
this.identifier = identifier; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
public String getDefaultValue(){ | ||
String value = null; | ||
if(getIdentifier().equals("default")){ | ||
value = getValue(); | ||
} | ||
return value; | ||
} | ||
} | ||
} | ||
|
37 changes: 37 additions & 0 deletions
37
src/main/java/org/mifos/connector/channel/camel/utils/AMSUtils.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,37 @@ | ||
package org.mifos.connector.channel.camel.utils; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
import java.util.List; | ||
|
||
|
||
@Component | ||
public class AMSUtils { | ||
|
||
private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
|
||
@Autowired | ||
private AMSProps amsProps; | ||
|
||
List<AMSProps.AMS> ams; | ||
|
||
public AMSUtils(){ | ||
} | ||
|
||
@PostConstruct | ||
public List<AMSProps.AMS> postConstruct(){ | ||
ams = amsProps.getGroups(); | ||
return ams; | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
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