當前位置: 首頁>>代碼示例>>Java>>正文


Java Workspace.getId方法代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:26,代碼來源:SyncServiceImp.java

示例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);
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:19,代碼來源:PostgresqlWorkspaceDAO.java

示例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);
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:20,代碼來源:PostgresqlWorkspaceDAO.java

示例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);
            }
        }

    }
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:30,代碼來源:XmlRpcSyncHandler.java

示例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);
            }
        }
    }
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:31,代碼來源:XmlRpcSyncHandler.java

示例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);
		}
	}
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:41,代碼來源:SyncServiceImp.java

示例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);
	}
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:30,代碼來源:SyncServiceImp.java

示例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);
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:16,代碼來源:PostgresqlWorkspaceDAO.java


注:本文中的com.stacksync.commons.models.Workspace.getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。