Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Registry.beginTransaction()


    private void addKeystores() throws Exception {
        Registry registry = SecurityServiceHolder.getRegistryService().getGovernanceSystemRegistry();
        try {
            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                registry.beginTransaction();
            }
            if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
                Collection kstores = registry.newCollection();
                registry.put(SecurityConstants.KEY_STORES, kstores);
View Full Code Here


        try {
            Registry registry = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(
                    tenantId);
            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                registry.beginTransaction();
            }
            for (String resourceLoc : policyResourceMap.keySet()) {
                if (!registry.resourceExists(resourceLoc)) {
                    registry.put(resourceLoc, policyResourceMap.get(resourceLoc));
                }
View Full Code Here

            }
        } catch (IOException e) {
            log.error(e);
        }

        sysRegistry.beginTransaction();
        while (zipentry != null) {
            String entryName = zipentry.getName();

            ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
View Full Code Here

        OMElement data = fac.createOMElement("configuration", null);

        Registry registry = Util.getConfigSystemRegistry(0);
        boolean success = false;
        try {
            registry.beginTransaction();

            String secretKeyPath = AdminMgtConstants.ADMIN_MANAGEMENT_COLLECTION + "/" + secretKey;
            if (!registry.resourceExists(secretKeyPath)) {
                String msg = "Failed Admin account management attempt.";
                log.error(msg);
View Full Code Here

    private static final String instIdPath = "/repository/components/org.wso2.carbon.instance-id/uuid";
    public String retrieveRegId() throws Exception {
        RegistryService registryService = Util.getRegistryService();
        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
        String uuid = null;
        systemRegistry.beginTransaction();
        boolean isSuccess = false;
        try {
            if (systemRegistry.resourceExists(instIdPath)) {
                Resource resource = systemRegistry.get(instIdPath);
                byte[] uuidBytes = (byte[])resource.getContent();
View Full Code Here

      throw new Exception("WSO2 Registry is not available");
    }
    boolean transactionStarted = Transaction.isStarted();
    try {
      if (transactionStarted) {
        registry.beginTransaction();
      }
      String serviceResourcePath = RegistryResources.SERVICE_GROUPS + serviceGroupName;
      /* the resource should already exist */
      if (registry.resourceExists(serviceResourcePath)) {
        Resource serviceResource = registry.get(serviceResourcePath);
View Full Code Here

        Resource resource = null;

        try {
            systemRegistry = EventingServiceComponent.getRegistry();

            systemRegistry.beginTransaction();

            if (!systemRegistry.resourceExists(SUBSCRIBERS_PATH)) {
                resource = systemRegistry.newResource();
                resource.setContent(getDefaultSubcribers().toString());
                systemRegistry.put(SUBSCRIBERS_PATH, resource);
View Full Code Here

            return;
        }
        try {
            RegistryService registryService = ReportingComponent.getRegistryService();
            Registry registry = registryService.getConfigSystemRegistry();
            registry.beginTransaction();
            Resource reportFilesResource = registry.newResource();
            InputStream xmlStream = null;
            try{
            while (enumeration.hasMoreElements()) {
                String path = enumeration.nextElement().toString();
View Full Code Here

                return false;
            }
            registry = getConfigSystemRegistry();
            // Need not do any null checks for registry, as if so, we'll never
            // get here.
            registry.beginTransaction();

            // Adding the gadget to the registry and getting its ID
            String gadgetId = addGadgetToRegistry(userId, url, dashboardName, registry);

            // Adding the latest Gadget ID to the layout
View Full Code Here

        Boolean response = false;
        Registry registry = null;
        try {
            registry = getConfigSystemRegistry();
            registry.beginTransaction();

            // First remove this gadget from the Layout and persist the new layout.
            removeGadgetFromLayout(userId, tabId, gadgetId, dashboardName);

            // Remove the Gadget from registry
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.