/** * Sets the workflow's organization. * * @param organization * the organization */ public void setOrganization(Organization organization) { if (organization == null) this.organization = null; else this.organization = JaxbOrganization.fromOrganization(organization); }
/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (!(obj instanceof Group)) return false; Group other = (Group) obj; return groupId.equals(other.getGroupId()) && organization.equals(other.getOrganization()); }
/** * Create the global anonymous user with the given organization. * * @param org * the organization * @return the global anonymous user */ public static User createAnonymousUser(Organization org) { JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(org); return new JaxbUser(GLOBAL_ANONYMOUS_USERNAME, null, jaxbOrganization, new JaxbRole( jaxbOrganization.getAnonymousRole(), jaxbOrganization)); }
this.roles = new HashSet<JaxbRole>(); for (Role role : roles) { if (role.getOrganization() == null || !organization.getId().equals(role.getOrganization().getId())) throw new IllegalArgumentException("Role " + role + " is not from the same organization!");
/** * Constructs an organization from an organization * * @param org * the organization */ public static JaxbOrganization fromOrganization(Organization org) { if (org instanceof JaxbOrganization) return (JaxbOrganization) org; return new JaxbOrganization(org.getId(), org.getName(), org.getServers(), org.getAdminRole(), org.getAnonymousRole(), org.getProperties()); }
@Override public JaxbOrganization marshal(Organization org) throws Exception { if (org == null) return null; if (org instanceof JaxbOrganization) return (JaxbOrganization) org; return JaxbOrganization.fromOrganization(org); }
/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (!(obj instanceof Role)) return false; Role other = (Role) obj; return name.equals(other.getName()) && organization.equals(other.getOrganization()); }
public void add(Organization org) { if (org instanceof JaxbOrganization) { organizations.add((JaxbOrganization) org); } else { organizations.add(JaxbOrganization.fromOrganization(org)); } }
/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (!(obj instanceof User)) return false; User other = (User) obj; return userName.equals(other.getUsername()) && organization.equals(other.getOrganization()); }
@Override public JaxbRole apply(String role, Organization organization) { return new JaxbRole(role, JaxbOrganization.fromOrganization(organization)); } };
public User toUser(final String providerName) { Set<JaxbRole> roleSet = new HashSet<JaxbRole>(); for (JpaRole role : roles) { roleSet.add(JaxbRole.fromRole(role)); } return new JaxbUser(username, null, name, email, providerName, JaxbOrganization.fromOrganization(organization), roleSet); }
@Override public Iterator<User> findUsers(String query, int offset, int limit) { if (query == null) throw new IllegalArgumentException("Query must be set"); if (query.endsWith("%")) { query = query.substring(0, query.length() - 1); } if (query.isEmpty()) { return Collections.emptyIterator(); } // Verify if a user exists (non-wildcard searches only) if (!verifySakaiUser(query)) { return Collections.emptyIterator(); } List<User> users = new LinkedList<User>(); JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization); JaxbUser queryUser = new JaxbUser(query, PROVIDER_NAME, jaxbOrganization, new HashSet<JaxbRole>()); users.add(queryUser); return users.iterator(); }
this.instructorRoles = instructorRoles; JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
@GET @Path("{id}.xml") @Produces(MediaType.TEXT_XML) @RestQuery(name = "orgasxml", description = "Gets an organizations as xml", returnDescription = "The org as xml", pathParameters = { @RestParameter(name = "id", type = Type.STRING, description = "The job identifier", isRequired = true) }, reponses = { @RestResponse(responseCode = 200, description = "Organization returned"), @RestResponse(responseCode = 404, description = "No organization with this identifier found") }) public JaxbOrganization getOrganizationAsXml(@PathParam("id") String id) { try { return JaxbOrganization.fromOrganization(orgDirectoryService.getOrganization(id)); } catch (NotFoundException e) { return null; } }
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization); if (ltirole) {
this.creator = creator; if (organization != null) this.organization = JaxbOrganization.fromOrganization(organization); this.state = WorkflowState.INSTANTIATED; this.mediaPackage = mediaPackage;
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
public static JaxbGroup fromGroup(Group group) { JaxbOrganization organization = JaxbOrganization.fromOrganization(group.getOrganization()); Set<JaxbRole> roles = new HashSet<JaxbRole>(); for (Role role : group.getRoles()) { if (role instanceof JaxbRole) { roles.add((JaxbRole) role); } else { roles.add(JaxbRole.fromRole(role)); } } return new JaxbGroup(group.getGroupId(), organization, group.getName(), group.getDescription(), roles, group.getMembers()); }
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(org); if (auth != null) { Object principal = auth.getPrincipal();