ServiceLoginUtil.java
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.RepositoryException
* javax.jcr.Session
* org.apache.sling.jcr.api.SlingRepository
*/
package com.adobe.granite.taskmanagement.impl.utils;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.apache.sling.jcr.api.SlingRepository;
public class ServiceLoginUtil {
private static final String WORKFLOW_USER_READER_SERVICE = "user";
private static final String TASKMANAGEMENT_SERVICE = "taskmanagement";
public static Session createWorkflowUserReaderSession(SlingRepository repository) {
try {
return repository.loginService("user", null);
}
catch (RepositoryException e) {
throw new RuntimeException("Unable to create workflow user reader service session.", (Throwable)e);
}
}
public static Session createTaskmanagementSession(SlingRepository repository) {
try {
return repository.loginService("taskmanagement", null);
}
catch (RepositoryException e) {
throw new RuntimeException("Unable to create taskamnagement service session.", (Throwable)e);
}
}
}