Joram ${version}

org.objectweb.joram.client.jms.admin
Class User

java.lang.Object
  extended byorg.objectweb.joram.client.jms.admin.AdministeredObject
      extended byorg.objectweb.joram.client.jms.admin.User
All Implemented Interfaces:
javax.naming.Referenceable, java.io.Serializable, fr.dyade.aaa.jndi2.soap.SoapObjectItf

public class User
extends AdministeredObject

The User class is a utility class needed for administering JORAM users.

See Also:
Serialized Form

Constructor Summary
User()
           
User(java.lang.String name, java.lang.String proxyId)
          Constructs an User instance.
 
Method Summary
 void clearSubscription(java.lang.String subName)
           
 java.util.Hashtable code()
          Codes an User instance as a Hashtable for travelling through the SOAP protocol.
static User create(java.lang.String name, java.lang.String password)
          Admin method creating a user on the local server and instanciating the corresponding User object.
static User create(java.lang.String name, java.lang.String password, int serverId)
          Admin method creating a user for a given server and instanciating the corresponding User object.
 void decode(java.util.Hashtable h)
          Decodes an User which travelled through the SOAP protocol.
 void delete()
          Removes this user.
 void deleteMessage(java.lang.String subName, java.lang.String msgId)
           
 boolean equals(java.lang.Object o)
          Provides a reliable way to compare User instances.
 DeadMQueue getDMQ()
          Returns the dead message queue for this user, null if not set.
 java.lang.String[] getMessageIds(java.lang.String subName)
           
 java.lang.String getName()
          Returns the user name.
 java.lang.String getProxyId()
          Returns the identifier of the user's proxy.
 javax.naming.Reference getReference()
          Sets the naming reference of this user.
 Subscription getSubscription(java.lang.String subName)
          Returns a subscription.
 Subscription[] getSubscriptions()
          Returns the subscriptions owned by a user.
 int getThreshold()
          Returns the threshold for this user, -1 if not set.
 Message readMessage(java.lang.String subName, java.lang.String msgId)
           
 void setDMQ(DeadMQueue dmq)
          Admin method setting a given dead message queue for this user.
 void setThreshold(int thresh)
          Admin method setting a given value as the threshold for this user.
 java.lang.String toString()
          Returns a string view of this User instance.
 void update(java.lang.String newName, java.lang.String newPassword)
          Admin method updating this user identification.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User()

User

public User(java.lang.String name,
            java.lang.String proxyId)
Constructs an User instance.

Parameters:
name - The name of the user.
proxyId - Identifier of the user's proxy agent.
Method Detail

toString

public java.lang.String toString()
Returns a string view of this User instance.


getName

public java.lang.String getName()
Returns the user name.


equals

public boolean equals(java.lang.Object o)
Provides a reliable way to compare User instances.


create

public static User create(java.lang.String name,
                          java.lang.String password,
                          int serverId)
                   throws java.net.ConnectException,
                          AdminException
Admin method creating a user for a given server and instanciating the corresponding User object.

If the user has already been set on this server, the method simply returns the corresponding User object. Its fails if the target server does not belong to the platform, or if a proxy could not be deployed server side for a new user.

Parameters:
name - Name of the user.
password - Password of the user.
serverId - The identifier of the user's server.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

create

public static User create(java.lang.String name,
                          java.lang.String password)
                   throws java.net.ConnectException,
                          AdminException
Admin method creating a user on the local server and instanciating the corresponding User object.

If the user has already been set on this server, the method simply returns the corresponding User object. It fails if a proxy could not be deployed server side for a new user.

Parameters:
name - Name of the user.
password - Password of the user.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

update

public void update(java.lang.String newName,
                   java.lang.String newPassword)
            throws java.net.ConnectException,
                   AdminException
Admin method updating this user identification.

The request fails if the user does not exist server side, or if the new identification is already taken by a user on the same server.

Parameters:
newName - The new name of the user.
newPassword - The new password of the user.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

delete

public void delete()
            throws java.net.ConnectException,
                   AdminException
Removes this user.

Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

setDMQ

public void setDMQ(DeadMQueue dmq)
            throws java.net.ConnectException,
                   AdminException
Admin method setting a given dead message queue for this user.

The request fails if the user is deleted server side.

Parameters:
dmq - The dead message queue to be set.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

setThreshold

public void setThreshold(int thresh)
                  throws java.net.ConnectException,
                         AdminException
Admin method setting a given value as the threshold for this user.

The request fails if the user is deleted server side.

Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getDMQ

public DeadMQueue getDMQ()
                  throws java.net.ConnectException,
                         AdminException
Returns the dead message queue for this user, null if not set.

The request fails if the user is deleted server side.

Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getThreshold

public int getThreshold()
                 throws java.net.ConnectException,
                        AdminException
Returns the threshold for this user, -1 if not set.

The request fails if the user is deleted server side.

Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getSubscriptions

public Subscription[] getSubscriptions()
                                throws AdminException,
                                       java.net.ConnectException
Returns the subscriptions owned by a user.

Throws:
AdminException - If an error is raised by the administration operation.
java.net.ConnectException - If the admin connection is not established.

getSubscription

public Subscription getSubscription(java.lang.String subName)
                             throws AdminException,
                                    java.net.ConnectException
Returns a subscription.

Parameters:
subName - the name of the subscription.
Throws:
AdminException - If an error is raised by the administration operation.
java.net.ConnectException - If the admin connection is not established.

getMessageIds

public java.lang.String[] getMessageIds(java.lang.String subName)
                                 throws AdminException,
                                        java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

readMessage

public Message readMessage(java.lang.String subName,
                           java.lang.String msgId)
                    throws AdminException,
                           java.net.ConnectException,
                           javax.jms.JMSException
Throws:
AdminException
java.net.ConnectException
javax.jms.JMSException

deleteMessage

public void deleteMessage(java.lang.String subName,
                          java.lang.String msgId)
                   throws AdminException,
                          java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

clearSubscription

public void clearSubscription(java.lang.String subName)
                       throws AdminException,
                              java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

getProxyId

public java.lang.String getProxyId()
Returns the identifier of the user's proxy.


getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Sets the naming reference of this user.

Specified by:
getReference in interface javax.naming.Referenceable
Overrides:
getReference in class AdministeredObject
Throws:
javax.naming.NamingException

code

public java.util.Hashtable code()
Codes an User instance as a Hashtable for travelling through the SOAP protocol.


decode

public void decode(java.util.Hashtable h)
Decodes an User which travelled through the SOAP protocol.


Joram ${version}

Copyright ? 2005 Scalagent - All rights reserved