use of edu.cornell.kfs.sys.businessobject.WebServiceCredential in project cu-kfs by CU-CommunityApps.
the class AccountingXmlDocumentDownloadAttachmentServiceImpl method buildClientRequest.
protected Invocation buildClientRequest(String url, Collection<WebServiceCredential> creds) throws URISyntaxException {
URI uri = new URI(url);
Builder builder = getClient().target(uri).request();
if (CollectionUtils.isNotEmpty(creds)) {
for (WebServiceCredential cred : creds) {
if (!isCredentialUsedForValidatingBackupLinkURL(cred)) {
builder.header(cred.getCredentialKey(), cred.getCredentialValue());
}
}
}
return builder.buildGet();
}
use of edu.cornell.kfs.sys.businessobject.WebServiceCredential in project cu-kfs by CU-CommunityApps.
the class WebServiceCredentialAuthorizer method canMaintain.
@Override
public boolean canMaintain(Object dataObject, Person user) {
if (!super.canMaintain(dataObject, user)) {
return false;
}
WebServiceCredential webServiceCredential = (WebServiceCredential) dataObject;
ParameterEvaluator parameterEvaluator = getParameterEvaluatorService().getParameterEvaluator(WebServiceCredential.class, CUKFSParameterKeyConstants.NON_EDITABLE_CREDENTIAL_VALUES, webServiceCredential.getCredentialGroupCode(), webServiceCredential.getCredentialKey());
return !parameterEvaluator.evaluationSucceeds();
}
use of edu.cornell.kfs.sys.businessobject.WebServiceCredential in project cu-kfs by CU-CommunityApps.
the class WebServiceCredentialServiceImpl method updateWebServiceCredentialValue.
@Override
public void updateWebServiceCredentialValue(String credentialGroupCode, String credentialKey, String credentialValue) {
Map<String, String> keyMap = new HashMap<String, String>();
keyMap.put(CUKFSPropertyConstants.WEB_SERVICE_CREDENTIAL_GROUP_CODE, credentialGroupCode);
keyMap.put(CUKFSPropertyConstants.WEB_SERVICE_CREDENTIAL_KEY, credentialKey);
keyMap.put(KFSPropertyConstants.ACTIVE, KFSConstants.ParameterValues.YES);
Collection<WebServiceCredential> webServiceCredentials = businessObjectService.findMatching(WebServiceCredential.class, keyMap);
if (webServiceCredentials.size() > 0) {
WebServiceCredential webServiceCredential = webServiceCredentials.iterator().next();
webServiceCredential.setCredentialValue(credentialValue);
businessObjectService.save(webServiceCredential);
}
}
Aggregations