org.whitesource.agent.api.dispatch
Class RequestFactory

java.lang.Object
  extended by org.whitesource.agent.api.dispatch.RequestFactory

public class RequestFactory
extends Object

Factory for constructing ServiceRequest.

Author:
Edo.Shor

Constructor Summary
RequestFactory(String agent, String agentVersion)
          Constructor
 
Method Summary
 CheckPoliciesRequest newCheckPoliciesRequest(String orgToken, Collection<AgentProjectInfo> projects)
          Create new Check policies request.
 PropertiesRequest newPropertiesRequest(String orgToken)
          Create new Properties request.
 ReportRequest newReportRequest(Collection<DependencyInfo> dependencies)
          Create new Report request.
 UpdateInventoryRequest newUpdateInventoryRequest(String orgToken, Collection<AgentProjectInfo> projects)
          Create new Inventory Update request.
protected  void prepareRequest(BaseRequest<?> request)
          The method populate the given request with basic information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestFactory

public RequestFactory(String agent,
                      String agentVersion)
Constructor

Parameters:
agent - Agent type identifier.
agentVersion - Agent version.
Method Detail

newPropertiesRequest

public PropertiesRequest newPropertiesRequest(String orgToken)
Create new Properties request.

Parameters:
orgToken - WhiteSource organization token.
Returns:
Newly created request for properties.

newReportRequest

public ReportRequest newReportRequest(Collection<DependencyInfo> dependencies)
Create new Report request.

Parameters:
dependencies - List of dependencies for analysis.
Returns:
Newly created request for analysis.

newUpdateInventoryRequest

public UpdateInventoryRequest newUpdateInventoryRequest(String orgToken,
                                                        Collection<AgentProjectInfo> projects)
Create new Inventory Update request.

Parameters:
orgToken - WhiteSource organization token.
projects - Projects status statement to update.
Returns:
Newly created request to update organization inventory.

newCheckPoliciesRequest

public CheckPoliciesRequest newCheckPoliciesRequest(String orgToken,
                                                    Collection<AgentProjectInfo> projects)
Create new Check policies request.

Parameters:
orgToken - WhiteSource organization token.
projects - Projects status statement to check.
Returns:
Newly created request to check policies application.

prepareRequest

protected void prepareRequest(BaseRequest<?> request)
The method populate the given request with basic information.

Parameters:
request - Service request to prepare.


Copyright © 2011-2012 White Source. All Rights Reserved.