本文整理汇总了Java中com.stacksync.commons.models.Workspace.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Workspace.getId方法的具体用法?Java Workspace.getId怎么用?Java Workspace.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.stacksync.commons.models.Workspace
的用法示例。
在下文中一共展示了Workspace.getId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: commit
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void commit(CommitRequest request) {
logger.debug(request);
try {
User user = new User();
user.setId(request.getUserId());
Device device = new Device(request.getDeviceId());
Workspace workspace = new Workspace(request.getWorkspaceId());
CommitNotification result = getHandler().doCommit(user, workspace, device, request.getItems());
result.setRequestId(request.getRequestId());
UUID id = workspace.getId();
RemoteWorkspace commitNotifier = broker.lookupMulti(id.toString(), RemoteWorkspace.class);
commitNotifier.notifyCommit(result);
logger.debug("Consumer: Response sent to workspace \"" + workspace + "\"");
} catch (Exception e) {
logger.error(e);
}
}
示例2: update
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void update(User user, Workspace workspace) throws DAOException {
if (workspace.getId() == null || user.getId() == null) {
throw new IllegalArgumentException("Attributes not set");
}
Long parentItemId = null;
if (workspace.getParentItem() != null) {
parentItemId = workspace.getParentItem().getId();
}
Object[] values = { workspace.getName(), parentItemId, workspace.getId(), user.getId() };
String query = "UPDATE workspace_user " + " SET workspace_name = ?, parent_item_id = ?, modified_at = now() "
+ " WHERE workspace_id = ?::uuid AND user_id = ?::uuid";
executeUpdate(query, values);
}
示例3: addUser
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void addUser(User user, Workspace workspace) throws DAOException {
if (user == null || !user.isValid()) {
throw new IllegalArgumentException("User not valid");
} else if (workspace == null || !workspace.isValid()) {
throw new IllegalArgumentException("Workspace not valid");
}
Long parentItemId = null;
if (workspace.getParentItem() != null) {
parentItemId = workspace.getParentItem().getId();
}
Object[] values = { workspace.getId(), user.getId(), workspace.getName(), parentItemId };
String query = "INSERT INTO workspace_user (workspace_id, user_id, workspace_name, parent_item_id) VALUES (?::uuid, ?::uuid, ?, ?)";
executeUpdate(query, values);
}
示例4: bindUsersToWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
private void bindUsersToWorkspace(Workspace workspace, Long folderId) {
// Create notification
ShareProposalNotification notification = new ShareProposalNotification(workspace.getId(),
workspace.getName(), folderId, workspace.getOwner().getId(), workspace.getOwner().getName(),
workspace.getSwiftContainer(), workspace.getSwiftUrl(), workspace.isEncrypted());
notification.setRequestId("");
// Send notification to owner
RemoteClient client;
try {
client = broker.lookupMulti(workspace.getOwner().getId().toString(), RemoteClient.class);
client.notifyShareProposal(notification);
} catch (RemoteException e1) {
logger.error(String.format("Could not notify user: '%s'", workspace.getOwner().getId()), e1);
}
// Send notifications to users
for (User addressee : workspace.getUsers()) {
try {
client = broker.lookupMulti(addressee.getId().toString(), RemoteClient.class);
client.notifyShareProposal(notification);
} catch (RemoteException e) {
logger.error(String.format("Could not notify user: '%s'", addressee.getId()), e);
}
}
}
示例5: unBindUsersToWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
private void unBindUsersToWorkspace(Workspace workspace, List<User> usersToRemove, boolean isUnshared, Long folderId) {
// Create notification
UnshareNotification notification = new UnshareNotification(workspace.getId(),
workspace.getName(), folderId, workspace.getOwner().getId(), workspace.getOwner().getName(),
workspace.getSwiftContainer(), workspace.getSwiftUrl(), workspace.isEncrypted());
notification.setRequestId("");
RemoteClient client;
// Send notification to owner
if (isUnshared) {
try {
client = broker.lookupMulti(workspace.getOwner().getId().toString(), RemoteClient.class);
client.notifyUnshare(notification);
} catch (RemoteException e1) {
logger.error(String.format("Could not notify user: '%s'", workspace.getOwner().getId()), e1);
}
}
// Send notifications to users
for (User addressee : usersToRemove) {
try {
client = broker.lookupMulti(addressee.getId().toString(), RemoteClient.class);
client.notifyUnshare(notification);
} catch (RemoteException e) {
logger.error(String.format("Could not notify user: '%s'", addressee.getId()), e);
}
}
}
示例6: createShareProposal
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void createShareProposal(ShareProposalRequest request) throws ShareProposalNotCreatedException,
UserNotFoundException {
logger.debug(request);
User user = new User();
user.setId(request.getUserId());
Item item = new Item(request.getItemId());
// Create share proposal
Workspace workspace = getHandler().doShareFolder(user, request.getEmails(), item, request.isEncrypted());
// Create notification
ShareProposalNotification notification = new ShareProposalNotification(workspace.getId(),
workspace.getName(), item.getId(), workspace.getOwner().getId(), workspace.getOwner().getName(),
workspace.getSwiftContainer(), workspace.getSwiftUrl(), workspace.isEncrypted());
notification.setRequestId(request.getRequestId());
// Send notification to owner
RemoteClient client;
try {
client = broker.lookupMulti(user.getId().toString(), RemoteClient.class);
client.notifyShareProposal(notification);
} catch (RemoteException e1) {
logger.error(String.format("Could not notify user: '%s'", user.getId()), e1);
}
// Send notifications to users
for (User addressee : workspace.getUsers()) {
try {
client = broker.lookupMulti(addressee.getId().toString(), RemoteClient.class);
client.notifyShareProposal(notification);
} catch (RemoteException e) {
logger.error(String.format("Could not notify user: '%s'", addressee.getId()), e);
}
}
}
示例7: updateWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void updateWorkspace(UpdateWorkspaceRequest request) throws UserNotFoundException,
WorkspaceNotUpdatedException {
logger.debug(request);
User user = new User();
user.setId(request.getUserId());
Item item = new Item(request.getParentItemId());
Workspace workspace = new Workspace(request.getWorkspaceId());
workspace.setName(request.getWorkspaceName());
workspace.setParentItem(item);
getHandler().doUpdateWorkspace(user, workspace);
// Create notification
UpdateWorkspaceNotification notification = new UpdateWorkspaceNotification(workspace.getId(),
workspace.getName(), workspace.getParentItem().getId());
notification.setRequestId(request.getRequestId());
// Send notification to owner
RemoteClient client;
try {
client = broker.lookupMulti(user.getId().toString(), RemoteClient.class);
client.notifyUpdateWorkspace(notification);
} catch (RemoteException e1) {
logger.error(String.format("Could not notify user: '%s'", user.getId()), e1);
}
}
示例8: deleteUser
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void deleteUser(User user, Workspace workspace) throws DAOException {
if (user == null || !user.isValid()) {
throw new IllegalArgumentException("User not valid");
} else if (workspace == null || !workspace.isValid()) {
throw new IllegalArgumentException("Workspace not valid");
}
Object[] values = { workspace.getId(), user.getId() };
String query = "DELETE FROM workspace_user WHERE workspace_id=?::uuid AND user_id=?::uuid";
executeUpdate(query, values);
}