Package org.jasig.portal.security.provider

Examples of org.jasig.portal.security.provider.PersonImpl


        assertEquals(13, this.countRowsInTable("STATS_FOLDER"));
        assertEquals(3, this.countRowsInTable("STATS_RENDER_TIME"));
    }
   
    public void testStoreTwoPeople() throws Exception {
        PersonImpl person = new PersonImpl();
        person.setID(1);
        person.setAttribute(IPerson.USERNAME, "admin");
        this.jpaPortalEventStore.addPersonGroups(person, new HashSet<String>(Arrays.asList("admin", "student")));

       
        UserLoggedInPortalEvent loggedInPortalEvent = new UserLoggedInPortalEvent(this, person);
        this.jpaPortalEventStore.storePortalEvents(loggedInPortalEvent);
        this.checkPoint();
       
        assertEquals(1, this.countRowsInTable("STATS_SESSION"));
        assertEquals(2, this.countRowsInTable("STATS_SESSION_GROUPS"));
        assertEquals(1, this.countRowsInTable("STATS_EVENT"));
        assertEquals(1, this.countRowsInTable("STATS_EVENT_TYPE"));
       
       
        UserLoggedOutPortalEvent loggedOutPortalEvent = new UserLoggedOutPortalEvent(this, person);
        this.jpaPortalEventStore.storePortalEvents(loggedOutPortalEvent);
        this.checkPoint();
       
        assertEquals(1, this.countRowsInTable("STATS_SESSION"));
        assertEquals(2, this.countRowsInTable("STATS_SESSION_GROUPS"));
        assertEquals(2, this.countRowsInTable("STATS_EVENT"));
        assertEquals(2, this.countRowsInTable("STATS_EVENT_TYPE"));
       


        person = new PersonImpl();
        person.setID(2);
        person.setAttribute(IPerson.USERNAME, "student");
        this.jpaPortalEventStore.addPersonGroups(person, new HashSet<String>(Arrays.asList("developer", "student")));
       
        loggedInPortalEvent = new UserLoggedInPortalEvent(this, person);
        this.jpaPortalEventStore.storePortalEvents(loggedInPortalEvent);
        this.checkPoint();
View Full Code Here


/**
* @return org.jasig.portal.groups.IEntity
*/
private IPerson getIPerson(String key)
{
    IPerson ip = new PersonImpl();
    ip.setAttribute(IPerson.USERNAME, key);
    return  ip;
}
View Full Code Here

  }// setUserPassword

  public void removeUser( IPerson AnIndividual ) throws Exception {

       IPerson per= new PersonImpl();
       per.setAttribute(IPerson.USERNAME, AnIndividual.getAttribute( Constants.UNFIELD ));

       int portalUID = -1;
       try{
          portalUID = rdbmuser.getPortalUID(per, false);
       }catch(org.jasig.portal.AuthorizationException ae) { /* do nothing */ }
View Full Code Here

     Vector v = new Vector();
     IPerson person = null;

     while( R.next() ){

       person = new PersonImpl();

       for( int i = 1; i <= R.getMetaData().getColumnCount(); i++ ) {

           if( R.getMetaData().getColumnType( i ) != Types.TIMESTAMP )
             person.setAttribute(
                   R.getMetaData().getColumnName( i ).toLowerCase(),
                      (R.getString( i )==null?"":R.getString( i )));
            else
             person.setAttribute(
                   R.getMetaData().getColumnName( i ).toLowerCase(),
                      (R.getString( i )==null?"": Constants.SDF.format(
                         new java.util.Date( R.getTimestamp( i ).getTime()) )));

       }// for

       v.addElement( person );
     }// while

     IPerson pwdtst = null;
     IPerson[] people = new IPerson[ v.size() ];
     for( int i = 0; i < people.length; i++ ) {
       people[ i ] = (IPerson)v.elementAt( i );

       // if the user exists but has no layout information, the account
       // is considered to be locked, this is technically inaccurate
       try{
         pwdtst = new PersonImpl();

         pwdtst.setAttribute( IPerson.USERNAME,
              people[ i ].getAttribute( Constants.UNFIELD ));

         rdbmuser.getPortalUID( pwdtst, false );
View Full Code Here

    /**
     * Creates an empty <code>IPerson</code> implementation.
     * @return an empty <code>IPerson</code> implementation
     */
    public static IPerson createPerson() {
        return new PersonImpl();
    }
View Full Code Here

  }// getDataSource

  private IPerson crd2persion( ChannelRuntimeData CRD ) throws Exception {

      String worker = null;
      IPerson newborn = new PersonImpl();
      Enumeration E = CRD.getParameterNames();
      while( E.hasMoreElements()){
         worker = (String)E.nextElement();
         if( !worker.equals( Constants.FORMACTION ))
             newborn.setAttribute( worker,
              ( CRD.getParameter( worker ) == null?
                 "" : CRD.getParameter( worker ) ));

      }// while
View Full Code Here

                                        String ownerId = definitions[i].ownerID;
                                        int userId  = definitions[i].userID;
                                       
                                        if ( null != ownerId )
                                        {
                                            IPerson p = new PersonImpl();
                                            p.setID( userId );
                                            p.setAttribute( "username", ownerId );
                                            owners.put(p, definitions[i]);
                                        }
                                    }
                                }
View Full Code Here

        }
    }

    private IPerson bindToOwner( FragmentDefinition fragment )
    {
        IPerson owner = new PersonImpl();
        owner.setAttribute( "username", fragment.ownerID );
        int userID = -1;
       
        try
        {
            userID = identityStore.getPortalUID( owner, false );
        }
        catch( AuthorizationException ae )
        {
            // current implementation of RDMBUserIdentityStore throws an
            // auth exception if the user doesn't exist even if
            // create data is false as we have it here. So this exception
            // can be discarded since we check for the userID being -1
            // meaning that the user wasn't found to trigger creating
            // that user.
        }
        if (userID == -1)
        {
            userID = createOwner( owner, fragment );
            owner.setAttribute("newlyCreated", "" + (userID != -1));
        }
        fragment.userID = userID;
        owner.setID(userID);
        return owner;
    }
View Full Code Here

    {
        // if fragment not bound to user can't return any preferences.
        if ( fragment.userID == -1 )
            return;

        IPerson p = new PersonImpl();
        p.setID( fragment.userID );
        p.setAttribute( "username", fragment.ownerID );

        try
        {
            view.structUserPrefs = dls.getDistributedSSUP(p, view.profileId,
                    view.structureStylesheetId);
View Full Code Here

    @Before
    public void setUp() {
        initMocks(this);

        person = new PersonImpl();
        person.setID(1);

        differentPerson = new PersonImpl();
        differentPerson.setID(2);

        samePerson = new PersonImpl();
        samePerson.setID(1);
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.provider.PersonImpl

Copyright © 2018 www.massapicom. 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.