Commit 094f319f authored by guus's avatar guus

Add @Override annotations where appropiate (OF-343)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11608 b35dd754-fafc-0310-a699-88a17e54d16e
parent f5bf8c3f
...@@ -257,6 +257,12 @@ public class MINAStatCollector { ...@@ -257,6 +257,12 @@ public class MINAStatCollector {
super( "StatCollectorWorker-"+id ); super( "StatCollectorWorker-"+id );
} }
/*
* (non-Javadoc)
*
* @see java.lang.Thread#run()
*/
@Override
public void run() public void run()
{ {
while ( !stop ) while ( !stop )
......
...@@ -132,6 +132,7 @@ public class SidebarTag extends BodyTagSupport { ...@@ -132,6 +132,7 @@ public class SidebarTag extends BodyTagSupport {
/** /**
* Does nothing, returns {@link #EVAL_BODY_BUFFERED} always. * Does nothing, returns {@link #EVAL_BODY_BUFFERED} always.
*/ */
@Override
public int doStartTag() throws JspException { public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED; return EVAL_BODY_BUFFERED;
} }
...@@ -145,6 +146,7 @@ public class SidebarTag extends BodyTagSupport { ...@@ -145,6 +146,7 @@ public class SidebarTag extends BodyTagSupport {
* @return {@link #EVAL_PAGE} after rendering the tabs. * @return {@link #EVAL_PAGE} after rendering the tabs.
* @throws JspException if an exception occurs while rendering the sidebar items. * @throws JspException if an exception occurs while rendering the sidebar items.
*/ */
@Override
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
// Start by getting the request from the page context // Start by getting the request from the page context
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
......
...@@ -64,6 +64,7 @@ public class SubSidebarTag extends SidebarTag { ...@@ -64,6 +64,7 @@ public class SubSidebarTag extends SidebarTag {
* @return {@link #EVAL_BODY_BUFFERED} if no errors. * @return {@link #EVAL_BODY_BUFFERED} if no errors.
* @throws javax.servlet.jsp.JspException if a parent SidebarTag is not found. * @throws javax.servlet.jsp.JspException if a parent SidebarTag is not found.
*/ */
@Override
public int doStartTag() throws JspException { public int doStartTag() throws JspException {
// The I18nTag should be our parent Tag // The I18nTag should be our parent Tag
parent = (SidebarTag)findAncestorWithClass(this, SidebarTag.class); parent = (SidebarTag)findAncestorWithClass(this, SidebarTag.class);
...@@ -81,6 +82,7 @@ public class SubSidebarTag extends SidebarTag { ...@@ -81,6 +82,7 @@ public class SubSidebarTag extends SidebarTag {
* @return {@link #EVAL_PAGE} * @return {@link #EVAL_PAGE}
* @throws JspException if an error occurs. * @throws JspException if an error occurs.
*/ */
@Override
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
setBody(bodyContent.getString()); setBody(bodyContent.getString());
parent.setSubSidebar(this); parent.setSubSidebar(this);
......
...@@ -101,6 +101,7 @@ public class SubnavTag extends BodyTagSupport { ...@@ -101,6 +101,7 @@ public class SubnavTag extends BodyTagSupport {
/** /**
* Does nothing, returns {@link #EVAL_BODY_BUFFERED} always. * Does nothing, returns {@link #EVAL_BODY_BUFFERED} always.
*/ */
@Override
public int doStartTag() throws JspException { public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED; return EVAL_BODY_BUFFERED;
} }
...@@ -114,6 +115,7 @@ public class SubnavTag extends BodyTagSupport { ...@@ -114,6 +115,7 @@ public class SubnavTag extends BodyTagSupport {
* @return {@link #EVAL_PAGE} after rendering the tabs. * @return {@link #EVAL_PAGE} after rendering the tabs.
* @throws JspException if an exception occurs while rendering the sidebar items. * @throws JspException if an exception occurs while rendering the sidebar items.
*/ */
@Override
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
// Start by getting the request from the page context // Start by getting the request from the page context
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
......
...@@ -125,6 +125,7 @@ public class TabsTag extends BodyTagSupport { ...@@ -125,6 +125,7 @@ public class TabsTag extends BodyTagSupport {
/** /**
* Does nothing, returns {@link #EVAL_BODY_BUFFERED} always. * Does nothing, returns {@link #EVAL_BODY_BUFFERED} always.
*/ */
@Override
public int doStartTag() throws JspException { public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED; return EVAL_BODY_BUFFERED;
} }
...@@ -137,6 +138,7 @@ public class TabsTag extends BodyTagSupport { ...@@ -137,6 +138,7 @@ public class TabsTag extends BodyTagSupport {
* @return {@link #EVAL_PAGE} after rendering the tabs. * @return {@link #EVAL_PAGE} after rendering the tabs.
* @throws JspException if an exception occurs while rendering the tabs. * @throws JspException if an exception occurs while rendering the tabs.
*/ */
@Override
public int doEndTag() throws JspException { public int doEndTag() throws JspException {
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
// Get the page data bean from the request: // Get the page data bean from the request:
......
...@@ -156,7 +156,8 @@ public class CachedPreparedStatement { ...@@ -156,7 +156,8 @@ public class CachedPreparedStatement {
} }
} }
public boolean equals(Object object) { @Override
public boolean equals(Object object) {
if (object == null) { if (object == null) {
return false; return false;
} }
...@@ -171,7 +172,8 @@ public class CachedPreparedStatement { ...@@ -171,7 +172,8 @@ public class CachedPreparedStatement {
&& types.equals(otherStmt.types) && params.equals(otherStmt.params); && types.equals(otherStmt.types) && params.equals(otherStmt.params);
} }
public int hashCode() { @Override
public int hashCode() {
int hashCode = 1; int hashCode = 1;
if (sql != null) { if (sql != null) {
hashCode += sql.hashCode(); hashCode += sql.hashCode();
...@@ -181,7 +183,8 @@ public class CachedPreparedStatement { ...@@ -181,7 +183,8 @@ public class CachedPreparedStatement {
return hashCode; return hashCode;
} }
public String toString() { @Override
public String toString() {
String toStringSql = sql; String toStringSql = sql;
try { try {
int index = toStringSql.indexOf('?'); int index = toStringSql.indexOf('?');
......
...@@ -380,7 +380,8 @@ public class DefaultConnectionProvider implements ConnectionProvider { ...@@ -380,7 +380,8 @@ public class DefaultConnectionProvider implements ConnectionProvider {
Double.toString(connectionTimeout)); Double.toString(connectionTimeout));
} }
public String toString() { @Override
public String toString() {
try { try {
ConnectionPoolDefinitionIF poolDef = ProxoolFacade.getConnectionPoolDefinition("openfire"); ConnectionPoolDefinitionIF poolDef = ProxoolFacade.getConnectionPoolDefinition("openfire");
SnapshotIF poolStats = ProxoolFacade.getSnapshot("openfire", true); SnapshotIF poolStats = ProxoolFacade.getSnapshot("openfire", true);
......
...@@ -43,14 +43,32 @@ public class DefaultConnectionProviderBeanInfo extends JiveBeanInfo { ...@@ -43,14 +43,32 @@ public class DefaultConnectionProviderBeanInfo extends JiveBeanInfo {
super(); super();
} }
/*
* (non-Javadoc)
*
* @see org.jivesoftware.util.JiveBeanInfo#getBeanClass()
*/
@Override
public Class getBeanClass() { public Class getBeanClass() {
return org.jivesoftware.database.DefaultConnectionProvider.class; return org.jivesoftware.database.DefaultConnectionProvider.class;
} }
/*
* (non-Javadoc)
*
* @see org.jivesoftware.util.JiveBeanInfo#getPropertyNames()
*/
@Override
public String[] getPropertyNames() { public String[] getPropertyNames() {
return PROPERTY_NAMES; return PROPERTY_NAMES;
} }
/*
* (non-Javadoc)
*
* @see org.jivesoftware.util.JiveBeanInfo#getName()
*/
@Override
public String getName() { public String getName() {
return "DefaultConnectionProvider"; return "DefaultConnectionProvider";
} }
......
...@@ -113,7 +113,8 @@ public class EmbeddedConnectionProvider implements ConnectionProvider { ...@@ -113,7 +113,8 @@ public class EmbeddedConnectionProvider implements ConnectionProvider {
settings = null; settings = null;
} }
public void finalize() throws Throwable { @Override
public void finalize() throws Throwable {
super.finalize(); super.finalize();
destroy(); destroy();
} }
......
...@@ -92,7 +92,8 @@ public class SchemaManager { ...@@ -92,7 +92,8 @@ public class SchemaManager {
try { try {
return checkSchema(con, "openfire", DATABASE_VERSION, return checkSchema(con, "openfire", DATABASE_VERSION,
new ResourceLoader() { new ResourceLoader() {
public InputStream loadResource(String resourceName) { @Override
public InputStream loadResource(String resourceName) {
File file = new File(JiveGlobals.getHomeDirectory() + File.separator + File file = new File(JiveGlobals.getHomeDirectory() + File.separator +
"resources" + File.separator + "database", resourceName); "resources" + File.separator + "database", resourceName);
try { try {
...@@ -134,7 +135,8 @@ public class SchemaManager { ...@@ -134,7 +135,8 @@ public class SchemaManager {
try { try {
con = DbConnectionManager.getConnection(); con = DbConnectionManager.getConnection();
return checkSchema(con, schemaKey, schemaVersion, new ResourceLoader() { return checkSchema(con, schemaKey, schemaVersion, new ResourceLoader() {
public InputStream loadResource(String resourceName) { @Override
public InputStream loadResource(String resourceName) {
File file = new File(pluginManager.getPluginDirectory(plugin) + File file = new File(pluginManager.getPluginDirectory(plugin) +
File.separator + "database", resourceName); File.separator + "database", resourceName);
try { try {
......
...@@ -50,7 +50,8 @@ public class FlashCrossDomainHandler extends BasicModule { ...@@ -50,7 +50,8 @@ public class FlashCrossDomainHandler extends BasicModule {
super("Flash CrossDomain Handler"); super("Flash CrossDomain Handler");
} }
public void start() { @Override
public void start() {
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
public void run() { public void run() {
try { try {
...@@ -65,7 +66,8 @@ public class FlashCrossDomainHandler extends BasicModule { ...@@ -65,7 +66,8 @@ public class FlashCrossDomainHandler extends BasicModule {
thread.start(); thread.start();
} }
public void stop() { @Override
public void stop() {
try { try {
if (serverSocket != null) { if (serverSocket != null) {
serverSocket.close(); serverSocket.close();
......
...@@ -249,7 +249,8 @@ public class IQRouter extends BasicModule { ...@@ -249,7 +249,8 @@ public class IQRouter extends BasicModule {
resultTimeout.put(id, System.currentTimeMillis() + timeoutmillis); resultTimeout.put(id, System.currentTimeMillis() + timeoutmillis);
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), 5000, 5000); TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), 5000, 5000);
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
......
...@@ -166,7 +166,8 @@ class LocalSessionManager { ...@@ -166,7 +166,8 @@ class LocalSessionManager {
/** /**
* Close incoming server sessions that have been idle for a long time. * Close incoming server sessions that have been idle for a long time.
*/ */
public void run() { @Override
public void run() {
// Do nothing if this feature is disabled // Do nothing if this feature is disabled
int idleTime = SessionManager.getInstance().getServerSessionIdleTime(); int idleTime = SessionManager.getInstance().getServerSessionIdleTime();
if (idleTime == -1) { if (idleTime == -1) {
......
...@@ -171,7 +171,8 @@ public class MessageRouter extends BasicModule { ...@@ -171,7 +171,8 @@ public class MessageRouter extends BasicModule {
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
messageStrategy = server.getOfflineMessageStrategy(); messageStrategy = server.getOfflineMessageStrategy();
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
......
...@@ -401,7 +401,8 @@ public class MulticastRouter extends BasicModule implements ServerFeaturesProvid ...@@ -401,7 +401,8 @@ public class MulticastRouter extends BasicModule implements ServerFeaturesProvid
return features.iterator(); return features.iterator();
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
this.server = server; this.server = server;
this.packetRouter = server.getPacketRouter(); this.packetRouter = server.getPacketRouter();
......
...@@ -432,7 +432,8 @@ public class OfflineMessageStore extends BasicModule implements UserEventListene ...@@ -432,7 +432,8 @@ public class OfflineMessageStore extends BasicModule implements UserEventListene
//Do nothing //Do nothing
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
// Initialize the pool of sax readers // Initialize the pool of sax readers
for (int i=0; i<POOL_SIZE; i++) { for (int i=0; i<POOL_SIZE; i++) {
...@@ -445,7 +446,8 @@ public class OfflineMessageStore extends BasicModule implements UserEventListene ...@@ -445,7 +446,8 @@ public class OfflineMessageStore extends BasicModule implements UserEventListene
UserEventDispatcher.addListener(this); UserEventDispatcher.addListener(this);
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
// Clean up the pool of sax readers // Clean up the pool of sax readers
xmlReaders.clear(); xmlReaders.clear();
......
...@@ -182,7 +182,8 @@ public class OfflineMessageStrategy extends BasicModule { ...@@ -182,7 +182,8 @@ public class OfflineMessageStrategy extends BasicModule {
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
messageStore = server.getOfflineMessageStore(); messageStore = server.getOfflineMessageStore();
router = server.getPacketRouter(); router = server.getPacketRouter();
......
...@@ -214,7 +214,8 @@ public class PresenceRouter extends BasicModule { ...@@ -214,7 +214,8 @@ public class PresenceRouter extends BasicModule {
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
......
...@@ -232,7 +232,8 @@ public class PrivateStorage extends BasicModule implements UserEventListener { ...@@ -232,7 +232,8 @@ public class PrivateStorage extends BasicModule implements UserEventListener {
//Do nothing //Do nothing
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
// Initialize the pool of sax readers // Initialize the pool of sax readers
for (int i=0; i<POOL_SIZE; i++) { for (int i=0; i<POOL_SIZE; i++) {
...@@ -245,7 +246,8 @@ public class PrivateStorage extends BasicModule implements UserEventListener { ...@@ -245,7 +246,8 @@ public class PrivateStorage extends BasicModule implements UserEventListener {
UserEventDispatcher.addListener(this); UserEventDispatcher.addListener(this);
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
// Clean up the pool of sax readers // Clean up the pool of sax readers
xmlReaders.clear(); xmlReaders.clear();
......
...@@ -1260,7 +1260,8 @@ public class SessionManager extends BasicModule implements ClusterEventListener ...@@ -1260,7 +1260,8 @@ public class SessionManager extends BasicModule implements ClusterEventListener
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
this.server = server; this.server = server;
router = server.getPacketRouter(); router = server.getPacketRouter();
...@@ -1348,12 +1349,14 @@ public class SessionManager extends BasicModule implements ClusterEventListener ...@@ -1348,12 +1349,14 @@ public class SessionManager extends BasicModule implements ClusterEventListener
return message; return message;
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
localSessionManager.start(); localSessionManager.start();
} }
public void stop() { @Override
public void stop() {
Log.debug("SessionManager: Stopping server"); Log.debug("SessionManager: Stopping server");
// Stop threads that are sending packets to remote servers // Stop threads that are sending packets to remote servers
OutgoingSessionPromise.getInstance().shutdown(); OutgoingSessionPromise.getInstance().shutdown();
......
...@@ -43,21 +43,24 @@ public class SessionNotFoundException extends Exception { ...@@ -43,21 +43,24 @@ public class SessionNotFoundException extends Exception {
this.nestedThrowable = nestedThrowable; this.nestedThrowable = nestedThrowable;
} }
public void printStackTrace() { @Override
public void printStackTrace() {
super.printStackTrace(); super.printStackTrace();
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(); nestedThrowable.printStackTrace();
} }
} }
public void printStackTrace(PrintStream ps) { @Override
public void printStackTrace(PrintStream ps) {
super.printStackTrace(ps); super.printStackTrace(ps);
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(ps); nestedThrowable.printStackTrace(ps);
} }
} }
public void printStackTrace(PrintWriter pw) { @Override
public void printStackTrace(PrintWriter pw) {
super.printStackTrace(pw); super.printStackTrace(pw);
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(pw); nestedThrowable.printStackTrace(pw);
......
...@@ -311,7 +311,8 @@ public class SessionResultFilter { ...@@ -311,7 +311,8 @@ public class SessionResultFilter {
return date - (date % (1000 * seconds)); return date - (date % (1000 * seconds));
} }
public boolean equals(Object object) { @Override
public boolean equals(Object object) {
if (this == object) { if (this == object) {
return true; return true;
} }
......
...@@ -419,7 +419,8 @@ public class XMPPServer { ...@@ -419,7 +419,8 @@ public class XMPPServer {
AdminManager.getInstance().getAdminAccounts(); AdminManager.getInstance().getAdminAccounts();
Thread finishSetup = new Thread() { Thread finishSetup = new Thread() {
public void run() { @Override
public void run() {
try { try {
if (isStandAlone()) { if (isStandAlone()) {
// Always restart the HTTP server manager. This covers the case // Always restart the HTTP server manager. This covers the case
...@@ -654,7 +655,8 @@ public class XMPPServer { ...@@ -654,7 +655,8 @@ public class XMPPServer {
*/ */
public void restartHTTPServer() { public void restartHTTPServer() {
Thread restartThread = new Thread() { Thread restartThread = new Thread() {
public void run() { @Override
public void run() {
if (isStandAlone()) { if (isStandAlone()) {
// Restart the HTTP server manager. This covers the case // Restart the HTTP server manager. This covers the case
// of changing the ports, as well as generating self-signed certificates. // of changing the ports, as well as generating self-signed certificates.
...@@ -897,7 +899,8 @@ public class XMPPServer { ...@@ -897,7 +899,8 @@ public class XMPPServer {
/** /**
* <p>Logs the server shutdown.</p> * <p>Logs the server shutdown.</p>
*/ */
public void run() { @Override
public void run() {
shutdownServer(); shutdownServer();
Log.info("Server halted"); Log.info("Server halted");
System.err.println("Server halted"); System.err.println("Server halted");
...@@ -916,7 +919,8 @@ public class XMPPServer { ...@@ -916,7 +919,8 @@ public class XMPPServer {
/** /**
* <p>Shuts down the JVM after a 5 second delay.</p> * <p>Shuts down the JVM after a 5 second delay.</p>
*/ */
public void run() { @Override
public void run() {
try { try {
Thread.sleep(5000); Thread.sleep(5000);
// No matter what, we make sure it's dead // No matter what, we make sure it's dead
......
...@@ -235,7 +235,8 @@ public class AuditManagerImpl extends BasicModule implements AuditManager { ...@@ -235,7 +235,8 @@ public class AuditManagerImpl extends BasicModule implements AuditManager {
// Basic module methods // Basic module methods
// ######################################################################### // #########################################################################
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
enabled = JiveGlobals.getBooleanProperty("xmpp.audit.active"); enabled = JiveGlobals.getBooleanProperty("xmpp.audit.active");
auditMessage = JiveGlobals.getBooleanProperty("xmpp.audit.message"); auditMessage = JiveGlobals.getBooleanProperty("xmpp.audit.message");
...@@ -272,7 +273,8 @@ public class AuditManagerImpl extends BasicModule implements AuditManager { ...@@ -272,7 +273,8 @@ public class AuditManagerImpl extends BasicModule implements AuditManager {
} }
} }
public void stop() { @Override
public void stop() {
if (auditor != null) { if (auditor != null) {
auditor.stop(); auditor.stop();
} }
......
...@@ -355,7 +355,8 @@ public class AuditorImpl implements Auditor { ...@@ -355,7 +355,8 @@ public class AuditorImpl implements Auditor {
* Saves the queued entries to an XML file and checks that very old files are deleted. * Saves the queued entries to an XML file and checks that very old files are deleted.
*/ */
private class SaveQueuedPacketsTask extends TimerTask { private class SaveQueuedPacketsTask extends TimerTask {
public void run() { @Override
public void run() {
try { try {
// Ensure that saved audit logs are not too old // Ensure that saved audit logs are not too old
ensureMaxDays(); ensureMaxDays();
......
...@@ -56,7 +56,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate { ...@@ -56,7 +56,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
csComponentAddress = ClearspaceManager.CLEARSPACE_COMPONENT + "." + xmppDomain; csComponentAddress = ClearspaceManager.CLEARSPACE_COMPONENT + "." + xmppDomain;
} }
public InvitationResult sendingInvitation(MUCRoom room, JID invitee, JID inviter, String reason) @Override
public InvitationResult sendingInvitation(MUCRoom room, JID invitee, JID inviter, String reason)
{ {
// Packet should look like: // Packet should look like:
// <iq to="clearspace.example.org" from="clearspace-conference.example.org"> // <iq to="clearspace.example.org" from="clearspace-conference.example.org">
...@@ -103,7 +104,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate { ...@@ -103,7 +104,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
* @param userjid the JID of the user attempting to join the room. * @param userjid the JID of the user attempting to join the room.
* @return true if the user is allowed to join the room. * @return true if the user is allowed to join the room.
*/ */
public boolean joiningRoom(MUCRoom room, JID userjid) { @Override
public boolean joiningRoom(MUCRoom room, JID userjid) {
// Always allow an owner to join the room (especially since they need to join to configure the // Always allow an owner to join the room (especially since they need to join to configure the
// room on initial creation). // room on initial creation).
Collection<String> owners = room.getOwners(); Collection<String> owners = room.getOwners();
...@@ -145,11 +147,13 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate { ...@@ -145,11 +147,13 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
return false; return false;
} }
public boolean shouldRecreate(String roomName, JID userjid) { @Override
public boolean shouldRecreate(String roomName, JID userjid) {
return !(roomName + "@" + csComponentAddress).equals(userjid.toBareJID()); return !(roomName + "@" + csComponentAddress).equals(userjid.toBareJID());
} }
public Map<String, String> getRoomConfig(String roomName) { @Override
public Map<String, String> getRoomConfig(String roomName) {
Map<String, String> roomConfig = new HashMap<String, String>(); Map<String, String> roomConfig = new HashMap<String, String>();
IQ iq = new IQ(IQ.Type.get); IQ iq = new IQ(IQ.Type.get);
...@@ -209,7 +213,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate { ...@@ -209,7 +213,8 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
* @param userjid the JID of the user attempting to destroy the room. * @param userjid the JID of the user attempting to destroy the room.
* @return true if the user is allowed to destroy the room. * @return true if the user is allowed to destroy the room.
*/ */
public boolean destroyingRoom(String roomName, JID userjid) { @Override
public boolean destroyingRoom(String roomName, JID userjid) {
// We never allow destroying a room as a user, but clearspace components are permitted. // We never allow destroying a room as a user, but clearspace components are permitted.
return ClearspaceManager.getInstance().isFromClearspace(userjid); return ClearspaceManager.getInstance().isFromClearspace(userjid);
} }
......
...@@ -124,7 +124,8 @@ public class ClearspaceMUCTranscriptManager implements MUCEventListener { ...@@ -124,7 +124,8 @@ public class ClearspaceMUCTranscriptManager implements MUCEventListener {
// Schedule a task for this new transcript event queue. // Schedule a task for this new transcript event queue.
transcriptUpdateTask = new TimerTask() { transcriptUpdateTask = new TimerTask() {
public void run() { @Override
public void run() {
if (roomEvents.isEmpty()) { if (roomEvents.isEmpty()) {
return; return;
} }
......
...@@ -155,7 +155,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM ...@@ -155,7 +155,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
} }
// Create xmpp parser to keep in each thread // Create xmpp parser to keep in each thread
localParser = new ThreadLocal<XMPPPacketReader>() { localParser = new ThreadLocal<XMPPPacketReader>() {
protected XMPPPacketReader initialValue() { @Override
protected XMPPPacketReader initialValue() {
XMPPPacketReader parser = new XMPPPacketReader(); XMPPPacketReader parser = new XMPPPacketReader();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
parser.setXPPFactory(factory); parser.setXPPFactory(factory);
...@@ -529,7 +530,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM ...@@ -529,7 +530,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
return AuthFactory.getAuthProvider() instanceof ClearspaceAuthProvider; return AuthFactory.getAuthProvider() instanceof ClearspaceAuthProvider;
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
if (isEnabled()) { if (isEnabled()) {
// Before starting up service make sure there is a default secret // Before starting up service make sure there is a default secret
...@@ -587,7 +589,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM ...@@ -587,7 +589,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
} }
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
// Stops the Clearspace MUC transcript manager // Stops the Clearspace MUC transcript manager
...@@ -1331,7 +1334,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM ...@@ -1331,7 +1334,8 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
private class ConfigClearspaceTask extends TimerTask { private class ConfigClearspaceTask extends TimerTask {
public void run() { @Override
public void run() {
try { try {
Log.debug("Trying to configure Clearspace."); Log.debug("Trying to configure Clearspace.");
doConfigClearspace(); doConfigClearspace();
......
...@@ -171,11 +171,13 @@ public class SSLProtocolSocketFactory implements SecureProtocolSocketFactory { ...@@ -171,11 +171,13 @@ public class SSLProtocolSocketFactory implements SecureProtocolSocketFactory {
); );
} }
public boolean equals(Object obj) { @Override
public boolean equals(Object obj) {
return ((obj != null) && obj.getClass().equals(SSLProtocolSocketFactory.class)); return ((obj != null) && obj.getClass().equals(SSLProtocolSocketFactory.class));
} }
public int hashCode() { @Override
public int hashCode() {
return SSLProtocolSocketFactory.class.hashCode(); return SSLProtocolSocketFactory.class.hashCode();
} }
......
...@@ -49,7 +49,8 @@ public class ClusterManager { ...@@ -49,7 +49,8 @@ public class ClusterManager {
static { static {
Thread thread = new Thread("ClusterManager events dispatcher") { Thread thread = new Thread("ClusterManager events dispatcher") {
public void run() { @Override
public void run() {
for (; ;) { for (; ;) {
try { try {
Event event = events.take(); Event event = events.take();
...@@ -453,7 +454,8 @@ public class ClusterManager { ...@@ -453,7 +454,8 @@ public class ClusterManager {
this.processed = processed; this.processed = processed;
} }
public String toString() { @Override
public String toString() {
return super.toString() + " type: " + type; return super.toString() + " type: " + type;
} }
} }
......
...@@ -79,7 +79,8 @@ public class NodeID implements Externalizable { ...@@ -79,7 +79,8 @@ public class NodeID implements Externalizable {
return Arrays.equals(nodeID, anotherID); return Arrays.equals(nodeID, anotherID);
} }
public boolean equals(Object o) { @Override
public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
...@@ -88,7 +89,8 @@ public class NodeID implements Externalizable { ...@@ -88,7 +89,8 @@ public class NodeID implements Externalizable {
return Arrays.equals(nodeID, that.nodeID); return Arrays.equals(nodeID, that.nodeID);
} }
public int hashCode() { @Override
public int hashCode() {
return Arrays.hashCode(nodeID); return Arrays.hashCode(nodeID);
} }
......
...@@ -84,11 +84,13 @@ public class AdHocCommandHandler extends IQHandler ...@@ -84,11 +84,13 @@ public class AdHocCommandHandler extends IQHandler
manager = new AdHocCommandManager(); manager = new AdHocCommandManager();
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
return manager.process(packet); return manager.process(packet);
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
...@@ -144,14 +146,16 @@ public class AdHocCommandHandler extends IQHandler ...@@ -144,14 +146,16 @@ public class AdHocCommandHandler extends IQHandler
return answer.iterator(); return answer.iterator();
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
infoHandler = server.getIQDiscoInfoHandler(); infoHandler = server.getIQDiscoInfoHandler();
itemsHandler = server.getIQDiscoItemsHandler(); itemsHandler = server.getIQDiscoItemsHandler();
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
infoHandler.setServerNodeInfoProvider(NAMESPACE, this); infoHandler.setServerNodeInfoProvider(NAMESPACE, this);
itemsHandler.setServerNodeInfoProvider(NAMESPACE, this); itemsHandler.setServerNodeInfoProvider(NAMESPACE, this);
...@@ -159,7 +163,8 @@ public class AdHocCommandHandler extends IQHandler ...@@ -159,7 +163,8 @@ public class AdHocCommandHandler extends IQHandler
addDefaultCommands(); addDefaultCommands();
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
infoHandler.removeServerNodeInfoProvider(NAMESPACE); infoHandler.removeServerNodeInfoProvider(NAMESPACE);
itemsHandler.removeServerNodeInfoProvider(NAMESPACE); itemsHandler.removeServerNodeInfoProvider(NAMESPACE);
......
...@@ -44,11 +44,13 @@ import java.util.List; ...@@ -44,11 +44,13 @@ import java.util.List;
*/ */
public class GetAdminConsoleInfo extends AdHocCommand { public class GetAdminConsoleInfo extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -126,25 +128,30 @@ public class GetAdminConsoleInfo extends AdHocCommand { ...@@ -126,25 +128,30 @@ public class GetAdminConsoleInfo extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-console-info"; return "http://jabber.org/protocol/admin#get-console-info";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get admin console info."; return "Get admin console info.";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
...@@ -155,7 +162,8 @@ public class GetAdminConsoleInfo extends AdHocCommand { ...@@ -155,7 +162,8 @@ public class GetAdminConsoleInfo extends AdHocCommand {
* @param requester the JID of the user requesting to execute this command. * @param requester the JID of the user requesting to execute this command.
* @return true if the requester can access this command. * @return true if the requester can access this command.
*/ */
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -38,7 +38,8 @@ import java.util.*; ...@@ -38,7 +38,8 @@ import java.util.*;
*/ */
public class GetListActiveUsers extends AdHocCommand { public class GetListActiveUsers extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Requesting List of Active Users"); form.setTitle("Requesting List of Active Users");
form.addInstruction("Fill out this form to request the active users of this service."); form.addInstruction("Fill out this form to request the active users of this service.");
...@@ -64,7 +65,8 @@ public class GetListActiveUsers extends AdHocCommand { ...@@ -64,7 +65,8 @@ public class GetListActiveUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
String max_items = data.getData().get("max_items").get(0); String max_items = data.getData().get("max_items").get(0);
int maxItems = -1; int maxItems = -1;
if (max_items != null && "none".equals(max_items)) { if (max_items != null && "none".equals(max_items)) {
...@@ -105,23 +107,28 @@ public class GetListActiveUsers extends AdHocCommand { ...@@ -105,23 +107,28 @@ public class GetListActiveUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-active-users"; return "http://jabber.org/protocol/admin#get-active-users";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get List of Active Users"; return "Get List of Active Users";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -40,11 +40,13 @@ import java.util.Set; ...@@ -40,11 +40,13 @@ import java.util.Set;
*/ */
public class GetNumberActiveUsers extends AdHocCommand { public class GetNumberActiveUsers extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -68,26 +70,31 @@ public class GetNumberActiveUsers extends AdHocCommand { ...@@ -68,26 +70,31 @@ public class GetNumberActiveUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-active-users-num"; return "http://jabber.org/protocol/admin#get-active-users-num";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
// TODO Use i18n // TODO Use i18n
return "Number of Active Users"; return "Number of Active Users";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
} }
...@@ -41,11 +41,13 @@ import java.util.Set; ...@@ -41,11 +41,13 @@ import java.util.Set;
*/ */
public class GetNumberOnlineUsers extends AdHocCommand { public class GetNumberOnlineUsers extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -67,26 +69,31 @@ public class GetNumberOnlineUsers extends AdHocCommand { ...@@ -67,26 +69,31 @@ public class GetNumberOnlineUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-online-users-num"; return "http://jabber.org/protocol/admin#get-online-users-num";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
// TODO Use i18n // TODO Use i18n
return "Number of Online Users"; return "Number of Online Users";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
} }
...@@ -33,11 +33,13 @@ import java.util.List; ...@@ -33,11 +33,13 @@ import java.util.List;
*/ */
public class GetNumberUserSessions extends AdHocCommand { public class GetNumberUserSessions extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -54,26 +56,31 @@ public class GetNumberUserSessions extends AdHocCommand { ...@@ -54,26 +56,31 @@ public class GetNumberUserSessions extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-sessions-num"; return "http://jabber.org/protocol/admin#get-sessions-num";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
// TODO Use i18n // TODO Use i18n
return "Number of Connected User Sessions"; return "Number of Connected User Sessions";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
} }
...@@ -48,11 +48,13 @@ import java.util.*; ...@@ -48,11 +48,13 @@ import java.util.*;
public class GetServerStats extends AdHocCommand { public class GetServerStats extends AdHocCommand {
final private FastDateFormat dateFormat = FastDateFormat.getInstance(JiveConstants.XMPP_DATETIME_FORMAT, TimeZone.getTimeZone("UTC")); final private FastDateFormat dateFormat = FastDateFormat.getInstance(JiveConstants.XMPP_DATETIME_FORMAT, TimeZone.getTimeZone("UTC"));
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -130,25 +132,30 @@ public class GetServerStats extends AdHocCommand { ...@@ -130,25 +132,30 @@ public class GetServerStats extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-server-stats"; return "http://jabber.org/protocol/admin#get-server-stats";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get basic statistics of the server."; return "Get basic statistics of the server.";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
...@@ -159,7 +166,8 @@ public class GetServerStats extends AdHocCommand { ...@@ -159,7 +166,8 @@ public class GetServerStats extends AdHocCommand {
* @param requester the JID of the user requesting to execute this command. * @param requester the JID of the user requesting to execute this command.
* @return true if the requester can access this command. * @return true if the requester can access this command.
*/ */
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
...@@ -42,7 +42,8 @@ import java.util.List; ...@@ -42,7 +42,8 @@ import java.util.List;
*/ */
public class GetUsersPresence extends AdHocCommand { public class GetUsersPresence extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Requesting Presence of Active Users"); form.setTitle("Requesting Presence of Active Users");
form.addInstruction("Fill out this form to request the active users presence of this service."); form.addInstruction("Fill out this form to request the active users presence of this service.");
...@@ -68,7 +69,8 @@ public class GetUsersPresence extends AdHocCommand { ...@@ -68,7 +69,8 @@ public class GetUsersPresence extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
String max_items = data.getData().get("max_items").get(0); String max_items = data.getData().get("max_items").get(0);
int maxItems = -1; int maxItems = -1;
if (max_items != null && "none".equals(max_items)) { if (max_items != null && "none".equals(max_items)) {
...@@ -105,23 +107,28 @@ public class GetUsersPresence extends AdHocCommand { ...@@ -105,23 +107,28 @@ public class GetUsersPresence extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-active-presences"; return "http://jabber.org/protocol/admin#get-active-presences";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get Presence of Active Users"; return "Get Presence of Active Users";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
...@@ -132,7 +139,8 @@ public class GetUsersPresence extends AdHocCommand { ...@@ -132,7 +139,8 @@ public class GetUsersPresence extends AdHocCommand {
* @param requester the JID of the entity requesting to execute this command. * @param requester the JID of the entity requesting to execute this command.
* @return true if the requester can access this command. * @return true if the requester can access this command.
*/ */
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
...@@ -39,19 +39,23 @@ import java.util.List; ...@@ -39,19 +39,23 @@ import java.util.List;
* @author Alexander Wenckus * @author Alexander Wenckus
*/ */
public class HttpBindStatus extends AdHocCommand { public class HttpBindStatus extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#status-http-bind"; return "http://jabber.org/protocol/admin#status-http-bind";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Current Http Bind Status"; return "Current Http Bind Status";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -89,15 +93,18 @@ public class HttpBindStatus extends AdHocCommand { ...@@ -89,15 +93,18 @@ public class HttpBindStatus extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
// no stages, do nothing. // no stages, do nothing.
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Collections.emptyList(); return Collections.emptyList();
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return null; return null;
} }
......
...@@ -41,7 +41,8 @@ import java.util.List; ...@@ -41,7 +41,8 @@ import java.util.List;
*/ */
public class PacketsNotification extends AdHocCommand { public class PacketsNotification extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Receiving notification of packets activity"); form.setTitle("Receiving notification of packets activity");
form.addInstruction("Fill out this form to configure packets to receive."); form.addInstruction("Fill out this form to configure packets to receive.");
...@@ -80,7 +81,8 @@ public class PacketsNotification extends AdHocCommand { ...@@ -80,7 +81,8 @@ public class PacketsNotification extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
boolean presenceEnabled = false; boolean presenceEnabled = false;
boolean messageEnabled = false; boolean messageEnabled = false;
boolean iqEnabled = false; boolean iqEnabled = false;
...@@ -110,23 +112,28 @@ public class PacketsNotification extends AdHocCommand { ...@@ -110,23 +112,28 @@ public class PacketsNotification extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#packets_notification"; return "http://jabber.org/protocol/admin#packets_notification";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get notifications of packet activity"; return "Get notifications of packet activity";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
...@@ -137,7 +144,8 @@ public class PacketsNotification extends AdHocCommand { ...@@ -137,7 +144,8 @@ public class PacketsNotification extends AdHocCommand {
* @param requester the JID of the user requesting to execute this command. * @param requester the JID of the user requesting to execute this command.
* @return true if the requester can access this command. * @return true if the requester can access this command.
*/ */
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return InternalComponentManager.getInstance().hasComponent(requester); return InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
...@@ -46,7 +46,8 @@ public class AddGroup extends AdHocCommand { ...@@ -46,7 +46,8 @@ public class AddGroup extends AdHocCommand {
private static final Logger Log = LoggerFactory.getLogger(AddGroup.class); private static final Logger Log = LoggerFactory.getLogger(AddGroup.class);
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Create new group"); form.setTitle("Create new group");
form.addInstruction("Fill out this form to create a new group."); form.addInstruction("Fill out this form to create a new group.");
...@@ -99,7 +100,8 @@ public class AddGroup extends AdHocCommand { ...@@ -99,7 +100,8 @@ public class AddGroup extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (GroupManager.getInstance().isReadOnly()) { if (GroupManager.getInstance().isReadOnly()) {
...@@ -174,23 +176,28 @@ public class AddGroup extends AdHocCommand { ...@@ -174,23 +176,28 @@ public class AddGroup extends AdHocCommand {
note.setText("Operation finished" + (withErrors ? " with errors" : " successfully")); note.setText("Operation finished" + (withErrors ? " with errors" : " successfully"));
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#add-group"; return "http://jabber.org/protocol/admin#add-group";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Create new group"; return "Create new group";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -46,7 +46,8 @@ public class AddGroupUsers extends AdHocCommand { ...@@ -46,7 +46,8 @@ public class AddGroupUsers extends AdHocCommand {
private static final Logger Log = LoggerFactory.getLogger(AddGroupUsers.class); private static final Logger Log = LoggerFactory.getLogger(AddGroupUsers.class);
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Add members or admins to a group"); form.setTitle("Add members or admins to a group");
form.addInstruction("Fill out this form to add new members or admins to a group."); form.addInstruction("Fill out this form to add new members or admins to a group.");
...@@ -79,7 +80,8 @@ public class AddGroupUsers extends AdHocCommand { ...@@ -79,7 +80,8 @@ public class AddGroupUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (GroupManager.getInstance().isReadOnly()) { if (GroupManager.getInstance().isReadOnly()) {
...@@ -116,23 +118,28 @@ public class AddGroupUsers extends AdHocCommand { ...@@ -116,23 +118,28 @@ public class AddGroupUsers extends AdHocCommand {
note.setText("Operation finished" + (withErrors ? " with errors" : " successfully")); note.setText("Operation finished" + (withErrors ? " with errors" : " successfully"));
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#add-group-members"; return "http://jabber.org/protocol/admin#add-group-members";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Add members or admins to a group"; return "Add members or admins to a group";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -39,7 +39,8 @@ import java.util.List; ...@@ -39,7 +39,8 @@ import java.util.List;
* TODO Use i18n * TODO Use i18n
*/ */
public class DeleteGroup extends AdHocCommand { public class DeleteGroup extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Delete group"); form.setTitle("Delete group");
form.addInstruction("Fill out this form to delete a group."); form.addInstruction("Fill out this form to delete a group.");
...@@ -59,7 +60,8 @@ public class DeleteGroup extends AdHocCommand { ...@@ -59,7 +60,8 @@ public class DeleteGroup extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (GroupManager.getInstance().isReadOnly()) { if (GroupManager.getInstance().isReadOnly()) {
...@@ -84,23 +86,28 @@ public class DeleteGroup extends AdHocCommand { ...@@ -84,23 +86,28 @@ public class DeleteGroup extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#delete-group"; return "http://jabber.org/protocol/admin#delete-group";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Delete group"; return "Delete group";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -45,7 +45,8 @@ public class DeleteGroupUsers extends AdHocCommand { ...@@ -45,7 +45,8 @@ public class DeleteGroupUsers extends AdHocCommand {
private static final Logger Log = LoggerFactory.getLogger(DeleteGroupUsers.class); private static final Logger Log = LoggerFactory.getLogger(DeleteGroupUsers.class);
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Delete members or admins from a group"); form.setTitle("Delete members or admins from a group");
form.addInstruction("Fill out this form to delete members or admins from a group."); form.addInstruction("Fill out this form to delete members or admins from a group.");
...@@ -71,7 +72,8 @@ public class DeleteGroupUsers extends AdHocCommand { ...@@ -71,7 +72,8 @@ public class DeleteGroupUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (GroupManager.getInstance().isReadOnly()) { if (GroupManager.getInstance().isReadOnly()) {
...@@ -105,23 +107,28 @@ public class DeleteGroupUsers extends AdHocCommand { ...@@ -105,23 +107,28 @@ public class DeleteGroupUsers extends AdHocCommand {
note.setText("Operation finished" + (withErrors ? " with errors" : " successfully")); note.setText("Operation finished" + (withErrors ? " with errors" : " successfully"));
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#delete-group-members"; return "http://jabber.org/protocol/admin#delete-group-members";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Delete members or admins from a group"; return "Delete members or admins from a group";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -42,7 +42,8 @@ import java.util.Map; ...@@ -42,7 +42,8 @@ import java.util.Map;
* TODO Use i18n * TODO Use i18n
*/ */
public class GetListGroupUsers extends AdHocCommand { public class GetListGroupUsers extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Requesting List of Group Members"); form.setTitle("Requesting List of Group Members");
form.addInstruction("Fill out this form to request list of group members and admins."); form.addInstruction("Fill out this form to request list of group members and admins.");
...@@ -62,7 +63,8 @@ public class GetListGroupUsers extends AdHocCommand { ...@@ -62,7 +63,8 @@ public class GetListGroupUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Group group; Group group;
try { try {
group = GroupManager.getInstance().getGroup(data.getData().get("group").get(0)); group = GroupManager.getInstance().getGroup(data.getData().get("group").get(0));
...@@ -96,23 +98,28 @@ public class GetListGroupUsers extends AdHocCommand { ...@@ -96,23 +98,28 @@ public class GetListGroupUsers extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-group-members"; return "http://jabber.org/protocol/admin#get-group-members";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get List of Group Members"; return "Get List of Group Members";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -42,7 +42,8 @@ import java.util.Map; ...@@ -42,7 +42,8 @@ import java.util.Map;
*/ */
public class GetListGroups extends AdHocCommand { public class GetListGroups extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Requesting List of Existing Groups"); form.setTitle("Requesting List of Existing Groups");
form.addInstruction("Fill out this form to request list of groups."); form.addInstruction("Fill out this form to request list of groups.");
...@@ -84,7 +85,8 @@ public class GetListGroups extends AdHocCommand { ...@@ -84,7 +85,8 @@ public class GetListGroups extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
String start = data.getData().get("start").get(0); String start = data.getData().get("start").get(0);
String max_items = data.getData().get("max_items").get(0); String max_items = data.getData().get("max_items").get(0);
int nStart = 0; int nStart = 0;
...@@ -141,23 +143,28 @@ public class GetListGroups extends AdHocCommand { ...@@ -141,23 +143,28 @@ public class GetListGroups extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-groups"; return "http://jabber.org/protocol/admin#get-groups";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get List of Existing Groups"; return "Get List of Existing Groups";
} }
protected List<AdHocCommand.Action> getActions(SessionData data) { @Override
protected List<AdHocCommand.Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
} }
...@@ -38,7 +38,8 @@ import java.util.*; ...@@ -38,7 +38,8 @@ import java.util.*;
* TODO Use i18n * TODO Use i18n
*/ */
public class UpdateGroup extends AdHocCommand { public class UpdateGroup extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
if (data.getStage() == 0) { if (data.getStage() == 0) {
form.setTitle("Update group configuration"); form.setTitle("Update group configuration");
...@@ -146,7 +147,8 @@ public class UpdateGroup extends AdHocCommand { ...@@ -146,7 +147,8 @@ public class UpdateGroup extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Get requested group // Get requested group
Group group; Group group;
...@@ -198,15 +200,18 @@ public class UpdateGroup extends AdHocCommand { ...@@ -198,15 +200,18 @@ public class UpdateGroup extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#update-group"; return "http://jabber.org/protocol/admin#update-group";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Update group configuration"; return "Update group configuration";
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
if (data.getStage() == 0) { if (data.getStage() == 0) {
return Arrays.asList(AdHocCommand.Action.next); return Arrays.asList(AdHocCommand.Action.next);
} }
...@@ -216,14 +221,16 @@ public class UpdateGroup extends AdHocCommand { ...@@ -216,14 +221,16 @@ public class UpdateGroup extends AdHocCommand {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
if (data.getStage() == 0) { if (data.getStage() == 0) {
return AdHocCommand.Action.next; return AdHocCommand.Action.next;
} }
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 2; return 2;
} }
} }
...@@ -41,19 +41,23 @@ import java.util.Map; ...@@ -41,19 +41,23 @@ import java.util.Map;
* @author Alexander Wenckus * @author Alexander Wenckus
*/ */
public class CreateMUCRoom extends AdHocCommand { public class CreateMUCRoom extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#create-muc-room"; return "http://jabber.org/protocol/admin#create-muc-room";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Create a Multi-user Chat"; return "Create a Multi-user Chat";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Collection<JID> admins = XMPPServer.getInstance().getAdmins(); Collection<JID> admins = XMPPServer.getInstance().getAdmins();
if (admins.size() <= 0) { if (admins.size() <= 0) {
...@@ -114,7 +118,8 @@ public class CreateMUCRoom extends AdHocCommand { ...@@ -114,7 +118,8 @@ public class CreateMUCRoom extends AdHocCommand {
} }
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Create a multi-user chat room"); form.setTitle("Create a multi-user chat room");
form.addInstruction("Fill out this form to create a multi-user chat room."); form.addInstruction("Fill out this form to create a multi-user chat room.");
...@@ -160,11 +165,13 @@ public class CreateMUCRoom extends AdHocCommand { ...@@ -160,11 +165,13 @@ public class CreateMUCRoom extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
......
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Alexander Wenckus * @author Alexander Wenckus
*/ */
public class AddUser extends AdHocCommand { public class AddUser extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#add-user"; return "http://jabber.org/protocol/admin#add-user";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Add a User"; return "Add a User";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (UserManager.getUserProvider().isReadOnly()) { if (UserManager.getUserProvider().isReadOnly()) {
...@@ -116,7 +120,8 @@ public class AddUser extends AdHocCommand { ...@@ -116,7 +120,8 @@ public class AddUser extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Adding a user"); form.setTitle("Adding a user");
form.addInstruction("Fill out this form to add a user."); form.addInstruction("Fill out this form to add a user.");
...@@ -161,15 +166,18 @@ public class AddUser extends AdHocCommand { ...@@ -161,15 +166,18 @@ public class AddUser extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester)) return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester))
&& !UserManager.getUserProvider().isReadOnly(); && !UserManager.getUserProvider().isReadOnly();
} }
......
...@@ -44,19 +44,23 @@ import java.util.List; ...@@ -44,19 +44,23 @@ import java.util.List;
* @author Alexander Wenckus * @author Alexander Wenckus
*/ */
public class AuthenticateUser extends AdHocCommand { public class AuthenticateUser extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#authenticate-user"; return "http://jabber.org/protocol/admin#authenticate-user";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Authenticate User"; return "Authenticate User";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
JID account; JID account;
try { try {
...@@ -109,7 +113,8 @@ public class AuthenticateUser extends AdHocCommand { ...@@ -109,7 +113,8 @@ public class AuthenticateUser extends AdHocCommand {
note.setText("Operation finished successfully."); note.setText("Operation finished successfully.");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Authenticating a user"); form.setTitle("Authenticating a user");
form.addInstruction("Fill out this form to authenticate a user."); form.addInstruction("Fill out this form to authenticate a user.");
...@@ -135,11 +140,13 @@ public class AuthenticateUser extends AdHocCommand { ...@@ -135,11 +140,13 @@ public class AuthenticateUser extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
......
...@@ -41,19 +41,23 @@ import java.util.List; ...@@ -41,19 +41,23 @@ import java.util.List;
* TODO Use i18n * TODO Use i18n
*/ */
public class ChangeUserPassword extends AdHocCommand { public class ChangeUserPassword extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#change-user-password"; return "http://jabber.org/protocol/admin#change-user-password";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Change User Password"; return "Change User Password";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
// Check if groups cannot be modified (backend is read-only) // Check if groups cannot be modified (backend is read-only)
if (UserManager.getUserProvider().isReadOnly()) { if (UserManager.getUserProvider().isReadOnly()) {
...@@ -85,7 +89,8 @@ public class ChangeUserPassword extends AdHocCommand { ...@@ -85,7 +89,8 @@ public class ChangeUserPassword extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Changing a User Password"); form.setTitle("Changing a User Password");
form.addInstruction("Fill out this form to change a user\u2019s password."); form.addInstruction("Fill out this form to change a user\u2019s password.");
...@@ -111,16 +116,19 @@ public class ChangeUserPassword extends AdHocCommand { ...@@ -111,16 +116,19 @@ public class ChangeUserPassword extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) && !UserManager.getUserProvider().isReadOnly(); return super.hasPermission(requester) && !UserManager.getUserProvider().isReadOnly();
} }
} }
...@@ -37,19 +37,23 @@ import java.util.Arrays; ...@@ -37,19 +37,23 @@ import java.util.Arrays;
* @author Alexander Wenckus * @author Alexander Wenckus
*/ */
public class UserProperties extends AdHocCommand { public class UserProperties extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/admin#get-user-properties"; return "http://jabber.org/protocol/admin#get-user-properties";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Get User Properties"; return "Get User Properties";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -93,7 +97,8 @@ public class UserProperties extends AdHocCommand { ...@@ -93,7 +97,8 @@ public class UserProperties extends AdHocCommand {
} }
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Retrieve Users' Information"); form.setTitle("Retrieve Users' Information");
form.addInstruction("Fill out this form to retrieve users' information."); form.addInstruction("Fill out this form to retrieve users' information.");
...@@ -113,11 +118,13 @@ public class UserProperties extends AdHocCommand { ...@@ -113,11 +118,13 @@ public class UserProperties extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete); return Arrays.asList(AdHocCommand.Action.complete);
} }
protected AdHocCommand.Action getExecuteAction(SessionData data) { @Override
protected AdHocCommand.Action getExecuteAction(SessionData data) {
return AdHocCommand.Action.complete; return AdHocCommand.Action.complete;
} }
} }
...@@ -38,19 +38,23 @@ import java.util.Map; ...@@ -38,19 +38,23 @@ import java.util.Map;
* @author Gabriel Guardincerri * @author Gabriel Guardincerri
*/ */
public class ChangeSharedSecret extends AdHocCommand { public class ChangeSharedSecret extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/clearspace#change-sharedsecret"; return "http://jabber.org/protocol/clearspace#change-sharedsecret";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Change the share secret"; return "Change the share secret";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -89,7 +93,8 @@ public class ChangeSharedSecret extends AdHocCommand { ...@@ -89,7 +93,8 @@ public class ChangeSharedSecret extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Changing the share secret"); form.setTitle("Changing the share secret");
form.addInstruction("Fill out this form to change the shared secret."); form.addInstruction("Fill out this form to change the shared secret.");
...@@ -115,15 +120,18 @@ public class ChangeSharedSecret extends AdHocCommand { ...@@ -115,15 +120,18 @@ public class ChangeSharedSecret extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester)); return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester));
} }
} }
\ No newline at end of file
...@@ -37,11 +37,13 @@ import java.util.List; ...@@ -37,11 +37,13 @@ import java.util.List;
*/ */
public class GenerateNonce extends AdHocCommand { public class GenerateNonce extends AdHocCommand {
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
//Do nothing since there are no stages //Do nothing since there are no stages
} }
public void execute(SessionData data, Element command) { @Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result); DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField(); FormField field = form.addField();
...@@ -57,30 +59,36 @@ public class GenerateNonce extends AdHocCommand { ...@@ -57,30 +59,36 @@ public class GenerateNonce extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/clearspace#generate-nonce"; return "http://jabber.org/protocol/clearspace#generate-nonce";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
// TODO Use i18n // TODO Use i18n
return "New nonce"; return "New nonce";
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
//Do nothing since there are no stages //Do nothing since there are no stages
return null; return null;
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 0; return 0;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester)); return (super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester));
} }
......
...@@ -35,19 +35,23 @@ import java.util.Arrays; ...@@ -35,19 +35,23 @@ import java.util.Arrays;
* @author Armando Jagucki * @author Armando Jagucki
*/ */
public class SystemAdminAdded extends AdHocCommand { public class SystemAdminAdded extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#sys-admin-added"; return "http://jabber.org/protocol/event#sys-admin-added";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "System administrator added"; return "System administrator added";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -71,7 +75,8 @@ public class SystemAdminAdded extends AdHocCommand { ...@@ -71,7 +75,8 @@ public class SystemAdminAdded extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a system admin added event."); form.setTitle("Dispatching a system admin added event.");
form.addInstruction("Fill out this form to dispatch a system admin added event."); form.addInstruction("Fill out this form to dispatch a system admin added event.");
...@@ -91,11 +96,13 @@ public class SystemAdminAdded extends AdHocCommand { ...@@ -91,11 +96,13 @@ public class SystemAdminAdded extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
......
...@@ -35,19 +35,23 @@ import java.util.Arrays; ...@@ -35,19 +35,23 @@ import java.util.Arrays;
* @author Armando Jagucki * @author Armando Jagucki
*/ */
public class SystemAdminRemoved extends AdHocCommand { public class SystemAdminRemoved extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#sys-admin-removed"; return "http://jabber.org/protocol/event#sys-admin-removed";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "System administrator status removed"; return "System administrator status removed";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -71,7 +75,8 @@ public class SystemAdminRemoved extends AdHocCommand { ...@@ -71,7 +75,8 @@ public class SystemAdminRemoved extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a system admin removed event."); form.setTitle("Dispatching a system admin removed event.");
form.addInstruction("Fill out this form to dispatch a system admin removed event."); form.addInstruction("Fill out this form to dispatch a system admin removed event.");
...@@ -91,11 +96,13 @@ public class SystemAdminRemoved extends AdHocCommand { ...@@ -91,11 +96,13 @@ public class SystemAdminRemoved extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
......
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupAdminAdded extends AdHocCommand { public class GroupAdminAdded extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-admin-added"; return "http://jabber.org/protocol/event#group-admin-added";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group admin added"; return "Group admin added";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -107,7 +111,8 @@ public class GroupAdminAdded extends AdHocCommand { ...@@ -107,7 +111,8 @@ public class GroupAdminAdded extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group admin added event."); form.setTitle("Dispatching a group admin added event.");
form.addInstruction("Fill out this form to dispatch a group admin added event."); form.addInstruction("Fill out this form to dispatch a group admin added event.");
...@@ -133,15 +138,18 @@ public class GroupAdminAdded extends AdHocCommand { ...@@ -133,15 +138,18 @@ public class GroupAdminAdded extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupAdminRemoved extends AdHocCommand { public class GroupAdminRemoved extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-admin-removed"; return "http://jabber.org/protocol/event#group-admin-removed";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group admin removed"; return "Group admin removed";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -107,7 +111,8 @@ public class GroupAdminRemoved extends AdHocCommand { ...@@ -107,7 +111,8 @@ public class GroupAdminRemoved extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group admin removed event."); form.setTitle("Dispatching a group admin removed event.");
form.addInstruction("Fill out this form to dispatch a group admin removed event."); form.addInstruction("Fill out this form to dispatch a group admin removed event.");
...@@ -133,15 +138,18 @@ public class GroupAdminRemoved extends AdHocCommand { ...@@ -133,15 +138,18 @@ public class GroupAdminRemoved extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupCreated extends AdHocCommand { public class GroupCreated extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-created"; return "http://jabber.org/protocol/event#group-created";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group created"; return "Group created";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -90,7 +94,8 @@ public class GroupCreated extends AdHocCommand { ...@@ -90,7 +94,8 @@ public class GroupCreated extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group created event."); form.setTitle("Dispatching a group created event.");
form.addInstruction("Fill out this form to dispatch a group created event."); form.addInstruction("Fill out this form to dispatch a group created event.");
...@@ -110,15 +115,18 @@ public class GroupCreated extends AdHocCommand { ...@@ -110,15 +115,18 @@ public class GroupCreated extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupDeleting extends AdHocCommand { public class GroupDeleting extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-created"; return "http://jabber.org/protocol/event#group-created";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group deleting"; return "Group deleting";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -90,7 +94,8 @@ public class GroupDeleting extends AdHocCommand { ...@@ -90,7 +94,8 @@ public class GroupDeleting extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a deleting group event."); form.setTitle("Dispatching a deleting group event.");
form.addInstruction("Fill out this form to dispatch a deleting group event."); form.addInstruction("Fill out this form to dispatch a deleting group event.");
...@@ -110,15 +115,18 @@ public class GroupDeleting extends AdHocCommand { ...@@ -110,15 +115,18 @@ public class GroupDeleting extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupMemberAdded extends AdHocCommand { public class GroupMemberAdded extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-member-added"; return "http://jabber.org/protocol/event#group-member-added";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group member added"; return "Group member added";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -107,7 +111,8 @@ public class GroupMemberAdded extends AdHocCommand { ...@@ -107,7 +111,8 @@ public class GroupMemberAdded extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group member added event."); form.setTitle("Dispatching a group member added event.");
form.addInstruction("Fill out this form to dispatch a group member added event."); form.addInstruction("Fill out this form to dispatch a group member added event.");
...@@ -133,15 +138,18 @@ public class GroupMemberAdded extends AdHocCommand { ...@@ -133,15 +138,18 @@ public class GroupMemberAdded extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupMemberRemoved extends AdHocCommand { public class GroupMemberRemoved extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-member-removed"; return "http://jabber.org/protocol/event#group-member-removed";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group member removed"; return "Group member removed";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -107,7 +111,8 @@ public class GroupMemberRemoved extends AdHocCommand { ...@@ -107,7 +111,8 @@ public class GroupMemberRemoved extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group member removed event."); form.setTitle("Dispatching a group member removed event.");
form.addInstruction("Fill out this form to dispatch a group member removed event."); form.addInstruction("Fill out this form to dispatch a group member removed event.");
...@@ -133,15 +138,18 @@ public class GroupMemberRemoved extends AdHocCommand { ...@@ -133,15 +138,18 @@ public class GroupMemberRemoved extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class GroupModified extends AdHocCommand { public class GroupModified extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#group-modified"; return "http://jabber.org/protocol/event#group-modified";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Group modified"; return "Group modified";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -139,7 +143,8 @@ public class GroupModified extends AdHocCommand { ...@@ -139,7 +143,8 @@ public class GroupModified extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group created event."); form.setTitle("Dispatching a group created event.");
form.addInstruction("Fill out this form to dispatch a group created event."); form.addInstruction("Fill out this form to dispatch a group created event.");
...@@ -181,15 +186,18 @@ public class GroupModified extends AdHocCommand { ...@@ -181,15 +186,18 @@ public class GroupModified extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class UserCreated extends AdHocCommand { public class UserCreated extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#user-created"; return "http://jabber.org/protocol/event#user-created";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "User created"; return "User created";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -91,7 +95,8 @@ public class UserCreated extends AdHocCommand { ...@@ -91,7 +95,8 @@ public class UserCreated extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a user created event."); form.setTitle("Dispatching a user created event.");
form.addInstruction("Fill out this form to dispatch a user created event."); form.addInstruction("Fill out this form to dispatch a user created event.");
...@@ -111,15 +116,18 @@ public class UserCreated extends AdHocCommand { ...@@ -111,15 +116,18 @@ public class UserCreated extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class UserDeleting extends AdHocCommand { public class UserDeleting extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#user-deleting"; return "http://jabber.org/protocol/event#user-deleting";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Deleting a User"; return "Deleting a User";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -88,7 +92,8 @@ public class UserDeleting extends AdHocCommand { ...@@ -88,7 +92,8 @@ public class UserDeleting extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a user deleting event."); form.setTitle("Dispatching a user deleting event.");
form.addInstruction("Fill out this form to dispatch a user deleting event."); form.addInstruction("Fill out this form to dispatch a user deleting event.");
...@@ -108,15 +113,18 @@ public class UserDeleting extends AdHocCommand { ...@@ -108,15 +113,18 @@ public class UserDeleting extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -43,19 +43,23 @@ import java.util.Map; ...@@ -43,19 +43,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class UserModified extends AdHocCommand { public class UserModified extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#user-modified"; return "http://jabber.org/protocol/event#user-modified";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "User modified"; return "User modified";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -143,7 +147,8 @@ public class UserModified extends AdHocCommand { ...@@ -143,7 +147,8 @@ public class UserModified extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a user updated event."); form.setTitle("Dispatching a user updated event.");
form.addInstruction("Fill out this form to dispatch a user updated event."); form.addInstruction("Fill out this form to dispatch a user updated event.");
...@@ -187,15 +192,18 @@ public class UserModified extends AdHocCommand { ...@@ -187,15 +192,18 @@ public class UserModified extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -40,19 +40,23 @@ import java.util.Map; ...@@ -40,19 +40,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class VCardCreated extends AdHocCommand { public class VCardCreated extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#vcard-created"; return "http://jabber.org/protocol/event#vcard-created";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "VCard created"; return "VCard created";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -85,7 +89,8 @@ public class VCardCreated extends AdHocCommand { ...@@ -85,7 +89,8 @@ public class VCardCreated extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a vCard created event."); form.setTitle("Dispatching a vCard created event.");
form.addInstruction("Fill out this form to dispatch a vCard created event."); form.addInstruction("Fill out this form to dispatch a vCard created event.");
...@@ -105,15 +110,18 @@ public class VCardCreated extends AdHocCommand { ...@@ -105,15 +110,18 @@ public class VCardCreated extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -40,19 +40,23 @@ import java.util.Map; ...@@ -40,19 +40,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class VCardDeleting extends AdHocCommand { public class VCardDeleting extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#vcard-deleting"; return "http://jabber.org/protocol/event#vcard-deleting";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "Deleting a VCard"; return "Deleting a VCard";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -85,7 +89,8 @@ public class VCardDeleting extends AdHocCommand { ...@@ -85,7 +89,8 @@ public class VCardDeleting extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a vCard deleting event."); form.setTitle("Dispatching a vCard deleting event.");
form.addInstruction("Fill out this form to dispatch a vCard deleting event."); form.addInstruction("Fill out this form to dispatch a vCard deleting event.");
...@@ -105,15 +110,18 @@ public class VCardDeleting extends AdHocCommand { ...@@ -105,15 +110,18 @@ public class VCardDeleting extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -40,19 +40,23 @@ import java.util.Map; ...@@ -40,19 +40,23 @@ import java.util.Map;
* @author Gabriel Guarincerri * @author Gabriel Guarincerri
*/ */
public class VCardModified extends AdHocCommand { public class VCardModified extends AdHocCommand {
public String getCode() { @Override
public String getCode() {
return "http://jabber.org/protocol/event#vcard-modified"; return "http://jabber.org/protocol/event#vcard-modified";
} }
public String getDefaultLabel() { @Override
public String getDefaultLabel() {
return "VCard modified"; return "VCard modified";
} }
public int getMaxStages(SessionData data) { @Override
public int getMaxStages(SessionData data) {
return 1; return 1;
} }
public void execute(SessionData sessionData, Element command) { @Override
public void execute(SessionData sessionData, Element command) {
Element note = command.addElement("note"); Element note = command.addElement("note");
Map<String, List<String>> data = sessionData.getData(); Map<String, List<String>> data = sessionData.getData();
...@@ -85,7 +89,8 @@ public class VCardModified extends AdHocCommand { ...@@ -85,7 +89,8 @@ public class VCardModified extends AdHocCommand {
note.setText("Operation finished successfully"); note.setText("Operation finished successfully");
} }
protected void addStageInformation(SessionData data, Element command) { @Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form); DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a vCard updated event."); form.setTitle("Dispatching a vCard updated event.");
form.addInstruction("Fill out this form to dispatch a vCard updated event."); form.addInstruction("Fill out this form to dispatch a vCard updated event.");
...@@ -105,15 +110,18 @@ public class VCardModified extends AdHocCommand { ...@@ -105,15 +110,18 @@ public class VCardModified extends AdHocCommand {
command.add(form.getElement()); command.add(form.getElement());
} }
protected List<Action> getActions(SessionData data) { @Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete); return Arrays.asList(Action.complete);
} }
protected Action getExecuteAction(SessionData data) { @Override
protected Action getExecuteAction(SessionData data) {
return Action.complete; return Action.complete;
} }
public boolean hasPermission(JID requester) { @Override
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester); return super.hasPermission(requester) || InternalComponentManager.getInstance().hasComponent(requester);
} }
} }
\ No newline at end of file
...@@ -97,12 +97,14 @@ public class InternalComponentManager extends BasicModule implements ComponentMa ...@@ -97,12 +97,14 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
return instance; return instance;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
} }
public void start() { @Override
public void start() {
// Set this ComponentManager as the current component manager // Set this ComponentManager as the current component manager
ComponentManagerFactory.setComponentManager(instance); ComponentManagerFactory.setComponentManager(instance);
...@@ -116,7 +118,8 @@ public class InternalComponentManager extends BasicModule implements ComponentMa ...@@ -116,7 +118,8 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
} }
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
if (getAddress() != null) { if (getAddress() != null) {
// Remove the route to this service // Remove the route to this service
......
...@@ -41,11 +41,13 @@ import java.io.OutputStream; ...@@ -41,11 +41,13 @@ import java.io.OutputStream;
*/ */
public class PluginIconServlet extends HttpServlet { public class PluginIconServlet extends HttpServlet {
public void init(ServletConfig config) throws ServletException { @Override
public void init(ServletConfig config) throws ServletException {
super.init(config); super.init(config);
} }
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { @Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException {
String pluginName = ParamUtils.getParameter(request, "plugin"); String pluginName = ParamUtils.getParameter(request, "plugin");
PluginManager pluginManager = XMPPServer.getInstance().getPluginManager(); PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
Plugin plugin = pluginManager.getPlugin(pluginName); Plugin plugin = pluginManager.getPlugin(pluginName);
......
...@@ -82,12 +82,14 @@ public class PluginServlet extends HttpServlet { ...@@ -82,12 +82,14 @@ public class PluginServlet extends HttpServlet {
servlets = new ConcurrentHashMap<String, GenericServlet>(); servlets = new ConcurrentHashMap<String, GenericServlet>();
} }
public void init(ServletConfig config) throws ServletException { @Override
public void init(ServletConfig config) throws ServletException {
super.init(config); super.init(config);
servletConfig = config; servletConfig = config;
} }
public void service(HttpServletRequest request, HttpServletResponse response) @Override
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { throws ServletException, IOException {
String pathInfo = request.getPathInfo(); String pathInfo = request.getPathInfo();
if (pathInfo == null) { if (pathInfo == null) {
......
...@@ -96,11 +96,13 @@ public class IQDiscoInfoHandler extends IQHandler implements ClusterEventListene ...@@ -96,11 +96,13 @@ public class IQDiscoInfoHandler extends IQHandler implements ClusterEventListene
userFeatures.add(NAMESPACE_DISCO_INFO); userFeatures.add(NAMESPACE_DISCO_INFO);
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
public IQ handleIQ(IQ packet) { @Override
public IQ handleIQ(IQ packet) {
// Create a copy of the sent pack that will be used as the reply // Create a copy of the sent pack that will be used as the reply
// we only need to add the requested info to the reply if any otherwise add // we only need to add the requested info to the reply if any otherwise add
// a not found error // a not found error
...@@ -312,7 +314,8 @@ public class IQDiscoInfoHandler extends IQHandler implements ClusterEventListene ...@@ -312,7 +314,8 @@ public class IQDiscoInfoHandler extends IQHandler implements ClusterEventListene
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverFeatures = CacheFactory.createCache("Disco Server Features"); serverFeatures = CacheFactory.createCache("Disco Server Features");
addServerFeature(NAMESPACE_DISCO_INFO); addServerFeature(NAMESPACE_DISCO_INFO);
......
...@@ -91,11 +91,13 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv ...@@ -91,11 +91,13 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
info = new IQHandlerInfo("query", NAMESPACE_DISCO_ITEMS); info = new IQHandlerInfo("query", NAMESPACE_DISCO_ITEMS);
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
public IQ handleIQ(IQ packet) { @Override
public IQ handleIQ(IQ packet) {
// Create a copy of the sent pack that will be used as the reply // Create a copy of the sent pack that will be used as the reply
// we only need to add the requested items to the reply if any otherwise add // we only need to add the requested items to the reply if any otherwise add
// a not found error // a not found error
...@@ -389,7 +391,8 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv ...@@ -389,7 +391,8 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
localServerItems.remove(jid); localServerItems.remove(jid);
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverItems = CacheFactory.createCache("Disco Server Items"); serverItems = CacheFactory.createCache("Disco Server Items");
// Track the implementors of ServerItemsProvider so that we can collect the items // Track the implementors of ServerItemsProvider so that we can collect the items
...@@ -400,7 +403,8 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv ...@@ -400,7 +403,8 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
ClusterManager.addListener(this); ClusterManager.addListener(this);
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
for (ServerItemsProvider provider : XMPPServer.getInstance().getServerItemsProviders()) { for (ServerItemsProvider provider : XMPPServer.getInstance().getServerItemsProviders()) {
addServerItemsProvider(provider); addServerItemsProvider(provider);
......
...@@ -57,21 +57,24 @@ public class FileTransferRejectedException extends Exception { ...@@ -57,21 +57,24 @@ public class FileTransferRejectedException extends Exception {
this.nestedThrowable = nestedThrowable; this.nestedThrowable = nestedThrowable;
} }
public void printStackTrace() { @Override
public void printStackTrace() {
super.printStackTrace(); super.printStackTrace();
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(); nestedThrowable.printStackTrace();
} }
} }
public void printStackTrace(PrintStream ps) { @Override
public void printStackTrace(PrintStream ps) {
super.printStackTrace(ps); super.printStackTrace(ps);
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(ps); nestedThrowable.printStackTrace(ps);
} }
} }
public void printStackTrace(PrintWriter pw) { @Override
public void printStackTrace(PrintWriter pw) {
super.printStackTrace(pw); super.printStackTrace(pw);
if (nestedThrowable != null) { if (nestedThrowable != null) {
nestedThrowable.printStackTrace(pw); nestedThrowable.printStackTrace(pw);
......
...@@ -169,7 +169,8 @@ public class FileTransferProxy extends BasicModule ...@@ -169,7 +169,8 @@ public class FileTransferProxy extends BasicModule
return info; return info;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
proxyServiceName = JiveGlobals.getProperty("xmpp.proxy.service", "proxy"); proxyServiceName = JiveGlobals.getProperty("xmpp.proxy.service", "proxy");
...@@ -206,7 +207,8 @@ public class FileTransferProxy extends BasicModule ...@@ -206,7 +207,8 @@ public class FileTransferProxy extends BasicModule
return server.getFileTransferManager(); return server.getFileTransferManager();
} }
public void start() { @Override
public void start() {
super.start(); super.start();
if (isEnabled()) { if (isEnabled()) {
...@@ -225,7 +227,8 @@ public class FileTransferProxy extends BasicModule ...@@ -225,7 +227,8 @@ public class FileTransferProxy extends BasicModule
server.getIQDiscoItemsHandler().addServerItemsProvider(this); server.getIQDiscoItemsHandler().addServerItemsProvider(this);
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
XMPPServer.getInstance().getIQDiscoItemsHandler() XMPPServer.getInstance().getIQDiscoItemsHandler()
...@@ -234,7 +237,8 @@ public class FileTransferProxy extends BasicModule ...@@ -234,7 +237,8 @@ public class FileTransferProxy extends BasicModule
connectionManager.disable(); connectionManager.disable();
} }
public void destroy() { @Override
public void destroy() {
super.destroy(); super.destroy();
connectionManager.shutdown(); connectionManager.shutdown();
......
...@@ -34,7 +34,8 @@ public class ProxyOutputStream extends DataOutputStream { ...@@ -34,7 +34,8 @@ public class ProxyOutputStream extends DataOutputStream {
super(out); super(out);
} }
public synchronized void write(byte b[], int off, int len) throws IOException { @Override
public synchronized void write(byte b[], int off, int len) throws IOException {
super.write(b, off, len); super.write(b, off, len);
amountTransfered.addAndGet(len); amountTransfered.addAndGet(len);
} }
......
...@@ -217,7 +217,8 @@ public class XFormFieldImpl implements FormField { ...@@ -217,7 +217,8 @@ public class XFormFieldImpl implements FormField {
} }
} }
public String toString() { @Override
public String toString() {
return "XFormFieldImpl " + Integer.toHexString(hashCode()) + " " + getVariable() + ">" + values return "XFormFieldImpl " + Integer.toHexString(hashCode()) + " " + getVariable() + ">" + values
+ " o: " + (options.isEmpty() ? "no options" : options.toString()); + " o: " + (options.isEmpty() ? "no options" : options.toString());
} }
......
...@@ -275,7 +275,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -275,7 +275,8 @@ public class Group implements Cacheable, Externalizable {
} }
} }
public String toString() { @Override
public String toString() {
return name; return name;
} }
...@@ -365,11 +366,13 @@ public class Group implements Cacheable, Externalizable { ...@@ -365,11 +366,13 @@ public class Group implements Cacheable, Externalizable {
return size; return size;
} }
public int hashCode() { @Override
public int hashCode() {
return name.hashCode(); return name.hashCode();
} }
public boolean equals(Object object) { @Override
public boolean equals(Object object) {
if (this == object) { if (this == object) {
return true; return true;
} }
...@@ -394,7 +397,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -394,7 +397,8 @@ public class Group implements Cacheable, Externalizable {
this.adminCollection = adminCollection; this.adminCollection = adminCollection;
} }
public Iterator<JID> iterator() { @Override
public Iterator<JID> iterator() {
return new Iterator<JID>() { return new Iterator<JID>() {
Iterator<JID> iter = users.iterator(); Iterator<JID> iter = users.iterator();
...@@ -439,11 +443,13 @@ public class Group implements Cacheable, Externalizable { ...@@ -439,11 +443,13 @@ public class Group implements Cacheable, Externalizable {
}; };
} }
public int size() { @Override
public int size() {
return users.size(); return users.size();
} }
public boolean add(Object member) { @Override
public boolean add(Object member) {
// Do nothing if the provider is read-only. // Do nothing if the provider is read-only.
if (provider.isReadOnly()) { if (provider.isReadOnly()) {
return false; return false;
...@@ -513,7 +519,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -513,7 +519,8 @@ public class Group implements Cacheable, Externalizable {
*/ */
private class PropertiesMap extends AbstractMap { private class PropertiesMap extends AbstractMap {
public Object put(Object key, Object value) { @Override
public Object put(Object key, Object value) {
if (key == null || value == null) { if (key == null || value == null) {
throw new NullPointerException(); throw new NullPointerException();
} }
...@@ -549,7 +556,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -549,7 +556,8 @@ public class Group implements Cacheable, Externalizable {
return answer; return answer;
} }
public Set<Entry> entrySet() { @Override
public Set<Entry> entrySet() {
return new PropertiesEntrySet(); return new PropertiesEntrySet();
} }
} }
...@@ -559,11 +567,13 @@ public class Group implements Cacheable, Externalizable { ...@@ -559,11 +567,13 @@ public class Group implements Cacheable, Externalizable {
*/ */
private class PropertiesEntrySet extends AbstractSet { private class PropertiesEntrySet extends AbstractSet {
public int size() { @Override
public int size() {
return properties.entrySet().size(); return properties.entrySet().size();
} }
public Iterator iterator() { @Override
public Iterator iterator() {
return new Iterator() { return new Iterator() {
Iterator iter = properties.entrySet().iterator(); Iterator iter = properties.entrySet().iterator();
......
...@@ -49,11 +49,13 @@ public class GroupCollection extends AbstractCollection { ...@@ -49,11 +49,13 @@ public class GroupCollection extends AbstractCollection {
this.elements = elements; this.elements = elements;
} }
public Iterator iterator() { @Override
public Iterator iterator() {
return new UserIterator(); return new UserIterator();
} }
public int size() { @Override
public int size() {
return elements.length; return elements.length;
} }
......
...@@ -107,7 +107,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -107,7 +107,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
anonymousAllowed = JiveGlobals.getBooleanProperty("xmpp.auth.anonymous"); anonymousAllowed = JiveGlobals.getBooleanProperty("xmpp.auth.anonymous");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
JID from = packet.getFrom(); JID from = packet.getFrom();
LocalClientSession session = (LocalClientSession) sessionManager.getSession(from); LocalClientSession session = (LocalClientSession) sessionManager.getSession(from);
// If no session was found then answer an error (if possible) // If no session was found then answer an error (if possible)
...@@ -388,7 +389,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -388,7 +389,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
JiveGlobals.setProperty("xmpp.auth.anonymous", Boolean.toString(anonymousAllowed)); JiveGlobals.setProperty("xmpp.auth.anonymous", Boolean.toString(anonymousAllowed));
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
userManager = server.getUserManager(); userManager = server.getUserManager();
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
...@@ -396,7 +398,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -396,7 +398,8 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
} }
...@@ -64,7 +64,8 @@ public class IQBindHandler extends IQHandler { ...@@ -64,7 +64,8 @@ public class IQBindHandler extends IQHandler {
info = new IQHandlerInfo("bind", "urn:ietf:params:xml:ns:xmpp-bind"); info = new IQHandlerInfo("bind", "urn:ietf:params:xml:ns:xmpp-bind");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
LocalClientSession session = (LocalClientSession) sessionManager.getSession(packet.getFrom()); LocalClientSession session = (LocalClientSession) sessionManager.getSession(packet.getFrom());
// If no session was found then answer an error (if possible) // If no session was found then answer an error (if possible)
if (session == null) { if (session == null) {
...@@ -161,13 +162,15 @@ public class IQBindHandler extends IQHandler { ...@@ -161,13 +162,15 @@ public class IQBindHandler extends IQHandler {
return null; return null;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
} }
...@@ -114,7 +114,8 @@ public abstract class IQHandler extends BasicModule implements ChannelHandler { ...@@ -114,7 +114,8 @@ public abstract class IQHandler extends BasicModule implements ChannelHandler {
*/ */
public abstract IQHandlerInfo getInfo(); public abstract IQHandlerInfo getInfo();
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
deliverer = server.getPacketDeliverer(); deliverer = server.getPacketDeliverer();
sessionManager = server.getSessionManager(); sessionManager = server.getSessionManager();
......
...@@ -52,7 +52,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr ...@@ -52,7 +52,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr
info = new IQHandlerInfo("query", "jabber:iq:last"); info = new IQHandlerInfo("query", "jabber:iq:last");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
IQ reply = IQ.createResultIQ(packet); IQ reply = IQ.createResultIQ(packet);
Element lastActivity = reply.setChildElement("query", "jabber:iq:last"); Element lastActivity = reply.setChildElement("query", "jabber:iq:last");
String sender = packet.getFrom().getNode(); String sender = packet.getFrom().getNode();
...@@ -99,7 +100,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr ...@@ -99,7 +100,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr
return reply; return reply;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
...@@ -109,7 +111,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr ...@@ -109,7 +111,8 @@ public class IQLastActivityHandler extends IQHandler implements ServerFeaturesPr
return features.iterator(); return features.iterator();
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
presenceManager = server.getPresenceManager(); presenceManager = server.getPresenceManager();
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
......
...@@ -83,7 +83,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature ...@@ -83,7 +83,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
IQ reply = IQ.createResultIQ(packet); IQ reply = IQ.createResultIQ(packet);
Element offlineRequest = packet.getChildElement(); Element offlineRequest = packet.getChildElement();
...@@ -137,7 +138,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature ...@@ -137,7 +138,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature
routingTable.routePacket(receipient, offlineMessage, true); routingTable.routePacket(receipient, offlineMessage, true);
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
...@@ -195,7 +197,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature ...@@ -195,7 +197,8 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature
return answer.iterator(); return answer.iterator();
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
infoHandler = server.getIQDiscoInfoHandler(); infoHandler = server.getIQDiscoInfoHandler();
itemsHandler = server.getIQDiscoItemsHandler(); itemsHandler = server.getIQDiscoItemsHandler();
...@@ -204,13 +207,15 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature ...@@ -204,13 +207,15 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
} }
public void start() throws IllegalStateException { @Override
public void start() throws IllegalStateException {
super.start(); super.start();
infoHandler.setServerNodeInfoProvider(NAMESPACE, this); infoHandler.setServerNodeInfoProvider(NAMESPACE, this);
itemsHandler.setServerNodeInfoProvider(NAMESPACE, this); itemsHandler.setServerNodeInfoProvider(NAMESPACE, this);
} }
public void stop() { @Override
public void stop() {
super.stop(); super.stop();
infoHandler.removeServerNodeInfoProvider(NAMESPACE); infoHandler.removeServerNodeInfoProvider(NAMESPACE);
itemsHandler.removeServerNodeInfoProvider(NAMESPACE); itemsHandler.removeServerNodeInfoProvider(NAMESPACE);
......
...@@ -58,7 +58,8 @@ public class IQPrivacyHandler extends IQHandler ...@@ -58,7 +58,8 @@ public class IQPrivacyHandler extends IQHandler
info = new IQHandlerInfo("query", "jabber:iq:privacy"); info = new IQHandlerInfo("query", "jabber:iq:privacy");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
IQ.Type type = packet.getType(); IQ.Type type = packet.getType();
JID from = packet.getFrom(); JID from = packet.getFrom();
if (from.getNode() == null || !UserManager.getInstance().isRegisteredUser(from.getNode())) { if (from.getNode() == null || !UserManager.getInstance().isRegisteredUser(from.getNode())) {
...@@ -409,7 +410,8 @@ public class IQPrivacyHandler extends IQHandler ...@@ -409,7 +410,8 @@ public class IQPrivacyHandler extends IQHandler
return result; return result;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
...@@ -432,7 +434,8 @@ public class IQPrivacyHandler extends IQHandler ...@@ -432,7 +434,8 @@ public class IQPrivacyHandler extends IQHandler
//Do nothing //Do nothing
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
} }
} }
...@@ -69,7 +69,8 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide ...@@ -69,7 +69,8 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide
info = new IQHandlerInfo("query", "jabber:iq:private"); info = new IQHandlerInfo("query", "jabber:iq:private");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
IQ replyPacket; IQ replyPacket;
Element child = packet.getChildElement(); Element child = packet.getChildElement();
Element dataElement = (Element) child.elementIterator().next(); Element dataElement = (Element) child.elementIterator().next();
...@@ -97,12 +98,14 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide ...@@ -97,12 +98,14 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide
return replyPacket; return replyPacket;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
privateStorage = server.getPrivateStorage(); privateStorage = server.getPrivateStorage();
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
......
...@@ -99,7 +99,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -99,7 +99,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
info = new IQHandlerInfo("query", "jabber:iq:register"); info = new IQHandlerInfo("query", "jabber:iq:register");
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
userManager = server.getUserManager(); userManager = server.getUserManager();
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
...@@ -162,7 +163,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -162,7 +163,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
canChangePassword = JiveGlobals.getBooleanProperty("register.password", true); canChangePassword = JiveGlobals.getBooleanProperty("register.password", true);
} }
public IQ handleIQ(IQ packet) throws PacketException, UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws PacketException, UnauthorizedException {
ClientSession session = sessionManager.getSession(packet.getFrom()); ClientSession session = sessionManager.getSession(packet.getFrom());
IQ reply = null; IQ reply = null;
// If no session was found then answer an error (if possible) // If no session was found then answer an error (if possible)
...@@ -461,7 +463,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -461,7 +463,8 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
JiveGlobals.setProperty("register.password", canChangePassword ? "true" : "false"); JiveGlobals.setProperty("register.password", canChangePassword ? "true" : "false");
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
......
...@@ -108,7 +108,8 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider ...@@ -108,7 +108,8 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
* @param packet The update packet * @param packet The update packet
* @return The reply or null if no reply * @return The reply or null if no reply
*/ */
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
try { try {
IQ returnPacket = null; IQ returnPacket = null;
org.xmpp.packet.Roster roster = (org.xmpp.packet.Roster)packet; org.xmpp.packet.Roster roster = (org.xmpp.packet.Roster)packet;
...@@ -307,14 +308,16 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider ...@@ -307,14 +308,16 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
return response; return response;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
localServer = server; localServer = server;
userManager = server.getUserManager(); userManager = server.getUserManager();
router = server.getPacketRouter(); router = server.getPacketRouter();
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
......
...@@ -44,14 +44,16 @@ public class IQSessionEstablishmentHandler extends IQHandler { ...@@ -44,14 +44,16 @@ public class IQSessionEstablishmentHandler extends IQHandler {
info = new IQHandlerInfo("session", "urn:ietf:params:xml:ns:xmpp-session"); info = new IQHandlerInfo("session", "urn:ietf:params:xml:ns:xmpp-session");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
// Just answer that the session has been activated // Just answer that the session has been activated
IQ reply = IQ.createResultIQ(packet); IQ reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy()); reply.setChildElement(packet.getChildElement().createCopy());
return reply; return reply;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
} }
...@@ -45,7 +45,8 @@ public class IQSharedGroupHandler extends IQHandler { ...@@ -45,7 +45,8 @@ public class IQSharedGroupHandler extends IQHandler {
info = new IQHandlerInfo("sharedgroup", "http://www.jivesoftware.org/protocol/sharedgroup"); info = new IQHandlerInfo("sharedgroup", "http://www.jivesoftware.org/protocol/sharedgroup");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException {
IQ result = IQ.createResultIQ(packet); IQ result = IQ.createResultIQ(packet);
String username = packet.getFrom().getNode(); String username = packet.getFrom().getNode();
if (!serverName.equals(packet.getFrom().getDomain()) || username == null) { if (!serverName.equals(packet.getFrom().getDomain()) || username == null) {
...@@ -69,11 +70,13 @@ public class IQSharedGroupHandler extends IQHandler { ...@@ -69,11 +70,13 @@ public class IQSharedGroupHandler extends IQHandler {
return result; return result;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
......
...@@ -76,7 +76,8 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider { ...@@ -76,7 +76,8 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider {
responseElement.addElement("display"); responseElement.addElement("display");
} }
public IQ handleIQ(IQ packet) { @Override
public IQ handleIQ(IQ packet) {
IQ response = null; IQ response = null;
response = IQ.createResultIQ(packet); response = IQ.createResultIQ(packet);
response.setChildElement(buildResponse()); response.setChildElement(buildResponse());
...@@ -97,7 +98,8 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider { ...@@ -97,7 +98,8 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider {
return response; return response;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
......
...@@ -57,7 +57,8 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide ...@@ -57,7 +57,8 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide
} }
} }
public IQ handleIQ(IQ packet) throws PacketException { @Override
public IQ handleIQ(IQ packet) throws PacketException {
if (IQ.Type.get == packet.getType()) { if (IQ.Type.get == packet.getType()) {
// Could cache this information for every server we see // Could cache this information for every server we see
Element answerElement = bodyElement.createCopy(); Element answerElement = bodyElement.createCopy();
...@@ -77,7 +78,8 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide ...@@ -77,7 +78,8 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide
return null; return null;
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
......
...@@ -83,7 +83,8 @@ public class IQvCardHandler extends IQHandler { ...@@ -83,7 +83,8 @@ public class IQvCardHandler extends IQHandler {
info = new IQHandlerInfo("vCard", "vcard-temp"); info = new IQHandlerInfo("vCard", "vcard-temp");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
IQ result = IQ.createResultIQ(packet); IQ result = IQ.createResultIQ(packet);
IQ.Type type = packet.getType(); IQ.Type type = packet.getType();
if (type.equals(IQ.Type.set)) { if (type.equals(IQ.Type.set)) {
...@@ -151,13 +152,15 @@ public class IQvCardHandler extends IQHandler { ...@@ -151,13 +152,15 @@ public class IQvCardHandler extends IQHandler {
return result; return result;
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
this.server = server; this.server = server;
userManager = server.getUserManager(); userManager = server.getUserManager();
} }
public IQHandlerInfo getInfo() { @Override
public IQHandlerInfo getInfo() {
return info; return info;
} }
} }
...@@ -487,7 +487,8 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand ...@@ -487,7 +487,8 @@ public class PresenceSubscribeHandler extends BasicModule implements ChannelHand
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
localServer = server; localServer = server;
serverName = server.getServerInfo().getXMPPDomain(); serverName = server.getServerInfo().getXMPPDomain();
......
...@@ -530,7 +530,8 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler ...@@ -530,7 +530,8 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
} }
} }
public void initialize(XMPPServer server) { @Override
public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
localServer = server; localServer = server;
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
......
...@@ -86,7 +86,8 @@ public class HttpSession extends LocalClientSession { ...@@ -86,7 +86,8 @@ public class HttpSession extends LocalClientSession {
} }
// Create xmpp parser to keep in each thread // Create xmpp parser to keep in each thread
localParser = new ThreadLocal<XMPPPacketReader>() { localParser = new ThreadLocal<XMPPPacketReader>() {
protected XMPPPacketReader initialValue() { @Override
protected XMPPPacketReader initialValue() {
XMPPPacketReader parser = new XMPPPacketReader(); XMPPPacketReader parser = new XMPPPacketReader();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
parser.setXPPFactory(factory); parser.setXPPFactory(factory);
...@@ -174,7 +175,8 @@ public class HttpSession extends LocalClientSession { ...@@ -174,7 +175,8 @@ public class HttpSession extends LocalClientSession {
return elements; return elements;
} }
public String getAvailableStreamFeatures() { @Override
public String getAvailableStreamFeatures() {
StringBuilder sb = new StringBuilder(200); StringBuilder sb = new StringBuilder(200);
for (Element element : getAvailableStreamFeaturesElements()) { for (Element element : getAvailableStreamFeaturesElements()) {
sb.append(element.asXML()); sb.append(element.asXML());
...@@ -186,7 +188,8 @@ public class HttpSession extends LocalClientSession { ...@@ -186,7 +188,8 @@ public class HttpSession extends LocalClientSession {
* Closes the session. After a session has been closed it will no longer accept new connections * Closes the session. After a session has been closed it will no longer accept new connections
* on the session ID. * on the session ID.
*/ */
public void close() { @Override
public void close() {
if (isClosed) { if (isClosed) {
return; return;
} }
...@@ -198,7 +201,8 @@ public class HttpSession extends LocalClientSession { ...@@ -198,7 +201,8 @@ public class HttpSession extends LocalClientSession {
* *
* @return true if this session has been closed and no longer activley accepting connections. * @return true if this session has been closed and no longer activley accepting connections.
*/ */
public synchronized boolean isClosed() { @Override
public synchronized boolean isClosed() {
return isClosed; return isClosed;
} }
...@@ -340,7 +344,8 @@ public class HttpSession extends LocalClientSession { ...@@ -340,7 +344,8 @@ public class HttpSession extends LocalClientSession {
* @return true if all connections on this session should be secured, and false if they should * @return true if all connections on this session should be secured, and false if they should
* not. * not.
*/ */
public boolean isSecure() { @Override
public boolean isSecure() {
return isSecure; return isSecure;
} }
...@@ -982,7 +987,8 @@ public class HttpSession extends LocalClientSession { ...@@ -982,7 +987,8 @@ public class HttpSession extends LocalClientSession {
this.address = address; this.address = address;
} }
public void closeVirtualConnection() { @Override
public void closeVirtualConnection() {
((HttpSession) session).closeConnection(); ((HttpSession) session).closeConnection();
} }
...@@ -1010,7 +1016,8 @@ public class HttpSession extends LocalClientSession { ...@@ -1010,7 +1016,8 @@ public class HttpSession extends LocalClientSession {
((HttpSession) session).deliver(text); ((HttpSession) session).deliver(text);
} }
public Certificate[] getPeerCertificates() { @Override
public Certificate[] getPeerCertificates() {
return ((HttpSession) session).getPeerCertificates(); return ((HttpSession) session).getPeerCertificates();
} }
} }
......
...@@ -363,7 +363,8 @@ public class HttpSessionManager { ...@@ -363,7 +363,8 @@ public class HttpSessionManager {
private class HttpSessionReaper extends TimerTask { private class HttpSessionReaper extends TimerTask {
public void run() { @Override
public void run() {
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
for (HttpSession session : sessionMap.values()) { for (HttpSession session : sessionMap.values()) {
long lastActive = currentTime - session.getLastActivity(); long lastActive = currentTime - session.getLastActivity();
......
...@@ -44,14 +44,16 @@ public class ResourceServlet extends HttpServlet { ...@@ -44,14 +44,16 @@ public class ResourceServlet extends HttpServlet {
private boolean disableCompression = false; private boolean disableCompression = false;
private static Cache<String, byte[]> cache = CacheFactory.createCache("Javascript Cache"); private static Cache<String, byte[]> cache = CacheFactory.createCache("Javascript Cache");
public void init(ServletConfig config) throws ServletException { @Override
public void init(ServletConfig config) throws ServletException {
super.init(config); super.init(config);
debug = Boolean.valueOf(config.getInitParameter("debug")); debug = Boolean.valueOf(config.getInitParameter("debug"));
disableCompression = Boolean.valueOf(config.getInitParameter("disableCompression")); disableCompression = Boolean.valueOf(config.getInitParameter("disableCompression"));
} }
public void service(HttpServletRequest request, HttpServletResponse response) { @Override
public void service(HttpServletRequest request, HttpServletResponse response) {
boolean compress = false; boolean compress = false;
boolean javascript = request.getRequestURI().endsWith("scripts/"); boolean javascript = request.getRequestURI().endsWith("scripts/");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment