Package org.foafrealm.manage

Examples of org.foafrealm.manage.Person


   */
  public void storeCredentials(String sscfPerson,BookmarkingSource bookmarkingSource,String login, String password) throws BadCredentialsException{
    if(login == null || "".equals(login) ||
        password == null || "".equals(password))
      throw new BadCredentialsException("Invalid login/password");
    Person person = PersonFactory.getPerson(sscfPerson);
    if(person != null){
      String mbox_sha1sum = person.getMbox_sha1sum();
      PBEKeySpec keySpec = new PBEKeySpec(mbox_sha1sum.toCharArray());
      String[] encryptedCredentials = encryptCredentials(login, password, keySpec);
      if(encryptedCredentials != null && encryptedCredentials[0] != null && encryptedCredentials[1] != null){
        String loginToStore = encryptedCredentials[0];
        String passwordToStore = encryptedCredentials[1];
View Full Code Here


    if(credentials.getLogin() == null || credentials.getPassword() == null || "".equals(credentials.getLogin()) ||
         "".equals(credentials.getPassword())){
      throw new BadCredentialsException("Invalid login/password");
    }
   
    Person person  = PersonFactory.getPerson(sscfPerson);
    if(person != null){
      String mbox_sha1sum = person.getMbox_sha1sum();
      PBEKeySpec keySpec = new PBEKeySpec(mbox_sha1sum.toCharArray());
      String[] encryptedCredentials = encryptCredentials(credentials.getLogin(), credentials.getPassword(), keySpec);
      if(encryptedCredentials != null && encryptedCredentials[0] != null && encryptedCredentials[1] != null){
        String loginToStore = encryptedCredentials[0];
        String passwordToStore = encryptedCredentials[1];
View Full Code Here

   * @return <tt>TaggingCredentials</tt> credentials of the given user for the given bookmarking source
   * @throws BadCredentialsException when user's credentials where not found
   */
  public TaggingCredential loadCredentials(String sscfPerson, BookmarkingSource bookmarkingSource) throws BadCredentialsException{
    TaggingCredential credentials = null;
    Person person = PersonFactory.getPerson(sscfPerson);
    String[] encryptedCredentials = readFromStorage(person,bookmarkingSource);
    if(person != null && encryptedCredentials != null){
      String mbox_sha1sum = person.getMbox_sha1sum();
      PBEKeySpec keySpec = new PBEKeySpec(mbox_sha1sum.toCharArray());
      try {
        BASE64Decoder decoder = new BASE64Decoder();
       
        SecretKey secretKey = secretKeyFactory.generateSecret(keySpec);
View Full Code Here

   * @param isConjunction <code>true</code> if all the conditions stated by the actor posting the query are to be fullfiled
   * @return
   */
  public QueryObject getQueryObject(String user, String query,
      Boolean isConjunction, List<QueryParameterEntry> queryList) {
    Person principal = PersonFactory.getPerson(user);
    //principal = null;
    return getQueryObject(principal, query, isConjunction, queryList);
  }
View Full Code Here

      this.lstIsInInited = true;
      this.initLstIsIn();
    }
    else this.synchronize();
   
    Person p = PersonFactory.findPerson(mbox);
    if(p!=null)
    {
      this.lstIsIn.contains(p);
      return true;
    }
View Full Code Here

   */
  public static String treeBookmarks(String personUri,String standalone,String serviceAddr,HttpSession session,String selectedUri)
  {
    if(personUri!=null&&!"".equals(personUri.trim()))
    {
      Person person = PersonFactory.findPerson(personUri);
      if(person!=null)
      {
        StringBuilder sb = new StringBuilder();
   
        boolean standaloneBool = false;
View Full Code Here

 
  public static String getMbox(String uri)
  {
    if(uri!=null&&!"".equals(uri.trim()))
    {
      Person person = PersonFactory.findPerson(uri);
      if(person!=null)
      {
        return person.getMbox().toString();
      }
    }
    return null;
  }
View Full Code Here

   * @param authorMbox of one who evaluated that resource
   * @return
   */
  public static Float getPersonEvaluation(String resourceUri, String authorMbox) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    Person person = PersonFactory.findPerson(authorMbox);
    if (person == null) {
      person = PersonFactory.createPerson(authorMbox,null,false);
    }
    Float personRating = new Float(resource.getEvaluation(person));
    return (Float.isNaN(personRating)) ? new Float(0) : personRating;
View Full Code Here

   * @return
   */
  public Float getPersonWhithinEvaluation(String resourceUri, String authorMbox,
      int maxDist, float minLevel,boolean matchAll) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    Person person = PersonFactory.findPerson(authorMbox);
    if (person == null) {
      person = PersonFactory.createPerson(authorMbox, null, false);
    }
   
    Float personRating = new Float(resource.getEvaluation(person,maxDist,minLevel,matchAll));
View Full Code Here

   */
  public static XfoafSscfResource getXfoafSscfResource(String _uri,ModelSet  _model) {
    //problem with short ids of persons....
    String uri = _uri;
    if(!uri.startsWith("http://")&&!uri.startsWith("mailto:")) {
      Person person = PersonFactory.findPerson(uri);
      uri = person.getURI().toString();
    }
   
    XfoafSscfResource x = null;
    synchronized (MAP_RESOURCES) {
      x = MAP_RESOURCES.get(uri);
View Full Code Here

TOP

Related Classes of org.foafrealm.manage.Person

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.