Write a Mock Service from WSO2ESB

1. Start ESB

2. Go to carbon console (https://localhost:9443/carbon)

3. Manage > APIs > Add API > switch to source view

4. Copy & Paste this code there

<api xmlns="http://ws.apache.org/ns/synapse" name="SimpleAPI" context="/simple">
   <resource methods="GET">
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <Response xmlns="">
                  <status>OK</status>
                  <code>1</code>
               </Response>
            </format>
            <args/>
         </payloadFactory>
         <respond/>
      </inSequence>
   </resource>
</api>

5. Now run it from postman

 GET http://10.10.12.59:8280/simple

 Response

 <Response>
    <status>OK</status>
    <code>1</code>

</Response>


=============================================================
If you want to write proxy service user this code
(Manage > services > Add proxy service > Custom proxy > switch to source view)

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="MyMockProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <Response xmlns="">
                  <status>OK</status>
                  <code>1</code>
               </Response>
            </format>
            <args/>
         </payloadFactory>
         <header action="remove" name="To"/>
         <property name="RESPONSE" scope="default" type="STRING" value="true"/>
         <property action="remove" name="NO_ENTITY_BODY" scope="axis2"/>
         <send/>
      </inSequence>
   </target>
   <description/>
</proxy>

Convert to OSGI & FEATURE (example workflow-core)

1. Change pom.xml in relevant project

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.wso2telco.dep</groupId>
<artifactId>component-dep</artifactId>
   <version>2.3.2-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>workflow-core</artifactId>
<packaging>bundle</packaging>
<name>WSO2.Telco Workflow Core Module</name>
<description>WSO2.Telco - Workflow module</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>2.3.5</version>
<configuration>
<obrRepository>NONE</obrRepository>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package/>
<Export-Package>
org.workflow.*
</Export-Package>
<Import-Package>
*;resolution:=optional
</Import-Package>
<Embed-Dependency>
scribe;scope=compile|runtime;inline=false;
</Embed-Dependency>
<DynamicImport-Package>*</DynamicImport-Package>
<Carbon-Component>UIBundle</Carbon-Component>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

2. Create feature folder in component-dep like this 
com.wso2telco.dep.workflow-core.feature

3. Add pom.xml and add these contents


<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <groupId>com.wso2telco.dep</groupId>
        <artifactId>component-dep-feature</artifactId>
        <version>2.3.2-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>


    <artifactId>com.wso2telco.dep.workflow.core.feature</artifactId>
    <packaging>pom</packaging>
    <name>WSO2.Telco Workflow Core Service</name>
    <description>This feature contains the server bundles required for workflow core service</description>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>com.wso2telco.dep.workflow.core</id>
                            <propertiesFile>../feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>
                                    <propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
                                    <propertyDef>org.eclipse.equinox.p2.type.group:true</propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>
                                <bundleDef>com.wso2telco.dep:workflow-core:${com.wso2telco.dep.version}</bundleDef>
                            </bundles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

4. Change product-hub\modules\p2-profile\product\pom.xml

<featureArtifactDef>
com.wso2telco.dep:com.wso2telco.dep.workflow.core.feature:${com.wso2telco.dep.version}
</featureArtifactDef>

<feature>
<id>com.wso2telco.dep.workflow.core.feature.group</id>
<version>${com.wso2telco.dep.version}</version>
</feature>
//7 places

5. Change component-dep\pom.xml 


<module>components/workflow-core</module>

6. Change component-dep\features\pom.xml

<module>com.wso2telco.dep.workflow.core.feature</module>


Verify product-hub dep & core versions and core-util/component-dep versions.. 

ESB Get & Set Auth Header

SET HEADER

<property xmlns:ns="http://org.apache.synapse/xsd"  
           name="Authorization"  
           expression="fn:concat('Basic ', base64Encode('username:password'))"  
           scope="transport"/>

GET HEADER

<property name="AuthHeader" expression="$trp:Authorization"/>

<log>
 <property name ="====HEADER====" expression=get-property('AuthHeader')/>
</log>


GET JWT HEADER


<property name="authheader" expression="get-property('transport','X-JWT-Assertion')"></property>

Read & Add resource using Governance Registry Libraries

Maven Repo & Dependencies

<repository>
    <id>wso2-nexus</id>
    <name>WSO2 internal Repository</name>
    <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
    </releases>
</repository>

<dependency> 
     <groupId>org.wso2.carbon</groupId> 
     <artifactId>org.wso2.carbon.registry.api</artifactId> 
     <version>4.3.0</version> 
</dependency> 
        
<dependency> 
    <groupId>org.wso2.carbon</groupId> 
    <artifactId>org.wso2.carbon.registry.core</artifactId> 
    <version>4.3.0</version> 
</dependency>

Import these Classes

import org.wso2.carbon.context.CarbonContext; 
import org.wso2.carbon.context.RegistryType; 
import org.wso2.carbon.registry.api.Registry; 
import org.wso2.carbon.registry.api.RegistryException; 
import org.wso2.carbon.registry.api.Resource;

Reading a Resource 

try {
    CarbonContext cCtx = CarbonContext.getThreadLocalCarbonContext();
    Registry registry = cCtx.getRegistry(RegistryType.LOCAL_REPOSITORY);
    Resource resource = registry.get("/c1/c2/r1");
    Object content = resource.getContent();
    String output = new String((byte[]) content);
    System.out.println(output);
} catch (RegistryException e) {
    e.printStackTrace();
}

Adding a Resource

try { 
      CarbonContext cCtx = CarbonContext.getThreadLocalCarbonContext(); 
      Registry registry = cCtx.getRegistry(RegistryType.LOCAL_REPOSITORY); 
      Resource resource = registry.newResource(); 
      String str = "My File Content"; 
      resource.setContent(str.getBytes()); 
      registry.put("/c1/c2/r1", resource); 
    } 
catch (RegistryException e) { 
      e.printStackTrace(); 
}

WSO2 Read Registry

Registry registry = messageContext.getConfiguration().getRegistry();
Object obj=registry.getResource(new Entry("conf:/repository/wso2telco/configurations/mediationConfig.xml"),null);
if (obj!=null) {
String content = obj.toString();
}

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Linux


1. Generate crt file from InstallCert.java (output file is cert )

2. keytool -importcert -file cert -alias localhostdas -keystore $JAVA_HOME/jre/lib/security/cacerts

3. Enter keystore password:  changeit



for Windows



1. Go to URL in your firefox browser, click on HTTPS certificate chain (next to URL address). Click "more info" > "security" > "show certificate" > "details" > "export..". Pickup the name and choose file type example.cer. Now you have file with keystore and you have to add it to your JVM

2. Determine location of cacerts files, eg. C:\Program Files (x86)\Java\jre1.6.0_22\lib\security\cacerts.

3. Next import the example.cer file into cacerts in command line:
keytool -import -alias example -keystore  C:\Program Files (x86)\Java\jre1.6.0_22\lib\security\cacerts -file example.cer
You will be asked for password which default is changeit

4. Restart your JVM/PC.

Create MySql user with all grants

GRANT ALL PRIVILEGES ON dbTest.* To 'user'@'hostname' IDENTIFIED BY 'password';

Maven build without test cases

mvn clean install -DskipTests

--HUB OLD CODE PATCH--

1. clone Telco FORK old code to build server
2. checkout 1.6.1-release branch(if not in this branch)
3. change the class file

4. 
git status
git add .
git commit -m "HUBDEV-1779 CREDIT API LOGS"

git push origin 1.6.1-release [PUSH TO FORK REPO-BRANCH]

5. goto git hub fork
6. create pull request & merge to wso2telco repo

7. goto buildserver again
8. mkdir & clone  wso2telco oldcode repo

9. goto folder
10. git tag v1.6.1_099
11. git push origin v1.6.1_099
12. now checkout to tag (refer google if wanted)
git checkout tags/v1.6.1_099
13. verify u checkout the tag by type this  command 
git describe --tags
14. build relevant project by
mvn clean install AxiataMediator
15. Package & share the jar file with Readme 16. upload with this name [before QA]
v1.6.1_QA_099_RC1.zip
17. after QA verified rename it to
MIFE-PATCH-1.6.1-099.zip

CURL Login SOAP request

curl -k -v -H "SOAPAction: urn:login" -H "Content-Type: text/xml" -d @req.xml https://localhost:9443/services/AuthenticationAdmin

req.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.synapse/xsd">
 <soapenv:Header/>
 <soapenv:Body>
      <aut:login xmlns:aut="http://authentication.services.core.carbon.wso2.org">
         <aut:username>admin</aut:username>
         <aut:password>admin123</aut:password>
         <aut:remoteAddress>localhost</aut:remoteAddress>
      </aut:login>
   </soapenv:Body>
</soapenv:Envelope>

Admin services deployed on WSO2 Identity & API Manager server:

IS 

1. ProvisioningAdminService, ProvisioningAdminService, https://localhost:9444/services/ProvisioningAdminService/
2. CarbonAppUploader, CarbonAppUploader, https://localhost:9444/services/CarbonAppUploader/
3. OperationAdmin, OperationAdmin, https://localhost:9444/services/OperationAdmin/
4. JaggeryAppAdmin, JaggeryAppAdmin, https://localhost:9444/services/JaggeryAppAdmin/
5. WebappAdmin, WebappAdmin, https://localhost:9444/services/WebappAdmin/
6. StatisticsAdmin, StatisticsAdmin, https://localhost:9444/services/StatisticsAdmin/
7. ws-xacml, ws-xacml, https://localhost:9444/services/ws-xacml/
8. RemoteUserRealmService, RemoteUserRealmService, https://localhost:9444/services/RemoteUserRealmService/
9. TopicManagerAdminService, TopicManagerAdminService, https://localhost:9444/services/TopicManagerAdminService/
10. ApplicationAdmin, ApplicationAdmin, https://localhost:9444/services/ApplicationAdmin/
11. ClaimManagementService, ClaimManagementService, https://localhost:9444/services/ClaimManagementService/
12. ServiceGroupAdmin, ServiceGroupAdmin, https://localhost:9444/services/ServiceGroupAdmin/
13. CustomMeteringService, CustomMeteringService, https://localhost:9444/services/CustomMeteringService/
14. STSAdminService, STSAdminService, https://localhost:9444/services/STSAdminService/
15. OAuthAdminService, OAuthAdminService, https://localhost:9444/services/OAuthAdminService/
16. FileDownloadService, FileDownloadService, https://localhost:9444/services/FileDownloadService/
17. CachingAdminService, CachingAdminService, https://localhost:9444/services/CachingAdminService/
18. CustomUIAdminService, CustomUIAdminService, https://localhost:9444/services/CustomUIAdminService/
19. RMAdminService, RMAdminService, https://localhost:9444/services/RMAdminService/
20. ThrottleAdminService, ThrottleAdminService, https://localhost:9444/services/ThrottleAdminService/
21. RemoteAuthorizationManagerService, RemoteAuthorizationManagerService, https://localhost:9444/services/RemoteAuthorizationManagerService/
22. IWAAuthenticator, IWAAuthenticator, https://localhost:9444/services/IWAAuthenticator/
23. IdentityProviderAdminService, IdentityProviderAdminService, https://localhost:9444/services/IdentityProviderAdminService/
24. IdentityProviderMgtService, IdentityProviderMgtService, https://localhost:9444/services/IdentityProviderMgtService/
25. ResourceAdminService, ResourceAdminService, https://localhost:9444/services/ResourceAdminService/
26. FileUploadService, FileUploadService, https://localhost:9444/services/FileUploadService/
27. RemoteTenantManagerService, RemoteTenantManagerService, https://localhost:9444/services/RemoteTenantManagerService/
28. DataSourceAdmin, DataSourceAdmin, https://localhost:9444/services/DataSourceAdmin/
29. EventBrokerService, EventBrokerService, https://localhost:9444/services/EventBrokerService/
30. TracerAdmin, TracerAdmin, https://localhost:9444/services/TracerAdmin/
31. RepositoryAdminService, RepositoryAdminService, https://localhost:9444/services/RepositoryAdminService/
32. DeploymentSynchronizerAdmin, DeploymentSynchronizerAdmin, https://localhost:9444/services/DeploymentSynchronizerAdmin/
33. EntitlementPolicyAdminService, EntitlementPolicyAdminService, https://localhost:9444/services/EntitlementPolicyAdminService/
34. ServerAdmin, ServerAdmin, https://localhost:9444/services/ServerAdmin/
35. EntitlementAdminService, EntitlementAdminService, https://localhost:9444/services/EntitlementAdminService/
36. AccountCredentialMgtConfigService, AccountCredentialMgtConfigService, https://localhost:9444/services/AccountCredentialMgtConfigService/
37. UserAdmin, UserAdmin, https://localhost:9444/services/UserAdmin/
38. APIKeyValidationService, APIKeyValidationService, https://localhost:9444/services/APIKeyValidationService/
39. LogViewer, LogViewer, https://localhost:9444/services/LogViewer/
40. EntitlementService, EntitlementService, https://localhost:9444/services/EntitlementService/
41. ProfilesAdminService, ProfilesAdminService, https://localhost:9444/services/ProfilesAdminService/
42. IdentitySAMLSSOConfigService, IdentitySAMLSSOConfigService, https://localhost:9444/services/IdentitySAMLSSOConfigService/
43. JaxwsWebappAdmin, JaxwsWebappAdmin, https://localhost:9444/services/JaxwsWebappAdmin/
44. RemoteUserStoreManagerService, RemoteUserStoreManagerService, https://localhost:9444/services/RemoteUserStoreManagerService/
45. UserProfileMgtService, UserProfileMgtService, https://localhost:9444/services/UserProfileMgtService/
46. LoggedUserInfoAdmin, LoggedUserInfoAdmin, https://localhost:9444/services/LoggedUserInfoAdmin/
47. IdentitySTSAdminService, IdentitySTSAdminService, https://localhost:9444/services/IdentitySTSAdminService/
48. NDataSourceAdmin, NDataSourceAdmin, https://localhost:9444/services/NDataSourceAdmin/
49. IdentityApplicationManagementService, IdentityApplicationManagementService,https://localhost:9444/services/IdentityApplicationManagementService/
50. DirectoryServerManager, DirectoryServerManager, https://localhost:9444/services/DirectoryServerManager/
51. RegistryAdminService, RegistryAdminService, https://localhost:9444/services/RegistryAdminService/
52. APIKeyMgtProviderService, APIKeyMgtProviderService, https://localhost:9444/services/APIKeyMgtProviderService/
53. RMAdminGlobal, RMAdminGlobal, https://localhost:9444/services/RMAdminGlobal/
54. ContentSearchAdminService, ContentSearchAdminService, https://localhost:9444/services/ContentSearchAdminService/
55. MessageTracerAdmin, MessageTracerAdmin, https://localhost:9444/services/MessageTracerAdmin/
56. LoginStatisticsAdmin, LoginStatisticsAdmin, https://localhost:9444/services/LoginStatisticsAdmin/
57. SearchAdminService, SearchAdminService, https://localhost:9444/services/SearchAdminService/
58. RemoteProfileConfigurationManagerService, RemoteProfileConfigurationManagerService, https://localhost:9444/services/RemoteProfileConfigurationManagerService/
59. SCIMConfigAdminService, SCIMConfigAdminService, https://localhost:9444/services/SCIMConfigAdminService/
60. ModuleAdminService, ModuleAdminService, https://localhost:9444/services/ModuleAdminService/
61. LoggingAdmin, LoggingAdmin, https://localhost:9444/services/LoggingAdmin/
62. SampleDeployer, SampleDeployer, https://localhost:9444/services/SampleDeployer/
63. XMPPConfigurationService, XMPPConfigurationService, https://localhost:9444/services/XMPPConfigurationService/
64. KeyStoreAdminService, KeyStoreAdminService, https://localhost:9444/services/KeyStoreAdminService/
65. SecurityAdminService, SecurityAdminService, https://localhost:9444/services/SecurityAdminService/
66. ServerRolesManager, ServerRolesManager, https://localhost:9444/services/ServerRolesManager/
67. ThemeMgtService, ThemeMgtService, https://localhost:9444/services/ThemeMgtService/
68. MultipleCredentialsUserAdmin, MultipleCredentialsUserAdmin, https://localhost:9444/services/MultipleCredentialsUserAdmin/
69. UserStoreConfigAdminService, UserStoreConfigAdminService, https://localhost:9444/services/UserStoreConfigAdminService/
70. TenantMgtAdminService, TenantMgtAdminService, https://localhost:9444/services/TenantMgtAdminService/
71. ServiceAdmin, ServiceAdmin, https://localhost:9444/services/ServiceAdmin/
72. UserIdentityManagementAdminService, UserIdentityManagementAdminService, https://localhost:9444/services/UserIdentityManagementAdminService/
73. UserInformationRecoveryService, UserInformationRecoveryService, https://localhost:9444/services/UserInformationRecoveryService/
74. PropertiesAdminService, PropertiesAdminService, https://localhost:9444/services/PropertiesAdminService/
75. RemoteClaimManagerService, RemoteClaimManagerService, https://localhost:9444/services/RemoteClaimManagerService/
76. APIKeyMgtSubscriberService, APIKeyMgtSubscriberService, https://localhost:9444/services/APIKeyMgtSubscriberService/
77. OAuth2TokenValidationService, OAuth2TokenValidationService, https://localhost:9444/services/OAuth2TokenValidationService/



AM

Admin services deployed on this server:
1. ModuleAdminService, ModuleAdminService, https://DESKTOP-47OLP5T:8243/services/ModuleAdminService
2. EventStatisticsAdminService, EventStatisticsAdminService, https://DESKTOP-47OLP5T:8243/services/EventStatisticsAdminService
3. ThemeMgtService, ThemeMgtService, https://DESKTOP-47OLP5T:8243/services/ThemeMgtService
4. RemoteUserRealmService, RemoteUserRealmService, https://DESKTOP-47OLP5T:8243/services/RemoteUserRealmService
5. Document, null, https://DESKTOP-47OLP5T:8243/services/Document
6. ListMetadataService, ListMetadataService, https://DESKTOP-47OLP5T:8243/services/ListMetadataService
7. PropertiesAdminService, PropertiesAdminService, https://DESKTOP-47OLP5T:8243/services/PropertiesAdminService
8. AndesEventAdminService, AndesEventAdminService, https://DESKTOP-47OLP5T:8243/services/AndesEventAdminService
9. RemoteUserStoreManagerService, RemoteUserStoreManagerService, https://DESKTOP-47OLP5T:8243/services/RemoteUserStoreManagerService
10. PublishEventMediatorConfigAdmin, PublishEventMediatorConfigAdmin, https://DESKTOP-47OLP5T:8243/services/PublishEventMediatorConfigAdmin
11. LogViewer, LogViewer, https://DESKTOP-47OLP5T:8243/services/LogViewer
12. SearchAdminService, SearchAdminService, https://DESKTOP-47OLP5T:8243/services/SearchAdminService
13. ws-xacml, ws-xacml, https://DESKTOP-47OLP5T:8243/services/ws-xacml
14. CustomMeteringService, CustomMeteringService, https://DESKTOP-47OLP5T:8243/services/CustomMeteringService
15. UserAdmin, UserAdmin, https://DESKTOP-47OLP5T:8243/services/UserAdmin
16. UserStoreConfigAdminService, UserStoreConfigAdminService, https://DESKTOP-47OLP5T:8243/services/UserStoreConfigAdminService
17. TaskAdmin, TaskAdmin, https://DESKTOP-47OLP5T:8243/services/TaskAdmin
18. RegistryCacheInvalidationService, RegistryCacheInvalidationService, https://DESKTOP-47OLP5T:8243/services/RegistryCacheInvalidationService
19. ServerAdmin, ServerAdmin, https://DESKTOP-47OLP5T:8243/services/ServerAdmin
20. RelationAdminService, RelationAdminService, https://DESKTOP-47OLP5T:8243/services/RelationAdminService
21. ServiceAdmin, ServiceAdmin, https://DESKTOP-47OLP5T:8243/services/ServiceAdmin
22. ConfigServiceAdmin, ConfigServiceAdmin, https://DESKTOP-47OLP5T:8243/services/ConfigServiceAdmin
23. WebappAdmin, WebappAdmin, https://DESKTOP-47OLP5T:8243/services/WebappAdmin
24. EventPublisherAdminService, EventPublisherAdminService, https://DESKTOP-47OLP5T:8243/services/EventPublisherAdminService
25. EventBrokerService, EventBrokerService, https://DESKTOP-47OLP5T:8243/services/EventBrokerService
26. StatisticsAdmin, StatisticsAdmin, https://DESKTOP-47OLP5T:8243/services/StatisticsAdmin
27. KeyStoreAdminService, KeyStoreAdminService, https://DESKTOP-47OLP5T:8243/services/KeyStoreAdminService
28. MessageProcessorAdminService, MessageProcessorAdminService, https://DESKTOP-47OLP5T:8243/services/MessageProcessorAdminService
29. OAuth2TokenValidationService, OAuth2TokenValidationService, https://DESKTOP-47OLP5T:8243/services/OAuth2TokenValidationService
30. APIGatewayAdmin, APIGatewayAdmin, https://DESKTOP-47OLP5T:8243/services/APIGatewayAdmin
31. APIKeyMgtProviderService, APIKeyMgtProviderService, https://DESKTOP-47OLP5T:8243/services/APIKeyMgtProviderService
32. ProvisioningAdminService, ProvisioningAdminService, https://DESKTOP-47OLP5T:8243/services/ProvisioningAdminService
33. MediationSecurityAdminService, MediationSecurityAdminService, https://DESKTOP-47OLP5T:8243/services/MediationSecurityAdminService
34. EventSimulatorAdminService, EventSimulatorAdminService, https://DESKTOP-47OLP5T:8243/services/EventSimulatorAdminService
35. IdentityApplicationManagementService, IdentityApplicationManagementService, https://DESKTOP-47OLP5T:8243/services/IdentityApplicationManagementService
36. APIAuthenticationService, APIAuthenticationService, https://DESKTOP-47OLP5T:8243/services/APIAuthenticationService
37. ServerRolesManager, ServerRolesManager, https://DESKTOP-47OLP5T:8243/services/ServerRolesManager
38. IdentityProviderMgtService, IdentityProviderMgtService, https://DESKTOP-47OLP5T:8243/services/IdentityProviderMgtService
39. InfoAdminService, InfoAdminService, https://DESKTOP-47OLP5T:8243/services/InfoAdminService
40. LoggedUserInfoAdmin, LoggedUserInfoAdmin, https://DESKTOP-47OLP5T:8243/services/LoggedUserInfoAdmin
41. RemoteProfileConfigurationManagerService, RemoteProfileConfigurationManagerService, https://DESKTOP-47OLP5T:8243/services/RemoteProfileConfigurationManagerService
42. RegistryEventBrokerService, RegistryEventBrokerService, https://DESKTOP-47OLP5T:8243/services/RegistryEventBrokerService
43. TenantMgtAdminService, TenantMgtAdminService, https://DESKTOP-47OLP5T:8243/services/TenantMgtAdminService
44. AndesAdminService, AndesAdminService, https://DESKTOP-47OLP5T:8243/services/AndesAdminService
45. CarbonAppUploader, CarbonAppUploader, https://DESKTOP-47OLP5T:8243/services/CarbonAppUploader
46. CommandMediatorAdmin, CommandMediatorAdmin, https://DESKTOP-47OLP5T:8243/services/CommandMediatorAdmin
47. ServiceGroupAdmin, ServiceGroupAdmin, https://DESKTOP-47OLP5T:8243/services/ServiceGroupAdmin
48. DeploymentSynchronizerAdmin, DeploymentSynchronizerAdmin, https://DESKTOP-47OLP5T:8243/services/DeploymentSynchronizerAdmin
49. AndesManagerService, AndesManagerService, https://DESKTOP-47OLP5T:8243/services/AndesManagerService
50. EndpointAdmin, EndpointAdmin, https://DESKTOP-47OLP5T:8243/services/EndpointAdmin
51. UserProfileMgtService, UserProfileMgtService, https://DESKTOP-47OLP5T:8243/services/UserProfileMgtService
52. MediationLibraryAdminService, MediationLibraryAdminService, https://DESKTOP-47OLP5T:8243/services/MediationLibraryAdminService
53. EntitlementService, EntitlementService, https://DESKTOP-47OLP5T:8243/services/EntitlementService
54. OperationAdmin, OperationAdmin, https://DESKTOP-47OLP5T:8243/services/OperationAdmin
55. LocalEntryAdmin, LocalEntryAdmin, https://DESKTOP-47OLP5T:8243/services/LocalEntryAdmin
56. MultipleCredentialsUserAdmin, MultipleCredentialsUserAdmin, https://DESKTOP-47OLP5T:8243/services/MultipleCredentialsUserAdmin
57. EventFlowAdminService, EventFlowAdminService, https://DESKTOP-47OLP5T:8243/services/EventFlowAdminService
58. QpidAdminService, QpidAdminService, https://DESKTOP-47OLP5T:8243/services/QpidAdminService
59. RegistryAdminService, RegistryAdminService, https://DESKTOP-47OLP5T:8243/services/RegistryAdminService
60. EventTracerAdminService, EventTracerAdminService, https://DESKTOP-47OLP5T:8243/services/EventTracerAdminService
61. Reply, null, https://DESKTOP-47OLP5T:8243/services/Reply
62. CustomLifecyclesChecklistAdminService, CustomLifecyclesChecklistAdminService, https://DESKTOP-47OLP5T:8243/services/CustomLifecyclesChecklistAdminService
63. FileUploadService, FileUploadService, https://DESKTOP-47OLP5T:8243/services/FileUploadService
64. RemoteAuthorizationManagerService, RemoteAuthorizationManagerService, https://DESKTOP-47OLP5T:8243/services/RemoteAuthorizationManagerService
65. EntitlementPolicyAdminService, EntitlementPolicyAdminService, https://DESKTOP-47OLP5T:8243/services/EntitlementPolicyAdminService
66. LifeCycleManagementService, LifeCycleManagementService, https://DESKTOP-47OLP5T:8243/services/LifeCycleManagementService
67. TracerAdmin, TracerAdmin, https://DESKTOP-47OLP5T:8243/services/TracerAdmin
68. InboundAdmin, InboundAdmin, https://DESKTOP-47OLP5T:8243/services/InboundAdmin
69. TemplateAdminService, TemplateAdminService, https://DESKTOP-47OLP5T:8243/services/TemplateAdminService
70. CustomUIAdminService, CustomUIAdminService, https://DESKTOP-47OLP5T:8243/services/CustomUIAdminService
71. MediationLibraryUploader, MediationLibraryUploader, https://DESKTOP-47OLP5T:8243/services/MediationLibraryUploader
72. MetricsDataService, MetricsDataService, https://DESKTOP-47OLP5T:8243/services/MetricsDataService
73. LoginStatisticsAdmin, LoginStatisticsAdmin, https://DESKTOP-47OLP5T:8243/services/LoginStatisticsAdmin
74. TierCacheService, TierCacheService, https://DESKTOP-47OLP5T:8243/services/TierCacheService
75. EventProcessorAdminService, EventProcessorAdminService, https://DESKTOP-47OLP5T:8243/services/EventProcessorAdminService
76. LoggingAdmin, LoggingAdmin, https://DESKTOP-47OLP5T:8243/services/LoggingAdmin
77. EventStreamAdminService, EventStreamAdminService, https://DESKTOP-47OLP5T:8243/services/EventStreamAdminService
78. NDataSourceAdmin, NDataSourceAdmin, https://DESKTOP-47OLP5T:8243/services/NDataSourceAdmin
79. RestApiAdmin, RestApiAdmin, https://DESKTOP-47OLP5T:8243/services/RestApiAdmin
80. SynapseArtifactUploaderAdmin, SynapseArtifactUploaderAdmin, https://DESKTOP-47OLP5T:8243/services/SynapseArtifactUploaderAdmin
81. PriorityMediationAdmin, PriorityMediationAdmin, https://DESKTOP-47OLP5T:8243/services/PriorityMediationAdmin
82. ClaimManagementService, ClaimManagementService, https://DESKTOP-47OLP5T:8243/services/ClaimManagementService
83. APIKeyMgtSubscriberService, APIKeyMgtSubscriberService, https://DESKTOP-47OLP5T:8243/services/APIKeyMgtSubscriberService
84. MessageTracerAdmin, MessageTracerAdmin, https://DESKTOP-47OLP5T:8243/services/MessageTracerAdmin
85. ProxyServiceAdmin, ProxyServiceAdmin, https://DESKTOP-47OLP5T:8243/services/ProxyServiceAdmin
86. ResourceAdminService, ResourceAdminService, https://DESKTOP-47OLP5T:8243/services/ResourceAdminService
87. EntitlementAdminService, EntitlementAdminService, https://DESKTOP-47OLP5T:8243/services/EntitlementAdminService
88. ESBNTaskAdmin, ESBNTaskAdmin, https://DESKTOP-47OLP5T:8243/services/ESBNTaskAdmin
89. RemoteTaskAdmin, RemoteTaskAdmin, https://DESKTOP-47OLP5T:8243/services/RemoteTaskAdmin
90. SecurityAdminService, SecurityAdminService, https://DESKTOP-47OLP5T:8243/services/SecurityAdminService
91. ContentSearchAdminService, ContentSearchAdminService, https://DESKTOP-47OLP5T:8243/services/ContentSearchAdminService
92. ManageGenericArtifactService, ManageGenericArtifactService, https://DESKTOP-47OLP5T:8243/services/ManageGenericArtifactService
93. MessageStoreAdminService, MessageStoreAdminService, https://DESKTOP-47OLP5T:8243/services/MessageStoreAdminService
94. FileDownloadService, FileDownloadService, https://DESKTOP-47OLP5T:8243/services/FileDownloadService
95. JaggeryAppAdmin, JaggeryAppAdmin, https://DESKTOP-47OLP5T:8243/services/JaggeryAppAdmin
96. Topic, null, https://DESKTOP-47OLP5T:8243/services/Topic
97. ApplicationAdmin, ApplicationAdmin, https://DESKTOP-47OLP5T:8243/services/ApplicationAdmin
98. DirectoryServerManager, DirectoryServerManager, https://DESKTOP-47OLP5T:8243/services/DirectoryServerManager
99. RemoteClaimManagerService, RemoteClaimManagerService, https://DESKTOP-47OLP5T:8243/services/RemoteClaimManagerService
100. TopicManagerAdminService, TopicManagerAdminService, https://DESKTOP-47OLP5T:8243/services/TopicManagerAdminService
101. OAuthAdminService, OAuthAdminService, https://DESKTOP-47OLP5T:8243/services/OAuthAdminService
102. SynapseApplicationAdmin, SynapseApplicationAdmin, https://DESKTOP-47OLP5T:8243/services/SynapseApplicationAdmin
103. EventReceiverAdminService, EventReceiverAdminService, https://DESKTOP-47OLP5T:8243/services/EventReceiverAdminService
104. IdentityProviderAdminService, IdentityProviderAdminService, https://DESKTOP-47OLP5T:8243/services/IdentityProviderAdminService
105. UserStoreCountService, UserStoreCountService, https://DESKTOP-47OLP5T:8243/services/UserStoreCountService
106. APIKeyValidationService, APIKeyValidationService, https://DESKTOP-47OLP5T:8243/services/APIKeyValidationService
107. SequenceAdminService, SequenceAdminService, https://DESKTOP-47OLP5T:8243/services/SequenceAdminService
108. Provider, null, https://DESKTOP-47OLP5T:8243/services/Provider
109. STSAdminService, STSAdminService, https://DESKTOP-47OLP5T:8243/services/STSAdminService
110. FlowsAdminService, FlowsAdminService, https://DESKTOP-47OLP5T:8243/services/FlowsAdminService
111. RepositoryAdminService, RepositoryAdminService, https://DESKTOP-47OLP5T:8243/services/RepositoryAdminService
112. EndpointTemplateAdminService, EndpointTemplateAdminService, https://DESKTOP-47OLP5T:8243/services/EndpointTemplateAdminService
113. WSRegistryService, WSRegistryService, https://DESKTOP-47OLP5T:8243/services/WSRegistryService
114. WSDLToolService, WSDLToolService, https://DESKTOP-47OLP5T:8243/services/WSDLToolService
115. API, null, https://DESKTOP-47OLP5T:8243/services/API
116. ClassMediatorAdmin, ClassMediatorAdmin, https://DESKTOP-47OLP5T:8243/services/ClassMediatorAdmin
117. RemoteTenantManagerService, RemoteTenantManagerService, https://DESKTOP-47OLP5T:8243/services/RemoteTenantManagerService
118. TemplateManagerAdminService, TemplateManagerAdminService, https://DESKTOP-47OLP5T:8243/services/TemplateManagerAdminService

How to print JsonBody from MessageContext wso2esb.?

<log level="custom">
<property name="################USSD##################" expression="json-eval($.)"></property>
</log>

Move all files with a certain extension from multiple sub-directories into one directory

find . -name '*.zip' -exec mv {} /path/to/single/target/directory \;

HUB RELEASE

=================================RELEASE=================================
mkdir 20170518
cd 20170518/
git clone -b 2.x.x https://github.com/WSO2Telco/mediation-dep-hub.git

vi mediation-dep/pom.xml (change upstream versions)
cd mediation-dep/
git status
git add .
git commit -m "Prepare for next dev"
vi capp_release_script.sh(change version names for release)
chmod +x capp_release_script.sh
cd mediation-dep/
./../capp_release_script.sh (Run from inside the repo-folder)

again change pom.xml to ealier settings
git status
git add .
git commit -m "Revert back from release"

git push origin v2_0_0-release_branch (go to github & see new branch & copy it)

goto git hub
pull request->merge
delete newly added branches (show as merged)

GIT Commands

--------------git push origin v2_1_3-release_branch


//===================================GIT Commands============================
git checkout -b 2.x.x_data_publishing_release
git remote -v
git push origin -u 2.x.x_data_publishing_release
git remote add upstream https://github.com/WSO2Telco/mediation-dep.git
git remote -v
//===================================GIT=====================================


git branch
git status
git clean -f
git log -n 4
git pull
git pull upstream 2.x.x_data_publishing_release
git remote
git remote set-url upstream https://github.com/WSO2Telco/mediation-dep-common
git pull upstream 2.x.x_data_publishing_release
git diff
git checkout -b 2.x.x_data_publishing_release
git push origin 2.x.x_data_publishing_release
git checkout master
git branch -D 2.x.x_data_publishing_release//USING FOR DELETE BRANCH

===============================CORRECT WAY===============================
git remote add upstream https://github.com/WSO2Telco/mediation-dep-common.git
git pull --all
git checkout -b 2.x.x_data_publishing_release upstream/2.x.x_data_publishing_release
git push origin

Converting a PuTTY key for SecureCRT

1. Use PuTTYGen to load your existing private keys
2. Use "Conversions" to export private key in OpenSSH format named identity
3. Export your public key named identity.pub
4. Put both files in the same folder

Then Start your SecureCRT

1. Choose QuickConnect
2. Protocol = SSH2, and enter the hostname or ip address
3. Under the "Authentication" session, Only checked "PublicKey"
4. Click "Properties" at the right pane
5. Choose "Use Global public key setting"
6. Under "Use identity or certificate file" and choose your identity.pub and click ok.
7. Enter your passphrase and get connected!

Search all images in folder

find . -type f -exec file {} \; | grep -o -P '^.+: \w+ image'

How to set java path in Ubuntu 16.04

Just edit & append below code at the end of file (vi /etc/profile)

export JAVA_HOME=/home/priyan/softwares/jdk1.7.0_80
export PATH=$PATH:$JAVA_HOME/bin
echo $JAVA_HOME

/home/priyan/softwares/jdk1.7.0_80  - - - This is my location. You can add your own

How to add source codes to blog

Add this one in HTML design view in blogger page

<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;
            color: #000000; background-color: #eee;
            font-size: 12px; border: 1px dashed #999999;
            line-height: 14px; padding: 5px;
            overflow: auto; width: 100%">
   <code style="color:#000000;word-wrap:normal;">
>>>>>>>>>>>>>>>>>>>ADD YOUR CODE HERE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
   </code>
</pre>

Grep & Split log file

sed -n '/Jun 17 13:39:54/ , /Jun 18 10:50:28/p' kern.log

How to remove all .svn files recursively.?

find . -name .svn -exec rm -rf '{}' \;