private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } }
public boolean existsUser(String userId) { Iterator<User> iter = userGroupMapping.keySet().iterator(); while (iter.hasNext()) { User u = iter.next(); if (u.getId().equals(userId)) { return true; } } return false; }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof Comment) ) return false; Comment other = (Comment) obj; if ( addedBy == null ) { if ( other.addedBy != null ) return false; } else if ( !addedBy.equals( other.addedBy ) ) return false; if ( addedAt == null ) { if ( other.addedAt != null ) return false; } else if ( addedAt.getTime() != other.addedAt.getTime() ) return false; if ( text == null ) { if ( other.text != null ) return false; } else if ( !text.equals( other.text ) ) return false; return true; }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); text = in.readUTF(); addedBy = new User(); addedBy.readExternal( in ); addedAt = new Date( in.readLong() ); }
List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>(); for (String id: actorIds) { User user = new User(); user.setId(id.trim()); potentialOwners.add(user); businessAdministrators.add(new User("Administrator")); assignments.setBusinessAdministrators(businessAdministrators); task.setPeopleAssignments(assignments);
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addedBy == null) ? 0 : addedBy.hashCode()); result = prime * result + ((addedAt == null) ? 0 : addedAt.hashCode()); result = prime * result + ((text == null) ? 0 : text.hashCode()); return result; }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); name = in.readUTF(); accessType = AccessType.valueOf( in.readUTF() ); contentType = in.readUTF(); attachedBy = new User(); attachedBy.readExternal( in ); attachedAt = new Date( in.readLong() ); size = in.readInt( ); attachmentContentId = in.readLong(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((accessType == null) ? 0 : accessType.hashCode()); result = prime * result + ((attachedAt == null) ? 0 : attachedAt.hashCode()); result = prime * result + ((attachedBy == null) ? 0 : attachedBy.hashCode()); result = prime * result + size; result = prime * result + (int) (attachmentContentId ^ (attachmentContentId >>> 32)); result = prime * result + ((contentType == null) ? 0 : contentType.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { logger.log(Level.SEVERE, "Unable to add user " + userId); } } // ALL THIS CODE SHOULD NOT BE HERE>> THIS IS PLACED HERE TO DEMONSTRATE THAT IS WRONG
public List<String> getGroupsForUser(String userId) { Iterator<User> iter = userGroupMapping.keySet().iterator(); while (iter.hasNext()) { User u = iter.next(); if (u.getId().equals(userId)) { List<String> groupList = new ArrayList<String>(); List<Group> userGroupList = userGroupMapping.get(u); for (Group g : userGroupList) { groupList.add(g.getId()); } return groupList; } } return null; } }
public static List<OrganizationalEntity> readOrganizationalEntityList(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); List<OrganizationalEntity> list = new ArrayList<OrganizationalEntity>(size); for ( int i = 0; i < size; i++ ) { short type = in.readShort(); if ( type == 0 ) { User user = new User(); user.readExternal( in ); list.add( user ); } else { Group group = new Group(); group.readExternal( in ); list.add( group ); } } return list; } }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof Attachment) ) return false; Attachment other = (Attachment) obj; if ( accessType == null ) { if ( other.accessType != null ) return false; } else if ( !accessType.equals( other.accessType ) ) return false; if ( attachedAt == null ) { if ( other.attachedAt != null ) return false; } else if ( attachedAt.getTime() != other.attachedAt.getTime() ) return false; if ( attachedBy == null ) { if ( other.attachedBy != null ) return false; } else if ( !attachedBy.equals( other.attachedBy ) ) return false; if ( size != other.size ) return false; if ( attachmentContentId != other.attachmentContentId ) return false; if ( contentType == null ) { if ( other.contentType != null ) return false; } else if ( !contentType.equals( other.contentType ) ) return false; if ( name == null ) { if ( other.name != null ) return false; } else if ( !name.equals( other.name ) ) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((activationTime == null) ? 0 : activationTime.hashCode()); result = prime * result + ((actualOwner == null) ? 0 : actualOwner.hashCode()); result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode()); result = prime * result + ((createdOn == null) ? 0 : createdOn.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((expirationTime == null) ? 0 : expirationTime.hashCode()); result = prime * result + (int) (id ^ (id >>> 32)); result = prime * result + (int) (processInstanceId ^ (processInstanceId >>> 32)); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((subTaskStrategy == null) ? 0 : subTaskStrategy.hashCode()); result = prime * result + priority; result = prime * result + (int) (parentId ^ (parentId >>> 32)); result = prime * result + (skipable ? 1231 : 1237); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((subject == null) ? 0 : subject.hashCode()); result = prime * result + ((processId == null) ? 0 : processId.hashCode()); result = prime * result + processSessionId; return result; }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } }
public Task forward(Task task, User user){ BlockingTaskOperationResponseHandler forwardResponseHandler = new BlockingTaskOperationResponseHandler(); taskClient.forward(task.getId(), user.getId(), "Administrator" , forwardResponseHandler); return task; }
actualOwner = new User(); actualOwner.readExternal(in); createdBy = new User(); createdBy.readExternal(in);
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + CollectionUtils.hashCode( businessAdministrators ); result = prime * result + CollectionUtils.hashCode( excludedOwners ); result = prime * result + CollectionUtils.hashCode( potentialOwners ); result = prime * result + CollectionUtils.hashCode( recipients ); result = prime * result + ((taskInitiator == null) ? 0 : taskInitiator.hashCode()); result = prime * result + CollectionUtils.hashCode( taskStakeholders ); return result; }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } } }