dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42384
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21668: Code style
------------------------------------------------------------
revno: 21668
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-01-08 16:18:30 +0100
message:
Code style
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/DefaultGatewayAdministrationService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsServiceController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/DefaultGatewayAdministrationService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/DefaultGatewayAdministrationService.java 2016-01-07 15:15:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/DefaultGatewayAdministrationService.java 2016-01-08 15:18:30 +0000
@@ -1,3 +1,4 @@
+package org.hisp.dhis.sms.config;
/*
* Copyright (c) 2004-2015, University of Oslo
@@ -26,7 +27,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.sms.config;
import java.util.List;
@@ -36,22 +36,20 @@
/**
* @author Zubair <rajazubair.asghar@xxxxxxxxx>
- *
*/
public class DefaultGatewayAdministrationService
implements GatewayAdministratonService
{
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
@Autowired
private SmsConfigurationManager smsConfigMgr;
@Autowired
private OutboundSmsTransportService transportService;
+ // -------------------------------------------------------------------------
+ // GatewayAdministratonService implementation
+ // -------------------------------------------------------------------------
+
@Override
public SmsConfiguration listGateways()
{
@@ -73,9 +71,9 @@
{
return null;
}
+
for ( SmsGatewayConfig gateway : list )
{
-
if ( gateway.getUid().equals( uid ) )
{
gateway.setDefault( true );
@@ -100,7 +98,6 @@
if ( smsConfig != null )
{
-
SmsGatewayConfig gatewayConfig = smsConfigMgr.checkInstanceOfGateway( klass );
int index = -1;
@@ -165,7 +162,9 @@
public SmsGatewayConfig getGatewayConfiguration( String uid )
{
SmsConfiguration smsConfig = getSmsConfiguration();
+
List<SmsGatewayConfig> list = smsConfig.getGateways();
+
for ( SmsGatewayConfig gw : list )
{
if ( gw.getUid().equals( uid ) )
@@ -177,6 +176,10 @@
return null;
}
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private boolean checkGateway( List<SmsGatewayConfig> list, String uid )
{
for ( SmsGatewayConfig gateway : list )
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsServiceController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsServiceController.java 2016-01-08 15:07:47 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/sms/SmsServiceController.java 2016-01-08 15:18:30 +0000
@@ -51,7 +51,6 @@
@RequestMapping( value = "/sms/services" )
public class SmsServiceController
{
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -136,6 +135,7 @@
}
SMSServiceStatus status = outboundSmsTransportService.getServiceStatusEnum();
+
if ( status == SMSServiceStatus.STOPPED )
{
throw new WebMessageException( WebMessageUtils.conflict( "Service already stopped" ) );