public class Restriction extends Object implements Serializable
Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, restrictions are based on distributor (uri) and country codes. This element is purely informational and no obligation can be assumed or implied. Only one <media:restriction> element of the same type can be applied to a media object - all others will be ignored. Entities in this element should be space separated. To allow the producer to explicitly declare his/her intentions, two literals are reserved: 'all', 'none'. These literals can only be used once. This element has 1 required attribute, and 1 optional attribute (with strict requirements for its exclusion).
<media:restriction relationship="allow" type="country">au us</media:restriction>
relationship indicates the type of relationship that the restriction represents (allow | deny). In the example above, the media object should only be syndicated in Australia and the United States. It is a required attribute.
Note: If the "allow" element is empty and the type is relationship is "allow", it is assumed that the empty list means "allow nobody" and the media should not be syndicated.
A more explicit method would be:
<media:restriction relationship="allow" type="country">au us</media:restriction>
type specifies the type of restriction (country | uri) that the media can be syndicated. It is an optional attribute; however can only be excluded when using one of the literal values "all" or "none".
"country" allows restrictions to be placed based on country code. [ISO 3166]
"uri" allows restrictions based on URI. Examples: urn:apple, http://images.google.com, urn:yahoo, etc.
Modifier and Type | Class and Description |
---|---|
static class |
Restriction.Relationship
Indicates the action of the relationship
|
static class |
Restriction.Type
Indicated the type of the relationship
|
Constructor and Description |
---|
Restriction(Restriction.Relationship relationship,
Restriction.Type type,
String value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Restriction.Relationship |
getRelationship() |
Restriction.Type |
getType() |
String |
getValue() |
int |
hashCode() |
String |
toString() |
public Restriction(Restriction.Relationship relationship, Restriction.Type type, String value)
relationship
- a Restriction.Relationship objecttype
- A Restriction.Type objectvalue
- a value for the restriction.public Restriction.Relationship getRelationship()
public Restriction.Type getType()
public String getValue()
Copyright © 2019. All rights reserved.