Skip to content

Instantly share code, notes, and snippets.

@4toblerone
Created September 20, 2012 12:14
Show Gist options
  • Save 4toblerone/3755552 to your computer and use it in GitHub Desktop.
Save 4toblerone/3755552 to your computer and use it in GitHub Desktop.
Validator
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