You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nuvem-commits@incubator.apache.org by lr...@apache.org on 2012/03/12 02:34:52 UTC
svn commit: r1299530 - in
/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp:
message/ presence/
Author: lresende
Date: Mon Mar 12 02:34:51 2012
New Revision: 1299530
URL: http://svn.apache.org/viewvc?rev=1299530&view=rev
Log:
Minor formatting
Modified:
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/MessageListener.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/PayLoad.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/Presence.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceAttributes.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceBuilder.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceListener.java
incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceManager.java
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/MessageListener.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/MessageListener.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/MessageListener.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/MessageListener.java Mon Mar 12 02:34:51 2012
@@ -33,18 +33,18 @@ import org.apache.nuvem.cloud.xmpp.XMPPE
*/
public interface MessageListener {
- /**
- * To be used as default one.
- */
- public static final MessageListener LOGGING_LISTENER = new LoggingMessageListener();
+ /**
+ * To be used as default one.
+ */
+ public static final MessageListener LOGGING_LISTENER = new LoggingMessageListener();
- /**
- * This method will be called when a message is received by the XMPP
- * endpoint for a specific {@link JID} this listener is registred for.
- *
- * @param message
- * @see org.apache.nuvem.cloud.xmpp.XMPPEndPoint
- */
- void listen(Message message);
+ /**
+ * This method will be called when a message is received by the XMPP
+ * endpoint for a specific {@link JID} this listener is registred for.
+ *
+ * @param message
+ * @see org.apache.nuvem.cloud.xmpp.XMPPEndPoint
+ */
+ void listen(Message message);
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/PayLoad.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/PayLoad.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/PayLoad.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/message/PayLoad.java Mon Mar 12 02:34:51 2012
@@ -91,10 +91,12 @@ public final class PayLoad {
* for the user.
*/
public boolean equals(Object o) {
- if (this == o)
+ if (this == o) {
return true;
- if (!(o instanceof PayLoad))
+ }
+ if (!(o instanceof PayLoad)) {
return false;
+ }
final PayLoad payLoad = (PayLoad)o;
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/Presence.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/Presence.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/Presence.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/Presence.java Mon Mar 12 02:34:51 2012
@@ -31,32 +31,32 @@ package org.apache.nuvem.cloud.xmpp.pres
*/
public final class Presence extends PresenceAttributes {
- /**
- * Constructor which takes a builder as parameter to maintain immutability.
- *
- */
- public Presence(PresenceBuilder builder) {
- this.from = builder.from();
- this.status = builder.status();
- this.type = builder.type();
- this.show = builder.show();
- this.to = builder.to();
- this.stanza = builder.stanza();
- }
+ /**
+ * Constructor which takes a builder as parameter to maintain immutability.
+ *
+ */
+ public Presence(PresenceBuilder builder) {
+ this.from = builder.from();
+ this.status = builder.status();
+ this.type = builder.type();
+ this.show = builder.show();
+ this.to = builder.to();
+ this.stanza = builder.stanza();
+ }
- /**
- * Represents the substanza of the presence stanza.
- *
- */
- public enum Show {
- AVAILABLE, CHAT, AWAY, DND, XA, NONE;
- }
+ /**
+ * Represents the substanza of the presence stanza.
+ *
+ */
+ public enum Show {
+ AVAILABLE, CHAT, AWAY, DND, XA, NONE;
+ }
- /**
- * Represents the type of the presence stanza.
- *
- */
- public enum Type {
- AVAILABLE, PROBE, UNAVAILABLE, SUBSCRIBED, SUBSCRIBE, UNSUBSCRIBE, UNSUBSCRIBED, ERROR;
- }
+ /**
+ * Represents the type of the presence stanza.
+ *
+ */
+ public enum Type {
+ AVAILABLE, PROBE, UNAVAILABLE, SUBSCRIBED, SUBSCRIBE, UNSUBSCRIBE, UNSUBSCRIBED, ERROR;
+ }
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceAttributes.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceAttributes.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceAttributes.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceAttributes.java Mon Mar 12 02:34:51 2012
@@ -30,72 +30,72 @@ import org.apache.nuvem.cloud.xmpp.JID;
*/
public class PresenceAttributes {
- /**
- * The sender of a presence.
- */
- protected JID from;
-
- /**
- * The recipient of the presence.
- */
- protected JID to;
-
- /**
- * The stanza of the presence message.
- */
- protected String stanza;
-
- /**
- * The additional status string sent by an entity.
- */
- protected String status;
-
- /**
- * Additional availability status along with the {@link #type}} value
- */
- protected Presence.Show show;
-
- /**
- * Represents the type of the presence stanza which could be
- * <ul>
- * <li>unavailable -- Signals that the entity is no longer available for communication.
- * <li>subscribe -- The sender wishes to subscribe to the recipient's presence.
- * <li>subscribed -- The sender has allowed the recipient to receive their presence.
- * <li>unsubscribe -- The sender is unsubscribing from another entity's presence.
+ /**
+ * The sender of a presence.
+ */
+ protected JID from;
+
+ /**
+ * The recipient of the presence.
+ */
+ protected JID to;
+
+ /**
+ * The stanza of the presence message.
+ */
+ protected String stanza;
+
+ /**
+ * The additional status string sent by an entity.
+ */
+ protected String status;
+
+ /**
+ * Additional availability status along with the {@link #type}} value
+ */
+ protected Presence.Show show;
+
+ /**
+ * Represents the type of the presence stanza which could be
+ * <ul>
+ * <li>unavailable -- Signals that the entity is no longer available for communication.
+ * <li>subscribe -- The sender wishes to subscribe to the recipient's presence.
+ * <li>subscribed -- The sender has allowed the recipient to receive their presence.
+ * <li>unsubscribe -- The sender is unsubscribing from another entity's presence.
* <li>unsubscribed -- The subscription request has been denied or a previously-granted subscription has been cancelled.
- * <li>probe -- A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.
- * <li>error -- An error has occurred regarding processing or delivery of a previously-sent presence stanza.
- * </ul>
- */
- protected Presence.Type type;
-
- /**
- * The priority of the presence message.
- */
- protected int priority;
-
- public final Presence.Type type() {
- return type;
- }
-
- public final Presence.Show show() {
- return show;
- }
-
- public final JID from() {
- return from;
- }
-
- public final JID to() {
- return to;
- }
-
- public final String stanza() {
- return stanza;
- }
-
- public final String status() {
- return status;
- }
+ * <li>probe -- A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.
+ * <li>error -- An error has occurred regarding processing or delivery of a previously-sent presence stanza.
+ * </ul>
+ */
+ protected Presence.Type type;
+
+ /**
+ * The priority of the presence message.
+ */
+ protected int priority;
+
+ public final Presence.Type type() {
+ return type;
+ }
+
+ public final Presence.Show show() {
+ return show;
+ }
+
+ public final JID from() {
+ return from;
+ }
+
+ public final JID to() {
+ return to;
+ }
+
+ public final String stanza() {
+ return stanza;
+ }
+
+ public final String status() {
+ return status;
+ }
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceBuilder.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceBuilder.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceBuilder.java Mon Mar 12 02:34:51 2012
@@ -28,81 +28,81 @@ import org.apache.nuvem.cloud.xmpp.JID;
*/
public final class PresenceBuilder extends PresenceAttributes {
- /**
- * Initializes the JID for recipient.
- *
- * @param jid
- * the JID for the recipient.
- * @return the message builder.
- */
- public PresenceBuilder toRecipient(String jid) {
- this.to = new JID(jid);
- return this;
- }
-
- /**
- * The sender for a message.
- *
- * @param jid
- * the jid of the sender.
- * @return the message builder.
- */
- public PresenceBuilder from(String jid) {
- this.from = new JID(jid);
- return this;
- }
-
- /**
- * Initialises the content for sending to the recipient.
- *
- * @param content
- * the actual content.
- * @return the message builder.
- */
- public PresenceBuilder withStanza(String stanza) {
- this.stanza = stanza;
- return this;
- }
-
- public PresenceBuilder withStatus(String status) {
- this.status = status;
- return this;
- }
-
- public PresenceBuilder withShow(Presence.Show show) {
- this.show = show;
- return this;
- }
-
- public PresenceBuilder withType(Presence.Type type) {
- this.type = type;
- return this;
- }
-
- public PresenceBuilder from(JID jid) {
- this.from = jid;
- return this;
- }
-
- public PresenceBuilder to(JID jid) {
- this.to = jid;
- return this;
- }
-
- /**
- * Builds the Presence object by using all the previously passed attributes
- * through various methods like.
- * <ul>
- * <li/>{@link #containing(Object)}
- * <li/>{@link #toRecipient(String)}
- * <li/>{@link #withShow(String)}
- * <li/>{@link #withStanza(String)}
- * <li/>{@link #withStatus(String)}
- * <li/>{@link #withType(String)}
- *
- * @return
- */
- public Presence build() {
- return new Presence(this);
- }
+ /**
+ * Initializes the JID for recipient.
+ *
+ * @param jid
+ * the JID for the recipient.
+ * @return the message builder.
+ */
+ public PresenceBuilder toRecipient(String jid) {
+ this.to = new JID(jid);
+ return this;
+ }
+
+ /**
+ * The sender for a message.
+ *
+ * @param jid
+ * the jid of the sender.
+ * @return the message builder.
+ */
+ public PresenceBuilder from(String jid) {
+ this.from = new JID(jid);
+ return this;
+ }
+
+ /**
+ * Initialises the content for sending to the recipient.
+ *
+ * @param content
+ * the actual content.
+ * @return the message builder.
+ */
+ public PresenceBuilder withStanza(String stanza) {
+ this.stanza = stanza;
+ return this;
+ }
+
+ public PresenceBuilder withStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ public PresenceBuilder withShow(Presence.Show show) {
+ this.show = show;
+ return this;
+ }
+
+ public PresenceBuilder withType(Presence.Type type) {
+ this.type = type;
+ return this;
+ }
+
+ public PresenceBuilder from(JID jid) {
+ this.from = jid;
+ return this;
+ }
+
+ public PresenceBuilder to(JID jid) {
+ this.to = jid;
+ return this;
+ }
+
+ /**
+ * Builds the Presence object by using all the previously passed attributes
+ * through various methods like.
+ * <ul>
+ * <li/>{@link #containing(Object)}
+ * <li/>{@link #toRecipient(String)}
+ * <li/>{@link #withShow(String)}
+ * <li/>{@link #withStanza(String)}
+ * <li/>{@link #withStatus(String)}
+ * <li/>{@link #withType(String)}
+ *
+ * @return
+ */
+ public Presence build() {
+ return new Presence(this);
+ }
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceListener.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceListener.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceListener.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceListener.java Mon Mar 12 02:34:51 2012
@@ -21,7 +21,7 @@
package org.apache.nuvem.cloud.xmpp.presence;
public interface PresenceListener {
-
- void listen(Presence presence);
+
+ void listen(Presence presence);
}
Modified: incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceManager.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceManager.java?rev=1299530&r1=1299529&r2=1299530&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceManager.java (original)
+++ incubator/nuvem/trunk/nuvem-api/src/main/java/org/apache/nuvem/cloud/xmpp/presence/PresenceManager.java Mon Mar 12 02:34:51 2012
@@ -29,26 +29,26 @@ import java.util.List;
*/
public interface PresenceManager {
- /**
- * Registers a presence listener to recieve notification of any presence
- * message recieved from the XMPP server.
- *
- * @param listener
- */
- void registerListener(PresenceListener listener);
+ /**
+ * Registers a presence listener to recieve notification of any presence
+ * message recieved from the XMPP server.
+ *
+ * @param listener
+ */
+ void registerListener(PresenceListener listener);
- /**
- * Returns a list of all {@link PresenceListener}s waiting to receive
- * presence stanzas.
- *
- * @return
- */
- List<PresenceListener> listeners();
-
- /**
- * Sends the presence stanza to the XMPP server.
- * @param presence
- */
- void sendPresence(Presence presence);
+ /**
+ * Returns a list of all {@link PresenceListener}s waiting to receive
+ * presence stanzas.
+ *
+ * @return
+ */
+ List<PresenceListener> listeners();
+
+ /**
+ * Sends the presence stanza to the XMPP server.
+ * @param presence
+ */
+ void sendPresence(Presence presence);
}