package net.sourceforge.fenixedu.domain.softwareLicenseManagement;
import java.util.Collections;
import net.sourceforge.fenixedu.domain.Person;
import net.sourceforge.fenixedu.domain.util.Email;
public class SPSSKeyModel extends SPSSKeyModel_Base {
private static final String from = "spss.licencas.dsi@iscte.pt";
public SPSSKeyModel() {
super();
}
@Override
public void process(LicenseRequest request) {
Person requestor = request.getRequestor();
String userUId = requestor.getUser().getUserUId();
String username = userUId.split("@")[0];
StringBuilder subject = new StringBuilder();
subject.append(username);
subject.append(" : authorization code request (please use reply so that username is preserved)");
StringBuilder body = new StringBuilder();
body.append("\n*** EMPTY ***\n");
String[] replyTo = new String[] { from };
new Email(from, from, replyTo,
Collections.singletonList(request.getRequestedVersion().getApplication().getVendorEmail()),
Collections.EMPTY_LIST, Collections.EMPTY_LIST, subject.toString(), body.toString());
}
@Override
public boolean isPending() {
return getPersonalKeys().isEmpty();
}
@Override
public void registerKey(String key) {
new PersonalKey(key, this);
}
@Override
public void delete() {
super.delete();
}
}