mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Javadoc fixes, builds now go to target directory.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6616 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
2ab0cd9749
commit
5a57e2390a
12 changed files with 119 additions and 94 deletions
|
@ -32,10 +32,10 @@
|
|||
<property name="version.name" value="${version.major}_${version.minor}_${version.revision}" />
|
||||
|
||||
<property file="${basedir}/build/build.properties" />
|
||||
<property name="compile.dir" value="${basedir}/classes" />
|
||||
<property name="compile.test.dir" value="${basedir}/classes-test" />
|
||||
<property name="jar.dest.dir" value="${basedir}" />
|
||||
<property name="javadoc.dest.dir" value="${basedir}/javadoc" />
|
||||
<property name="compile.dir" value="${basedir}/target/classes" />
|
||||
<property name="compile.test.dir" value="${basedir}/target/classes-test" />
|
||||
<property name="jar.dest.dir" value="${basedir}/target" />
|
||||
<property name="javadoc.dest.dir" value="${basedir}/target/javadoc" />
|
||||
<property name="build.lib.dir" value="${basedir}/build/lib" />
|
||||
<property name="merge.lib.dir" value="${basedir}/build/merge" />
|
||||
<property name="test.dir" value="${basedir}/test" />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/../resources" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../source" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../test" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../release" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
<property name="release-dev.name" value="smack-dev-${version.name}" />
|
||||
</else>
|
||||
</if>
|
||||
<property name="release.dir" value="${basedir}/release/${release.name}" />
|
||||
<property name="release-dev.dir" value="${basedir}/release/${release-dev.name}" />
|
||||
<property name="release.dir" value="${basedir}/target/release/${release.name}" />
|
||||
<property name="release-dev.dir" value="${basedir}/target/release/${release-dev.name}" />
|
||||
<!-- create release dirs -->
|
||||
<mkdir dir="${release.dir}" />
|
||||
<mkdir dir="${release-dev.dir}" />
|
||||
|
@ -71,10 +71,10 @@
|
|||
</copy>
|
||||
<!-- Copy Javadocs -->
|
||||
<copy todir="${release.dir}/javadoc">
|
||||
<fileset dir="${basedir}/javadoc" includes="**/*.*" />
|
||||
<fileset dir="${basedir}/target/javadoc" includes="**/*.*" />
|
||||
</copy>
|
||||
<copy todir="${release-dev.dir}/javadoc">
|
||||
<fileset dir="${basedir}/javadoc" includes="**/*.*" />
|
||||
<fileset dir="${basedir}/target/javadoc" includes="**/*.*" />
|
||||
</copy>
|
||||
<!-- Copy documentation -->
|
||||
<copy todir="${release.dir}/documentation">
|
||||
|
|
|
@ -706,7 +706,7 @@ class PacketReader {
|
|||
item.setItemStatus(status);
|
||||
// Set type.
|
||||
String subscription = parser.getAttributeValue("", "subscription");
|
||||
RosterPacket.ItemType type = RosterPacket.ItemType.fromString(subscription);
|
||||
RosterPacket.ItemType type = RosterPacket.ItemType.valueOf(subscription);
|
||||
item.setItemType(type);
|
||||
}
|
||||
if (parser.getName().equals("group") && item!= null) {
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/**
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*
|
||||
* Copyright 2006-2007 Jive Software.
|
||||
*
|
||||
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smack;
|
||||
|
||||
import org.jivesoftware.smack.packet.PrivacyItem;
|
||||
|
@ -8,7 +27,7 @@ import java.util.List;
|
|||
* Interface to implement classes to listen for server events about privacy communication.
|
||||
* Listeners are registered with the {@link PrivacyListManager}.
|
||||
*
|
||||
* @see {@link PrivacyListManager#addListener}
|
||||
* @see PrivacyListManager#addListener
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/**
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*
|
||||
* Copyright 2006-2007 Jive Software.
|
||||
*
|
||||
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smack;
|
||||
|
||||
import org.jivesoftware.smack.filter.*;
|
||||
|
@ -224,6 +243,7 @@ public class PrivacyListManager {
|
|||
* Answer a privacy containing the list structre without {@link PrivacyItem}.
|
||||
*
|
||||
* @return a Privacy with the list names.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
private Privacy getPrivacyWithListNames() throws XMPPException {
|
||||
|
||||
|
@ -237,7 +257,8 @@ public class PrivacyListManager {
|
|||
/**
|
||||
* Answer the active privacy list.
|
||||
*
|
||||
* @return the {@see PrivacyList} of the active list.
|
||||
* @return the privacy list of the active list.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public PrivacyList getActiveList() throws XMPPException {
|
||||
Privacy privacyAnswer = this.getPrivacyWithListNames();
|
||||
|
@ -252,7 +273,8 @@ public class PrivacyListManager {
|
|||
/**
|
||||
* Answer the default privacy list.
|
||||
*
|
||||
* @return the {@see PrivacyList} of the default list.
|
||||
* @return the privacy list of the default list.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public PrivacyList getDefaultList() throws XMPPException {
|
||||
Privacy privacyAnswer = this.getPrivacyWithListNames();
|
||||
|
@ -268,7 +290,8 @@ public class PrivacyListManager {
|
|||
* Answer the privacy list items under listName with the allowed and blocked permissions.
|
||||
*
|
||||
* @param listName the name of the list to get the allowed and blocked permissions.
|
||||
* @return a list of {@link PrivacyItem} under the list listName.
|
||||
* @return a list of privacy items under the list listName.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
private List<PrivacyItem> getPrivacyListItems(String listName) throws XMPPException {
|
||||
|
||||
|
@ -286,7 +309,8 @@ public class PrivacyListManager {
|
|||
* Answer the privacy list items under listName with the allowed and blocked permissions.
|
||||
*
|
||||
* @param listName the name of the list to get the allowed and blocked permissions.
|
||||
* @return a {@link PrivacyList} under the list listName.
|
||||
* @return a privacy list under the list listName.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public PrivacyList getPrivacyList(String listName) throws XMPPException {
|
||||
|
||||
|
@ -296,7 +320,8 @@ public class PrivacyListManager {
|
|||
/**
|
||||
* Answer every privacy list with the allowed and blocked permissions.
|
||||
*
|
||||
* @return a List of {@link PrivacyList}.
|
||||
* @return an array of privacy lists.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public PrivacyList[] getPrivacyLists() throws XMPPException {
|
||||
Privacy privacyAnswer = this.getPrivacyWithListNames();
|
||||
|
@ -334,6 +359,8 @@ public class PrivacyListManager {
|
|||
|
||||
/**
|
||||
* Client declines the use of active lists.
|
||||
*
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public void declineActiveList() throws XMPPException {
|
||||
|
||||
|
@ -363,6 +390,8 @@ public class PrivacyListManager {
|
|||
|
||||
/**
|
||||
* Client declines the use of default lists.
|
||||
*
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public void declineDefaultList() throws XMPPException {
|
||||
|
||||
|
@ -378,7 +407,8 @@ public class PrivacyListManager {
|
|||
* The client has created a new list. It send the new one to the server.
|
||||
*
|
||||
* @param listName the list that has changed its content.
|
||||
* @param privacyItems a List with every {@link PrivacyItem} in the list.
|
||||
* @param privacyItems a List with every privacy item in the list.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public void createPrivacyList(String listName, List<PrivacyItem> privacyItems) throws XMPPException {
|
||||
|
||||
|
@ -387,11 +417,12 @@ public class PrivacyListManager {
|
|||
|
||||
/**
|
||||
* The client has edited an existing list. It updates the server content with the resulting
|
||||
* list of {@link PrivacyItem}. The {@link PrivacyItem} list MUST contain all elements in the
|
||||
* list of privacy items. The {@link PrivacyItem} list MUST contain all elements in the
|
||||
* list (not the "delta").
|
||||
*
|
||||
* @param listName the list that has changed its content.
|
||||
* @param privacyItems a List with every {@link PrivacyItem} in the list.
|
||||
* @param privacyItems a List with every privacy item in the list.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public void updatePrivacyList(String listName, List<PrivacyItem> privacyItems) throws XMPPException {
|
||||
|
||||
|
@ -407,6 +438,7 @@ public class PrivacyListManager {
|
|||
* Remove a privacy list.
|
||||
*
|
||||
* @param listName the list that has changed its content.
|
||||
* @throws XMPPException if an error occurs.
|
||||
*/
|
||||
public void deletePrivacyList(String listName) throws XMPPException {
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ public class Roster implements ConnectionListener {
|
|||
packet.setType(IQ.Type.SET);
|
||||
RosterPacket.Item item = RosterEntry.toRosterItem(entry);
|
||||
// Set the item type as REMOVE so that the server will delete the entry
|
||||
item.setItemType(RosterPacket.ItemType.REMOVE);
|
||||
item.setItemType(RosterPacket.ItemType.remove);
|
||||
packet.addRosterItem(item);
|
||||
PacketCollector collector = connection.createPacketCollector(
|
||||
new PacketIDFilter(packet.getPacketID()));
|
||||
|
@ -669,7 +669,7 @@ public class Roster implements ConnectionListener {
|
|||
item.getItemType(), item.getItemStatus(), connection);
|
||||
|
||||
// If the packet is of the type REMOVE then remove the entry
|
||||
if (RosterPacket.ItemType.REMOVE.equals(item.getItemType())) {
|
||||
if (RosterPacket.ItemType.remove.equals(item.getItemType())) {
|
||||
// Remove the entry from the entry list.
|
||||
if (entries.contains(entry)) {
|
||||
entries.remove(entry);
|
||||
|
@ -721,7 +721,7 @@ public class Roster implements ConnectionListener {
|
|||
}
|
||||
|
||||
// If the packet is not of the type REMOVE then add the entry to the groups
|
||||
if (!RosterPacket.ItemType.REMOVE.equals(item.getItemType())) {
|
||||
if (!RosterPacket.ItemType.remove.equals(item.getItemType())) {
|
||||
// Create the new list of groups the user belongs to.
|
||||
List<String> newGroupNames = new ArrayList<String>();
|
||||
for (String groupName : item.getGroupNames()) {
|
||||
|
|
|
@ -124,7 +124,7 @@ public class RosterEntry {
|
|||
|
||||
/**
|
||||
* Returns the roster subscription type of the entry. When the type is
|
||||
* {@link RosterPacket.ItemType#NONE} or {@link RosterPacket.ItemType#FROM},
|
||||
* {@link RosterPacket.ItemType#none} or {@link RosterPacket.ItemType#from},
|
||||
* refer to {@link RosterEntry getStatus()} to see if a subscription request
|
||||
* is pending.
|
||||
*
|
||||
|
|
|
@ -543,7 +543,7 @@ public class XMPPConnection {
|
|||
* Closes the connection by setting presence to unavailable then closing the stream to
|
||||
* the XMPP server. The shutdown logic will be used during a planned disconnection or when
|
||||
* dealing with an unexpected disconnection. Unlike {@link #disconnect()} the connection's
|
||||
* {@link PacketReader}, {@link PacketWriter} and {@link Roster} will not be removed thus
|
||||
* packet reader, packet writer, and {@link Roster} will not be removed; thus
|
||||
* connection's state is kept.
|
||||
*/
|
||||
protected void shutdown() {
|
||||
|
|
|
@ -1,12 +1,32 @@
|
|||
/**
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*
|
||||
* Copyright 2006-2007 Jive Software.
|
||||
*
|
||||
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smack.packet;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A Privacy IQ Packet, is used by the {@see PrivacyListManager} and {@see PrivacyProvider} to allow
|
||||
* and block communications from other users. It contains the appropriate structure to suit
|
||||
* user-defined privacy lists. Different configured Privacy packages are used in the Server –
|
||||
* Manager communication in order to:
|
||||
* A Privacy IQ Packet, is used by the {@link org.jivesoftware.smack.PrivacyListManager}
|
||||
* and {@link org.jivesoftware.smack.provider.PrivacyProvider} to allow and block
|
||||
* communications from other users. It contains the appropriate structure to suit
|
||||
* user-defined privacy lists. Different configured Privacy packages are used in the
|
||||
* Server – Manager communication in order to:
|
||||
* <ul>
|
||||
* <li>Retrieving one's privacy lists.
|
||||
* <li>Adding, removing, and editing one's privacy lists.
|
||||
|
@ -14,11 +34,10 @@ import java.util.*;
|
|||
* <li>Setting, changing, or declining the default list (i.e., the list that is active by default).
|
||||
* </ul>
|
||||
* Privacy Items can handle different kind of blocking communications based on JID, group,
|
||||
* subscription type or globally {@see PrivacyItem}
|
||||
* subscription type or globally {@link PrivacyItem}
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
|
||||
public class Privacy extends IQ {
|
||||
/** declineActiveList is true when the user declines the use of the active list **/
|
||||
private boolean declineActiveList=false;
|
||||
|
@ -33,7 +52,7 @@ public class Privacy extends IQ {
|
|||
private Map<String, List<PrivacyItem>> itemLists = new HashMap<String, List<PrivacyItem>>();
|
||||
|
||||
/**
|
||||
* Set or update a privacy list with {@link PrivacyItem}.
|
||||
* Set or update a privacy list with privacy items.
|
||||
*
|
||||
* @param listName the name of the new privacy list.
|
||||
* @param listItem the {@link PrivacyItem} that rules the list.
|
||||
|
@ -113,6 +132,7 @@ public class Privacy extends IQ {
|
|||
/**
|
||||
* Returns the privacy item in the specified order.
|
||||
*
|
||||
* @param listName the name of the privacy list.
|
||||
* @param order the order of the element.
|
||||
* @return a List with {@link PrivacyItem}
|
||||
*/
|
||||
|
@ -128,7 +148,6 @@ public class Privacy extends IQ {
|
|||
return itemFound;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets a given privacy list as the new user default list.
|
||||
*
|
||||
|
@ -144,7 +163,6 @@ public class Privacy extends IQ {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove the list.
|
||||
*
|
||||
|
@ -154,10 +172,9 @@ public class Privacy extends IQ {
|
|||
this.getItemLists().remove(listName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name associated with the active list set for the session. Communications
|
||||
* will be verified against the active list.<p>
|
||||
* will be verified against the active list.
|
||||
*
|
||||
* @return the name of the active list.
|
||||
*/
|
||||
|
@ -167,7 +184,7 @@ public class Privacy extends IQ {
|
|||
|
||||
/**
|
||||
* Sets the name associated with the active list set for the session. Communications
|
||||
* will be verified against the active list.<p>
|
||||
* will be verified against the active list.
|
||||
*
|
||||
* @param activeName is the name of the active list.
|
||||
*/
|
||||
|
|
|
@ -265,74 +265,31 @@ public class RosterPacket extends IQ {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The subscription type of a roster item.
|
||||
*/
|
||||
public static class ItemType {
|
||||
public static enum ItemType {
|
||||
|
||||
/**
|
||||
* The user and subscriber have no interest in each other's presence.
|
||||
*/
|
||||
public static final ItemType NONE = new ItemType("none");
|
||||
none,
|
||||
|
||||
/**
|
||||
* The user is interested in receiving presence updates from the subscriber.
|
||||
*/
|
||||
public static final ItemType TO = new ItemType("to");
|
||||
to,
|
||||
|
||||
/**
|
||||
* The subscriber is interested in receiving presence updates from the user.
|
||||
*/
|
||||
public static final ItemType FROM = new ItemType("from");
|
||||
from,
|
||||
|
||||
/**
|
||||
* The user and subscriber have a mutual interest in each other's presence.
|
||||
*/
|
||||
public static final ItemType BOTH = new ItemType("both");
|
||||
both,
|
||||
|
||||
/**
|
||||
* The user wishes to stop receiving presence updates from the subscriber.
|
||||
*/
|
||||
public static final ItemType REMOVE = new ItemType("remove");
|
||||
|
||||
public static ItemType fromString(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
value = value.toLowerCase();
|
||||
if ("none".equals(value)) {
|
||||
return NONE;
|
||||
}
|
||||
else if ("to".equals(value)) {
|
||||
return TO;
|
||||
}
|
||||
else if ("from".equals(value)) {
|
||||
return FROM;
|
||||
}
|
||||
else if ("both".equals(value)) {
|
||||
return BOTH;
|
||||
}
|
||||
else if ("remove".equals(value)) {
|
||||
return REMOVE;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* Returns the item type associated with the specified string.
|
||||
*
|
||||
* @param value the item type.
|
||||
*/
|
||||
public ItemType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
remove
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||
* The PrivacyProvider parses {@link Privacy} packets. {@link Privacy}
|
||||
* Parses the <tt>query</tt> sub-document and creates an instance of {@link Privacy}.
|
||||
* For each <tt>item</tt> in the <tt>list</tt> element, it creates an instance
|
||||
* of {@link PrivacyItem} and {@link PrivacyRule}.
|
||||
* of {@link PrivacyItem} and {@link org.jivesoftware.smack.packet.PrivacyItem.PrivacyRule}.
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue