Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHOReVOLUTION
enactment-engine
Commits
3221442f
Commit
3221442f
authored
Jul 25, 2016
by
Alessio Carenini
Browse files
Added missing files. Renamed docs
parent
69ce9d75
Changes
8
Hide whitespace changes
Inline
Side-by-side
ee2/Enactment Engine
1.0.0 M1
Installation guide.docx
→
ee2/Enactment Engine Installation guide.docx
View file @
3221442f
File moved
ee2/Enactment Engine
1.0.0 M1
Release Notes.docx
→
ee2/Enactment Engine Release Notes.docx
View file @
3221442f
File moved
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/ChoreographyServerNode.java
0 → 100644
View file @
3221442f
package
org.apache.brooklyn.entity.webapp.chorevolution
;
import
org.apache.brooklyn.api.catalog.Catalog
;
import
org.apache.brooklyn.api.entity.ImplementedBy
;
import
org.apache.brooklyn.config.ConfigKey
;
import
org.apache.brooklyn.core.config.ConfigKeys
;
import
org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey
;
import
org.apache.brooklyn.entity.software.base.SoftwareProcess
;
import
org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server
;
import
org.apache.brooklyn.util.core.flags.SetFromFlag
;
@Catalog
(
name
=
"Choreography Server"
,
description
=
"Chorevolution server node is installation of Apache Tomcat and Apache ODE"
,
iconUrl
=
"classpath:///tomcat-logo.png"
)
@ImplementedBy
(
ChoreographyServerNodeImpl
.
class
)
public
interface
ChoreographyServerNode
extends
Tomcat8Server
{
@SetFromFlag
(
"ode_version"
)
ConfigKey
<
String
>
SUGGESTED_ODE_VERSION
=
ConfigKeys
.
newConfigKeyWithDefault
(
SoftwareProcess
.
SUGGESTED_VERSION
,
"1.3.6"
);
@SetFromFlag
(
"ode_archiveNameFormat"
)
ConfigKey
<
String
>
ODE_ARCHIVE_DIRECTORY_NAME_FORMAT
=
ConfigKeys
.
newConfigKeyWithDefault
(
SoftwareProcess
.
ARCHIVE_DIRECTORY_NAME_FORMAT
,
"apache-ode-%s"
);
@SetFromFlag
(
"ode_downloadUrl"
)
AttributeSensorAndConfigKey
<
String
,
String
>
ODE_DOWNLOAD_URL
=
ConfigKeys
.
newSensorAndConfigKeyWithDefault
(
SoftwareProcess
.
DOWNLOAD_URL
,
"http://www-eu.apache.org/dist/ode/apache-ode-war-${ode_version}.zip "
);
}
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/ChoreographyServerNodeImpl.java
0 → 100644
View file @
3221442f
package
org.apache.brooklyn.entity.webapp.chorevolution
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.brooklyn.entity.webapp.JavaWebAppService
;
import
org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess
;
import
org.apache.brooklyn.entity.webapp.tomcat.Tomcat8ServerImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.google.common.collect.Sets
;
public
class
ChoreographyServerNodeImpl
extends
Tomcat8ServerImpl
implements
ChoreographyServerNode
,
JavaWebAppService
,
JavaWebAppSoftwareProcess
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ChoreographyServerNodeImpl
.
class
);
// TODO thread-safety issues: if multiple concurrent calls, may break (e.g. deployment_wars being reset)
public
void
deployInitialWars
()
{
String
ode_url
=
null
;
if
(
getAttribute
(
DEPLOYED_WARS
)
==
null
)
sensors
().
set
(
DEPLOYED_WARS
,
Sets
.<
String
>
newLinkedHashSet
());
ode_url
=
getConfig
(
ODE_DOWNLOAD_URL
);
String
rootWar
=
getConfig
(
ROOT_WAR
);
if
(
rootWar
!=
null
)
deploy
(
rootWar
,
"ROOT.war"
);
List
<
String
>
namedWars
=
getConfig
(
NAMED_WARS
,
Collections
.<
String
>
emptyList
());
if
(
ode_url
.
endsWith
(
".war"
))
{
namedWars
.
add
(
ode_url
);
}
else
if
(
ode_url
.
endsWith
(
".zip"
))
{
}
for
(
String
war:
namedWars
){
deploy
(
war
,
getDriver
().
getFilenameContextMapper
().
findArchiveNameFromUrl
(
war
,
true
));
}
Map
<
String
,
String
>
warsByContext
=
getConfig
(
WARS_BY_CONTEXT
);
if
(
warsByContext
!=
null
)
{
for
(
String
context:
warsByContext
.
keySet
())
{
deploy
(
warsByContext
.
get
(
context
),
context
);
}
}
}
}
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/ConfigurableChoreography.java
0 → 100644
View file @
3221442f
/* CEFRIEL
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.brooklyn.entity.webapp.chorevolution
;
import
org.apache.brooklyn.core.annotation.Effector
;
import
org.apache.brooklyn.core.effector.MethodEffector
;
public
interface
ConfigurableChoreography
{
MethodEffector
<
String
>
CONFIGURE_CHOREOGRAPHY
=
new
MethodEffector
<
String
>(
ConfigurableChoreography
.
class
,
"configureNetwork"
);
@Effector
(
description
=
"Reconfigures the services composing the choreography"
)
public
void
configureNetwork
();
}
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/TomcatOdeServer.java
0 → 100644
View file @
3221442f
package
org.apache.brooklyn.entity.webapp.chorevolution
;
import
java.util.List
;
import
org.apache.brooklyn.api.catalog.Catalog
;
import
org.apache.brooklyn.api.entity.ImplementedBy
;
import
org.apache.brooklyn.core.annotation.Effector
;
import
org.apache.brooklyn.core.annotation.EffectorParam
;
import
org.apache.brooklyn.core.effector.MethodEffector
;
import
org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server
;
/**
* An {@link org.apache.brooklyn.api.entity.Entity} that represents a single Tomcat+ODE instance.
*/
@Catalog
(
name
=
"Tomcat Server with Apache ODE"
,
description
=
"Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies"
,
iconUrl
=
"classpath:///tomcat-logo.png"
)
@ImplementedBy
(
TomcatOdeServerImpl
.
class
)
public
interface
TomcatOdeServer
extends
Tomcat8Server
{
MethodEffector
<
String
>
DEPLOY_PROCESS
=
new
MethodEffector
<
String
>(
TomcatOdeServerImpl
.
class
,
"deployProcess"
);
MethodEffector
<
String
>
DEPLOY_PROCESSES
=
new
MethodEffector
<
String
>(
TomcatOdeServerImpl
.
class
,
"deployMultipleProcesses"
);
@Effector
(
description
=
"Deploy an ODE process"
)
public
void
deployProcess
(
@EffectorParam
(
name
=
"url"
)
String
url
);
@Effector
(
description
=
"Deploy an ODE process"
)
public
void
deployMultipleProcesses
(
@EffectorParam
(
name
=
"urls"
)
List
<
String
>
urls
);
}
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/TomcatOdeServerImpl.java
0 → 100644
View file @
3221442f
package
org.apache.brooklyn.entity.webapp.chorevolution
;
import
java.util.List
;
import
org.apache.brooklyn.entity.webapp.tomcat.TomcatServerImpl
;
public
class
TomcatOdeServerImpl
extends
TomcatServerImpl
implements
TomcatOdeServer
{
@SuppressWarnings
(
"rawtypes"
)
@Override
public
Class
getDriverInterface
()
{
return
TomcatOdeSshDriver
.
class
;
}
public
TomcatOdeSshDriver
getDriver
()
{
return
(
TomcatOdeSshDriver
)
super
.
getDriver
();
}
public
void
deployProcess
(
String
url
)
{
// TODO Auto-generated method stub
getDriver
().
deployProcess
(
url
);
}
public
void
deployMultipleProcesses
(
List
<
String
>
urls
)
{
for
(
String
url:
urls
)
{
deployProcess
(
url
);
}
}
}
ee2/brooklyn-library/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/chorevolution/TomcatOdeSshDriver.java
0 → 100644
View file @
3221442f
package
org.apache.brooklyn.entity.webapp.chorevolution
;
import
static
java
.
lang
.
String
.
format
;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.apache.brooklyn.entity.webapp.tomcat.TomcatServerImpl
;
import
org.apache.brooklyn.entity.webapp.tomcat.TomcatSshDriver
;
import
org.apache.brooklyn.location.ssh.SshMachineLocation
;
import
org.apache.brooklyn.util.os.Os
;
import
org.apache.brooklyn.util.ssh.BashCommands
;
public
class
TomcatOdeSshDriver
extends
TomcatSshDriver
{
public
TomcatOdeSshDriver
(
TomcatServerImpl
entity
,
SshMachineLocation
machine
)
{
super
(
entity
,
machine
);
}
public
void
deployProcess
(
String
url
)
{
List
<
String
>
commands
=
new
LinkedList
<
String
>();
commands
.
add
(
BashCommands
.
INSTALL_CURL
);
String
directory
=
Os
.
mergePaths
(
getRunDir
(),
"webapps"
,
"ode"
,
"WEB-INF"
,
"processes"
,
url
.
substring
(
url
.
lastIndexOf
(
"/"
)+
1
).
replace
(
".tar"
,
""
).
replace
(
".gz"
,
""
));
commands
.
add
(
format
(
"mkdir -p "
+
directory
+
" && curl "
+
url
+
" | tar x -C "
+
directory
));
newScript
(
CUSTOMIZING
)
.
environmentVariablesReset
()
.
body
.
append
(
commands
)
.
execute
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment