Created
September 20, 2012 12:14
-
-
Save 4toblerone/3755552 to your computer and use it in GitHub Desktop.
Validator
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
package net.netm.portals.tapestry.kino.services.impl; | |
import net.netm.platform.auxiliary.backendbox.exception.BackendboxAccessException; | |
import net.netm.platform.auxiliary.backendbox.model.AvsPinResponse; | |
import net.netm.platform.auxiliary.backendbox.service.AvsService; | |
import net.netm.platform.client.tapestry.core.services.MsisdnSource; | |
import net.netm.portals.tapestry.kino.services.PinValidator; | |
public class PinValidatorImpl implements PinValidator { | |
private final AvsService avsService; | |
private final MsisdnSource msisdnSource; | |
public PinValidatorImpl(final AvsService avsService, final MsisdnSource msisdnSource){ | |
this.avsService = avsService; | |
this.msisdnSource = msisdnSource; | |
} | |
@Override | |
public AvsPinResponse checkPinStatus(String pin) throws BackendboxAccessException { | |
//check if pin is null | |
//check if it returns null and check if it throws exception | |
if(pin==null) | |
throw new IllegalArgumentException(); | |
return avsService.validateAvsPin(msisdnSource.get(), pin); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment