Search in sources :

Example 1 with RemoteContact

use of org.jbei.ice.lib.net.RemoteContact in project ice by JBEI.

the class RemoteUsers method get.

public RemoteUser get(long partnerId, String email) {
    RemotePartnerDAO remotePartnerDAO = DAOFactory.getRemotePartnerDAO();
    RemotePartner remotePartner = remotePartnerDAO.get(partnerId);
    if (remotePartner == null)
        return null;
    RemoteContact remoteContact = new RemoteContact();
    AccountTransfer accountTransfer = remoteContact.getUser(remotePartner.getUrl(), email, remotePartner.getApiKey());
    if (accountTransfer == null)
        return null;
    RemoteUser remoteUser = new RemoteUser();
    remoteUser.setPartner(remotePartner.toDataTransferObject());
    remoteUser.setUser(accountTransfer);
    return remoteUser;
}
Also used : RemotePartnerDAO(org.jbei.ice.storage.hibernate.dao.RemotePartnerDAO) RemoteContact(org.jbei.ice.lib.net.RemoteContact) RemotePartner(org.jbei.ice.storage.model.RemotePartner) AccountTransfer(org.jbei.ice.lib.account.AccountTransfer)

Aggregations

AccountTransfer (org.jbei.ice.lib.account.AccountTransfer)1 RemoteContact (org.jbei.ice.lib.net.RemoteContact)1 RemotePartnerDAO (org.jbei.ice.storage.hibernate.dao.RemotePartnerDAO)1 RemotePartner (org.jbei.ice.storage.model.RemotePartner)1