Skip to content

Commit 9b9cb2a

Browse files
author
Mariano Converti
committed
# fixed checkstyle issues
1 parent 63fc31d commit 9b9cb2a

File tree

11 files changed

+254
-156
lines changed

11 files changed

+254
-156
lines changed

services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/implementation/templates/tokenrestriction/TokenRestrictionTemplate.java

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,49 @@
1010
import javax.xml.bind.annotation.XmlElementWrapper;
1111
import javax.xml.bind.annotation.XmlRootElement;
1212

13-
1413
@XmlRootElement(name = "TokenRestrictionTemplate")
1514
@XmlAccessorType(XmlAccessType.FIELD)
1615
public class TokenRestrictionTemplate {
17-
16+
1817
@XmlElementWrapper(name = "AlternateVerificationKeys")
1918
@XmlElement(name = "TokenVerificationKey")
2019
private List<TokenVerificationKey> alternateVerificationKeys;
21-
20+
2221
@XmlElement(name = "Audience", required = true)
2322
private URI audience;
24-
23+
2524
@XmlElement(name = "Issuer", required = true)
2625
private URI issuer;
27-
26+
2827
@XmlElement(name = "PrimaryVerificationKey", nillable = true)
2928
private TokenVerificationKey primaryVerificationKey;
30-
29+
3130
@XmlElementWrapper(name = "RequiredClaims")
3231
@XmlElement(name = "TokenClaim")
3332
private List<TokenClaim> requiredClaims;
34-
33+
3534
@XmlElement(name = "TokenType")
3635
private TokenType tokenType;
3736

3837
@XmlElement(name = "OpenIdConnectDiscoveryDocument")
3938
private OpenIdConnectDiscoveryDocument openIdConnectDiscoveryDocument;
40-
39+
4140
@SuppressWarnings("unused")
4241
private TokenRestrictionTemplate() {
4342
this.setTokenType(TokenType.SWT);
4443
initCollections();
4544
}
46-
45+
4746
public TokenRestrictionTemplate(TokenType tokenType) {
4847
this.setTokenType(tokenType);
4948
initCollections();
5049
}
51-
50+
5251
private void initCollections() {
5352
setRequiredClaims(new ArrayList<TokenClaim>());
5453
setAlternateVerificationKeys(new ArrayList<TokenVerificationKey>());
5554
}
56-
55+
5756
/**
5857
* @return the audience
5958
*/
@@ -62,7 +61,8 @@ public URI getAudience() {
6261
}
6362

6463
/**
65-
* @param audience the audience to set
64+
* @param audience
65+
* the audience to set
6666
* @return this
6767
*/
6868
public TokenRestrictionTemplate setAudience(URI audience) {
@@ -78,7 +78,8 @@ public URI getIssuer() {
7878
}
7979

8080
/**
81-
* @param issuer the issuer to set
81+
* @param issuer
82+
* the issuer to set
8283
* @return this
8384
*/
8485
public TokenRestrictionTemplate setIssuer(URI issuer) {
@@ -94,7 +95,8 @@ public TokenType getTokenType() {
9495
}
9596

9697
/**
97-
* @param tokenType the tokenType to set
98+
* @param tokenType
99+
* the tokenType to set
98100
* @return this
99101
*/
100102
public TokenRestrictionTemplate setTokenType(TokenType tokenType) {
@@ -110,7 +112,8 @@ public TokenVerificationKey getPrimaryVerificationKey() {
110112
}
111113

112114
/**
113-
* @param primaryVerificationKey the primaryVerificationKey to set
115+
* @param primaryVerificationKey
116+
* the primaryVerificationKey to set
114117
* @return this
115118
*/
116119
public TokenRestrictionTemplate setPrimaryVerificationKey(TokenVerificationKey primaryVerificationKey) {
@@ -126,7 +129,8 @@ public List<TokenClaim> getRequiredClaims() {
126129
}
127130

128131
/**
129-
* @param requiredClaims the requiredClaims to set
132+
* @param requiredClaims
133+
* the requiredClaims to set
130134
* @return this
131135
*/
132136
public TokenRestrictionTemplate setRequiredClaims(List<TokenClaim> requiredClaims) {
@@ -142,14 +146,15 @@ public List<TokenVerificationKey> getAlternateVerificationKeys() {
142146
}
143147

144148
/**
145-
* @param alternateVerificationKeys the alternateVerificationKeys to set
149+
* @param alternateVerificationKeys
150+
* the alternateVerificationKeys to set
146151
* @return this
147152
*/
148153
public TokenRestrictionTemplate setAlternateVerificationKeys(List<TokenVerificationKey> alternateVerificationKeys) {
149154
this.alternateVerificationKeys = alternateVerificationKeys;
150155
return this;
151156
}
152-
157+
153158
/**
154159
* @return the alternateVerificationKeys
155160
*/
@@ -158,12 +163,14 @@ public OpenIdConnectDiscoveryDocument getOpenIdConnectDiscoveryDocument() {
158163
}
159164

160165
/**
161-
* @param alternateVerificationKeys the alternateVerificationKeys to set
166+
* @param alternateVerificationKeys
167+
* the alternateVerificationKeys to set
162168
* @return this
163169
*/
164-
public TokenRestrictionTemplate setOpenIdConnectDiscoveryDocument(OpenIdConnectDiscoveryDocument openIdConnectDiscoveryDocument) {
170+
public TokenRestrictionTemplate setOpenIdConnectDiscoveryDocument(
171+
OpenIdConnectDiscoveryDocument openIdConnectDiscoveryDocument) {
165172
this.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument;
166173
return this;
167174
}
168-
175+
169176
}

services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/implementation/templates/tokenrestriction/TokenRestrictionTemplateSerializer.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@ private TokenRestrictionTemplateSerializer() {
3939
}
4040

4141
public static String serialize(TokenRestrictionTemplate template) throws JAXBException {
42-
43-
validateTokenRestrictionTemplate(template);
44-
42+
43+
validateTokenRestrictionTemplate(template);
44+
4545
StringWriter writer = new StringWriter();
4646
JAXBContext context = JAXBContext.newInstance(TokenRestrictionTemplate.class);
4747
Marshaller m = context.createMarshaller();
4848
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
4949
m.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapper() {
5050
@Override
5151
public String[] getPreDeclaredNamespaceUris() {
52-
return new String[] { XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI };
52+
return new String[] {
53+
XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI
54+
};
5355
}
5456

5557
@Override
@@ -65,7 +67,7 @@ public String getPreferredPrefix(String namespaceUri, String suggestion, boolean
6567
}
6668

6769
private static void validateTokenRestrictionTemplate(TokenRestrictionTemplate template) {
68-
if (template.getPrimaryVerificationKey() == null && template.getOpenIdConnectDiscoveryDocument() == null) {
70+
if (template.getPrimaryVerificationKey() == null && template.getOpenIdConnectDiscoveryDocument() == null) {
6971
throw new IllegalArgumentException(
7072
ErrorMessages.PRIMARY_VERIFICATIONKEY_AND_OPENIDCONNECTDISCOVERYDOCUMENT_ARE_NULL);
7173
}
@@ -86,10 +88,10 @@ private static void validateTokenRestrictionTemplate(TokenRestrictionTemplate te
8688
if (!openIdDiscoveryUrlValid) {
8789
throw new IllegalArgumentException(ErrorMessages.OPENIDDISCOVERYURI_STRING_IS_NOT_ABSOLUTE_URI);
8890
}
89-
}
90-
}
91+
}
92+
}
9193

92-
public static TokenRestrictionTemplate deserialize(String xml) throws JAXBException {
94+
public static TokenRestrictionTemplate deserialize(String xml) throws JAXBException {
9395
try {
9496
return deserialize(xml, null);
9597
} catch (SAXException e) {
@@ -108,7 +110,7 @@ public static TokenRestrictionTemplate deserialize(String xml, String validation
108110
u.setSchema(schema);
109111
}
110112
TokenRestrictionTemplate template = (TokenRestrictionTemplate) u.unmarshal(new StringReader(xml));
111-
validateTokenRestrictionTemplate(template);
113+
validateTokenRestrictionTemplate(template);
112114
return template;
113115
}
114116

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.microsoft.windowsazure.services.media.implementation.templates.widevine;
22

33
public enum AllowedTrackTypes {
4-
SD_ONLY,
5-
SD_HD
4+
SD_ONLY, SD_HD
65
}
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,76 @@
11
package com.microsoft.windowsazure.services.media.implementation.templates.widevine;
22

3-
import com.fasterxml.jackson.annotation.JsonInclude;
43
import com.fasterxml.jackson.annotation.JsonProperty;
54

6-
public class ContentKeySpecs {
7-
/**
8-
* A track type name.
9-
*/
10-
@JsonProperty
11-
public String track_type;
12-
13-
/**
14-
* Unique identifier for the key.
15-
*/
16-
@JsonProperty
17-
public String key_id;
18-
19-
/**
20-
* Defines client robustness requirements for playback.
21-
* 1 - Software-based whitebox crypto is required.
22-
* 2 - Software crypto and an obfuscated decoder is required.
23-
* 3 - The key material and crypto operations must be performed
24-
* within a hardware backed trusted execution environment.
25-
* 4 - The crypto and decoding of content must be performed within
26-
* a hardware backed trusted execution environment.
27-
* 5 - The crypto, decoding and all handling of the media (compressed
28-
* and uncompressed) must be handled within a hardware backed trusted
29-
* execution environment.
30-
*/
31-
@JsonProperty
32-
public Integer security_level;
33-
34-
/**
35-
* Indicates whether HDCP V1 or V2 is required or not.
36-
*/
37-
@JsonProperty
38-
public RequiredOutputProtection required_output_protection;
5+
public class ContentKeySpecs {
6+
/**
7+
* A track type name.
8+
*/
9+
@JsonProperty("track_type")
10+
private String trackType;
11+
12+
/**
13+
* Unique identifier for the key.
14+
*/
15+
@JsonProperty("key_id")
16+
private String keyId;
17+
18+
/**
19+
* Defines client robustness requirements for playback. 1 - Software-based
20+
* whitebox crypto is required. 2 - Software crypto and an obfuscated
21+
* decoder is required. 3 - The key material and crypto operations must be
22+
* performed within a hardware backed trusted execution environment. 4 - The
23+
* crypto and decoding of content must be performed within a hardware backed
24+
* trusted execution environment. 5 - The crypto, decoding and all handling
25+
* of the media (compressed and uncompressed) must be handled within a
26+
* hardware backed trusted execution environment.
27+
*/
28+
@JsonProperty("security_level")
29+
private Integer securityLevel;
30+
31+
/**
32+
* Indicates whether HDCP V1 or V2 is required or not.
33+
*/
34+
@JsonProperty("required_output_protection")
35+
private RequiredOutputProtection requiredOutputProtection;
36+
37+
@JsonProperty("track_type")
38+
public String getTrackType() {
39+
return trackType;
40+
}
41+
42+
@JsonProperty("track_type")
43+
public void setTrackType(String trackType) {
44+
this.trackType = trackType;
45+
}
46+
47+
@JsonProperty("key_id")
48+
public String getKeyId() {
49+
return keyId;
50+
}
51+
52+
@JsonProperty("key_id")
53+
public void setKeyId(String keyId) {
54+
this.keyId = keyId;
55+
}
56+
57+
@JsonProperty("security_level")
58+
public Integer getSecurityLevel() {
59+
return securityLevel;
60+
}
61+
62+
@JsonProperty("security_level")
63+
public void setSecurityLevel(Integer securityLevel) {
64+
this.securityLevel = securityLevel;
65+
}
66+
67+
@JsonProperty("required_output_protection")
68+
public RequiredOutputProtection getRequiredOutputProtection() {
69+
return requiredOutputProtection;
70+
}
71+
72+
@JsonProperty("required_output_protection")
73+
public void setRequiredOutputProtection(RequiredOutputProtection requiredOutputProtection) {
74+
this.requiredOutputProtection = requiredOutputProtection;
75+
}
3976
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.microsoft.windowsazure.services.media.implementation.templates.widevine;
22

33
public enum Hdcp {
4-
HDCP_NONE,
5-
HDCP_V1,
6-
HDCP_V2
4+
HDCP_NONE, HDCP_V1, HDCP_V2
75
}

services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/implementation/templates/widevine/RequiredOutputProtection.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
import com.fasterxml.jackson.annotation.JsonProperty;
44

55
public class RequiredOutputProtection {
6-
/**
7-
* Indicates whether HDCP is required.
8-
*/
9-
@JsonProperty
10-
public Hdcp hdcp;
6+
/**
7+
* Indicates whether HDCP is required.
8+
*/
9+
@JsonProperty("hdcp")
10+
private Hdcp hdcp;
11+
12+
@JsonProperty("hdcp")
13+
public Hdcp getHdcp() {
14+
return hdcp;
15+
}
16+
17+
@JsonProperty("hdcp")
18+
public void setHdcp(Hdcp hdcp) {
19+
this.hdcp = hdcp;
20+
}
1121
}

0 commit comments

Comments
 (0)