restx.security.AcceptedCORS Maven / Gradle / Ivy
package restx.security;
import com.google.common.base.Optional;
import restx.RestxRequest;
import java.util.Collection;
/**
* User: xavierhanin
* Date: 4/1/13
* Time: 10:29 PM
*/
public class AcceptedCORS extends CORS {
private final String origin;
private final Collection methods;
private final Collection headers;
private final Optional credentials;
private final int maxAge;
AcceptedCORS(String origin, Collection methods, Collection headers, Optional credentials, int maxAge) {
this.headers = headers;
this.credentials = credentials;
this.origin = origin;
this.methods = methods;
this.maxAge = maxAge;
}
public boolean isAccepted() {
return true;
}
public String getOrigin() {
return origin;
}
public Collection getMethods() {
return methods;
}
public Collection getHeaders() {
return headers;
}
public Optional getAllowCredentials() {
return credentials;
}
public int getMaxAge() {
return maxAge;
}
}