本文整理汇总了Java中org.uberfire.rpc.impl.SessionInfoImpl类的典型用法代码示例。如果您正苦于以下问题:Java SessionInfoImpl类的具体用法?Java SessionInfoImpl怎么用?Java SessionInfoImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionInfoImpl类属于org.uberfire.rpc.impl包,在下文中一共展示了SessionInfoImpl类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sessionInfo
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
private SessionInfo sessionInfo(final WatchContext context) {
final String sessionId;
final String user;
if (context.getSessionId() == null) {
sessionId = "<system>";
} else {
sessionId = context.getSessionId();
}
if (context.getUser() == null) {
user = "<system>";
} else {
user = context.getUser();
}
return new SessionInfoImpl(sessionId,
new UserImpl(user));
}
示例2: reloadEditorOnUpdateFromDifferentUser
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void reloadEditorOnUpdateFromDifferentUser() {
lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
"",
new SessionInfoImpl(user)));
assertEquals(0,
reloads);
lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
"",
new SessionInfoImpl(new UserImpl("differentUser"))));
assertEquals(1,
reloads);
}
示例3: copyPath
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
Path copyPath(final Path path,
final String newName,
final Path targetPath,
final String comment) {
final org.uberfire.java.nio.file.Path _path = Paths.convert(path);
final org.uberfire.java.nio.file.Path _target = Paths.convert(targetPath);
try {
ioService.startBatch(_target.getFileSystem());
ioService.copy(_path,
_target,
new CommentedOption(sessionInfo != null ? sessionInfo.getId() : "--",
identity.getIdentifier(),
null,
comment));
//Delegate additional changes required for a copy to applicable Helpers
if (helpers != null) {
for (CopyHelper helper : helpers) {
if (helper.supports(targetPath)) {
helper.postProcess(path,
targetPath);
}
}
}
} catch (final Exception e) {
throw new RuntimeException(e);
} finally {
endBatch();
}
resourceCopiedEvent.fire(new ResourceCopiedEvent(path,
targetPath,
comment,
sessionInfo != null ? sessionInfo : new SessionInfoImpl("--",
identity)));
return targetPath;
}
示例4: releaseLockOnUpdate
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void releaseLockOnUpdate() {
lockManager.acquireLockOnDemand();
simulateLockSuccess();
simulateLockDemand();
lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
"",
new SessionInfoImpl(user)));
verify(lockService,
times(1)).releaseLock(any(Path.class),
any(ParameterizedCommand.class));
}
示例5: releaseOwnedLockOnly
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void releaseOwnedLockOnly() {
lockManager.acquireLockOnDemand();
simulateLockFailure();
simulateLockDemand();
lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
"",
new SessionInfoImpl(user)));
verify(lockService,
never()).releaseLock(any(Path.class),
any(ParameterizedCommand.class));
}
示例6: getSessionInfo
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
@RequestScoped
@Default
public SessionInfo getSessionInfo(AuthenticationService authenticationService) {
String sessionId = getSessionId();
User user;
if (sessionId == null) {
user = getDefaultUser();
sessionId = user.getIdentifier();
} else {
user = authenticationService.getUser();
}
return new SessionInfoImpl(sessionId,
user);
}
示例7: getSessionInfo
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Override
@Produces
@Default
@ApplicationScoped
public SessionInfo getSessionInfo(AuthenticationService authenticationService) {
return new SessionInfoImpl("dummy-id", authenticationService.getUser());
}
示例8: createSessionInfo
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
protected SessionInfo createSessionInfo(InjectionPoint injectionPoint) {
return new SessionInfoImpl(new UserImpl(Thread.currentThread().getName()));
}
示例9: currentSession
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
@ApplicationScoped
private SessionInfo currentSession(User identity) {
return new SessionInfoImpl(identity);
}
示例10: getSessionInfo
import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
private SessionInfo getSessionInfo( final String sessionId ) {
return new SafeSessionInfo( new SessionInfoImpl( sessionId,
authenticationService.getUser() ) );
}