-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
2,035 additions
and
3,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/MessageUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
* and other contributors as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hawkular.cmdgw.api; | ||
|
||
/** | ||
* @author <a href="https://github.com/ppalaga">Peter Palaga</a> | ||
*/ | ||
public class MessageUtils { | ||
public static void prepareResourcePathResponse(ResourcePathRequest request, ResourcePathResponse response) { | ||
prepareUiSessionDestination((UiSessionOrigin) request, (UiSessionDestination) response); | ||
response.setResourcePath(request.getResourcePath()); | ||
} | ||
public static void prepareUiSessionDestination(UiSessionOrigin request, UiSessionDestination response) { | ||
response.setDestinationSessionId(request.getSenderSessionId()); | ||
response.setSenderRequestId(request.getSenderRequestId()); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...lar-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/ResourcePathDestination.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
* and other contributors as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hawkular.cmdgw.api; | ||
|
||
import org.hawkular.bus.common.BasicMessage; | ||
|
||
/** | ||
* @author <a href="https://github.com/ppalaga">Peter Palaga</a> | ||
*/ | ||
public interface ResourcePathDestination extends BasicMessage { | ||
String getResourcePath(); | ||
} |
37 changes: 37 additions & 0 deletions
37
hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/UiSessionDestination.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
* and other contributors as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hawkular.cmdgw.api; | ||
|
||
import org.hawkular.bus.common.BasicMessage; | ||
|
||
/** | ||
* @author <a href="https://github.com/ppalaga">Peter Palaga</a> | ||
*/ | ||
public interface UiSessionDestination extends BasicMessage { | ||
/** | ||
* @return an ID chosen originally by the sending UI client that should make it possible to associate this response | ||
* with the triggering request. This ID is supposed to be unique just within the sending WebSocket session. | ||
*/ | ||
String getSenderRequestId(); | ||
void setSenderRequestId(String requestId); | ||
|
||
/** | ||
* @return the ID of a WebSocket Session that is the destination of this message. | ||
*/ | ||
String getDestinationSessionId(); | ||
void setDestinationSessionId(String sessionId); | ||
} |
28 changes: 28 additions & 0 deletions
28
hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/UiSessionOrigin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
* and other contributors as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hawkular.cmdgw.api; | ||
|
||
import org.hawkular.bus.common.BasicMessage; | ||
|
||
/** | ||
* @author <a href="https://github.com/ppalaga">Peter Palaga</a> | ||
*/ | ||
public interface UiSessionOrigin extends BasicMessage { | ||
String getSenderRequestId(); | ||
String getSenderSessionId(); | ||
void setSenderSessionId(String sessionId); | ||
} |
54 changes: 54 additions & 0 deletions
54
hawkular-command-gateway-api/src/main/resources/schema/A0AuthMessage.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"definitions": { | ||
"authentication": { | ||
"type": "object", | ||
"description": "Provides user credentials or security token. The awkward name of the schema file A0AuthMessage.schema.json is there so that this schema file precedes all other schema files alphabetically. This is required by jsonschema2pojo-maven-plugin that is not resolving the inter-schema dependencies, it just takes files in alphabetical order.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"username": { "type": "string" }, | ||
"password": { "type": "string" }, | ||
"token": { "type": "string" }, | ||
"persona": { "type": "string" } | ||
} | ||
}, | ||
"recipientType": { | ||
"type": "object", | ||
"description": "A binary attachment metadata", | ||
"enum": ["UI", "resource"] | ||
}, | ||
"attachment": { | ||
"type": "object", | ||
"description": "A binary attachment metadata", | ||
"additionalProperties": false, | ||
"properties": { | ||
"filename": { | ||
"description" : "Plain file name without any folders. Just a proposal to use when storing in file system.", | ||
"type": "string" | ||
}, | ||
"length": { | ||
"description" : "The length of the binary content in bytes", | ||
"type": "int" | ||
}, | ||
"md5": { | ||
"description" : "An md5 hash of the binary content", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"type": "object", | ||
"extends": { | ||
"type": "object", | ||
"javaType": "org.hawkular.bus.common.AbstractMessage" | ||
}, | ||
"javaInterfaces" : ["org.hawkular.bus.common.BasicMessage", "org.hawkular.bus.common.msg.features.FailOnUnknownProperties"], | ||
"javaType": "org.hawkular.cmdgw.api.AuthMessage", | ||
"description": "Message properties that are needed for authentication.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"authentication": { | ||
"$ref": "#/definitions/authentication" | ||
} | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
hawkular-command-gateway-api/src/main/resources/schema/A0uthMessage.schema.json
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
hawkular-command-gateway-api/src/main/resources/schema/A1ResourcePathRequest.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"type": "object", | ||
"extends": { | ||
"type": "object", | ||
"javaType": "org.hawkular.cmdgw.api.AuthMessage" | ||
}, | ||
"javaType": "org.hawkular.cmdgw.api.ResourcePathRequest", | ||
"javaInterfaces" : ["org.hawkular.cmdgw.api.ResourcePathDestination", "org.hawkular.cmdgw.api.UiSessionOrigin"], | ||
"description": "Adds a Datasource or a XA Datasource to a resource. The awkward name of the schema file A1ResourcePathRequest.schema.json is there so that this schema file precedes all other schema files alphabetically. This is required by jsonschema2pojo-maven-plugin that is not resolving the inter-schema dependencies, it just takes files in alphabetical order.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"resourcePath": { | ||
"description" : "The inventory path to the Application Server resource where the driver should be installed", | ||
"type": "string" | ||
}, | ||
"senderRequestId": { | ||
"description" : "An ID chosen by the sending UI client that should make it possible to associate future responses with this request. This ID is supposed to be unique just within the current WebSocket session.", | ||
"type": "string" | ||
}, | ||
"senderSessionId": { | ||
"description" : "UI clients do not need to set this, the server will overwrite this field based on the ID of the present WebSocket session ID.", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["resourcePath"] | ||
} |
34 changes: 34 additions & 0 deletions
34
hawkular-command-gateway-api/src/main/resources/schema/A2ResourcePathResponse.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"type": "object", | ||
"extends": { | ||
"type": "object", | ||
"javaType": "org.hawkular.cmdgw.api.AuthMessage" | ||
}, | ||
"javaType": "org.hawkular.cmdgw.api.ResourcePathResponse", | ||
"javaInterfaces" : ["org.hawkular.cmdgw.api.UiSessionDestination"], | ||
"description": "Results of a Resource releated operation. The awkward name of the schema file A2ResourcePathResponse.schema.json is there so that this schema file precedes all other schema files alphabetically. This is required by jsonschema2pojo-maven-plugin that is not resolving the inter-schema dependencies, it just takes files in alphabetical order.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"resourcePath": { | ||
"description" : "The inventory path to the resource that was targeted by the request.", | ||
"type": "string" | ||
}, | ||
"senderRequestId": { | ||
"description" : "An ID chosen originally by the sending UI client that should make it possible to associate this response with the triggering request. This ID is supposed to be unique just within the sending WebSocket session", | ||
"type": "string" | ||
}, | ||
"destinationSessionId": { | ||
"description" : "The ID of a WebSocket Session that is the destination of this message.", | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "Indicates if the deployment succeeded or failed." | ||
}, | ||
"message": { | ||
"type": "string", | ||
"description": "A message that further describes the results of the operation." | ||
} | ||
}, | ||
"required": ["resourcePath", "destinationSessionId"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.