Skip to content

Commit

Permalink
TR download metadata file in background #349
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Feb 1, 2017
1 parent d2bbe0a commit ae91cbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.async.Asynchronous;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.international.StatusMessage.Severity;
Expand Down Expand Up @@ -298,7 +299,7 @@ public String save() {
// setEntityId();
boolean result = shibboleth3ConfService.existsResourceUri(trustRelationship.getSpMetaDataURL());
if(result){
metadataValidationTimer.newThreadSaveSpMetaDataFileSourceTypeURI(this);
newThreadSaveSpMetaDataFileSourceTypeURI();
}else{
log.info("There is no resource found Uri : {0}", trustRelationship.getSpMetaDataURL());
}
Expand Down Expand Up @@ -362,6 +363,17 @@ public String save() {

return OxTrustConstants.RESULT_SUCCESS;
}

@Asynchronous
public void newThreadSaveSpMetaDataFileSourceTypeURI() {
try {
boolean result = saveSpMetaDataFileSourceTypeURI();
log.info("Download metadata for TR " + getTrustRelationship().getDisplayName() + " : result : "
+ result);
} catch (IOException ex) {
log.error("Failed to Download metadata for TR :" + getTrustRelationship().getDisplayName(), ex);
}
}

private boolean initActions() {
initAttributes(this.trustRelationship);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,4 @@ private boolean validateMetadata(String shib3IdpTempmetadataFolder, String shib3

return result;
}

@Asynchronous
public void newThreadSaveSpMetaDataFileSourceTypeURI(UpdateTrustRelationshipAction updateTrustRelationshipAction){
try {
boolean result = updateTrustRelationshipAction.saveSpMetaDataFileSourceTypeURI();
log.info("Download metadata for TR " + updateTrustRelationshipAction.getTrustRelationship().getDisplayName() + " : result : " + result);
} catch (IOException e) {
log.info("Failed to Download metadata for TR :" + updateTrustRelationshipAction.getTrustRelationship().getDisplayName());
e.printStackTrace();
}
}
}

0 comments on commit ae91cbf

Please sign in to comment.