Search in sources :

Example 1 with WebServiceCredential

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();
}
Also used : Builder(javax.ws.rs.client.Invocation.Builder) WebServiceCredential(edu.cornell.kfs.sys.businessobject.WebServiceCredential) URI(java.net.URI)

Example 2 with WebServiceCredential

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();
}
Also used : WebServiceCredential(edu.cornell.kfs.sys.businessobject.WebServiceCredential) ParameterEvaluator(org.kuali.rice.core.api.parameter.ParameterEvaluator)

Example 3 with WebServiceCredential

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);
    }
}
Also used : HashMap(java.util.HashMap) WebServiceCredential(edu.cornell.kfs.sys.businessobject.WebServiceCredential)

Aggregations

WebServiceCredential (edu.cornell.kfs.sys.businessobject.WebServiceCredential)3 URI (java.net.URI)1 HashMap (java.util.HashMap)1 Builder (javax.ws.rs.client.Invocation.Builder)1 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)1