Skip to content

Commit

Permalink
Remove tabs, fix JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Morgan committed Mar 4, 2010
1 parent 74c149a commit 2771a22
Show file tree
Hide file tree
Showing 23 changed files with 131 additions and 120 deletions.
8 changes: 4 additions & 4 deletions src/org/hyperic/hq/hqapi1/AgentApi.java
Expand Up @@ -69,7 +69,7 @@ public AgentResponse getAgent(int id)
Map<String,String[]> params = new HashMap<String,String[]>();
params.put("id", new String[] { String.valueOf(id) });
return doGet("agent/get.hqu", params,
new XmlResponseHandler<AgentResponse>(AgentResponse.class));
new XmlResponseHandler<AgentResponse>(AgentResponse.class));
}

/**
Expand All @@ -92,7 +92,7 @@ public AgentResponse getAgent(String address, int port)
params.put("address", new String[] { address });
params.put("port", new String[] { String.valueOf(port) });
return doGet("agent/get.hqu", params,
new XmlResponseHandler<AgentResponse>(AgentResponse.class));
new XmlResponseHandler<AgentResponse>(AgentResponse.class));
}

/**
Expand All @@ -108,7 +108,7 @@ public AgentsResponse getAgents()
throws IOException
{
return doGet("agent/list.hqu", new HashMap<String,String[]>(),
new XmlResponseHandler<AgentsResponse>(AgentsResponse.class));
new XmlResponseHandler<AgentsResponse>(AgentsResponse.class));
}

/**
Expand All @@ -128,6 +128,6 @@ public PingAgentResponse pingAgent(Agent agent)
Map <String,String[]> params = new HashMap<String,String[]>();
params.put("id", new String[] { String.valueOf(agent.getId()) });
return doGet("agent/ping.hqu", params,
new XmlResponseHandler<PingAgentResponse>(PingAgentResponse.class));
new XmlResponseHandler<PingAgentResponse>(PingAgentResponse.class));
}
}
10 changes: 5 additions & 5 deletions src/org/hyperic/hq/hqapi1/AlertApi.java
Expand Up @@ -109,7 +109,7 @@ public AlertsResponse findAlerts(long begin, long end, int count,
}

return doGet("alert/find.hqu", params,
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
}

/**
Expand Down Expand Up @@ -150,7 +150,7 @@ public AlertsResponse findAlerts(Resource r, long begin, long end,
}

return doGet("alert/findByResource.hqu", params,
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
}

/**
Expand Down Expand Up @@ -234,7 +234,7 @@ public AlertsResponse fixAlerts(Integer[] alertIds, String reason)
params.put("reason", new String[] { reason });

return doGet("alert/fix.hqu", params,
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
}

/**
Expand Down Expand Up @@ -290,7 +290,7 @@ public AlertsResponse ackAlerts(Integer[] alertIds, String reason, Long pause)
params.put("pause", new String[] { Long.toString(pause)});

return doGet("alert/ack.hqu", params,
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
new XmlResponseHandler<AlertsResponse>(AlertsResponse.class));
}

/**
Expand Down Expand Up @@ -330,6 +330,6 @@ public StatusResponse delete(Integer[] alertIds)
params.put("id", ids);

return doGet("alert/delete.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}
}
10 changes: 5 additions & 5 deletions src/org/hyperic/hq/hqapi1/AlertDefinitionApi.java
Expand Up @@ -121,7 +121,7 @@ public AlertDefinitionsResponse getAlertDefinitions(boolean excludeTypeBased,
}

return doGet("alertdefinition/listDefinitions.hqu", params,
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
}

/**
Expand Down Expand Up @@ -160,7 +160,7 @@ public AlertDefinitionsResponse getAlertDefinitions(AlertDefinition parent)
params.put("parentId", new String[] { Integer.toString(parent.getId()) });

return doGet("alertdefinition/listDefinitions.hqu", params,
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
}

/**
Expand All @@ -180,7 +180,7 @@ public AlertDefinitionsResponse getTypeAlertDefinitions(boolean excludeIds)
params.put("excludeIds", new String[] { Boolean.toString(excludeIds)});

return doGet("alertdefinition/listTypeDefinitions.hqu", params,
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
}

/**
Expand All @@ -201,7 +201,7 @@ public StatusResponse deleteAlertDefinition(int id)
params.put("id", new String[] { Integer.toString(id) });

return doGet("alertdefinition/delete.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}

/**
Expand All @@ -221,6 +221,6 @@ public AlertDefinitionsResponse syncAlertDefinitions(List<AlertDefinition> defin
request.getAlertDefinition().addAll(definitions);

return doPost("alertdefinition/sync.hqu", request,
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
new XmlResponseHandler<AlertDefinitionsResponse>(AlertDefinitionsResponse.class));
}
}
10 changes: 5 additions & 5 deletions src/org/hyperic/hq/hqapi1/ApplicationApi.java
Expand Up @@ -36,7 +36,7 @@ public ApplicationsResponse listApplications()
{
Map<String, String[]> params = new HashMap<String, String[]>();
return doGet("application/list.hqu", params,
new XmlResponseHandler<ApplicationsResponse>(ApplicationsResponse.class));
new XmlResponseHandler<ApplicationsResponse>(ApplicationsResponse.class));
}

/**
Expand All @@ -56,7 +56,7 @@ public ApplicationResponse createApplication(Application app)
ApplicationRequest appRequest = new ApplicationRequest();
appRequest.setApplication(app);
return doPost("application/create.hqu", appRequest,
new XmlResponseHandler<ApplicationResponse>(ApplicationResponse.class));
new XmlResponseHandler<ApplicationResponse>(ApplicationResponse.class));
}

/**
Expand All @@ -76,7 +76,7 @@ public ApplicationResponse updateApplication(Application app)
ApplicationRequest appRequest = new ApplicationRequest();
appRequest.setApplication(app);
return doPost("application/update.hqu", appRequest,
new XmlResponseHandler<ApplicationResponse>(ApplicationResponse.class));
new XmlResponseHandler<ApplicationResponse>(ApplicationResponse.class));
}

/**
Expand All @@ -95,7 +95,7 @@ public StatusResponse deleteApplication(int id)
Map<String, String[]> params = new HashMap<String, String[]>();
params.put("id", new String[] { Integer.toString(id)});
return doGet("application/delete.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}

/**
Expand All @@ -115,6 +115,6 @@ public ApplicationsResponse syncApplications(List<Application> applications)
ApplicationsRequest applicationsRequest = new ApplicationsRequest();
applicationsRequest.getApplication().addAll(applications);
return doPost("application/sync.hqu", applicationsRequest,
new XmlResponseHandler<ApplicationsResponse>(ApplicationsResponse.class));
new XmlResponseHandler<ApplicationsResponse>(ApplicationsResponse.class));
}
}
4 changes: 2 additions & 2 deletions src/org/hyperic/hq/hqapi1/AutodiscoveryApi.java
Expand Up @@ -64,7 +64,7 @@ public QueueResponse getQueue()
throws IOException
{
return doGet("autodiscovery/getQueue.hqu", new HashMap<String,String[]>(),
new XmlResponseHandler<QueueResponse>(QueueResponse.class));
new XmlResponseHandler<QueueResponse>(QueueResponse.class));
}

/**
Expand All @@ -86,6 +86,6 @@ public StatusResponse approve(int id)
params.put("id", new String[] { String.valueOf(id) });

return doGet("autodiscovery/approve.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}
}
2 changes: 1 addition & 1 deletion src/org/hyperic/hq/hqapi1/BaseApi.java
Expand Up @@ -49,7 +49,7 @@ abstract class BaseApi {
* parameter may have multiple values.
*/
<T> T doGet(String action, Map<String, String[]> params,
ResponseHandler<T> responseHandler)
ResponseHandler<T> responseHandler)
throws IOException
{
return _conn.doGet(BASE_URI + action, params, responseHandler);
Expand Down
2 changes: 1 addition & 1 deletion src/org/hyperic/hq/hqapi1/Connection.java
Expand Up @@ -62,7 +62,7 @@ <T> T doPost(String path, Map<String, String[]> params, ResponseHandler<T> respo
* If a network error occurs during the request.
*/
<T> T doPost(String path, Map<String, String> params, File file,
ResponseHandler<T> responseHandler) throws IOException;
ResponseHandler<T> responseHandler) throws IOException;

/**
* Issue a POST against the API.
Expand Down
6 changes: 3 additions & 3 deletions src/org/hyperic/hq/hqapi1/ControlApi.java
Expand Up @@ -94,7 +94,7 @@ private ControlHistoryResponse getHistory(Integer resourceId)
params.put("resourceId", new String[] { Integer.toString(resourceId)});

return doGet("control/history.hqu", params,
new XmlResponseHandler<ControlHistoryResponse>(ControlHistoryResponse.class));
new XmlResponseHandler<ControlHistoryResponse>(ControlHistoryResponse.class));
}

/**
Expand Down Expand Up @@ -138,7 +138,7 @@ private ControlActionResponse getActions(Integer resourceId)
params.put("resourceId", new String[] { Integer.toString(resourceId)});

return doGet("control/actions.hqu", params,
new XmlResponseHandler<ControlActionResponse>(ControlActionResponse.class));
new XmlResponseHandler<ControlActionResponse>(ControlActionResponse.class));
}

/**
Expand Down Expand Up @@ -189,6 +189,6 @@ private StatusResponse executeAction(Integer resourceId, String action,
params.put("arguments", arguments);

return doGet("control/execute.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}
}
11 changes: 6 additions & 5 deletions src/org/hyperic/hq/hqapi1/EscalationApi.java
Expand Up @@ -70,7 +70,7 @@ public EscalationResponse getEscalation(int id)
Map<String, String[]> params = new HashMap<String, String[]>();
params.put("id", new String[] { Integer.toString(id) });
return doGet("escalation/get.hqu", params,
new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
}

/**
Expand Down Expand Up @@ -108,7 +108,7 @@ public EscalationResponse createEscalation(Escalation esc)
EscalationsRequest req = new EscalationsRequest();
req.getEscalation().add(esc);
return doPost("escalation/create.hqu", req,
new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
}

/**
Expand All @@ -126,7 +126,8 @@ public EscalationResponse updateEscalation(Escalation esc)
EscalationsRequest req = new EscalationsRequest();
req.getEscalation().add(esc);
return doPost("escalation/update.hqu",
req, new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
req,
new XmlResponseHandler<EscalationResponse>(EscalationResponse.class));
}

/**
Expand All @@ -141,7 +142,7 @@ public EscalationResponse updateEscalation(Escalation esc)
public EscalationsResponse getEscalations()
throws IOException {
return doGet("escalation/list.hqu", new HashMap<String,String[]>(),
new XmlResponseHandler<EscalationsResponse>(EscalationsResponse.class));
new XmlResponseHandler<EscalationsResponse>(EscalationsResponse.class));
}

/**
Expand All @@ -159,7 +160,7 @@ public StatusResponse syncEscalations(Collection<Escalation> escs)
EscalationsRequest req = new EscalationsRequest();
req.getEscalation().addAll(escs);
return doPost("escalation/sync.hqu", req,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/org/hyperic/hq/hqapi1/EventApi.java
Expand Up @@ -128,7 +128,7 @@ public EventsResponse findEvents(Resource r, long begin, long end)
params.put("resourceId", new String[] { Integer.toString(r.getId())});

return doGet("event/findByResource.hqu", params,
new XmlResponseHandler<EventsResponse>(EventsResponse.class));
new XmlResponseHandler<EventsResponse>(EventsResponse.class));
}

/**
Expand Down Expand Up @@ -159,6 +159,6 @@ public EventsResponse findEvents(long begin, long end,
params.put("count", new String[] { Integer.toString(count)});

return doGet("event/find.hqu", params,
new XmlResponseHandler<EventsResponse>(EventsResponse.class));
new XmlResponseHandler<EventsResponse>(EventsResponse.class));
}
}
1 change: 0 additions & 1 deletion src/org/hyperic/hq/hqapi1/FileResponseHandler.java
Expand Up @@ -131,5 +131,4 @@ public T handleResponse(int responseCode, HttpMethodBase method)
return getErrorResponse(error);
}
}

}
14 changes: 7 additions & 7 deletions src/org/hyperic/hq/hqapi1/GroupApi.java
Expand Up @@ -76,7 +76,7 @@ public GroupResponse getGroup(String name)
Map<String, String[]> params = new HashMap<String, String[]>();
params.put("name", new String[] { name });
return doGet("group/get.hqu", params,
new XmlResponseHandler<GroupResponse>(GroupResponse.class));
new XmlResponseHandler<GroupResponse>(GroupResponse.class));
}

/**
Expand All @@ -96,7 +96,7 @@ public GroupResponse getGroup(int id)
Map<String, String[]> params = new HashMap<String, String[]>();
params.put("id", new String[] { Integer.toString(id) });
return doGet("group/get.hqu", params,
new XmlResponseHandler<GroupResponse>(GroupResponse.class));
new XmlResponseHandler<GroupResponse>(GroupResponse.class));
}

private GroupResponse syncSingleGroup(Group group)
Expand Down Expand Up @@ -162,7 +162,7 @@ public StatusResponse deleteGroup(int id)
Map<String,String[]> params = new HashMap<String,String[]>();
params.put("id", new String[] { Integer.toString(id) });
return doGet("group/delete.hqu", params,
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
new XmlResponseHandler<StatusResponse>(StatusResponse.class));
}

/**
Expand All @@ -177,7 +177,7 @@ public GroupsResponse getGroups()
throws IOException
{
return doGet("group/list.hqu", new HashMap<String,String[]>(),
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
}

/**
Expand All @@ -196,7 +196,7 @@ public GroupsResponse getCompatibleGroups()
Map<String,String[]> params = new HashMap<String,String[]>();
params.put("compatible", new String[] { Boolean.toString(true) });
return doGet("group/list.hqu", params,
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
}

/**
Expand All @@ -215,7 +215,7 @@ public GroupsResponse getMixedGroups()
Map<String,String[]> params = new HashMap<String,String[]>();
params.put("compatible", new String[] { Boolean.toString(false) });
return doGet("group/list.hqu", params,
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
}

/**
Expand Down Expand Up @@ -266,6 +266,6 @@ public GroupsResponse syncGroups(List<Group> groups)
GroupsRequest groupRequest = new GroupsRequest();
groupRequest.getGroup().addAll(groups);
return doPost("group/sync.hqu", groupRequest,
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
new XmlResponseHandler<GroupsResponse>(GroupsResponse.class));
}
}

0 comments on commit 2771a22

Please sign in to comment.