Class AccessModel
java.lang.Object
org.jivesoftware.openfire.pubsub.models.AccessModel
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthorizeAccess
,OpenAccess
,PresenceAccess
,RosterAccess
,WhitelistAccess
Policy that defines who is allowed to subscribe and retrieve items.
- Author:
- Matt Tucker
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AccessModel
static final AccessModel
static final AccessModel
static final AccessModel
static final AccessModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canAccessItems
(Node node, org.xmpp.packet.JID owner, org.xmpp.packet.JID subscriber) Returns true if the entity is allowed to get the node published items.abstract boolean
canSubscribe
(Node node, org.xmpp.packet.JID owner, org.xmpp.packet.JID subscriber) Returns true if the entity is allowed to subscribe to the specified node.abstract String
getName()
Returns the name as defined by the JEP-60 spec.abstract org.xmpp.packet.PacketError.Condition
Returns the error condition that should be returned to the subscriber when subscription is not allowed.abstract org.dom4j.Element
Returns the error element that should be returned to the subscriber as error detail when subscription is not allowed.abstract boolean
Returns true if the new subscription should be authorized by a node owner.static AccessModel
Returns the specific subclass of AccessModel as specified by the access model name.
-
Field Details
-
whitelist
-
open
-
authorize
-
presence
-
roster
-
-
Constructor Details
-
AccessModel
public AccessModel()
-
-
Method Details
-
valueOf
Returns the specific subclass of AccessModel as specified by the access model name. If an unknown name is specified then an IllegalArgumentException is going to be thrown.- Parameters:
name
- the name of the subclass.- Returns:
- the specific subclass of AccessModel as specified by the access model name.
-
getName
Returns the name as defined by the JEP-60 spec.- Returns:
- the name as defined by the JEP-60 spec.
-
canSubscribe
public abstract boolean canSubscribe(Node node, org.xmpp.packet.JID owner, org.xmpp.packet.JID subscriber) Returns true if the entity is allowed to subscribe to the specified node.- Parameters:
node
- the node that the subscriber is trying to subscribe to.owner
- the JID of the owner of the subscription.subscriber
- the JID of the subscriber.- Returns:
- true if the subscriber is allowed to subscribe to the specified node.
-
canAccessItems
public abstract boolean canAccessItems(Node node, org.xmpp.packet.JID owner, org.xmpp.packet.JID subscriber) Returns true if the entity is allowed to get the node published items.- Parameters:
node
- the node that the entity is trying to get the node's items.owner
- the JID of the owner of the subscription.subscriber
- the JID of the subscriber.- Returns:
- true if the subscriber is allowed to get the node's published items.
-
getSubsriptionError
public abstract org.xmpp.packet.PacketError.Condition getSubsriptionError()Returns the error condition that should be returned to the subscriber when subscription is not allowed.- Returns:
- the error condition that should be returned to the subscriber when subscription is not allowed.
-
getSubsriptionErrorDetail
public abstract org.dom4j.Element getSubsriptionErrorDetail()Returns the error element that should be returned to the subscriber as error detail when subscription is not allowed. The returned element is created each time this message is sent so it is safe to include the returned element in the parent element.- Returns:
- the error element that should be returned to the subscriber as error detail when subscription is not allowed.
-
isAuthorizationRequired
public abstract boolean isAuthorizationRequired()Returns true if the new subscription should be authorized by a node owner.- Returns:
- true if the new subscription should be authorized by a node owner.
-