Examples of Username


Examples of com.dtolabs.rundeck.core.authentication.Username

        List<AclContext> contexts;


        formalSubject = new Subject();
        formalSubject.getPrincipals().add(new Username("yml_usr_1"));
        contexts = policies.narrowContext(formalSubject, environment);
        assertNotNull("Context is null.", contexts);
        assertEquals("Incorrect number of contexts returned when matching on group.", 1, contexts.size());
       
        formalSubject = new Subject();
        formalSubject.getPrincipals().add(new Username("test_1"));
        formalSubject.getPrincipals().add(new Group("admin")); // <-- will match on group membership.
        contexts = policies.narrowContext(formalSubject, environment);
        assertNotNull("Context is null.", contexts);
        assertEquals("Incorrect number of contexts returned when matching on group.", 1, contexts.size());
       
View Full Code Here

Examples of com.dtolabs.rundeck.core.authentication.Username

        if(username == null) throw new IllegalArgumentException("Username cannot be null.");
        if(groups == null) {
            groups = new String[0];
        }
        Subject subject = new Subject();
        subject.getPrincipals().add(new Username(username));
        for(String group : groups) {
            if(group == null || group.length() <= 0) throw new IllegalArgumentException("Group null or zero length.");
            subject.getPrincipals().add(new Group(group));
        }
        subject.setReadOnly();
View Full Code Here

Examples of com.dtolabs.rundeck.core.authentication.Username

        assertEquals(1, aclContexts.size());
    }

    private Subject makeSubject(String username, String... groups) {
        Subject subject = new Subject();
        subject.getPrincipals().add(new Username(username));
        for (int i = 0; i < groups.length; i++) {
            String group = groups[i];
            subject.getPrincipals().add(new Group(group));
        }
        return subject;
View Full Code Here

Examples of com.google.gdata.data.projecthosting.Username

    IssuesEntry entry = new IssuesEntry();
    entry.setTitle(new PlainTextConstruct(title));
    entry.setContent(new HtmlTextConstruct(content));
    entry.setStatus(new Status("New"));
    Owner owner = new Owner();
    owner.setUsername(new Username(user));

    Person author = new Person();
    author.setName(user);
    entry.getAuthors().add(author);
View Full Code Here

Examples of com.google.gdata.data.projecthosting.Username

  protected IssuesEntry makeNewIssue() {
    Person author = new Person();
    author.setName(username);

    Owner owner = new Owner();
    owner.setUsername(new Username(username));

    Cc cc = new Cc();
    cc.setUsername(new Username(username));

    IssuesEntry entry = new IssuesEntry();
    entry.getAuthors().add(author);

    // Uncomment the following line to set the owner along with issue creation.
View Full Code Here

Examples of com.google.gdata.data.projecthosting.Username

        entry.getAuthors().add(client.getCurrentUser());

        String ownerName = getStringValue(taskData, GoogleCodeAttribute.USER_ASSIGNED);
        if (!StringUtils.isEmpty(ownerName)) {
            Owner owner = new Owner();
            owner.setUsername(new Username(ownerName));
            entry.setOwner(owner);
        }

        entry.setContent(new HtmlTextConstruct(description));
        entry.setTitle(new PlainTextConstruct(summary));
View Full Code Here

Examples of com.sissi.protocol.iq.register.simple.Username

  public boolean input(JIDContext context, Protocol protocol) {
    return context.binding() ? this.writeAndReturn(context, protocol) : true;
  }

  private boolean writeAndReturn(JIDContext context, Protocol protocol) {
    context.write(protocol.cast(Register.class).clear().add(Registered.FIELD).add(new Username().setText(context.jid().user())).parent().reply().setType(ProtocolType.RESULT).setFrom(OfflineJID.OFFLINE));
    return false;
  }
View Full Code Here

Examples of com.sissi.protocol.iq.register.simple.Username

  private final Error error = new ServerError().type(ProtocolType.CANCEL).add(NotAcceptable.DETAIL);

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Username username = protocol.cast(Register.class).findField(Username.NAME, Username.class);
    return username != null && username.valid() ? true : this.writeAndReturn(context, protocol);
  }
View Full Code Here

Examples of de.fhkn.in.uce.stun.attribute.Username

    private void sendConnectionRequest(final String targetId, final Socket controlConnection) throws Exception {
        logger.debug("Sending connection request"); //$NON-NLS-1$
        final Message requestConnectionMessage = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.REQUEST,
                STUNMessageMethod.CONNECTION_REQUEST);
        requestConnectionMessage.addAttribute(new Username(targetId));
        requestConnectionMessage.addAttribute(new RelayingAttribute());
        requestConnectionMessage.writeTo(controlConnection.getOutputStream());
    }
View Full Code Here

Examples of de.fhkn.in.uce.stun.attribute.Username

    }

    private void sendConnectionRequest(final String targetId, final Socket controlConnection) throws IOException {
        final Message requestMessage = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.REQUEST,
                STUNMessageMethod.CONNECTION_REQUEST);
        requestMessage.addAttribute(new Username(targetId));
        requestMessage.addAttribute(new ReversalAttribute());
        logger.info("send connection request for target {}", targetId); //$NON-NLS-1$
        requestMessage.writeTo(controlConnection.getOutputStream());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.