mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-15 20:12:04 +01:00
SMACK-459 Add option to configure the default identity in ServiceDiscoveryManager
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13790 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
c4014b8ba9
commit
addf9ea6cd
1 changed files with 13 additions and 1 deletions
|
@ -53,9 +53,11 @@ public class ServiceDiscoveryManager {
|
||||||
private static final String DEFAULT_IDENTITY_NAME = "Smack";
|
private static final String DEFAULT_IDENTITY_NAME = "Smack";
|
||||||
private static final String DEFAULT_IDENTITY_CATEGORY = "client";
|
private static final String DEFAULT_IDENTITY_CATEGORY = "client";
|
||||||
private static final String DEFAULT_IDENTITY_TYPE = "pc";
|
private static final String DEFAULT_IDENTITY_TYPE = "pc";
|
||||||
|
private static DiscoverInfo.Identity defaultIdentity = new Identity(DEFAULT_IDENTITY_CATEGORY,
|
||||||
|
DEFAULT_IDENTITY_NAME, DEFAULT_IDENTITY_TYPE);
|
||||||
|
|
||||||
private Set<DiscoverInfo.Identity> identities = new HashSet<DiscoverInfo.Identity>();
|
private Set<DiscoverInfo.Identity> identities = new HashSet<DiscoverInfo.Identity>();
|
||||||
private DiscoverInfo.Identity identity = new Identity(DEFAULT_IDENTITY_CATEGORY, DEFAULT_IDENTITY_NAME, DEFAULT_IDENTITY_TYPE);
|
private DiscoverInfo.Identity identity = defaultIdentity;
|
||||||
|
|
||||||
private EntityCapsManager capsManager;
|
private EntityCapsManager capsManager;
|
||||||
|
|
||||||
|
@ -77,6 +79,16 @@ public class ServiceDiscoveryManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the default identity all new connections will have. If unchanged the default identity is an
|
||||||
|
* identity where category is set to 'client', type is set to 'pc' and name is set to 'Smack'.
|
||||||
|
*
|
||||||
|
* @param identity
|
||||||
|
*/
|
||||||
|
public static void setDefaultIdentity(DiscoverInfo.Identity identity) {
|
||||||
|
defaultIdentity = identity;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ServiceDiscoveryManager for a given Connection. This means that the
|
* Creates a new ServiceDiscoveryManager for a given Connection. This means that the
|
||||||
* service manager will respond to any service discovery request that the connection may
|
* service manager will respond to any service discovery request that the connection may
|
||||||
|
|
Loading…
Reference in a new issue