Package org.objectweb.joram.shared.security

Examples of org.objectweb.joram.shared.security.Identity


      long dt = Math.abs(StreamUtil.readLongFrom(is) - System.currentTimeMillis());
      if (dt > clockSynchroThreshold)
        logger.log(BasicLevel.WARN, " -> bad clock synchronization between client and server: " + dt);
      StreamUtil.writeTo(dt, nos);

      Identity identity = Identity.read(is);
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, " -> read identity = " + identity);

      int key = StreamUtil.readIntFrom(is);
      if (logger.isLoggable(BasicLevel.DEBUG))
View Full Code Here


                           int heartBeat) throws Exception {
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 "SoapProxyService.setConnection(" + identityMap + ',' + heartBeat + ')');

    Identity identity = (Identity) Identity.soapDecode(identityMap);
   
    GetProxyIdNot gpin = new GetProxyIdNot(identity, null);
    gpin.invoke(AdminTopic.getDefault());
    AgentId proxyId = gpin.getProxyId();
   
    OpenConnectionNot ocn = new OpenConnectionNot(false, heartBeat)
    ocn.invoke(proxyId);

    StandardConnectionContext cc = (StandardConnectionContext) ocn.getConnectionContext();
    ProxyConnectionContext pcc = new ProxyConnectionContext(proxyId, cc.getQueue());
    connections.put(new ConnectionKey(identity.getUserName(), cc.getKey()), pcc);
   
    return cc.getKey();
  }
View Full Code Here

   */
  public User createUser(String name, String password,
                         int serverId,
                         String identityClassName,
                         Properties prop) throws ConnectException, AdminException {
    Identity identity = createIdentity(name, password, identityClassName);
    AdminReply reply = doRequest(new CreateUserRequest(identity, serverId, prop));
    User user = new User(name, ((CreateUserReply) reply).getProxId());
   
    if (AdminModule.wrapper != this)
      user.setWrapper(this);
View Full Code Here

   * @param identityClassName identity class name (simple, jaas).
   * @return identity user Identity.
   * @throws AdminException
   */
  private Identity createIdentity(String user, String passwd, String identityClassName) throws AdminException {
    Identity identity = null;
    try {
      identity = (Identity) Class.forName(identityClassName).newInstance();
      if (passwd != null) identity.setIdentity(user, passwd);
      else
        identity.setUserName(user);
    } catch (Exception e) {
      throw new AdminException(e.getMessage());
    }
    return identity;
  }
View Full Code Here

   */
  public static User create(String name, String password,
                            int serverId,
                            String identityClassName,
                            Properties prop) throws ConnectException, AdminException {
    Identity identity = createIdentity(name, password, identityClassName);

    User user = new User(name);
    AdminReply reply = user.getWrapper().doRequest(new CreateUserRequest(identity, serverId, prop));
    user.proxyId = ((CreateUserReply) reply).getProxId();
   
View Full Code Here

   * @return identity user Identity.
   * @throws AdminException
   */
  private static Identity createIdentity(String user, String passwd,
                                         String identityClassName) throws AdminException {
    Identity identity = null;
    try {
      Class clazz = Class.forName(identityClassName);
      identity = (Identity) clazz.newInstance();
      if (passwd != null)
        identity.setIdentity(user, passwd);
      else
        identity.setUserName(user);
    } catch (Exception e) {
      throw new AdminException(e.getMessage());
    }
    return identity;
  }
View Full Code Here

   * @exception ConnectException  If the connection fails.
   * @exception AdminException  If the request fails.
   */
  public void update(String newName, String newPassword,
                     String identityClassName) throws ConnectException, AdminException {
    Identity newIdentity = createIdentity(newName, newPassword, identityClassName);
    doRequest(new UpdateUser(name, proxyId, newIdentity));
    name = newName;
  }
View Full Code Here

      if (initialAdminName != null) {
        UserAgent userAgent = new UserAgent(initialAdminName, AgentId.JoramAdminPxStamp);
        userAgent.deploy();

        Identity identity = createIdentity(Identity.getRootName(initialAdminName),
                                           initialAdminPass,
                                           Identity.getRootIdentityClass(initialAdminName));

        AdminNotification adminNot = new AdminNotification(userAgent.getId(), identity);
        Channel.sendTo(adminTopic.getId(), adminNot);
View Full Code Here

   * @throws Exception
   */
  private static Identity createIdentity(String adminName,
                                         String adminPassword,
                                         String identityClassName) throws Exception {
    Identity identity = null;
    try {
      Class clazz = Class.forName(identityClassName);
      identity = (Identity) clazz.newInstance();
      if (adminPassword != null)
        identity.setIdentity(adminName, adminPassword);
      else
        identity.setUserName(adminName);
    } catch (Exception e) {
      if (logger.isLoggable(BasicLevel.ERROR))
        logger.log(BasicLevel.ERROR, "EXCEPTION:: ConnectionManager.createIdentity: ", e);
      throw new Exception(e.getMessage());
    }
View Full Code Here

   * @param password the password of the user
   * @return <code>true</code> if the name and password match an existing user.
   */
  public boolean checkCredentials(String userName, String password) {
    try {
      Identity identity = createIdentity(Identity.getRootName(userName), password,
          Identity.getRootIdentityClass(userName));
      GetProxyIdNot gpin = new GetProxyIdNot(identity, null);
      gpin.invoke(AdminTopic.getDefault());
      return true;
    } catch (Exception exc) {
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.security.Identity

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.