public RequestMaker(HttpMethod method, HeaderType headerType, ConnectionSecurity security, Object data, String url) { this.headerType = headerType; this.httpMethod = method; this.security = security; this.address = url; this.data = data; }
/** * Constructor to create connection. * * @param address end point without protocol ex: localhost, toms-cz.com, google.com * @param port port in which service available. * @param parameters url parameters if service is available on localhost:8080/rest/personService * then parameter are /rest/personService include slash, or * localhost:8080/AFServer/rest/personService then parameter is * /AFserver/rest/personService * @param protocol ex: http, https, etc. */ public AFSwinxConnection(String address, int port, String parameters, String protocol) { this.address = address; this.port = port; this.parameters = parameters; this.acceptedType = HeaderType.JSON; this.contentType = HeaderType.JSON; this.protocol = protocol; this.httpMethod = HttpMethod.Get; }
/** * * Constructor to create connection. * * @param address end point without protocol ex: localhost, toms-cz.com, google.com * @param port port in which service available. * @param parameters url parameters if service is available on localhost:8080/rest/personService * then parameter are /rest/personService include slash, or * localhost:8080/AFServer/rest/personService then parameter is * /AFserver/rest/personService * @param acceptedType type of accepted response see {@link HeaderType} for more information * @param contentType type of request on end point see {@link HeaderType} for more information */ public AFSwinxConnection(String address, int port, String parameters, HeaderType acceptedType, HeaderType contentType) { this.address = address; this.port = port; this.parameters = parameters; this.acceptedType = acceptedType; this.contentType = contentType; this.protocol = PROTOCOL_HTTP; this.httpMethod = HttpMethod.Get; }
public void setContentType(HeaderType contentType) { this.contentType = contentType; }
public void setAcceptedType(HeaderType acceptedType) { this.acceptedType = acceptedType; }
/** * This constructor is protected because its used in {@link ConnectionParser}. It's easily use * set method then hold all variables in memory. Default content and header type is * application.json from {@link HeaderType}. */ public AFSwinxConnection() { this.contentType = HeaderType.JSON; this.acceptedType = HeaderType.JSON; }
/** * * Constructor to create connection. * * @param address end point without protocol ex: localhost, toms-cz.com, google.com * @param port port in which service available. * @param parameters url parameters if service is available on localhost:8080/rest/personService * then parameter are /rest/personService include slash, or * localhost:8080/AFServer/rest/personService then parameter is * /AFserver/rest/personServicer more information * @param contentType type of request on end point see {@link HeaderType} for more information * @param protocol ex: http, https, etc. * @param httpMethod method which will be used see {@link HttpMethod} */ public AFSwinxConnection(String address, int port, String parameters, HeaderType acceptedType, HeaderType contentType, String protocol, HttpMethod httpMethod) { this.address = address; this.port = port; this.parameters = parameters; this.acceptedType = acceptedType; this.contentType = contentType; this.protocol = protocol; this.httpMethod = httpMethod; }